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:Hilly/Macros"
From A Tale in the Desert
Jump to navigationJump to search (→Kilns) |
|||
| Line 55: | Line 55: | ||
Delay 150000 | Delay 150000 | ||
| + | end | ||
| + | |||
| + | </pre> | ||
| + | |||
| + | ===Barley=== | ||
| + | <pre> | ||
| + | (* Brute Force Barley Macro for ATITD 1280 1080 . 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. *) | ||
| + | Constants | ||
| + | // Insert constants here | ||
| + | |||
| + | NumberOfLoops = 14 //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 = 11000 //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 =1229 //973 //If you don't want the barley planting box in the upper right, | ||
| + | //can change this (and the Y value below this). | ||
| + | YCoordsOfPlantBarley = 41 //47 //See above comment | ||
| + | |||
| + | NumToDo = 18 //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=260 | ||
| + | MoveDeltaY=226 | ||
| + | |||
| + | //The center for calculating the movment | ||
| + | PlayerCenterX=625 | ||
| + | PlayerCenterY=524 | ||
| + | |||
| + | //How many patches of barley to plant per row | ||
| + | PlantsPerRow = 5 | ||
| + | |||
| + | //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=1280//1024 | ||
| + | ResolutionY=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 | ||
| + | |||
| + | 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 | ||
| + | |||
| + | |||
| + | loop $NumToDo //A statement like this that will be gone through for each number >1 | ||
| + | |||
| + | 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 //end loop | ||
| + | |||
| + | |||
| + | SetConst Adding = 0 | ||
| + | loop 6//This is the main loop | ||
| + | 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 //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 //end number of loop | ||
| + | end //end procedure | ||
| + | |||
| + | |||
| + | procedure Harvest | ||
| + | SetConst MousePosX = {MouseX} | ||
| + | SetConst MousePosY = {MouseY} | ||
| + | |||
| + | |||
| + | MousePos 190, 109 | ||
| + | loop $NumberAdded //This is for harvesting | ||
| + | |||
| + | |||
| + | Compute multiplyer= {LoopNo} - 1 | ||
| + | if {LoopNo} > 5 | ||
| + | Compute multiplyer= $multiplyer + 1 | ||
| + | //pause | ||
| + | end //if | ||
| + | |||
| + | if {LoopNo} > 12 | ||
| + | Compute multiplyer= $multiplyer + 4 | ||
| + | end //if | ||
| + | |||
| + | if {LoopNo} > 15 | ||
| + | Compute multiplyer= $multiplyer + 1 | ||
| + | end //if | ||
| + | |||
| + | Compute MousePosX = 110 + $BarleyWindowX * ($multiplyer MOD 6 ) | ||
| + | Compute MousePosY= 230 + $BarleyWindowY * ($multiplyer DIV 6 ) | ||
| + | |||
| + | |||
| + | |||
| + | call RightClick2 | ||
| + | Delay $sleeptime | ||
| + | Compute MousePosX = $MousePosX + 80 | ||
| + | Compute MousePosY = $MousePosY - 120 | ||
| + | call RightClick2 | ||
| + | Delay $sleeptime | ||
| + | SetConst NumberAdded = 0 | ||
| + | |||
| + | 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 | ||
| + | |||
| + | Compute multiplyer= {LoopNo} - 1 | ||
| + | if {LoopNo} > 5 | ||
| + | Compute multiplyer= $multiplyer + 1 | ||
| + | //pause | ||
| + | end //if | ||
| + | |||
| + | if {LoopNo} > 12 | ||
| + | Compute multiplyer= $multiplyer + 4 | ||
| + | end //if | ||
| + | |||
| + | if {LoopNo} > 15 | ||
| + | Compute multiplyer= $multiplyer + 1 | ||
| + | end //if | ||
| + | |||
| + | Compute varColourX = 179 + $BarleyWindowX * ($multiplyer MOD 6 ) - $ExtraTickX * $ExtraTickOffset | ||
| + | Compute varColourY= 164 + $BarleyWindowY * ($multiplyer DIV 6 ) | ||
| + | |||
| + | |||
| + | |||
| + | 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// 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 | ||
| + | Delay $sleeptime | ||
| + | SetConst varDelay = 1 | ||
| + | Compute MousePosX = INT(510/1024*$ResolutionX) | ||
| + | Compute MousePosY = INT(425/768*$ResolutionY) | ||
| + | call RightClick2 | ||
| + | Delay $sleeptime | ||
| + | Delay $sleeptime | ||
| + | call GetMousePos | ||
| + | Compute TempMouseX=(INT(510/1024*$ResolutionX) + 100) | ||
| + | Compute TempMouseY=(INT(425/768*$ResolutionY) - 95) | ||
| + | MousePos $TempMouseX,$TempMouseY | ||
| + | |||
| + | // NumberAdded | ||
| + | //DragTo 105, 265 | ||
| + | Compute TempMouseX=103 + $BarleyWindowX*$numberPlanted | ||
| + | Compute TempMouseY=44 | ||
| + | |||
| + | |||
| + | if $numberPlanted > 4 | ||
| + | Compute multiplyer= $numberPlanted + 1 | ||
| + | // pause | ||
| + | end //if | ||
| + | |||
| + | if $numberPlanted > 11 | ||
| + | Compute multiplyer= $multiplyer + 4 | ||
| + | end //if | ||
| + | |||
| + | if $numberPlanted > 14 | ||
| + | Compute multiplyer= $multiplyer + 1 | ||
| + | end //if | ||
| + | |||
| + | Compute TempMouseX=103 + $BarleyWindowX * ($multiplyer MOD 6 ) | ||
| + | Compute TempMouseY=44 + $BarleyWindowY * ($multiplyer DIV 6 ) | ||
| + | |||
| + | |||
| + | 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 //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 | ||
| + | </pre> | ||
| + | ===Clay=== | ||
| + | <per> | ||
| + | // Clay | ||
| + | loop 890 | ||
| + | |||
| + | delay 600 | ||
| + | |||
| + | MousePos 107, 96 | ||
| + | leftclick | ||
| + | |||
| + | delay 100 | ||
| + | |||
| + | MousePos 1762, 600 | ||
| + | leftclick | ||
| + | |||
| + | delay 600 | ||
| + | |||
| + | MousePos 107, 96 | ||
| + | leftclick | ||
| + | |||
| + | delay 100 | ||
| + | |||
| + | MousePos 68, 600 | ||
| + | leftclick | ||
| + | |||
| + | |||
end | end | ||
</pre> | </pre> | ||
Revision as of 09:09, 17 October 2009
Kilns
// Written by: Coyan/Mosaic Guild originally as a mining Macro
// Adjusted by Menhotep for woodplane work.
// Adjusted By Hilly for Kilns
// with minor adjustments
// This is what I suggest for setting up for this macro
Constructs
MouseX=List // this is an array of mouse X coords for gem sample points
MouseY=List // this is an array of mouse X coords for gem sample points
END
Constants
totalpulls = 16 // How many times do you want it to run all kilns? (make sure you have wood and brick in inventory)
loopcnt = 1
Mousecnt = 1
MouseXN = 0
MouseYN = 0
End
// First part that requires a detailed explanation
// this loop will pause for 3 seconds then grab the current mouse location
// its purpose is to identify the locations for the Kilns(or however
// many) when it grabs the spot(s), it will then echo a . to the chat window
// make sure you are in your main chat tab. After it finds all the Kilns, you
// may need to minimize your chat window. BE SURE TO BE IN MAIN TAB!
// Adjust this Loop numer to the number of kilns being used
Loop 20
Delay 3000
Listadd MouseX, {MouseX}
Listadd MouseY, {MouseY}
SayPaste ..
END
loop $totalpulls
Compute loopcnt = 1
// Adjust this Loop numer to the number of kins being used
loop 20
mousepos MouseX[$loopcnt], MouseY[$loopcnt]
Delay 150
keys t
Delay 150
keys c // c=Clay brick, b=fire bricks, ext
Delay 150
keys w
Delay 150
keys f
Compute loopcnt = $loopcnt + 1
Delay 100
END
Delay 150000
end
Barley
(* Brute Force Barley Macro for ATITD 1280 1080 . 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. *)
Constants
// Insert constants here
NumberOfLoops = 14 //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 = 11000 //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 =1229 //973 //If you don't want the barley planting box in the upper right,
//can change this (and the Y value below this).
YCoordsOfPlantBarley = 41 //47 //See above comment
NumToDo = 18 //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=260
MoveDeltaY=226
//The center for calculating the movment
PlayerCenterX=625
PlayerCenterY=524
//How many patches of barley to plant per row
PlantsPerRow = 5
//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=1280//1024
ResolutionY=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
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
loop $NumToDo //A statement like this that will be gone through for each number >1
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 //end loop
SetConst Adding = 0
loop 6//This is the main loop
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 //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 //end number of loop
end //end procedure
procedure Harvest
SetConst MousePosX = {MouseX}
SetConst MousePosY = {MouseY}
MousePos 190, 109
loop $NumberAdded //This is for harvesting
Compute multiplyer= {LoopNo} - 1
if {LoopNo} > 5
Compute multiplyer= $multiplyer + 1
//pause
end //if
if {LoopNo} > 12
Compute multiplyer= $multiplyer + 4
end //if
if {LoopNo} > 15
Compute multiplyer= $multiplyer + 1
end //if
Compute MousePosX = 110 + $BarleyWindowX * ($multiplyer MOD 6 )
Compute MousePosY= 230 + $BarleyWindowY * ($multiplyer DIV 6 )
call RightClick2
Delay $sleeptime
Compute MousePosX = $MousePosX + 80
Compute MousePosY = $MousePosY - 120
call RightClick2
Delay $sleeptime
SetConst NumberAdded = 0
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
Compute multiplyer= {LoopNo} - 1
if {LoopNo} > 5
Compute multiplyer= $multiplyer + 1
//pause
end //if
if {LoopNo} > 12
Compute multiplyer= $multiplyer + 4
end //if
if {LoopNo} > 15
Compute multiplyer= $multiplyer + 1
end //if
Compute varColourX = 179 + $BarleyWindowX * ($multiplyer MOD 6 ) - $ExtraTickX * $ExtraTickOffset
Compute varColourY= 164 + $BarleyWindowY * ($multiplyer DIV 6 )
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// 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
Delay $sleeptime
SetConst varDelay = 1
Compute MousePosX = INT(510/1024*$ResolutionX)
Compute MousePosY = INT(425/768*$ResolutionY)
call RightClick2
Delay $sleeptime
Delay $sleeptime
call GetMousePos
Compute TempMouseX=(INT(510/1024*$ResolutionX) + 100)
Compute TempMouseY=(INT(425/768*$ResolutionY) - 95)
MousePos $TempMouseX,$TempMouseY
// NumberAdded
//DragTo 105, 265
Compute TempMouseX=103 + $BarleyWindowX*$numberPlanted
Compute TempMouseY=44
if $numberPlanted > 4
Compute multiplyer= $numberPlanted + 1
// pause
end //if
if $numberPlanted > 11
Compute multiplyer= $multiplyer + 4
end //if
if $numberPlanted > 14
Compute multiplyer= $multiplyer + 1
end //if
Compute TempMouseX=103 + $BarleyWindowX * ($multiplyer MOD 6 )
Compute TempMouseY=44 + $BarleyWindowY * ($multiplyer DIV 6 )
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 //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
Clay
<per> // Clay loop 890
delay 600
MousePos 107, 96 leftclick
delay 100
MousePos 1762, 600 leftclick
delay 600
MousePos 107, 96 leftclick
delay 100
MousePos 68, 600 leftclick
end