The Wiki for Tale 4 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:Caigan/Cabbage Grow Macro"
From A Tale in the Desert
Jump to navigationJump to search (New page: I'll put a graphic up here later. I'll warn again, this is very ugly code, and works maybe 50% of the time. If it doesn't work the first time, move a bit, reload the macro, and try again....) |
|||
Line 714: | Line 714: | ||
End | End | ||
− | MousePos 745, 479 | + | //MousePos 745, 479 |
− | +28, +41 | + | //+28, +41 |
− | MousePos 773, 520 | + | //MousePos 773, 520 |
− | +134, +0 | + | //+134, +0 |
− | MousePos 907, 520 | + | //MousePos 907, 520 |
− | MousePos 839, 451 | + | //MousePos 839, 451 |
− | MousePos 839, 588 | + | //MousePos 839, 588 |
//MousePos 74, 46 //Plant Button Position | //MousePos 74, 46 //Plant Button Position |
Latest revision as of 14:27, 30 January 2009
I'll put a graphic up here later.
I'll warn again, this is very ugly code, and works maybe 50% of the time. If it doesn't work the first time, move a bit, reload the macro, and try again.
//Caigan's Cabbage Grower Macro // //Instructions //1. Turn off Lighting and Shadows //2. Have 4 cabbage seeds and lots of jugs of water in inventory. //3. Pin Plant menu in upper left. //4. Use F8 twice and zoom in all the way. Hit Alt + L to lock camera. //5. Plant a cabbage. //6. Hit the small left button twice on the build menu //7. Place mouse on the section of cabbage shown in the graphic on my wiki user page. (upper left corner of the top most cabbage) //Then Alt-Tab to AC Tool and hit F2 Constants CurrentLevel = 4 TotalLevel = 20 NewMouseX = 0 NewMouseY = 0 Cabbage1 = 1 Cabbage2 = 1 Cabbage3 = 1 Cabbage4 = 1 CabbageHor = 2 CabbageVer = 2 CabbageSet = NoValue CabbageDead = 0 ErrorColor = 0 //Replace this X,Y with the location of your overwater error box OK button ErrorX = 838 ErrorY = 619 End Constructs CornerstoneX = List CornerstoneY = List Cabbage1Color = List Cabbage1PosX = List Cabbage1PosY = List Cabbage2Color = List Cabbage2PosX = List Cabbage2PosY = List Cabbage3Color = List Cabbage3PosX = List Cabbage3PosY = List Cabbage4Color = List Cabbage4PosX = List Cabbage4PosY = List End ListAdd CornerstoneX, {MouseX} ListAdd CornerstoneY, {MouseY} ListAdd Cabbage1PosX, CornerstoneX[1] ListAdd Cabbage1PosY, CornerstoneY[1] ListAdd Cabbage1PosX, 0 ListAdd Cabbage1PosY, 0 ListAdd Cabbage1PosX, 0 ListAdd Cabbage1PosY, 0 ListAdd Cabbage1PosX, 0 ListAdd Cabbage1PosY, 0 ListAdd Cabbage1PosX, 0 ListAdd Cabbage1PosY, 0 ListAdd Cabbage2PosX, 0 ListAdd Cabbage2PosY, 0 ListAdd Cabbage2PosX, 0 ListAdd Cabbage2PosY, 0 ListAdd Cabbage2PosX, 0 ListAdd Cabbage2PosY, 0 ListAdd Cabbage2PosX, 0 ListAdd Cabbage2PosY, 0 ListAdd Cabbage2PosX, 0 ListAdd Cabbage2PosY, 0 ListAdd Cabbage3PosX, 0 ListAdd Cabbage3PosY, 0 ListAdd Cabbage3PosX, 0 ListAdd Cabbage3PosY, 0 ListAdd Cabbage3PosX, 0 ListAdd Cabbage3PosY, 0 ListAdd Cabbage3PosX, 0 ListAdd Cabbage3PosY, 0 ListAdd Cabbage3PosX, 0 ListAdd Cabbage3PosY, 0 ListAdd Cabbage4PosX, 0 ListAdd Cabbage4PosY, 0 ListAdd Cabbage4PosX, 0 ListAdd Cabbage4PosY, 0 ListAdd Cabbage4PosX, 0 ListAdd Cabbage4PosY, 0 ListAdd Cabbage4PosX, 0 ListAdd Cabbage4PosY, 0 ListAdd Cabbage4PosX, 0 ListAdd Cabbage4PosY, 0 ListAdd Cabbage1Color, 0 ListAdd Cabbage1Color, 0 ListAdd Cabbage1Color, 0 ListAdd Cabbage1Color, 0 ListAdd Cabbage1Color, 0 ListAdd Cabbage2Color, 0 ListAdd Cabbage2Color, 0 ListAdd Cabbage2Color, 0 ListAdd Cabbage2Color, 0 ListAdd Cabbage2Color, 0 ListAdd Cabbage3Color, 0 ListAdd Cabbage3Color, 0 ListAdd Cabbage3Color, 0 ListAdd Cabbage3Color, 0 ListAdd Cabbage3Color, 0 ListAdd Cabbage4Color, 0 ListAdd Cabbage4Color, 0 ListAdd Cabbage4Color, 0 ListAdd Cabbage4Color, 0 ListAdd Cabbage4Color, 0 MousePos 91, 18 Delay 100 LeftClick Delay 400 //Keys {F4} Compute Cabbage1PosX[2] = Cabbage1PosX[1] - 15 Compute Cabbage1PosX[3] = Cabbage1PosX[2] - 18 Compute Cabbage1PosX[4] = Cabbage1PosX[3] - 20 Compute Cabbage1PosX[5] = Cabbage1PosX[4] - 20 Compute Cabbage1PosY[2] = Cabbage1PosY[1] - 0 Compute Cabbage1PosY[3] = Cabbage1PosY[2] - 0 Compute Cabbage1PosY[4] = Cabbage1PosY[3] - 0 Compute Cabbage1PosY[5] = Cabbage1PosY[4] - 0 Compute Cabbage2PosX[1] = CornerstoneX[1] + 202 Compute Cabbage2PosX[2] = Cabbage2PosX[1] + 15 Compute Cabbage2PosX[3] = Cabbage2PosX[2] + 17 Compute Cabbage2PosX[4] = Cabbage2PosX[3] + 20 Compute Cabbage2PosX[5] = Cabbage2PosX[4] + 20 Compute Cabbage2PosY[1] = CornerstoneY[1] + 59 Compute Cabbage2PosY[2] = Cabbage2PosY[1] - 0 Compute Cabbage2PosY[3] = Cabbage2PosY[2] - 0 Compute Cabbage2PosY[4] = Cabbage2PosY[3] - 0 Compute Cabbage2PosY[5] = Cabbage2PosY[4] - 0 Compute Cabbage3PosX[1] = CornerstoneX[1] + 89 Compute Cabbage3PosX[2] = Cabbage3PosX[1] - 0 Compute Cabbage3PosX[3] = Cabbage3PosX[2] - 0 Compute Cabbage3PosX[4] = Cabbage3PosX[3] - 0 Compute Cabbage3PosX[5] = Cabbage3PosX[4] - 0 Compute Cabbage3PosY[1] = CornerstoneY[1] - 80 Compute Cabbage3PosY[2] = Cabbage3PosY[1] - 15 Compute Cabbage3PosY[3] = Cabbage3PosY[2] - 20 Compute Cabbage3PosY[4] = Cabbage3PosY[3] - 21 Compute Cabbage3PosY[5] = Cabbage3PosY[4] - 21 Compute Cabbage4PosX[1] = CornerstoneX[1] + 84 Compute Cabbage4PosX[2] = Cabbage4PosX[1] - 0 Compute Cabbage4PosX[3] = Cabbage4PosX[2] - 0 Compute Cabbage4PosX[4] = Cabbage4PosX[3] - 0 Compute Cabbage4PosX[5] = Cabbage4PosX[4] - 0 Compute Cabbage4PosY[1] = CornerstoneY[1] + 155 Compute Cabbage4PosY[2] = Cabbage4PosY[1] + 15 Compute Cabbage4PosY[3] = Cabbage4PosY[2] + 16 Compute Cabbage4PosY[4] = Cabbage4PosY[3] + 19 Compute Cabbage4PosY[5] = Cabbage4PosY[4] + 19 Procedure Error // LoadRGB $ErrorX, $ErrorY // Set ErrorColor = {RGBRed} // // If $ErrorColor > 230 // If $ErrorColor < 250 // MousePos $ErrorX, $ErrorY // Pause 100 // RightClick // Pause 100 // Set Cabbage$CabbageDead = 5 // End // End // If $ErrorColor = 0 // MousePos $ErrorX, $ErrorY // Pause 100 // RightClick // Pause 100 // Set Cabbage$CabbageDead = 5 // End End //BlackOkay //MousePos 842, 621 //SeedLocations //1 - R 208 //MousePos 791, 526 //Keys {F4} Delay 500 LoadRGB Cabbage1PosX[2], Cabbage1PosY[2] Set Cabbage1Color[1] = {RGBGreen} LoadRGB Cabbage2PosX[2], Cabbage2PosY[2] Set Cabbage2Color[1] = {RGBGreen} LoadRGB Cabbage3PosX[2], Cabbage3PosY[2] Set Cabbage3Color[1] = {RGBGreen} LoadRGB Cabbage4PosX[2], Cabbage4PosY[2] Set Cabbage4Color[1] = {RGBGreen} //MousePos 59, 122 // Down Position MousePos 85, 162 // Cancel Build if present Delay 100 RightClick Delay 300 MousePos 74, 46 //Plant Button Position Delay 100 RightClick Delay 300 MousePos 38, 103 //Left Position Delay 100 RightClick Delay 200 MousePos 38, 103 //Left Position Delay 100 RightClick Delay 200 MousePos 36, 160 // Build Button Delay 100 RightClick Delay 300 MousePos 74, 46 //Plant Button Position Delay 100 RightClick Delay 300 MousePos 83, 102 // Right Position Delay 100 RightClick Delay 200 MousePos 83, 102 // Right Position Delay 100 RightClick Delay 200 MousePos 36, 160 // Build Button Delay 100 RightClick Delay 300 MousePos 74, 46 //Plant Button Position Delay 100 RightClick Delay 300 MousePos 59, 77 // Up Position Delay 100 RightClick Delay 200 MousePos 59, 77 // Up Position Delay 100 RightClick Delay 200 MousePos 36, 160 // Build Button Delay 100 RightClick Delay 300 MousePos 74, 46 //Plant Button Position Delay 100 RightClick Delay 300 MousePos 59, 122 // Down Position Delay 100 RightClick Delay 200 MousePos 59, 122 // Down Position Delay 100 RightClick Delay 200 MousePos 36, 160 // Build Button Delay 100 RightClick Delay 300 //Water Left MousePos Cabbage1PosX[1], Cabbage1PosY[1] Delay 100 RightClick Delay 250 Compute NewMouseX = Cabbage1PosX[1] + 40 Compute NewMouseY = Cabbage1PosY[1] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 250 //Water Right MousePos Cabbage2PosX[1], Cabbage2PosY[1] Delay 100 RightClick Delay 250 Compute NewMouseX = Cabbage2PosX[1] + 40 Compute NewMouseY = Cabbage2PosY[1] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 250 //Water Up MousePos Cabbage3PosX[1], Cabbage3PosY[1] Delay 100 RightClick Delay 250 Compute NewMouseX = Cabbage3PosX[1] + 40 Compute NewMouseY = Cabbage3PosY[1] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 250 //Water Down MousePos Cabbage4PosX[1], Cabbage4PosY[1] Delay 100 RightClick Delay 250 Compute NewMouseX = Cabbage4PosX[1] + 40 Compute NewMouseY = Cabbage4PosY[1] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 250 While $CurrentLevel < $TotalLevel //Keys {F4} Delay 400 //Cabbage Left If $Cabbage1 = 1 LoadRGB Cabbage1PosX[2], Cabbage1PosY[2] //Cabbage 1 - Level 1 If Cabbage1Color[1] = {RGBGreen} Else MousePos Cabbage1PosX[1], Cabbage1PosY[1] Delay 100 RightClick Delay 250 Compute NewMouseX = Cabbage1PosX[1] + 40 Compute NewMouseY = Cabbage1PosY[1] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 250 Compute Cabbage1 = $Cabbage1 + 1 LoadRGB Cabbage1PosX[2], Cabbage1PosY[2] Set Cabbage1Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage 1 - Level 2 If $Cabbage1 = 2 LoadRGB Cabbage1PosX[2], Cabbage1PosY[2] If Cabbage1Color[1] = {RGBGreen} Else MousePos Cabbage1PosX[2], Cabbage1PosY[2] Delay 100 RightClick Delay 250 Compute NewMouseX = Cabbage1PosX[2] + 40 Compute NewMouseY = Cabbage1PosY[2] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 250 Compute Cabbage1 = $Cabbage1 + 1 LoadRGB Cabbage1PosX[2], Cabbage1PosY[2] Set Cabbage1Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage 1 - Level 3 If $Cabbage1 = 3 LoadRGB Cabbage1PosX[2], Cabbage1PosY[2] If Cabbage1Color[1] = {RGBGreen} Else MousePos Cabbage1PosX[3], Cabbage1PosY[3] Delay 100 RightClick Delay 250 Compute NewMouseX = Cabbage1PosX[3] + 40 Compute NewMouseY = Cabbage1PosY[3] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 250 Compute Cabbage1 = $Cabbage1 + 1 LoadRGB Cabbage1PosX[2], Cabbage1PosY[2] Set Cabbage1Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage 1 - Level 4 If $Cabbage1 = 4 LoadRGB Cabbage1PosX[2], Cabbage1PosY[2] If Cabbage1Color[1] = {RGBGreen} Else MousePos Cabbage1PosX[4], Cabbage1PosY[4] Delay 100 RightClick Delay 250 Compute NewMouseX = Cabbage1PosX[4] + 40 Compute NewMouseY = Cabbage1PosY[4] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 1000 Compute Cabbage1 = $Cabbage1 + 1 LoadRGB Cabbage1PosX[2], Cabbage1PosY[2] Set Cabbage1Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage Right If $Cabbage2 = 1 LoadRGB Cabbage2PosX[2], Cabbage2PosY[2] //Cabbage 1 - Level 1 If Cabbage2Color[1] = {RGBGreen} Else MousePos Cabbage2PosX[1], Cabbage2PosY[1] Delay 100 RightClick Delay 250 Compute NewMouseX = Cabbage2PosX[1] + 40 Compute NewMouseY = Cabbage2PosY[1] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 250 Compute Cabbage2 = $Cabbage2 + 1 LoadRGB Cabbage2PosX[2], Cabbage2PosY[2] Set Cabbage2Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage 1 - Level 2 If $Cabbage2 = 2 LoadRGB Cabbage2PosX[2], Cabbage2PosY[2] If Cabbage2Color[1] = {RGBGreen} Else MousePos Cabbage2PosX[2], Cabbage2PosY[2] Delay 100 RightClick Delay 400 Compute NewMouseX = Cabbage2PosX[2] + 40 Compute NewMouseY = Cabbage2PosY[2] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 400 Compute Cabbage2 = $Cabbage2 + 1 LoadRGB Cabbage2PosX[2], Cabbage2PosY[2] Set Cabbage2Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage 1 - Level 3 If $Cabbage2 = 3 LoadRGB Cabbage2PosX[2], Cabbage2PosY[2] If Cabbage2Color[1] = {RGBGreen} Else MousePos Cabbage2PosX[3], Cabbage2PosY[3] Delay 100 RightClick Delay 400 Compute NewMouseX = Cabbage2PosX[3] + 40 Compute NewMouseY = Cabbage2PosY[3] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 400 Compute Cabbage2 = $Cabbage2 + 1 LoadRGB Cabbage2PosX[2], Cabbage2PosY[2] Set Cabbage2Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage 1 - Level 4 If $Cabbage2 = 4 LoadRGB Cabbage2PosX[2], Cabbage2PosY[2] If Cabbage2Color[1] = {RGBGreen} Else MousePos Cabbage2PosX[4], Cabbage2PosY[4] Delay 100 RightClick Delay 400 Compute NewMouseX = Cabbage2PosX[4] + 40 Compute NewMouseY = Cabbage2PosY[4] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 1000 Compute Cabbage2 = $Cabbage2 + 1 LoadRGB Cabbage2PosX[2], Cabbage2PosY[2] Set Cabbage2Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage Up If $Cabbage3 = 1 LoadRGB Cabbage3PosX[2], Cabbage3PosY[2] //Cabbage 1 - Level 1 If Cabbage3Color[1] = {RGBGreen} Else MousePos Cabbage3PosX[1], Cabbage3PosY[1] Delay 100 RightClick Delay 400 Compute NewMouseX = Cabbage3PosX[1] + 40 Compute NewMouseY = Cabbage3PosY[1] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 400 Compute Cabbage3 = $Cabbage3 + 1 LoadRGB Cabbage3PosX[2], Cabbage3PosY[2] Set Cabbage3Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage 1 - Level 2 If $Cabbage3 = 2 LoadRGB Cabbage3PosX[2], Cabbage3PosY[2] If Cabbage3Color[1] = {RGBGreen} Else MousePos Cabbage3PosX[2], Cabbage3PosY[2] Delay 100 RightClick Delay 400 Compute NewMouseX = Cabbage3PosX[2] + 40 Compute NewMouseY = Cabbage3PosY[2] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 400 Compute Cabbage3 = $Cabbage3 + 1 LoadRGB Cabbage3PosX[2], Cabbage3PosY[2] Set Cabbage3Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage 1 - Level 3 If $Cabbage3 = 3 LoadRGB Cabbage3PosX[2], Cabbage3PosY[2] If Cabbage3Color[1] = {RGBGreen} Else MousePos Cabbage3PosX[3], Cabbage3PosY[3] Delay 100 RightClick Delay 400 Compute NewMouseX = Cabbage3PosX[3] + 40 Compute NewMouseY = Cabbage3PosY[3] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 400 Compute Cabbage3 = $Cabbage3 + 1 LoadRGB Cabbage3PosX[2], Cabbage3PosY[2] Set Cabbage3Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage 1 - Level 4 If $Cabbage3 = 4 LoadRGB Cabbage3PosX[2], Cabbage3PosY[2] If Cabbage3Color[1] = {RGBGreen} Else MousePos Cabbage3PosX[4], Cabbage3PosY[4] Delay 100 RightClick Delay 400 Compute NewMouseX = Cabbage3PosX[4] + 40 Compute NewMouseY = Cabbage3PosY[4] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 1000 Compute Cabbage3 = $Cabbage3 + 1 LoadRGB Cabbage3PosX[2], Cabbage3PosY[2] Set Cabbage3Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage Bottom If $Cabbage4 = 1 LoadRGB Cabbage4PosX[2], Cabbage4PosY[2] //Cabbage 1 - Level 1 If Cabbage4Color[1] = {RGBGreen} Else MousePos Cabbage4PosX[1], Cabbage4PosY[1] Delay 100 RightClick Delay 250 Compute NewMouseX = Cabbage4PosX[1] + 40 Compute NewMouseY = Cabbage4PosY[1] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 250 Compute Cabbage4 = $Cabbage4 + 1 LoadRGB Cabbage4PosX[2], Cabbage4PosY[2] Set Cabbage4Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage 1 - Level 2 If $Cabbage4 = 2 LoadRGB Cabbage4PosX[2], Cabbage4PosY[2] If Cabbage4Color[1] = {RGBGreen} Else MousePos Cabbage4PosX[2], Cabbage4PosY[2] Delay 100 RightClick Delay 250 Compute NewMouseX = Cabbage4PosX[2] + 40 Compute NewMouseY = Cabbage4PosY[2] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 250 Compute Cabbage4 = $Cabbage4 + 1 LoadRGB Cabbage4PosX[2], Cabbage4PosY[2] Set Cabbage4Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage 1 - Level 3 If $Cabbage4 = 3 LoadRGB Cabbage4PosX[2], Cabbage4PosY[2] If Cabbage4Color[1] = {RGBGreen} Else MousePos Cabbage4PosX[3], Cabbage4PosY[3] Delay 100 RightClick Delay 250 Compute NewMouseX = Cabbage4PosX[3] + 40 Compute NewMouseY = Cabbage4PosY[3] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 250 Compute Cabbage4 = $Cabbage4 + 1 LoadRGB Cabbage4PosX[2], Cabbage4PosY[2] Set Cabbage4Color[1] = {RGBGreen} //Keys {F4} End End //Cabbage 1 - Level 4 If $Cabbage4 = 4 LoadRGB Cabbage4PosX[2], Cabbage4PosY[2] If Cabbage4Color[1] = {RGBGreen} Else MousePos Cabbage4PosX[4], Cabbage4PosY[4] Delay 100 RightClick Delay 250 Compute NewMouseX = Cabbage4PosX[4] + 40 Compute NewMouseY = Cabbage4PosY[4] + 15 MousePos $NewMouseX, $NewMouseY Delay 100 RightClick Delay 1000 Compute Cabbage4 = $Cabbage4 + 1 LoadRGB Cabbage4PosX[2], Cabbage4PosY[2] Set Cabbage4Color[1] = {RGBGreen} //Keys {F4} End End Compute CabbageHor = $Cabbage1 + $Cabbage2 Compute CabbageVer = $Cabbage3 + $Cabbage4 Compute CurrentLevel = $CabbageHor + $CabbageVer End //MousePos 745, 479 //+28, +41 //MousePos 773, 520 //+134, +0 //MousePos 907, 520 //MousePos 839, 451 //MousePos 839, 588 //MousePos 74, 46 //Plant Button Position //MousePos 38, 103 //Left Position //MousePos 59, 77 // Up Position //MousePos 83, 102 // Right Position //MousePos 59, 122 // Down Position //MousePos 36, 160 // Build Button //MousePos 85, 162 // Cancel Button //Left Cabbage Sizes //MousePos 783, 490