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
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
<pre>
+
==Wheat (Autohotkey)==
;Ctrl+Alt+W to start macro.
+
*<b>Updated: 10/25/2010</b> - Removed 1 of the 3 steps needed to setup the macro. You no longer need to record the "Max" button to record its location. It is now found automatically, at any resolution.
;Ctrl+P to pause script (ie to click Water icon) and Ctrl+P again to resume
+
*<B>Updated: 10/16/2010</b> - Added Timers in the GUI status screen - Time Elapsed and Time to next water gather
;The AHK icon in system tray will turn red while paused.
+
*<b>Updated: 1/31/2010</b> - Revamed whole script. Now has more instructions on the GUI interface, so you can execute without having to read wiki; practically foolproof.  Previously the click water Max button was hardcoded at 1024x768 (causing other resolutions to mess up this stage). It now asks you to set the position of the Gather Water's "Max" button (via mouse click) so now this will work 100% at any resolution.
  
^p::Pause
 
^!w::
 
  
  
 +
<B>Instructions:</b>
  
IfWinExist eGenesis Client
+
Zoom in about half way (in F5 or F6) and lock your screen (Alt + L) to prevent your screen from moving around. 
{
 
WinActivate
 
WinGetPos,,, winWidth, winHeight
 
widthOffset := winWidth - 40
 
  
Gui, +AlwaysOnTop +ToolWindow
+
The script has GUI menus to walk you through the setup process, its very easy.
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
+
------
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
 
  
 +
Supports unlimited beds, but I suggest you start out small (6-10 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 2 seconds and repeat the cycle.
  
  
MineRecord:
+
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.
MineNum++
 
MouseGetPos, MineX%MineNum%, MineY%MineNum%
 
GuiControl, Text, MineNumText, %MineNum% wheat beds captured
 
TotalBeds := MineNum
 
return
 
  
  
MineSetLoops:
+
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
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%
 
  
;You got 7 seconds to drag the status bar out of the way (3s below + and 4 s furthur below
 
Sleep 3000
 
  
 +
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.
  
loop, %NumPulls%
 
{
 
  
Sleep, 4000
+
<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.  
;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!]]
  
 
+
[http://www.atitd.org/wiki/tale4/images/9/98/Wheat.zip Get EXE]
loop, %TotalBeds%
 
{
 
 
 
 
 
 
 
WinActivate, eGenesis Client
 
 
 
;BlockInput, MouseMove
 
 
 
GuiControl, Text, MineCycleText, Cycle %MineCycle%  Bed %BedNum%
 
MinePosX := MineX%MineNum%
 
MinePosY := MineY%MineNum%
 
MouseMove, %MinePosX%, %MinePosY%, 0
 
Send {H}
 
Send {W}
 
Sleep, 250
 
MineNum++
 
}
 
 
 
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>
 

Latest revision as of 00:47, 27 October 2010

Wheat (Autohotkey)

  • Updated: 10/25/2010 - Removed 1 of the 3 steps needed to setup the macro. You no longer need to record the "Max" button to record its location. It is now found automatically, at any resolution.
  • Updated: 10/16/2010 - Added Timers in the GUI status screen - Time Elapsed and Time to next water gather
  • Updated: 1/31/2010 - Revamed whole script. Now has more instructions on the GUI interface, so you can execute without having to read wiki; practically foolproof. Previously the click water Max button was hardcoded at 1024x768 (causing other resolutions to mess up this stage). It now asks you to set the position of the Gather Water's "Max" button (via mouse click) so now this will work 100% at any resolution.


Instructions:

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

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




Supports unlimited beds, but I suggest you start out small (6-10 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 2 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.


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.


Get Code!

Get EXE