#cs ----------------------------------------------------------------------------

 AutoIt Version:

 Script Function:
	Build Guild Automation
	for this to function properly you will need to do several things
	1. Heroes of Gaia must be up and running in your browser and you have to be
	   on the build page you wish to use and have selected the Hero you wish
	   to receive the XP
	2. The MouseClick coordinates I use are specific to my setup, you will need
	   to create a seperate mouse position script (code below) to find the correct 
	   x and y numbers for the "Confirm" and "Close" buttons, the coordinates
	   for the "Close" button should be the same for the "Need more AP?" "Don't
	   Remind Me" button
#ce ----------------------------------------------------------------------------

#cs begin mouse position script  -----------------------------------------------

;wait 5 seconds after starting the script	

; put the mouse over the button now!
$pos = MouseGetPos()
MsgBox(0,"Your mouse pointer coordinate is:", $pos[0]&"x"&$pos[1])

#ce end mouse position script --------------------------------------------------

; uncomment the WinActivate line for the browser you are using
; I did not find the class for IE as I never use it, AutoIt has a
; Window Info tool that will find it if you need it

; Google Chrome
;WinActivate("[CLASS:Chrome_WindowImpl_0]", "")
; Mozilla Firefox
;WinActivate("[CLASS:MozillaUIWindowClass]", "")

$i = InputBox("How much AP?", "Enter your current AP", "", " M3")

; pause 5 seconds

	; click the "Confirm" button
	MouseClick("left", 510, 781, 1, 1)
	; decrement the AP
	$i = $i - 20
	; wait 5 seconds to deal with lag issues
	; click the "Close" button on the "System Information" popup
	MouseClick("left", 510, 624, 1, 1)
	; add second click for the "Need more AP?" nag you get when AP is around 20% of max
	; I have it click the "Don't Remind Me Again" button
	MouseClick("left", 510, 624, 1, 1)		
	; if we have enough AP for another go around wait 60 seconds
	if $i >= 20 Then
Until $i < 20

MsgBox(0, "Finished", "Finished at " & @hour & ":" & @MIN)
Community content is available under CC-BY-SA unless otherwise noted.