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:Sithid/Macros/AHK/Grass"

From A Tale in the Desert
< User:Sithid‎ | Macros‎ | AHK
Jump to navigationJump to search
Line 1: Line 1:
 
== Grass Macro ==
 
== Grass Macro ==
My simple grass macro.<br>
+
My simple grass macro.<br><br>
Hotkeys:
+
 
 +
Hotkeys
 
   Alt + s      : starts the script/macro.
 
   Alt + s      : starts the script/macro.
 
   Alt + Escape : Terminates the script/macro.
 
   Alt + Escape : Terminates the script/macro.

Revision as of 20:34, 31 December 2008

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

; 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
	}
}