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
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
  
 
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.
   Pause        : pauses the script/macro.
+
   Pause        : Pauses the script/macro.
  
 
Run script/macro and press alt + s to start.  Follow the msgbox instructions and enjoy.
 
Run script/macro and press alt + s to start.  Follow the msgbox instructions and enjoy.
Line 39: Line 39:
 
return
 
return
  
SetDefaultMouseSpeed, 0
+
SetDefaultMouseSpeed 0
  
; Varibles, no touching!
 
GrassIconX  := 0
 
GrassIconY  := 0
 
CenterX  := win_Xmax / 2
 
CenterY  := win_Ymax / 2
 
 
 
; Main script execution.
 
; Main script execution.
 
Main()
 
Main()
Line 59: Line 53:
 
; Get egen client window stats.
 
; Get egen client window stats.
 
WinGetActiveStats, win_Title, win_Xmax, win_Ymax, win_Xpos, win_Ypos
 
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.
 
; Wait until the f1 key is pressed.
 
KeyWait F1, D
 
KeyWait F1, D
 +
 +
; Wait till the f1 key is released.
 +
KeyWait F1
 
 
 
; Set the grass icons x/y.
 
; Set the grass icons x/y.
 
MouseGetPos GrassIconX, GrassIconY
 
MouseGetPos GrassIconX, GrassIconY
 
; Wait till the f1 key is released.
 
KeyWait F1, U
 
 
 
 
; Main function loop, performs the picking.
 
; Main function loop, performs the picking.

Latest revision as of 03:31, 2 January 2009

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