The Wiki for Tale 6 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.

User:Obol/Macros

From ATITD6
< User:Obol
Revision as of 21:49, 15 December 2012 by Obol (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

ClaySlateV2.mac

1. Change the path in the CheckforLostFocus function to match where you saved the macro


//General purpose grass, slate and clay collector.  Works best without water jugs
//or a fishing pole.  To begin, hover your mouse over the icon
//you wish to collect in ATITD (i.e. be over a patch of clay or a piece of
//slate and have this program active.  Press F2, and the macro will start.
Constants
  clay = 0
  Red = 0
  Green = 0
  Blue = 0
  XPos = 0
  YPos = 0
  CurrKey = 0
  OrigX = 0
  OrigY = 0
  
End
SetConst XPos = {MouseX}
SetConst YPos = {MouseY}
LoadRGB $XPos, $YPos
SetConst Red = {RGBRed}
SetConst Blue = {RGBBlue}
SetConst Green = {RGBGreen}
SetConst CurrKey = {GlobalKeys}
Rightclick


While $CheckforLostFocus = 0
  GetRed  $XPos, $YPos = $Red
    GetGreen  $XPos, $YPos = $Green
      GetBlue  $XPos, $YPos = $Blue
        Set OrigX = {mousex}
        Set OrigY = {Mousey}
        MousePos $XPos, $YPos
        //delay 10
        if $clay = 1
          delay 150
        end
        RightClick
        
        MousePos $OrigX, $OrigY
        if $clay = 0
          delay 150
        end
      End
    End
  End
  Delay 60 //190
End

Function CheckforLostFocus
  if {activewindow} contains AC Tool 5.4.0 - C:\ACTool\Macros\ClaySlateV2.mac
    Compute Result = 1
    Exit
  Else
    Compute Result = 0
    Exit
  End
End


Clicker.mac

1. Change the path in the CheckforLostFocus function to match where you saved the macro
2. Use object mapper to map the To Tired OK button

constants
  MouseX = 0
  MouseY = 0
  XOrig = 0
  YOrig = 0
  looping = 0
  wait4Timer = 2400 //6000 //10000 //23000 //15250
  add2Wait = 3000
  reduceWait = 500
end


SetConst MouseX = {MouseX}
SetConst MouseY = {MouseY}

MousePos 873, 593
Delay 150
RightClick
MousePos 873, 593
Delay 100

while $CheckforLostFocus = 0
  Call GoPick
End

MousePos 100, 100
Delay 100
Stop

Procedure GoPick
  SetConst XOrig = {mousex}
  SetConst YOrig = {mousey}
  MousePos $MouseX, $MouseY
  Delay 250
  Rightclick
  Delay 200
  
  // uh oh, dialog about being to tired
  IsObject ToTired at 935, 639
    // ok button
    MousePos 958, 647
    Compute $wait4Timer = $wait4Timer + $add2Wait //1000
    // make them wait double time this time
  	Delay $wait4Timer
  	// close dialog
    MousePos 958, 647
    If $CheckforLostFocus = 0
    	Rightclick
    End
    
    // reset mouse pointer
    Mousepos $XOrig, $YOrig
	Else
		// reduce wait time if no dialog
    Compute $wait4Timer = $wait4Timer - $reduceWait //75
  End
  
  Mousepos $XOrig, $YOrig
  Delay $wait4Timer
End

Function CheckforLostFocus
  if {activewindow} contains AC Tool 5.4.0 - C:\ACTool\Macros\aPicker.mac
    Compute Result = 1
    exit
  Else
    Compute Result = 0
    Exit
    //Stop
  End
End

Object ToTired   // Test at coords 935, 639
192=0,0|249=1,0|250=2,0|250=3,0|250=4,0|250=5,0|250=6,0|250=7,0|250=8,0|250=9,0|250=10,0|250=11,0|250=12,0|250=13,0|250=14,0|249=15,0|249=16,0|250=17,0|250=18,0|249=19,0|250=20,0|249=21,0|248=22,0|249=23,0|250=24,0|249=25,0|248=26,0|249=27,0|250=28,0|249=29,0|249=30,0|249=31,0|250=32,0|249=33,0|249=34,0|250=35,0|250=36,0|249=37,0|250=38,0|250=39,0|250=40,0|250=41,0|249=42,0|250=43,0|250=44,0|250=45,0|249=46,0|250=47,0|33=48,0|
191=0,1|249=1,1|242=2,1|241=3,1|242=4,1|242=5,1|242=6,1|241=7,1|241=8,1|242=9,1|242=10,1|241=11,1|242=12,1|241=13,1|242=14,1|238=15,1|240=16,1|242=17,1|242=18,1|240=19,1|241=20,1|239=21,1|238=22,1|239=23,1|240=24,1|239=25,1|238=26,1|239=27,1|239=28,1|240=29,1|241=30,1|241=31,1|242=32,1|241=33,1|242=34,1|242=35,1|242=36,1|241=37,1|242=38,1|241=39,1|241=40,1|241=41,1|240=42,1|242=43,1|242=44,1|242=45,1|242=46,1|87=47,1|33=48,1|
192=0,2|249=1,2|242=2,2|235=3,2|235=4,2|237=5,2|231=6,2|233=7,2|235=8,2|235=9,2|233=10,2|233=11,2|234=12,2|235=13,2|237=14,2|228=15,2|232=16,2|234=17,2|235=18,2|231=19,2|232=20,2|229=21,2|230=22,2|231=23,2|234=24,2|230=25,2|229=26,2|231=27,2|231=28,2|232=29,2|233=30,2|233=31,2|233=32,2|233=33,2|231=34,2|234=35,2|234=36,2|234=37,2|233=38,2|233=39,2|233=40,2|233=41,2|230=42,2|235=43,2|234=44,2|233=45,2|140=46,2|87=47,2|33=48,2|
194=0,3|249=1,3|241=2,3|233=3,3|225=4,3|227=5,3|222=6,3|222=7,3|223=8,3|227=9,3|222=10,3|222=11,3|222=12,3|225=13,3|227=14,3|217=15,3|223=16,3|221=17,3|227=18,3|223=19,3|222=20,3|217=21,3|216=22,3|219=23,3|222=24,3|220=25,3|217=26,3|221=27,3|222=28,3|224=29,3|226=30,3|222=31,3|222=32,3|225=33,3|224=34,3|228=35,3|227=36,3|226=37,3|225=38,3|225=39,3|226=40,3|226=41,3|222=42,3|228=43,3|228=44,3|199=45,3|140=46,3|87=47,3|33=48,3|
193=0,4|249=1,4|242=2,4|237=3,4|226=4,4|223=5,4|221=6,4|222=7,4|220=8,4|226=9,4|215=10,4|219=11,4|220=12,4|221=13,4|221=14,4|213=15,4|219=16,4|217=17,4|222=18,4|219=19,4|219=20,4|211=21,4|211=22,4|215=23,4|218=24,4|215=25,4|211=26,4|217=27,4|215=28,4|219=29,4|219=30,4|218=31,4|219=32,4|220=33,4|220=34,4|224=35,4|220=36,4|220=37,4|222=38,4|221=39,4|220=40,4|223=41,4|219=42,4|226=43,4|224=44,4|197=45,4|139=46,4|86=47,4|33=48,4|
188=0,5|249=1,5|242=2,5|237=3,5|224=4,5|222=5,5|222=6,5|221=7,5|217=8,5|221=9,5|217=10,5|220=11,5|223=12,5|221=13,5|222=14,5|215=15,5|217=16,5|217=17,5|223=18,5|218=19,5|217=20,5|214=21,5|212=22,5|217=23,5|217=24,5|215=25,5|212=26,5|218=27,5|215=28,5|219=29,5|222=30,5|222=31,5|220=32,5|220=33,5|222=34,5|224=35,5|221=36,5|221=37,5|220=38,5|222=39,5|222=40,5|226=41,5|220=42,5|224=43,5|223=44,5|199=45,5|140=46,5|87=47,5|33=48,5|
188=0,6|249=1,6|242=2,6|235=3,6|225=4,6|221=5,6|223=6,6|221=7,6|220=8,6|220=9,6|217=10,6|221=11,6|226=12,6|222=13,6|221=14,6|215=15,6|217=16,6|221=17,6|221=18,6|217=19,6|215=20,6|215=21,6|212=22,6|215=23,6|215=24,6|214=25,6|210=26,6|215=27,6|215=28,6|218=29,6|217=30,6|216=31,6|218=32,6|220=33,6|220=34,6|220=35,6|223=36,6|217=37,6|220=38,6|221=39,6|223=40,6|223=41,6|220=42,6|224=43,6|227=44,6|197=45,6|140=46,6|85=47,6|33=48,6|
191=0,7|249=1,7|242=2,7|235=3,7|224=4,7|222=5,7|223=6,7|222=7,7|221=8,7|224=9,7|218=10,7|222=11,7|227=12,7|222=13,7|217=14,7|213=15,7|216=16,7|219=17,7|222=18,7|216=19,7|211=20,7|215=21,7|213=22,7|214=23,7|216=24,7|215=25,7|214=26,7|218=27,7|220=28,7|223=29,7|222=30,7|221=31,7|221=32,7|220=33,7|221=34,7|221=35,7|226=36,7|217=37,7|222=38,7|221=39,7|223=40,7|222=41,7|223=42,7|223=43,7|224=44,7|199=45,7|142=46,7|86=47,7|33=48,7|
188=0,8|249=1,8|242=2,8|235=3,8|223=4,8|222=5,8|224=6,8|220=7,8|223=8,8|227=9,8|221=10,8|223=11,8|226=12,8|223=13,8|218=14,8|215=15,8|214=16,8|222=17,8|111=18,8|0=19,8|0=20,8|0=21,8|0=22,8|107=23,8|215=24,8|217=25,8|0=26,8|0=27,8|219=28,8|220=29,8|168=30,8|0=31,8|55=32,8|220=33,8|223=34,8|224=35,8|227=36,8|217=37,8|223=38,8|221=39,8|226=40,8|222=41,8|222=42,8|222=43,8|224=44,8|199=45,8|144=46,8|87=47,8|34=48,8|
188=0,9|249=1,9|242=2,9|235=3,9|224=4,9|221=5,9|227=6,9|219=7,9|220=8,9|224=9,9|223=10,9|223=11,9|221=12,9|221=13,9|220=14,9|217=15,9|212=16,9|110=17,9|0=18,9|109=19,9|213=20,9|215=21,9|107=22,9|0=23,9|107=24,9|218=25,9|0=26,9|0=27,9|217=28,9|163=29,9|0=30,9|55=31,9|223=32,9|221=33,9|227=34,9|227=35,9|228=36,9|220=37,9|224=38,9|220=39,9|224=40,9|220=41,9|223=42,9|223=43,9|226=44,9|199=45,9|142=46,9|86=47,9|34=48,9|
187=0,10|249=1,10|244=2,10|237=3,10|226=4,10|222=5,10|226=6,10|220=7,10|223=8,10|224=9,10|220=10,10|222=11,10|221=12,10|221=13,10|220=14,10|218=15,10|212=16,10|0=17,10|0=18,10|162=19,10|214=20,10|218=21,10|161=22,10|0=23,10|0=24,10|218=25,10|0=26,10|0=27,10|167=28,10|0=29,10|54=30,10|220=31,10|223=32,10|220=33,10|227=34,10|226=35,10|227=36,10|220=37,10|224=38,10|220=39,10|224=40,10|222=41,10|224=42,10|224=43,10|227=44,10|199=45,10|141=46,10|87=47,10|33=48,10|
191=0,11|249=1,11|244=2,11|237=3,11|227=4,11|221=5,11|224=6,11|222=7,11|223=8,11|227=9,11|217=10,11|220=11,11|220=12,11|222=13,11|220=14,11|213=15,11|214=16,11|0=17,11|0=18,11|216=19,11|215=20,11|218=21,11|218=22,11|0=23,11|0=24,11|217=25,11|0=26,11|0=27,11|0=28,11|55=29,11|220=30,11|222=31,11|224=32,11|220=33,11|223=34,11|227=35,11|227=36,11|223=37,11|224=38,11|224=39,11|228=40,11|226=41,11|227=42,11|226=43,11|228=44,11|200=45,11|140=46,11|88=47,11|34=48,11|
191=0,12|249=1,12|244=2,12|235=3,12|224=4,12|223=5,12|224=6,12|222=7,12|226=8,12|228=9,12|222=10,12|220=11,12|217=12,12|222=13,12|220=14,12|214=15,12|217=16,12|0=17,12|0=18,12|217=19,12|217=20,12|219=21,12|217=22,12|0=23,12|0=24,12|218=25,12|0=26,12|0=27,12|0=28,12|166=29,12|215=30,12|218=31,12|220=32,12|219=33,12|220=34,12|223=35,12|227=36,12|226=37,12|224=38,12|223=39,12|228=40,12|224=41,12|224=42,12|223=43,12|227=44,12|199=45,12|138=46,12|87=47,12|33=48,12|
191=0,13|249=1,13|243=2,13|235=3,13|226=4,13|224=5,13|222=6,13|222=7,13|222=8,13|228=9,13|223=10,13|219=11,13|219=12,13|217=13,13|219=14,13|215=15,13|218=16,13|0=17,13|0=18,13|217=19,13|215=20,13|215=21,13|215=22,13|0=23,13|0=24,13|217=25,13|0=26,13|0=27,13|54=28,13|0=29,13|163=30,13|215=31,13|219=32,13|220=33,13|220=34,13|222=35,13|223=36,13|223=37,13|222=38,13|223=39,13|223=40,13|227=41,13|223=42,13|223=43,13|228=44,13|200=45,13|140=46,13|87=47,13|33=48,13|
191=0,14|250=1,14|242=2,14|235=3,14|227=4,14|224=5,14|220=6,14|219=7,14|218=8,14|227=9,14|223=10,14|218=11,14|220=12,14|215=13,14|220=14,14|215=15,14|218=16,14|0=17,14|0=18,14|163=19,14|215=20,14|214=21,14|160=22,14|0=23,14|0=24,14|216=25,14|0=26,14|0=27,14|217=28,14|55=29,14|0=30,14|220=31,14|220=32,14|220=33,14|220=34,14|223=35,14|222=36,14|224=37,14|219=38,14|222=39,14|219=40,14|224=41,14|219=42,14|224=43,14|226=44,14|199=45,14|140=46,14|87=47,14|33=48,14|
190=0,15|249=1,15|242=2,15|235=3,15|223=4,15|221=5,15|220=6,15|220=7,15|218=8,15|226=9,15|223=10,15|215=11,15|221=12,15|217=13,15|220=14,15|218=15,15|221=16,15|109=17,15|0=18,15|108=19,15|212=20,15|212=21,15|106=22,15|0=23,15|107=24,15|215=25,15|0=26,15|0=27,15|217=28,15|166=29,15|0=30,15|54=31,15|221=32,15|218=33,15|219=34,15|223=35,15|226=36,15|226=37,15|219=38,15|222=39,15|220=40,15|224=41,15|220=42,15|226=43,15|224=44,15|200=45,15|142=46,15|85=47,15|33=48,15|
189=0,16|250=1,16|241=2,16|233=3,16|223=4,16|222=5,16|220=6,16|220=7,16|220=8,16|226=9,16|221=10,16|215=11,16|222=12,16|216=13,16|219=14,16|220=15,16|221=16,16|215=17,16|110=18,16|0=19,16|0=20,16|0=21,16|0=22,16|106=23,16|214=24,16|218=25,16|0=26,16|0=27,16|218=28,16|224=29,16|166=30,16|0=31,16|55=32,16|221=33,16|222=34,16|223=35,16|224=36,16|223=37,16|218=38,16|224=39,16|224=40,16|227=41,16|222=42,16|227=43,16|227=44,16|200=45,16|142=46,16|84=47,16|33=48,16|
187=0,17|250=1,17|242=2,17|237=3,17|226=4,17|223=5,17|223=6,17|223=7,17|221=8,17|228=9,17|224=10,17|216=11,17|224=12,17|220=13,17|221=14,17|220=15,17|221=16,17|218=17,17|221=18,17|218=19,17|207=20,17|215=21,17|207=22,17|212=23,17|212=24,17|218=25,17|218=26,17|218=27,17|219=28,17|221=29,17|220=30,17|217=31,17|223=32,17|218=33,17|219=34,17|222=35,17|224=36,17|224=37,17|220=38,17|223=39,17|224=40,17|226=41,17|223=42,17|227=43,17|227=44,17|197=45,17|142=46,17|84=47,17|33=48,17|
189=0,18|250=1,18|244=2,18|235=3,18|227=4,18|223=5,18|227=6,18|223=7,18|223=8,18|228=9,18|223=10,18|217=11,18|223=12,18|220=13,18|224=14,18|221=15,18|219=16,18|220=17,18|223=18,18|217=19,18|210=20,18|219=21,18|209=22,18|211=23,18|207=24,18|220=25,18|219=26,18|222=27,18|220=28,18|223=29,18|220=30,18|216=31,18|222=32,18|218=33,18|219=34,18|223=35,18|227=36,18|222=37,18|222=38,18|223=39,18|226=40,18|227=41,18|226=42,18|227=43,18|226=44,18|200=45,18|142=46,18|85=47,18|33=48,18|
188=0,19|250=1,19|244=2,19|233=3,19|225=4,19|219=5,19|224=6,19|221=7,19|226=8,19|226=9,19|217=10,19|216=11,19|222=12,19|219=13,19|223=14,19|221=15,19|216=16,19|219=17,19|218=18,19|211=19,19|206=20,19|217=21,19|210=22,19|211=23,19|209=24,19|215=25,19|217=26,19|219=27,19|221=28,19|221=29,19|221=30,19|216=31,19|222=32,19|216=33,19|219=34,19|221=35,19|226=36,19|221=37,19|221=38,19|222=39,19|222=40,19|226=41,19|224=42,19|223=43,19|226=44,19|200=45,19|142=46,19|84=47,19|33=48,19|
188=0,20|249=1,20|242=2,20|231=3,20|190=4,20|190=5,20|195=6,20|192=7,20|196=8,20|195=9,20|185=10,20|187=11,20|191=12,20|189=13,20|191=14,20|191=15,20|187=16,20|191=17,20|189=18,20|179=19,20|177=20,20|184=21,20|179=22,20|180=23,20|182=24,20|184=25,20|189=26,20|189=27,20|189=28,20|192=29,20|193=30,20|189=31,20|194=32,20|191=33,20|193=34,20|195=35,20|199=36,20|196=37,20|196=38,20|193=39,20|197=40,20|199=41,20|196=42,20|196=43,20|196=44,20|199=45,20|140=46,20|84=47,20|33=48,20|
187=0,21|249=1,21|240=2,21|135=3,21|135=4,21|137=5,21|140=6,21|138=7,21|140=8,21|139=9,21|133=10,21|135=11,21|136=12,21|137=13,21|137=14,21|137=15,21|135=16,21|136=17,21|135=18,21|130=19,21|128=20,21|130=21,21|129=22,21|129=23,21|130=24,21|130=25,21|134=26,21|135=27,21|136=28,21|137=29,21|137=30,21|135=31,21|138=32,21|136=33,21|135=34,21|137=35,21|140=36,21|137=37,21|138=38,21|137=39,21|141=40,21|140=41,21|140=42,21|140=43,21|140=44,21|144=45,21|138=46,21|84=47,21|33=48,21|
191=0,22|249=1,22|86=2,22|84=3,22|84=4,22|84=5,22|85=6,22|85=7,22|87=8,22|86=9,22|84=10,22|85=11,22|84=12,22|85=13,22|84=14,22|83=15,22|83=16,22|84=17,22|84=18,22|79=19,22|80=20,22|80=21,22|79=22,22|80=23,22|80=24,22|79=25,22|81=26,22|82=27,22|82=28,22|83=29,22|82=30,22|82=31,22|85=32,22|84=33,22|83=34,22|84=35,22|86=36,22|84=37,22|84=38,22|84=39,22|85=40,22|85=41,22|85=42,22|84=43,22|85=44,22|87=45,22|83=46,22|82=47,22|32=48,22|
End Object 


VEGGIES.mac

(* 
	This macro plants up to 12 vegtables in a NxN grid.
 	Note: IT WILL NOT WATER THE VEG FOR YOU JUST PLANT THEM.

 	Usage:
 	Pin Plant menu where you want and place mouse over the veg that
 		you want to plant then press the F2
 	Remember to adjust seeds and dist for your specific veg in inv
 		recomend values for dist:
 		onions = 4, cabbage = 6.
	Options->One-Click and Related->Plant all crops where you stand->0ff
*)
Constants
  //User define variables
  seeds = 6 // Number of veg to plant
  dist = 7   // distance between veg (clicks on small movment) defult 4
  
  // NON user defined variables
  // button positions
  vegX = 0
  vegY = 0
  ulx = 45
  uly = 85
  lx = 36
  ly = 100
  dlx = 45
  dly = 115
  ux = 60
  uy = 78
  urx = 76
  ury = 85
  rx = 81
  ry = 100
  drx = 76
  dry = 115
  dx = 60
  dy = 125
  plantX = 26
  plantY = 162
  locX = 0
  locY = 0

  varOriginalMouseX = 0
  varOriginalMouseY = 0

end
//selects the veg
delay 20
setconst vegX = {mousex}
setconst vegY = {mousey}
MousePos $vegX, $vegY
delay 20
call main
delay 20
MousePos 954, 539

procedure main
  loop $seeds
    mousepos $vegX, $vegY
    delay 20
    rightclick
    delay 50
    if {loopno} = 1
      setconst locX = $ulx
      setconst locY = $uly
    end
    if {loopno} = 2
      setconst locX = $lx
      setconst locY = $ly
    end
    if {loopno} = 3
      setconst locX = $dlx
      setconst locY = $dly
    end
    if {loopno} = 4
      setconst locX = $ux
      setconst locY = $uy
    end
    if {loopno} = 5
       setconst locX = 12
       setconst locY = 71
    end
    if {loopno} = 6
      setconst locX = $dx
      setconst locY = $dy
    end
    if {loopno} = 7
      setconst locX = $urx
      setconst locY = $ury
    end
    if {loopno} = 8
      setconst locX = $rx
      setconst locY = $ry
    end
    if {loopno} = 9
      setconst locX = $drx
      setconst locY = $dry
    end
    if {loopno} = 10
      call rightshift
      setconst locX = $urx
      setconst locY = $ury
    end
    if {loopno} = 11
      call rightshift
      setconst locX = $rx
      setconst locY = $ry
    end
    if {loopno} = 12
      call rightshift
      setconst locX = $drx
      setconst locY = $dry
    end
    call plant
    delay 200
  end

//	Call CheckPlant
	
	Bell asterisk

end

procedure rightshift
  loop $dist
    mousepos $rx, $ry
    delay 20
    rightclick
  end
  delay 20
end

procedure plant
  loop $dist
    MousePos $locX, $locY
    delay 20
    rightclick
  end
  delay 20
  mousepos $plantX, $plantY
  delay 20
  rightclick
  delay 50
end

Procedure CheckPlant
  setconst varOriginalMouseX = {mousex}
  setconst varOriginalMouseY = {mousey}
  Compute NewY = $varOriginalMouseY
  Loop 15
    if $CheckforLostFocus = 0
      RightClick
      Delay 400
      LoadRGB {MouseX}, {MouseY}
      if {RGBBlue} > 220
        Compute NewX = {mousex} + 145
        Compute NewY = {mousey} - 23
        MousePos $NewX, $NewY
        Delay 200
        Leftclick
        Compute NewX = {mousex} - 145
        MousePos $NewX, $NewY
        
        if $Onion > 8
          Dragto $ODragX, $ODragY
          Compute ODragY = $ODragY + 60
        End
        if $Onion = 5 or $Onion = 6 or $Onion = 7 or $Onion = 8
          Dragto $ODragX, $ODragY
          Compute ODragY = $ODragY + 60
        End
        If $Onion = 2 or $Onion = 3 or $Onion = 4
          Dragto $ODragX, $ODragY
          Compute ODragY = $ODragY + 60
        End
        if $Onion = 1
          Dragto $ODragX, $ODragY
          Compute ODragY = $ODragY + 60
        End
        Compute Onion = $Onion + 1
        If $Onion = 5
          SetConst ODragY = 90
          Compute ODragX = $ODragX + 168
        End
        If $Onion = 9
          SetConst ODragY = 90
          Compute ODragX = $ODragX + 168
        END
        Break
      Else
        Compute Oy = $Oy + 1
        MousePos $varOriginalMouseX, $Oy
        Delay 200
      End
    End
  End
End


Paint.mac

(*
Paint Macro
Setup
1. Change X, Y values for your screen resolution
2. Change the Loops and Calls in each PAINT SUBROUTINES to match ingredients for your recipe for that color
3. Place a COLOR CALL STATEMENT for each color, **ONLY HAVE 1 CALL STATEMENT UNCOMMENTED AT A TIME**
4. Uncomment the TestMenuLocations call statement to test the menu coordinates and run script
STARTING MACRO
1. Pin pigment lab menu to top left corner of game window
2. Change Batch to the number of paints your want (Have enough supplies on hand)
*)

Constants
  Batch = 1
  MDelay = 200
  TESTING = 0
  TESTDelay = 500
  
  TakeX = 16
  TakeY = 91
  
  RibbonX = 68
  RibbonY = 94
  
  CabbageX = 16
  CabbageY = 269
  
  CarrotsX = 16
  CarrotsY = 288
  
  ClayX = 16
  ClayY = 306
  
  DeadX = 16
  DeadY = 324
  
  ToadX = 16
  ToadY = 342
  
  EarthX = 16
  EarthY = 360
  
  RedX = 16
  RedY = 378
  
  LeadX = 16
  LeadY = 396
  
  SilverX = 16
  SilverY = 414
  
  IronX = 16
  IronY = 432
  
  CopperX = 16
  CopperY = 450
  
  SulfurX = 16
  SulfurY = 468
  
  PotashX = 16
  PotashY = 486
  
  LimeX = 16
  LimeY = 504
  
  SaltpeterX = 16
  SaltpeterY = 522
End

// ***** MACRO START *****
MousePos 29, 46 //Activates eGenesis window.
Delay $MDelay
LeftClick
Delay $MDelay


// ***** COLOR CALL STATEMENTS *****
Call TestMenuLocations
//Call SandyBrown
//Call DarkOrange
//Call Goldenrod
//Call SkyBlue
//Call DeepSkyBlue
//Call SlateBlue
//Call Tomato
//Call Violet
//Call LightSeaGreen
//Call ForestGreen
//Call SpringGreen
//Call Yellow
//Call Turquoise
//Call BlueViolet
//Call Crimson

SetActiveWindow AC Tool 5.4.0 - C:\Macros\Paint.mac
// ***** MACRO END *****


// ***** TEST SUBROUTINE *****
Procedure TestMenuLocations
  SetConst TESTING = 1
  Call Take
  //Call MakeRibbon
  Call Cabbage
  Call Carrots
  Call Clay
  Call Dead
  Call Toad
  Call Earth
  Call Red
  Call Lead
  Call Silver
  Call Iron
  Call Copper
  Call Sulfur
  Call Potash
  Call Lime
  Call Saltpeter
End

// ***** PAINT SUBROUTINES *****
// 8 Clay, 1 Carrot, 1 Lead, 1 Potash
Procedure SandyBrown
  Loop $Batch
    Loop 8              //# of ingredient to add
      Call Clay
    End
    Call Carrots
    Call Lead
    Call Potash
  End
  Call Take
End


// 1 Clay, 9 Carrot, 1 Potash, 1 Saltpeter
Procedure DarkOrange
  Loop $Batch
    Call Clay
    Loop 9              //# of ingredient to add
      Call Carrots
    End
    Call Potash
    Call Saltpeter
  End
  Call Take
End


// 6 Copper, 2 Silver, 2 Clay
Procedure LightSeaGreen
  Loop $Batch
    Loop 6              //# of ingredient to add
      Call Copper
    End
    Loop 2              //# of ingredient to add
      Call Silver
    End
    Loop 2              //# of ingredient to add
      Call Clay
    End
  End
  Call MakeRibbon
End

// 7 Clay, 1 Lead, 1 Carrot, 1 Silver
Procedure Goldenrod
  Loop $Batch
    Loop 7              //# of ingredient to add
      Call Clay
    End
    Call Lead
    Call Carrots
    Call Silver
    Call Take
  End
End

//1 Copper, 1 Silver, 1 Saltpeter, 1 Clay, 1 Sulfur, 7 Cabbage
Procedure SkyBlue
  Loop $Batch
    Call Copper
    Call Silver
    Call Saltpeter
    Call Clay
    Call Sulfur
    Loop 7              //# of ingredient to add
      Call Cabbage
    End
    Call Take
  End
End

//5 RedSand, 4 Carrot, 1 DeadTongue
Procedure Crimson
  Loop $Batch
    Loop 5              //# of ingredient to add
      Call Red
    End
    Loop 4              //# of ingredient to add
      Call Carrots
    End
    Loop 1              //# of ingredient to add
      Call Dead
    End
    Call Take
  End
End

//8 Cabbage, 1 Lead, 1 Saltpeter, 1 Clay,
Procedure BlueViolet
  Loop $Batch
    Loop 8              //# of ingredient to add
      Call Cabbage
    End
    Loop 1              //# of ingredient to add
      Call Lead
    End
    Loop 1              //# of ingredient to add
      Call Saltpeter
    End
    Loop 1              //# of ingredient to add
      Call Clay
    End
  End
End

//1 Carrot, 1 Saltpeter, 6 Copper, 1 Clay, 1 Silver, 1 Cabbage
Procedure Turquoise
  Loop $Batch
    Loop 1              //# of ingredient to add
      Call Carrots
    End
    Loop 1              //# of ingredient to add
      Call Saltpeter
    End
    Loop 6              //# of ingredient to add
      Call Copper
    End
    Loop 1              //# of ingredient to add
      Call Clay
    End
    Loop 1              //# of ingredient to add
      Call Silver
    End
    Loop 1              //# of ingredient to add
      Call Cabbage
    End
    Call Take
  End
End

//Green, Sprng
//6 Copper, 1 Clay, 1 Silver, 1 Lime, 1 Carrot, 1 Cabbage
Procedure SpringGreen
  Loop $Batch
    Loop 6              //# of ingredient to add
      Call Copper
    End
    Loop 1              //# of ingredient to add
      Call Clay
    End
    Loop 1              //# of ingredient to add
      Call Silver
    End
    Loop 1              //# of ingredient to add
      Call Lime
    End
    Loop 1              //# of ingredient to add
      Call Carrots
    End
    Loop 1              //# of ingredient to add
      Call Cabbage
    End
    Call Take
  End
End

//Blue, Deep Sky
//1 Silver, 1 Saltpeter, 8 Copper, 1 Clay
Procedure DeepSkyBlue
  Loop $Batch
    Loop 1              //# of ingredient to add
      Call Silver
    End
    Loop 1              //# of ingredient to add
      Call Saltpeter
    End
    Loop 8              //# of ingredient to add
      Call Copper
    End
    Loop 1              //# of ingredient to add
      Call Clay
    End
    Call Take
  End
End

//Blue, Slate
//6 Cabbage, 1 Saltpeter, 4 Clay
Procedure SlateBlue
  Loop $Batch
    Loop 6              //# of ingredient to add
      Call Cabbage
    End
    Loop 1              //# of ingredient to add
      Call Saltpeter
    End
    Loop 4              //# of ingredient to add
      Call Clay
    End
    Call Take
  End
End

//Tomato
//1 Clay, 8 Carrots, 1 Sulfur, 1 Potash, 1 Lime, 1 Cabbage
Procedure Tomato
  Loop $Batch
    Loop 1              //# of ingredient to add
      Call Clay
    End
    Loop 8              //# of ingredient to add
      Call Carrots
    End
    Loop 1              //# of ingredient to add
      Call Sulfur
    End
    Loop 1              //# of ingredient to add
      Call Potash
    End
    Loop 1              //# of ingredient to add
      Call Lime
    End
    Loop 1              //# of ingredient to add
      Call Cabbage
    End
    Call Take
  End
End

//Violet
//8 Cabbage, 1 Sulfur, 1 Potash, 1 Carrots, 1 Lead
Procedure Violet
  Loop $Batch
    Loop 8              //# of ingredient to add
      Call Cabbage
    End
    Loop 1              //# of ingredient to add
      Call Sulfur
    End
    Loop 1              //# of ingredient to add
      Call Potash
    End
    Loop 1              //# of ingredient to add
      Call Carrots
    End
    Loop 1              //# of ingredient to add
      Call Lead
    End
    Call Take
  End
End


Procedure ForestGreen
  Loop $Batch
    Loop 4              //# of ingredient to add
      Call Lead
    End
    Loop 1              //# of ingredient to add
      Call Saltpeter
    End
    Loop 6              //# of ingredient to add
      Call Silver
    End
    Call Take
  End
End

//Yellow
Procedure Yellow
  Loop $Batch
    Loop 1              //# of ingredient to add
      Call Clay
    End
    Loop 1              //# of ingredient to add
      Call Silver
    End
    Loop 1              //# of ingredient to add
      Call Sulfur
    End
    Loop 1              //# of ingredient to add
      Call Iron
    End
    Loop 1              //# of ingredient to add
      Call Saltpeter
    End
    Loop 7              //# of ingredient to add
      Call Carrots
    End
    Call Take
  End
End

// ***** Menu Items *****

Procedure Take
  Call CheckforLostFocus
  MousePos $TakeX, $TakeY
  Call Clicker
End

Procedure MakeRibbon
  Call CheckforLostFocus
  MousePos $RibbonX, $RibbonY
  Call Clicker
End

Procedure Cabbage
  Call CheckforLostFocus
  MousePos $CabbageX, $CabbageY
  Call Clicker
End

Procedure Carrots
  Call CheckforLostFocus
  MousePos $CarrotsX, $CarrotsY
  Call Clicker
End

Procedure Clay
  Call CheckforLostFocus
  MousePos $ClayX, $ClayY
  Call Clicker
End

Procedure Dead
  Call CheckforLostFocus
  MousePos $DeadX, $DeadY
  Call Clicker
End

Procedure Toad
  Call CheckforLostFocus
  MousePos $ToadX, $ToadY
  Call Clicker
End

Procedure Earth
  Call CheckforLostFocus
  MousePos $EarthX, $EarthY
  Call Clicker
End

Procedure Red
  Call CheckforLostFocus
  MousePos $RedX, $RedY
  Call Clicker
End

Procedure Lead
  Call CheckforLostFocus
  MousePos $LeadX, $LeadY
  Call Clicker
End

Procedure Silver
  Call CheckforLostFocus
  MousePos $SilverX, $SilverY
  Call Clicker
End

Procedure Iron
  Call CheckforLostFocus
  MousePos $IronX, $IronY
  Call Clicker
End

Procedure Copper
  Call CheckforLostFocus
  MousePos $CopperX, $CopperY
  Call Clicker
End

Procedure Sulfur
  Call CheckforLostFocus
  MousePos $SulfurX, $SulfurY
  Call Clicker
End

Procedure Potash
  Call CheckforLostFocus
  MousePos $PotashX, $PotashY
  Call Clicker
End

Procedure Lime
  Call CheckforLostFocus
  MousePos $LimeX, $LimeY
  Call Clicker
End

Procedure Saltpeter
  Call CheckforLostFocus
  MousePos $SaltpeterX, $SaltpeterY
  Call Clicker
End

Procedure Clicker
  If $TESTING = 0
    Delay $MDelay
    LeftClick
    Delay $MDelay
  Else
    Delay $TESTDelay
  End
End

// ***** Kill Script *****
Procedure CheckforLostFocus
  If {activewindow} contains AC Tool 5.4.0 - C:\Macros\Paint.mac
    Stop
  End
End



Barley.mac

(* 
Brute Force Barley Macro for ATITD. This version by Silentdeth. T2 Original by Draeton.
To use pin the plant window to the upper RIGHT (not left), switch the view to double-f8 view and
zoom all the way in. 
Unset Right Click Pin, need at least 30 barley
*)
Constants
  // Insert constants here
  
  NumberOfLoops = 1
  //This is the number of loops, and with luck is the only thing you will
  //have to change to suit your own needs.  I personally use 8 with +2str
  //(and dex from acro).
  
  SleepTime	= 200		//If you're having major problems with lag try moving this to a higher
  //number (these are in milliseconds).  This delay is used between most
  //commands
  
  MoveSleepTime = 1500 	//This is the delay used for when the character is actually moving.
  //Again this is in milliseconds, if lag is troubling you, try
  //Upping this number.
  
  LoopWaitTime = 8000	//This is used in the loop to check if it should feed or water the
  //barley more.  If you Change the times above up or down you may need
  //to do the inverse with this in order to not waste fertilizer or
  //worse, harvest the barley before it's done.
  
  
  XCoordsOfPlantBarley =1867 //973 	//If you don't want the barley planting box in the upper right,
  //can change this (and the Y value below this).
  YCoordsOfPlantBarley = 47 //47		//See above comment
  
  NumToDo = 29				//This is actually equipped to handle doing anywhere between 1 and 18
  //patches of barley at a time.  Use this to set the number. 18 is the current maximum, I may
  // increase if further in the furture but right now I cant carry enouph to make increaseing it
  //worth my time.
  
  // How far over and up and down to move
  MoveDeltaX=300
  MoveDeltaY=300
  
  //The center for calculating the movment
  PlayerCenterX=955 //625
  PlayerCenterY=575 //524
  
  //How many patches of barley to plant per row
  PlantsPerRow = 6
  
  //If you want to have the macro save a bit of fert set ExtraTickOffset=1 and it will wait
  // 1 extra tick to fertalize or water.
  ExtraTickOffset = 1
  ExtraTickX=25
  
  //dont change these
  ResolutionX=1920//1280//1024
  ResolutionY=1080//1024//768
  varX = 0
  varY = 0
  Adding = 0
  LoopNum = 0
  NumberAdded = 0
  varColourY = 0
  varColourX = 0
  varAddX = 0
  
  varOriginalMouseX = 0
  varOriginalMouseY = 0
  
  MousePosX = 0
  MousePosY = 0
  varDelay = 0
  
  TempMouseX=0
  TempMouseY=0
  
  //The Size of the barley window
  
  BarleyWindowX=212
  BarleyWindowY=221
  
  multiplyer = 0
  
  LeftRightSwitch = 0
  
End

// Focus Game window
MousePos 100, 20
Delay 250
LeftClick
MousePos 24, 48
Delay 250

call MakeBarley
//call GetPixelAtMouse

Procedure MakeBarley
  //SetActiveWindow eGenesis Client   //On my computer I commented this line because it messes my computer up.  Try that if you're having issues
  loop $NumberOfLoops //How many times to run through the loop.  I use 8 usually and have carry food going (+2 str, +3 or more dex will do for 8)
    //SetConst NumToDo = 8 //Possible to do less than 8 at a time.  <1 or >8 will break this
    //SetConst sleeptime = 200 //How much time to wait
    SetConst Adding = 1 //Tells it we're still adding, used in a later Function
    SetConst LoopNum = 0 //Which Loop Number we're at.  Used in the main loop
    
    if $CheckforLostFocus = 0
      
      loop $NumToDo //A statement like this that will be gone through for each number >1
        if $CheckforLostFocus = 0
          if {LoopNo} = 1
          else
            //pause
            Compute LeftRightSwitch = $NumberAdded MOD $PlantsPerRow
            if $LeftRightSwitch = 0
              call MoveDown
            else
              Compute LeftRightSwitch = ($NumberAdded DIV $PlantsPerRow) MOD 2
              if $LeftRightSwitch = 0
                call MoveRight
              else
                call MoveLeft
              end //if LR switch
            end //if new row
          end// if first click
          call plant
          call drag $NumberAdded
          delay $sleeptime
          Compute MousePosX = $TempMouseX + 91 //411
          Compute MousePosY = $TempMouseY - 125//48
          call RightClick2
          //DragTo 105, 265
          //call LeftClick2
          Delay $sleeptime
          Inc NumberAdded
          Call TestColourWhich
        end // check
      end //end loop
      
      
      SetConst Adding = 0
      loop  8//This is the main loop
        if $CheckforLostFocus = 0
          SetConst LoopNum = {LoopNo} //Need this variable below so we don't keep feeding the early ones
          Delay $LoopWaitTime
          Call TestColourWhich //Go to the functions to test the colour, see if we need to add
        end // check
      end //loop 16
      delay $sleeptime
      
      call Harvest
      compute multiplyer =  ($NumberAdded DIV $PlantsPerRow)
      loop $multiplyer
        call MoveUP
      end
      compute multiplyer =  ($NumberAdded DIV $PlantsPerRow) MOD 2
      if $multiplyer = 0
        compute multiplyer =  ($NumberAdded MOD $PlantsPerRow)
        loop $multiplyer
          call MoveLeft
        end // move left loop
      else
        compute multiplyer = ($NumberAdded MOD $PlantsPerRow)
        loop $multiplyer
          call MoveRight
        end //move right loop
      end //if LR
      
    end //check
  end //end number of loop
end //end procedure


procedure Harvest
  SetConst MousePosX =  {MouseX}
  SetConst MousePosY = {MouseY}
  
  MousePos 190, 109
  loop $NumberAdded //This is for harvesting
    if $CheckforLostFocus = 0
      
      Compute multiplyer= {LoopNo} - 1
      if {LoopNo} > 19
        Compute multiplyer= $multiplyer + 3
      end //if
      
      //    if {LoopNo} > 25
      //      Compute multiplyer= $multiplyer + 1
      //    end //if
      
      Compute MousePosX = 110  + $BarleyWindowX * ($multiplyer MOD 8 )
      Compute MousePosY= 230 + $BarleyWindowY * ($multiplyer DIV 8 )
      
      call RightClick2
      Delay $sleeptime
      Compute MousePosX =  $MousePosX + 80
      Compute MousePosY =  $MousePosY - 120
      call RightClick2
      Delay $sleeptime
      SetConst NumberAdded = 0
    end //check
  end //loop
end //procedure

Procedure TestColourWhich //This function figures out which coordinates to call.
  //No it is not terribly good code, but this was written first for AutoHotKey
  //your right, so im gonna make it pretty
  
  
  
  loop $NumberAdded //This is for the water
    if $CheckforLostFocus = 0
      
      Compute multiplyer= {LoopNo} - 1
      if {LoopNo} > 19
        Compute multiplyer= $multiplyer + 3
      end //if
      
      //    if {LoopNo} > 25
      //      Compute multiplyer= $multiplyer + 1
      //    end //if
      
      Compute varColourX = 179 + $BarleyWindowX * ($multiplyer MOD 8 ) -  $ExtraTickX * $ExtraTickOffset
      Compute varColourY= 164 + $BarleyWindowY * ($multiplyer DIV 8 )
      
      Compute varAddX = $varColourX + 18 + $ExtraTickX * $ExtraTickOffset
      Call TestColour
      Compute varColourY = $varColourY + 20
      Call TestColour
      
      if $adding = 1 //This little section is to click a 2nd time when first planting the barley
        if {LoopNo} = $numberadded
          Call TestColour
          Compute varColourY = $varColourY - 20
          Call TestColour
        end//end if adding =1
      end // end if loopno=number added
    end //check
  end// end loop
end//end proceedure




Procedure TestColour  //This actually tests the colours based on the position set in TestColourWhich
  LoadRGB $varColourX, $varColourY
  if {RGBBlue} > 220 //If it's really high in blue content
  else
    Call GetMousePos
    SetConst MousePosX = $varAddX
    SetConst MousePosY = $varColourY
    call RightClick2
    Call SetMousePos
    Delay 100
  end
  
end

procedure drag using numberPlanted
  SetConst multiplyer= $numberPlanted
  loop 1000
    if $CheckforLostFocus = 0
      
      Delay $sleeptime
      SetConst varDelay = 1
      Compute MousePosX =  INT(850/1920*$ResolutionX)
      Compute MousePosY = INT(585/1080*$ResolutionY)
      call RightClick2
      Delay $sleeptime
      Delay $sleeptime
      call GetMousePos
      Compute TempMouseX=(INT(850/1920*$ResolutionX) + 100)
      Compute TempMouseY=(INT(585/1080*$ResolutionY) - 95)
      MousePos $TempMouseX,$TempMouseY
      
      if 	$numberPlanted > 18
        Compute multiplyer= $multiplyer + 3
      end //if
      
      //    if 	$numberPlanted > 24
      //      Compute multiplyer= $multiplyer + 1
      //    end //if
      
      Compute TempMouseX=103 + $BarleyWindowX * ($multiplyer MOD 8 )
      Compute TempMouseY=44 + $BarleyWindowY * ($multiplyer DIV 8 )
      
      DragTo $TempMouseX,$TempMouseY
      Compute TempMouseX={MouseX} + 2
      Compute TempMouseY={MouseY} + 122
      Call SetMousePos
      LoadRGB $TempMouseX,$TempMouseY
      if {RGBBlue} > 240
        break
      else
        Delay $sleeptime
        SetConst MousePosX =  743
        SetConst MousePosY = 611
        call RightClick2
      end //end if
    end //check
  end //end loop
  
end// end proceedure



procedure plant
  SetConst MousePosX = $XCoordsOfPlantBarley
  SetConst MousePosY = $YCoordsOfPlantBarley
  call RightClick2
end

procedure MoveLeft
  //SetConst MousePosX = 245
  //SetConst MousePosY = 393
  Compute MousePosX= $PlayerCenterX - $MoveDeltaX
  Compute MousePosY= $PlayerCenterY
  MousePos $MousePosX,$MousePosY
  Call LeftClick2
  Delay $MoveSleepTime
end

procedure MoveDown
  //SetConst MousePosX =  500
  //SetConst MousePosY = 620
  Compute MousePosX= $PlayerCenterX
  Compute MousePosY= $PlayerCenterY + $MoveDeltaY
  MousePos $MousePosX,$MousePosY
  Call LeftClick2
  Delay $MoveSleepTime
end

procedure MoveUp
  //SetConst MousePosX =  500
  //SetConst MousePosY = 167
  Compute MousePosX= $PlayerCenterX
  Compute MousePosY= $PlayerCenterY - $MoveDeltaY
  MousePos $MousePosX,$MousePosY
  Call LeftClick2
  Delay $MoveSleepTime
end

procedure MoveRight
  //MousePos 880, 512
  //SetConst MousePosX =  760
  //SetConst MousePosY = 392
  Compute MousePosX= $PlayerCenterX + $MoveDeltaX
  Compute MousePosY= $PlayerCenterY
  MousePos $MousePosX,$MousePosY
  Call LeftClick2
  Delay $MoveSleepTime
end

Procedure LeftClick2
  call GetMousePos
  MousePos $MousePosX, $MousePosY
  if $varDelay = 1
    delay 200
  end
  LeftClick
  //delay 200
  SetConst varDelay = 0
  Call SetMousePos
End

Procedure RightClick2
  Call GetMousePos
  MousePos $MousePosX, $MousePosY
  if $varDelay = 1
    delay 200
  end
  RightClick
  SetConst varDelay = 0
  //delay 400
  Call SetMousePos
End

Procedure GetMousePos //find the original coords of the mouse
  SetConst varOriginalMouseX = {MouseX}
  SetConst varOriginalMouseY = {MouseY}
End
Procedure SetMousePos //set the mouse back where it came from
  MousePos $varOriginalMouseX, $varOriginalMouseY
End

Function CheckforLostFocus
  if {activewindow} contains eGenesis
    Compute Result = 0
    Exit
  Else
    pause
    Delay 2000
    Compute Result = 0
    Exit
    //Stop
  End
End