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:Cegaiel/Macros/Wheat"

From A Tale in the Desert
Jump to navigationJump to search
Line 1: Line 1:
<pre>
+
==Wheat (Beta) (Autohotkey)==
;Ctrl+Alt+W to start macro.
+
<B>Instructions:</b>
;Ctrl+P to pause script (ie to click Water icon) and Ctrl+P again to resume
 
;The AHK icon in system tray will turn red while paused.
 
;Ctrl+R to reload script
 
  
^r::reload
+
Zoom in about half way (in F5 or F6) and lock your screen (Alt + L) to prevent your screen from moving around. 
^p::Pause
 
^!w::
 
  
 +
Start script with Ctrl+Alt+W
  
 +
The script has GUI menus to walk you through the setup process, its very easy.
  
IfWinExist eGenesis Client
 
{
 
WinActivate
 
  
Gui, +AlwaysOnTop +ToolWindow
+
Basically here is how I do it.  I first minimize my chat (so I dont forget and mess up the first watering). I plant my wheat beds next (before starting the script). Once planted, I quickly move and stand in the center of all the beds. Then quickly start the script and middle click your water icon. Then middle click all your wheat beds, press OK, drag the status bar so it doesn't cover any over your wheat beds, then sit back and enjoy the show. Don't worry about what you need to click, there is a GUI dialogue that will walk you through.
Gui, Font, bold
 
Gui, Add, Text, vMineNumText, Middle click water icon
 
Gui, Font, norm
 
Gui, Add, Text,,
 
( LTrim
 
Hover and middle-click (Click mouse-wheel) on each wheat bed, one by one,
 
until you've clicked on all the beds you want to use. Then click the OK button.
 
(Drag this box out of the way if any beds are hidden)
 
)
 
  
Gui, Add, Button, default gMineSetLoops, OK
+
------
Gui, Show
 
  
MineNum = 0
+
Supports unlimited beds, but I suggest you start out small (4-6 beds) until you get used to the script.  It will hover each bed and send the H and W hotkey over each bed, back to back. Then it will wait 4 seconds and repeat the cycle.
MineCycle = 0
 
NumPulls = 1000
 
  
WinGet, GameWinHandle, ID, eGenesis Client
 
loop
 
{
 
WinActivate
 
CoordMode, Mouse, Relative
 
KeyWait, MButton, D
 
KeyWait, MButton
 
MouseGetPos, TestX, TestY, WinHandle
 
if (WinHandle = GameWinHandle)
 
{
 
Gosub, MineRecord
 
}
 
else
 
{
 
Gui, Destroy
 
break
 
}
 
}
 
return
 
  
 +
Note you <b>must</b> have the chat <b>minimized</b> or else you will see HW appear in chat bar (will not send) repeatedly.
  
  
Water:
+
This macro you do NOT pin up any menus, it simply remembers where all your beds are and points to them and sends the H and W key back to back. By sending the H and W key at same time, this will ensure that it will [H]arvest the wheat (if its time) or [W]ater
MineNum = 1
 
GuiControl, Text, MineCycleText, Fetching Water...
 
MinePosX := MineX%MineNum%
 
MinePosY := MineY%MineNum%
 
MouseGetPos, OldMX, OldMY
 
Click, %MinePosX%, %MinePosY%
 
Sleep, 750
 
Click, 513, 423
 
Sleep, 750
 
MouseMove, %OldMX%, %OldMY%, 0
 
return
 
  
  
MineRecord:
+
Make sure you are standing along water, where you will be planting wheat.  Make sure you have at least one EMPTY jug (Esc, Skills, Empty Jugs), before you start the script, so that the water icon is showing on top left corner.
MineNum++
 
MouseGetPos, MineX%MineNum%, MineY%MineNum%
 
  
if (MineNum = 1)
 
{
 
BedNum = 0
 
GuiControl, Text, MineNumText, Middle click wheat beds
 
}
 
else
 
{
 
BedNum ++
 
GuiControl, Text, MineNumText, %BedNum% wheat beds captured
 
}
 
  
TotalBeds := MineNum-1
+
When you start the script it will tell you to point and middle click your water icon. Then it will tell you to middle click (click your mouse scroll wheel) all of your wheat beds.  Enter as many as you like. Then once you click OK, it will go to work. Once you start the script, you have 7 seconds (before script begins) to move the status bar out of the way of your wheat beds.
return
 
  
  
MineSetLoops:
 
Gui, Submit
 
Gui, Destroy
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, Font, bold
 
Gui, Add, Text, vMineCycleText, Cycle %NumPulls% of %NumPulls%
 
Gui, Font, norm
 
Gui, Show
 
GuiControl, Text, MineCycleText, Cycle %MineCycle% of %NumPulls%
 
  
#Persistent
+
When you first activate the script, it will wait 3 mins and then click the water icon. Once it clicks the water icon, then it will wait another 3 mins to gather more water and so on. Most wheat beds need watering every 32-34 seconds.  So every 3 minutes is more than enough for the water icon to appear. I usually keep about 50 water jugs on me.
;Every 3 mins, get water (180s for 3 mins. SetTimer = s*1000 per min, thus 180,000s for 3 mins)
 
;Normally each wheat needs watered every 33 seconds, real time, so 3 mins is plenty of time for water icon to appear.
 
SetTimer, Water, 180000
 
  
;You got 5 seconds to drag the status bar out of the way (3s below + and 4 s furthur below
 
Sleep 3000
 
  
 +
<b>Bonus Tactic:</b> if you have a Water Mine, plant your wheat next to it.  If a gem pops, then hit Ctrl+P to pause the macro and get your gem.  Then hit Ctrl+P again to resume where you left off at.
  
loop, %NumPulls%
 
{
 
  
Sleep, 2000
+
By the way, I took a shortcut and revamped an old mining script, so you will see alot of references to mining in the script, ^_^
;MinNum = 1 is the water icon location, thus why we are starting at 2. MineNum = 1 is only called during the #Persistent
 
BedNum = 1
 
MineNum = 2
 
MineCycle++
 
MouseGetPos, OldMX, OldMY
 
  
  
  
 
+
[[User:Cegaiel/Macros/Wheat/Code | Get Code!]]
 
 
loop, %TotalBeds%
 
{
 
 
 
 
 
 
 
WinActivate, eGenesis Client
 
 
 
;BlockInput, MouseMove
 
 
 
GuiControl, Text, MineCycleText, Cycle %MineCycle%  Bed %BedNum%
 
MinePosX := MineX%MineNum%
 
MinePosY := MineY%MineNum%
 
MouseMove, %MinePosX%, %MinePosY%, 0
 
Sleep, 100
 
Send {H}
 
Send {W}
 
MineNum++
 
BedNum ++
 
Sleep, 250
 
}
 
 
 
MouseMove, %OldMX%, %OldMY%, 0
 
GuiControl, Text, MineCycleText, Cycle %MineCycle%  PAUSE
 
;BlockInput, MouseMoveOff
 
 
 
 
 
 
 
}
 
Gui, Destroy
 
Gui, Add, Text,, Middle-click on this window to end the script.
 
Gui, Show
 
return
 
}
 
</pre>
 

Revision as of 19:11, 14 January 2010

Wheat (Beta) (Autohotkey)

Instructions:

Zoom in about half way (in F5 or F6) and lock your screen (Alt + L) to prevent your screen from moving around.

Start script with Ctrl+Alt+W

The script has GUI menus to walk you through the setup process, its very easy.


Basically here is how I do it. I first minimize my chat (so I dont forget and mess up the first watering). I plant my wheat beds next (before starting the script). Once planted, I quickly move and stand in the center of all the beds. Then quickly start the script and middle click your water icon. Then middle click all your wheat beds, press OK, drag the status bar so it doesn't cover any over your wheat beds, then sit back and enjoy the show. Don't worry about what you need to click, there is a GUI dialogue that will walk you through.


Supports unlimited beds, but I suggest you start out small (4-6 beds) until you get used to the script. It will hover each bed and send the H and W hotkey over each bed, back to back. Then it will wait 4 seconds and repeat the cycle.


Note you must have the chat minimized or else you will see HW appear in chat bar (will not send) repeatedly.


This macro you do NOT pin up any menus, it simply remembers where all your beds are and points to them and sends the H and W key back to back. By sending the H and W key at same time, this will ensure that it will [H]arvest the wheat (if its time) or [W]ater


Make sure you are standing along water, where you will be planting wheat. Make sure you have at least one EMPTY jug (Esc, Skills, Empty Jugs), before you start the script, so that the water icon is showing on top left corner.


When you start the script it will tell you to point and middle click your water icon. Then it will tell you to middle click (click your mouse scroll wheel) all of your wheat beds. Enter as many as you like. Then once you click OK, it will go to work. Once you start the script, you have 7 seconds (before script begins) to move the status bar out of the way of your wheat beds.


When you first activate the script, it will wait 3 mins and then click the water icon. Once it clicks the water icon, then it will wait another 3 mins to gather more water and so on. Most wheat beds need watering every 32-34 seconds. So every 3 minutes is more than enough for the water icon to appear. I usually keep about 50 water jugs on me.


Bonus Tactic: if you have a Water Mine, plant your wheat next to it. If a gem pops, then hit Ctrl+P to pause the macro and get your gem. Then hit Ctrl+P again to resume where you left off at.


By the way, I took a shortcut and revamped an old mining script, so you will see alot of references to mining in the script, ^_^


Get Code!