//Anka's Flax Macro //This macro will plant beds for seeds. After Seeds are //done, it will plant 20 beds of flax and either keep the flax //in inventory, store flax into a chest, or throw flax in the water to rot. //It now has a menu for changing options. :) // //Be sure you room in inventory. On current settings, have 21 seeds and jugs. //Pin open your planting window and drag it to the upper left corner. //Enter Cartagropher View and zoom all the way in. //Make Sure your ATITD window is maximized and then run this macro. //This macro works best on flat ground. //You must have your resolution set at 1024 by 768. //Do not use autohide on windows taskbar. It throws the numbers off. //You must also be sure to have flax hotkeys turned off before you start. //Start with 21 flax seeds in your inventory and at least 20 jugs. //Have at least 1 jug empty (If water is needed) //Make sure you have small action buttons under Utility>Options: Interface. //New: Added a water option in case you are growing flax that doesnt need water. //If needed have access to water when you start the macro. If you want to //store the flax in a chest. Click on the chest, pick stash then pin that //window to the top half of the right side. Place your pointer on the edge of that //window to the left of "Flax". When stashing, the macro will click on this //window to update it then, click on flax to dump it into the chest. Have 1 //flax in inventory to do this. Once you have the pointer on the edge of the //window, alt tab to ACTool without moving the mouse and press F2 to start. //You can move the mouse once the menu comes up. If you are not using the dump //feature, you can simply alt tab and press start or F2. //If using new seeds, you can use the Dump option to store rotten flax in the same //way. You just can't store flax and rotten flax. You can Rot flax and store //rotten flax if you like. // //I wrote this macro a while ago and was mainly to suit my needs. I'm on the //West side of water with lots of room to the West. It should work with water //to your north also. //This macro handles the recent changes to flax since it doesn't run on //timers. //It also can handle other seeds. //"Pick Rounds" = the number of times you want to harvest seeds from each bed. //"Weed #" = the number of times you need to weed flax before harvest. This number // should be set to 3 for Nile Green or 2 for most of the newer varieties. //"Seeds / Pick" = How many seeds you get from each bed when you harvest seeds. //"Color Test (200)" = This is for detecting the water icon. Adjust it up or down as //needed. // //You start with 21 seeds, the macro should plant enough beds to end up with 21 seeds //at the end. I haven't tested this fully with all seeds, let me know if you have //problems. // //These instructions need to be cleaned up after multiple builds :) I'll get to it. // //Enjoy! Anka Include Objects.mac constants SeedX = 9 //Set this to how many plantings - 1 per row for seeds Seeds = 0 Rounds = 2 Button = 0 Red = 50 Green = 228 Blue = 230 ButtonX = 995 ButtonY = 32 CenterX = 510 CenterY = 383 DumpX = 0 DumpY = 0 SubX = 31 PickX = 0 TempX = 0 TempY = 0 Left2X = 119 LeftX = 345 LeftY = 395 RightX = 655 RightY = 395 Right2X = 900 TextX = 0 TextY = 0 RipX = 0 RipY = 0 WeedX = 741 WeedY = 85 LSide1X = 11 LSide2X = 403 LSide1Y = 548 LSide2Y = 395 RSide1X = 1011 RSide2X = 650 RSide1Y = 225 RSide2Y = 395 ObjX = 752 ObjY = 72 SS1X = 0 SS2X = 0 SS1Y = 0 SS2Y = 0 Mod1 = 160 Mod2 = 260 Mod3 = 155 NewX = 0 NewY = 0 Color = 0 FlaxSet = 0 XPlant = 60 YPlant = 45 LeftStep = 256, 395 RightStep = 749, 395 RightStep2 = 640, 395 Picked = 0 Direction = 0 Pick = 3 Rip = 0 Flax = 1 Reset = 825, 113 Weed = 0 Job = 0 Dump = 0 Rot = 0 i = 0 Water = 0 end SetConst DumpX = {MouseX} SetConst DumpY = {MouseY} Form Flax, Settings ed1=Combobox:Job:Seeds, Flax, Both, Color Test ed2=Editbox:Seed Plants (Even Number):2 ed3=Editbox:Batch:1 ed4=Combobox:Pick Rounds:1, 2, 3, 4, 5 ed5=Combobox:Weed #:3, 2 ed9=Editbox:Seeds / Pick:1 ed6=CheckBox:Dump:False ed7=CheckBox:Rot:False ed10=CheckBox:Need Water:True ed8=Editbox:Color Test ( 200 ):200 end FormLoad Flax, Flax.frm if ShowForm Flax Set Seeds = Flax[ed9] if Flax[ed10] = True Set Water = 1 Else Set Water = 0 End If Flax[ed1] = Seeds Set Button = 1 End Compute SeedX = Flax[ed2]/2 - 1 Set Rounds = Flax[ed3] Set Pick = Flax[ed4] Set Weed = Flax[ed5] Case When Flax[ed1] = Color Test MousePos 100, 20 LeftClick Delay 400 Call ColorTest stop When Flax[ed1] = Flax Set Pick = 2 End SetConst Color = Flax[ed8] else stop end FormSave Flax, Flax.frm MousePos 100, 20 LeftClick Delay 400 Compute FlaxSet = $Pick * $Seeds - 1 Loop $Rounds If Flax[ed1] = Seeds or Flax[ed1] = Both Call Seeds End if Flax[ed1] = Both MousePos 345, $RSide2Y Delay 200 Leftclick Delay 2000 End Loop $FlaxSet If Flax[ed1] = Flax or Flax[ed1] = Both Call Flax End If Flax[ed7] = True Call Rot End Delay 4000 If Flax[ed6] = True Call Dump //Dumps raw flax into a chest End End End Procedure Seeds MousePos $LeftStep Leftclick delay 500 Call Plant Loop $SeedX Call MoveLeft End Call MoveDown Loop $SeedX Call MoveRight End MousePos 900, 220 delay 250 Leftclick Delay 4000 Loop $Pick Set Rip = {loopno} //Check for Seeds Left SetConst Direction = 0 Compute PickX = $SeedX + 1 SetConst NewX = $Left2X Call PickSeeds //Move to 2nd row SetConst SS1X = $LSide1X SetConst SS1Y = $LSide1Y SetConst SS2X = $LSide2X SetConst SS2Y = $LSide2Y Call SideStep //Check for Seeds Right SetConst Direction = 1 Compute NewX = $Right2X Call PickSeeds //Move to 1st Row SetConst SS1X = $RSide1X SetConst SS1Y = $RSide1Y SetConst SS2X = $RSide2X SetConst SS2Y = $RSide2Y Call SideStep End End Procedure Flax Set ButtonX = 995 If $Water = 1 Call FindButton Call Water End MousePos $LeftStep Leftclick Delay 2000 Call Group MousePos 512, 680 Delay 350 LeftClick Delay 500 Call Group MousePos 277, 85 Delay 350 LeftClick Delay 3000 loop $Weed //Change this number to equal how many times you have to weed //and or water + 1. for Old egypt and green nile this number is 3 Set Flax = {loopno} Call WeedLeft compute WeedY = $WeedY + $Mod1 Compute ObjY = $ObjY + $Mod1 Call WeedRight compute WeedY = $WeedY + $Mod2 Compute ObjY = $ObjY + $Mod2 Call WeedLeft compute WeedY = $WeedY + $Mod3 Compute ObjY = $ObjY + $Mod3 Call WeedRight SetConst WeedX = 741 SetConst WeedY = 85 SetConst ObjX = 752 SetConst ObjY = 72 Delay 1000 end SetConst ObjX = 752 SetConst Flax = 1 MousePos $Reset Delay 250 Leftclick Delay 2000 MousePos $RightStep2 Leftclick Delay 1500 End Procedure Rot MousePos 313, 384 delay 250 Keys {ESC} Delay 250 Compute NewX = {mousex} + 15 Compute NewY = {mousey} + 102 MousePos $NewX, $NewY delay 250 Rightclick Delay 250 Compute NewX = {mousex} + 15 Compute NewY = {mousey} + 47 //63 MousePos $NewX, $NewY delay 250 Rightclick Mousepos 510, 425 Delay 250 Rightclick Delay 250 End Procedure Dump MousePos $DumpX, $DumpY Delay 250 Rightclick Delay 200 Compute NewX = $DumpX + 10 MousePos $NewX, $DumpY Delay 250 Rightclick Delay 200 MousePos 513, 426 Delay 250 Rightclick Delay 250 end Procedure MoveLeft MousePos $LeftX, $LeftY Delay 350 LeftClick Delay 350 Call Plant End Procedure MoveRight MousePos $RightX, $RightY Delay 350 LeftClick Delay 350 Call Plant End Procedure Plant MousePos $XPlant, $YPlant Delay 350 LeftClick Delay 350 End Procedure Group Call Plant loop 4 Call MoveLeft end MousePos 512, 540 Delay 350 LeftClick Delay 350 Call Plant loop 4 Call MoveRight end End Procedure MoveDown MousePos 512, 540 //572, 600 //512, 540 Delay 350 LeftClick Delay 350 Call Plant End Procedure Weed SetConst Picked = 0 While $Picked = 0 MousePos $WeedX, $WeedY Delay 100 Rightclick Delay 250 Case When $Flax = $Weed IsObject Flax at $ObjX, $ObjY Compute TempX = $WeedX + 20 Compute TempY = $WeedY - 7 MousePos $TempX, $TempY Delay 200 Rightclick Delay 100 SetConst Picked = 1 Break End Else IsObject Weed at $ObjX, $ObjY Compute TempX = $WeedX + 20 Compute TempY = $WeedY - 7 MousePos $TempX, $TempY Delay 200 Rightclick Delay 100 SetConst Picked = 1 Break End End Keys {Esc} Delay 200 Rightclick Delay 200 End End Procedure WeedLeft Call Weed Loop 4 compute WeedX = $WeedX - $Mod1 Compute ObjX = $ObjX - $Mod1 Call Weed End End Procedure WeedRight Call Weed loop 4 compute WeedX = $WeedX + $Mod1 Compute ObjX = $ObjX + $Mod1 Call Weed end End Procedure PickSeeds Loop $PickX MousePos $NewX, $LeftY Delay 250 SetConst Picked = 0 While $Picked = 0 Rightclick Delay 250 Case When $Direction = 0 Compute TextX = $NewX + 9 Compute TextY = $LeftY - 22 IsObject Harvest at $TextX, $TextY Compute TempX = $TextX + 4 Compute TempY = $TextY + 6 MousePos $TempX, $TempY Delay 100 rightclick Inc Picked Delay 1800 If $Rip = $Pick Compute TempX = $NewX + 184 MousePos $TempX, $LeftY Delay 250 Rightclick Delay 250 Compute RipX = $TempX + 10 Compute RipY = $LeftY - 5 IsObject Rip at $RipX, $RipY Compute RipX = $RipX + 7 Compute RipY = $RipY + 5 MousePos $RipX, $RipY Delay 250 Rightclick Delay 250 End End Continue End When $Direction = 1 Compute TextX = $NewX - 137 Compute TextY = $LeftY - 22 IsObject Harvest at $TextX, $TextY Compute TempX = $TextX + 4 Compute TempY = $TextY + 6 MousePos $TempX, $TempY Delay 100 rightclick Inc Picked Delay 1800 If $Rip = $Pick Compute TempX = $NewX - 190 MousePos $TempX, $LeftY Delay 250 Rightclick Delay 250 Compute RipX = $TempX + 10 Compute RipY = $LeftY - 5 IsObject Rip at $RipX, $RipY Compute RipX = $RipX + 7 Compute RipY = $RipY + 5 MousePos $RipX, $RipY Delay 250 Rightclick Delay 250 End End Continue End End Keys {Esc} Delay 300 End End End Procedure SideStep MousePos $SS1X, $SS1Y Delay 250 Leftclick Delay 2250 MousePos $SS2X, $SS2Y Delay 250 Leftclick Delay 850 End Procedure Coords Bell Asterisk Delay 5000 Loadrgb {mousey}, {mousey} keys {rgbred},{rgbgreen},{rgbblue} //Keys {mousex}, {mousey} End Procedure FindButton MousePos $ButtonX, $ButtonY Delay 200 LoadRGB {mousex}, {mousey} //While {rgbred} <> $Red and {rgbgreen} <> $Green and {rgbblue} <> $Blue While {rgbgreen} < $Color or {rgbblue} < $Color Compute ButtonX = $ButtonX - $SubX MousePos $ButtonX, $ButtonY Delay 200 LoadRGB {mousex}, {mousey} Timestamp {loopno} {rgbred} {rgbgreen} {rgbblue} End Timestamp Water Button = {rgbred} {rgbgreen} {rgbblue} SetConst ButtonX = {mousex} SetConst ButtonY = {mousey} SetConst Button = 1 End Procedure Water MousePos $ButtonX, $ButtonY Delay 200 Rightclick Delay 250 MousePos 512, 424 Delay 250 Rightclick Delay 3000 End Procedure ColorTest MousePos $ButtonX, $ButtonY Delay 200 Loop 7 LoadRGB {mousex}, {mousey} Timestamp {loopno} - {rgbred} {rgbgreen} {rgbblue} Compute ButtonX = $ButtonX - $SubX MousePos $ButtonX, $ButtonY Delay 1000 End End Bell Exclamation //Written with ACTool 5.3.0 by Anka