The Wiki for Tale 7 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.
If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.
Difference between revisions of "User:Soak/Macro"
From ATITD7
Jump to navigationJump to searchLine 2: | Line 2: | ||
− | Firepit V1 | + | Firepit V1.2 |
− | - The way the macro works is by checking the colors at your mouse position and stoking the flame when colors are correct. | + | - The way the macro works is by checking the colors at your mouse position when starting macro, and stoking the flame when colors are correct. |
+ | - pin the firepit for macro to stoke. | ||
+ | - only works for 1 firepit | ||
- save as lua | - save as lua | ||
Line 15: | Line 17: | ||
strokes = 0; | strokes = 0; | ||
strokeCheck = 0; | strokeCheck = 0; | ||
− | askForWindow(" Start the firepit and keep mouse over the firepit, the macro only checks at your mouse position. Press shift over ATITD window to continue. Macro by Soak"); | + | strokeCheck2 = 0; |
+ | strokeColor = 0xFFFFFF; | ||
+ | strokeOffset = makePoint(0, 0); | ||
+ | askForWindow(" Start the firepit and keep mouse over the firepit, the macro only checks at your mouse position. Press shift over ATITD window to continue. Macro by Soak"); | ||
+ | MouseXY = getMousePos(); | ||
while true do | while true do | ||
srReadScreen(); | srReadScreen(); | ||
− | + | ||
− | local pixels = pixelDiffs( | + | local result2 = pixelMatch(MouseXY, strokeOffset, strokeColor, 0); |
− | local status = "Pos: (" .. | + | |
+ | local pixels = pixelDiffs(MouseXY[0], MouseXY[1], 0); | ||
+ | |||
+ | local status = "Pos: (" .. MouseXY[0] .. ", " .. MouseXY[1] .. ")\n"; | ||
+ | |||
status = status .. "Color: " .. table.concat(pixels, ", "); | status = status .. "Color: " .. table.concat(pixels, ", "); | ||
− | |||
− | |||
+ | status = status .. "\nCheck: ".. strokeCheck .. " extra: " ..strokeCheck2 ; | ||
+ | status = status .. "\nTotal Stoke: " .. strokes ; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | if result2 then | |
− | + | strokeCheck2 = strokeCheck2 +1; | |
− | + | strokeCheck = strokeCheck +1; | |
− | + | if strokeCheck > 2 then | |
− | + | clickAllImages("This.png"); -- update the firepit UI | |
− | if | + | sleepWithStatus(150, "refrshing UI"); |
− | + | clickAllImages("stoke2.png"); -- clicking the stoke option | |
− | + | sleepWithStatus(500, "clicking"); | |
− | + | strokes = strokes + 1; | |
− | + | strokeCheck = 0; -- reset value | |
− | + | strokeCheck2 = 0; | |
− | + | sleepWithStatus(32000, "Found 255, stokes " .. strokes); | |
− | + | end | |
− | + | else | |
− | + | strokeCheck = 0; | |
+ | |||
+ | end | ||
+ | |||
+ | if strokes > 60 then | ||
+ | break; | ||
+ | end | ||
− | + | ||
− | + | sleepWithStatus(200, status); | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Revision as of 19:48, 16 October 2015
Automato Macros
Firepit V1.2
- The way the macro works is by checking the colors at your mouse position when starting macro, and stoking the flame when colors are correct. - pin the firepit for macro to stoke. - only works for 1 firepit - save as lua
dofile("common.inc"); -- firepit macro by soak -- light the firepit and put mouse over the flame -- when firepit is at 255,255,255 color will stoke the flame using hotkeys function doit() strokes = 0; strokeCheck = 0; strokeCheck2 = 0; strokeColor = 0xFFFFFF; strokeOffset = makePoint(0, 0); askForWindow(" Start the firepit and keep mouse over the firepit, the macro only checks at your mouse position. Press shift over ATITD window to continue. Macro by Soak"); MouseXY = getMousePos(); while true do srReadScreen(); local result2 = pixelMatch(MouseXY, strokeOffset, strokeColor, 0); local pixels = pixelDiffs(MouseXY[0], MouseXY[1], 0); local status = "Pos: (" .. MouseXY[0] .. ", " .. MouseXY[1] .. ")\n"; status = status .. "Color: " .. table.concat(pixels, ", "); status = status .. "\nCheck: ".. strokeCheck .. " extra: " ..strokeCheck2 ; status = status .. "\nTotal Stoke: " .. strokes ; if result2 then strokeCheck2 = strokeCheck2 +1; strokeCheck = strokeCheck +1; if strokeCheck > 2 then clickAllImages("This.png"); -- update the firepit UI sleepWithStatus(150, "refrshing UI"); clickAllImages("stoke2.png"); -- clicking the stoke option sleepWithStatus(500, "clicking"); strokes = strokes + 1; strokeCheck = 0; -- reset value strokeCheck2 = 0; sleepWithStatus(32000, "Found 255, stokes " .. strokes); end else strokeCheck = 0; end if strokes > 60 then break; end sleepWithStatus(200, status); end end