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
Revision as of 20:30, 31 December 2008 by Sithid (talk | contribs) (New page: <pre> ; ; AutoHotkey Version: 1.x ; Language: English ; Platform: Win9x/NT ; Author: Sithid ; ; Script Function: ; Simple grass picker ; Notes: ; Thanks Selune for hel...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
;
; 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

; Varibles, no touching!
GrassIconX   := 0
GrassIconY   := 0
CenterX  := win_Xmax / 2
CenterY  := win_Ymax / 2
	
; 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
	
	; Wait until the f1 key is pressed.
	KeyWait F1, D
	
	; Set the grass icons x/y.
	MouseGetPos GrassIconX, GrassIconY
	
	; Wait till the f1 key is released.
	KeyWait F1, U
	
	; 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
	}
}