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.

User:Sithid/Macros/AHK/Grass

From A Tale in the Desert
< User:Sithid‎ | Macros‎ | AHK
Jump to navigationJump to search

Grass Macro

My simple grass macro.

Hotkeys

 Alt + s      : Starts the script/macro.
 Alt + Escape : Terminates the script/macro.
 Pause        : Pauses the script/macro.

Run script/macro and press alt + s to start. Follow the msgbox instructions and enjoy.

The Macro

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         Sithid	
;
; Script Function:
;	Simple grass picker
; Notes:
;	Thanks Selune for helping me out with AHK ... though I still hate AHK :P.
;

#NoEnv
SendMode Input
#SingleInstance force

Pause::
Pause
return

!Escape::
ExitApp
return

!s::
Main()
return

SetDefaultMouseSpeed 0

; Main script execution.
Main()
{
	; Wait for the egen client to be running.
	WinWait, eGenesis Client
	
	; Check if the egen client is active, wait for it to become so.
	IfWinNotActive, eGenesis Client, , WinActivate, eGenesis Client, 
		WinWaitActive, eGenesis Client,
	
	; Get egen client window stats.
	WinGetActiveStats, win_Title, win_Xmax, win_Ymax, win_Xpos, win_Ypos
	
	MsgBox, Please hover over your grass icon and press F1.
	
	; Varibles, no touching!
	GrassIconX   := 0
	GrassIconY   := 0
	CenterX  := win_Xmax / 2
	CenterY  := win_Ymax / 2
	
	; Wait until the f1 key is pressed.
	KeyWait F1, D
	
	; Wait till the f1 key is released.
	KeyWait F1
	
	; Set the grass icons x/y.
	MouseGetPos GrassIconX, GrassIconY
	
	; Main function loop, performs the picking.
	loop
	{
		; Click the grass icon, place to run to, and sleep.
		MouseClick, left, GrassIconX, GrassIconY
		MouseClick, left, CenterX, CenterY + 200
		Sleep, 3000
		
		; Again, click the grass icon, place to run to, and sleep.
		MouseClick, left, GrassIconX, GrassIconY
		MouseClick, left, CenterX, CenterY - 200
		Sleep, 3000
	}
}