Code:
Global $Paused
HotKeySet("y","Leave") ;Press Y to start the script
HotKeySet("x","Pause")
HotKeySet("z","Quit")
;Stop/Start runs
HotKeySet("c","stopRun") ;stops after current run
HotKeySet("v","startRun")
$default_resolutionX = 1920 ;changing these does nothing
$default_resolutionY = 1080 ;changing these does nothing
$x_ratio = @Desktopwidth / $default_resolutionX
$y_ratio = @Desktopheight / $default_resolutionY
$go = True
$Leave = False
$rand = 0;
;Custom Set Vars
;Move Speed, completely untested
$ms = 10 ;default of 10
;4.1 Seconds to load game, increase if you have a slower pc, decrease if you have a faster pc
$pcLoadTime = 4100 ;default of 4100
;Try to not pickup items (using mouse move instead of click)
$DontPickupItems = false ;default of false
;What hotkey to hit to use it as a buff. Cannot be a movement buff. Might also be an aoe ability key
$buffKey = 4 ;default of 4
;What mousekey to use to do the attacks
$mouseAttack = "left" ;default of left for melee, right for ranged
;2.3 Seconds to Load back into the game Menu
$pcExitTime = 2300 ;default of 2300
;Try to Collect X amount of times
$collectAttempts = 1 ;default of 1, increase if you are having problems collecting gold
;Try not to edit below these lines
While $go
if($Leave) then
if($Leave) then
resumeGame()
goToEnterance()
EndIF
Sleep(time(1500,1)) ;Load time
if($Leave) then
endEvent()
fight()
EndIF
if($Leave) then;
$ca = $collectAttempts;
while($ca > 0);
$ca = $ca-1;
goldCollect();
WEnd
EndIF
if($Leave) then
endGame()
EndIF
EndIF
WEnd
;----------Beginning of the mouse macro functions
Func resumeGame()
MouseClick("left",213,411,1) ;Click on Resume Game
Sleep($pcLoadTime) ;PC Load Time from Menu to Game
EndFunc
Func goToEnterance() ;Goes to the bottom enterance based on movespeed
Mouseclick("left",1530,369,1)
Sleep(ms(500))
Mouseclick("left",1533,477,1)
Sleep(ms(1000))
Mouseclick("left",1533,477,1)
Sleep(ms(1800))
MouseClick("left",968,388,1) ;Click on enterance
EndFunc
Func endEvent()
Send("{ESC}")
Mouseclick("left",928,359,1) ;Click on Yes to End Event
Sleep(time(2000,0))
EndFunc
Func fight()
Mouseclick("left",1062,722,1)
Sleep(time(4000,0))
Send($buffkey)
MouseMove(960,540)
MouseDown($mouseAttack)
Opt("SendKeyDownDelay", time(6300,0)) ;6.3 second delay with random added
Send("{LSHIFT}")
Opt("SendKeyDownDelay", 5)
Sleep(20)
MouseUp($mouseAttack)
EndFunc
Func goldCollect()
if($DontPickupItems) Then
justGold()
Return false
EndIf
Mouseclick("left",1150,620,1)
Sleep(time(400,2))
Mouseclick("left",1050,420,1)
Sleep(time(400,2))
Mouseclick("left",750,420,1)
Sleep(time(400,2))
Mouseclick("left",750,620,1)
Sleep(time(400,2))
Mouseclick("left",1050,620,1)
Sleep(time(400,2))
Mouseclick("left",1050,420,1)
Sleep(time(400,2))
Mouseclick("left",750,420,1)
Sleep(time(400,2))
Mouseclick("left",1050,620,1)
EndFunc
Func justGold()
MouseMove(1150,620)
MouseDown("left")
Sleep(time(400,2))
MouseMove(1050,420)
Sleep(time(400,2))
MouseMove(750,420)
Sleep(time(400,2))
MouseMove(750,620)
Sleep(time(400,2))
MouseMove(1050,620)
Sleep(time(400,2))
MouseMove(1050,420)
Sleep(time(400,2))
MouseMove(750,420)
Sleep(time(400,2))
MouseMove(1050,620)
MouseUp("left")
EndFunc
Func endGame()
Send("{ESC}")
Sleep(20)
MouseClick("left",995,580,1); end
Send("{ESC}") ;2nd ESC in case it clicked someone
Sleep(20)
MouseClick("left",995,580,1); end
Sleep($pcExitTime)
EndFunc
; Number Changing Functions
Func ms($time)
if($ms = 10) Then
Return $time
ElseIf($ms > 15) Then
if($ms > 24) Then
$i = $time-250
Return $i
Else
$i = $time-100
Return $i
EndIf
ElseIf($ms < 10) Then
$i = $time+100
Return $i
EndIf
EndFunc
Func rand($big)
$rand = Random(-20,80,1) ;Average Random Time Dilation
if($rand > 70) then ;To add a little bit more variation and the number is large and accuracy is not required
if($big = 1) then
$rand = Random(60,120,1)
EndIf
EndIf
if($big = 2) Then;If the number needs small variation
$rand = Random(-20,20,1)
EndIf
Return $rand
EndFunc
Func time($i,$big)
$temp = $i + rand($big)
Return $temp
EndFunc
;Pause/Stop Script
Func Pause()
$Leave = False
EndFunc
Func Quit() ;to allow the script to stop
Exit
EndFunc
Func Leave()
$Leave = True
EndFunc
Func stopRun()
$go = False
EndFunc
Func starRun()
$go = True
EndFunc