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 17: Line 17:
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, Font, bold
 
Gui, Font, bold
Gui, Add, Text, vMineNumText, Recording mouse position
+
Gui, Add, Text, vMineNumText, Middle click water icon
 
Gui, Font, norm
 
Gui, Font, norm
 
Gui, Add, Text,,
 
Gui, Add, Text,,
Line 52: Line 52:
 
}
 
}
 
return
 
return
 +
 +
  
 
MineRecord:
 
MineRecord:
Line 71: Line 73:
 
GuiControl, Text, MineCycleText, Cycle %MineCycle% of %NumPulls%
 
GuiControl, Text, MineCycleText, Cycle %MineCycle% of %NumPulls%
  
;You got 7 seconds to drag the status bar out of the way (3 below + and 4 seconds furthur below
+
;You got 7 seconds to drag the status bar out of the way (3s below + and 4 s furthur below
 
Sleep 3000
 
Sleep 3000
  
Line 79: Line 81:
  
 
Sleep, 4000
 
Sleep, 4000
 
+
;MinNum = 1 is the water icon location, thus why we are starting at 2. MineNum = 1 is only called during the #Persistent
MineNum = 1
+
BedNum = 1
 +
MineNum = 2
 
MineCycle++
 
MineCycle++
 
MouseGetPos, OldMX, OldMY
 
MouseGetPos, OldMX, OldMY
  
loop, %TotalBeds% {
+
 
 +
 
 +
 
 +
 
 +
loop, %TotalBeds%
 +
{
  
  
Line 92: Line 100:
 
;BlockInput, MouseMove
 
;BlockInput, MouseMove
  
GuiControl, Text, MineCycleText, Cycle %MineCycle%  Bed %MineNum%  
+
GuiControl, Text, MineCycleText, Cycle %MineCycle%  Bed %BedNum%  
 
MinePosX := MineX%MineNum%
 
MinePosX := MineX%MineNum%
 
MinePosY := MineY%MineNum%
 
MinePosY := MineY%MineNum%
 
MouseMove, %MinePosX%, %MinePosY%, 0
 
MouseMove, %MinePosX%, %MinePosY%, 0
Sleep, 250
 
 
 
Send {H}
 
Send {H}
 
Send {W}
 
Send {W}
Line 104: Line 110:
 
}
 
}
  
GuiControl, Text, MineCycleText, Cycle %MineCycle%  Pausing
 
 
MouseMove, %OldMX%, %OldMY%, 0
 
MouseMove, %OldMX%, %OldMY%, 0
 +
GuiControl, Text, MineCycleText, Cycle %MineCycle%  Pause
 
;BlockInput, MouseMoveOff
 
;BlockInput, MouseMoveOff
  

Revision as of 02:04, 25 December 2009

;Ctrl+Alt+W to start macro.
;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.

^p::Pause
^!w::



IfWinExist eGenesis Client
{
	WinActivate
	WinGetPos,,, winWidth, winHeight
	widthOffset := winWidth - 40

	Gui, +AlwaysOnTop +ToolWindow
	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



	MineRecord:
	MineNum++
	MouseGetPos, MineX%MineNum%, MineY%MineNum%
	GuiControl, Text, MineNumText, %MineNum% wheat beds captured
	TotalBeds := MineNum
	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%

;You got 7 seconds to drag the status bar out of the way (3s below + and 4 s furthur below
Sleep 3000


	loop, %NumPulls%
	{

				Sleep, 4000
			;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





	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
}