Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;; ;;;;
- ;;;; Edgeworld AI Attacker ;;;;
- ;;;; written by: kara marie rawson ;;;;
- ;;;; copyright 2013 - use at own risk ;;;;
- ;;;; ;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- #include <Misc.au3>
- ;constants
- Const $POST_CLICK_DELAY = 100
- Const $MOUSE_MOVE_SPEED = 1
- Const $BATTLE_SIM_LENGTH = 60000
- Const $PVP_LOAD_DELAY = 3000
- Const $BASE_LOAD_DELAY = 3000
- Const $ATTACK_LOAD_DELAY = 2000
- Const $DEPLOY_GEN_DELAY = 3000
- Const $DEPLOY_SEN_DELAY = 5000
- Const $DEPLOY_DEV_DELAY = 4000
- ;objects
- Local $hDLL = DllOpen("user32.dll")
- ;Main Script Function
- Func RunScript()
- ;scroll game down
- ScrollGameViewDown()
- ;lets fire a single run of the sim
- Local $i = 0
- While $i < 1
- RunSingleAttack("B", "helio"); <- A | B , maar | helio | erazi
- If _IsPressed("1B", $hDLL) Then
- DllClose($hDLL)
- ExitLoop
- EndIf
- $i = $i + 1
- WEnd
- EndFunc
- Func ScrollGameViewDown()
- MouseClickDrag("left", 2252, 319, 2252, 134)
- EndFunc
- Func ScrollGameViewUp()
- MouseClickDrag("left", 2252, 134, 2252, 319)
- EndFunc
- Func RunSingleAttack($warp, $type)
- OpenCombatWindow()
- SelectBase($type)
- InitateAttack($warp)
- AttackBase($type)
- CloseCombatResultsWindow();
- ;test
- MouseMove(0, 0, 0)
- EndFunc
- Func OpenCombatWindow()
- ;click combat icon in bottom right game menu
- MouseClick ( "left", 3631, 931 , 1 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;wait to load pvp list
- Sleep($PVP_LOAD_DELAY)
- EndFunc
- Func SelectBase($type)
- ;select factions tab
- MouseClick ( "left", 3076, 302, 1 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;reset page to first faction page
- MouseClick ( "left", 2528, 539, 17 , $MOUSE_MOVE_SPEED)
- ;select level 750 -1500 page
- MouseClick ( "left", 3226, 537, 7, $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;select which base type to scout
- If $type = "maar" Then
- ScoutMaarBase()
- ElseIf $type = "helio" Then
- ScoutHelioBase()
- ElseIf $type = "erazi" Then
- ScoutEraziBase()
- EndIf
- ;wait to load pvp base
- Sleep($BASE_LOAD_DELAY)
- EndFunc
- Func ScoutMaarBase()
- MouseClick ( "left", 3165, 432, 1, $MOUSE_MOVE_SPEED) ; <- lvl 750 Maar
- EndFunc
- Func ScoutHelioBase()
- MouseClick ( "left", 3164, 473, 1, $MOUSE_MOVE_SPEED) ; <- lvl 750 Helio
- EndFunc
- Func ScoutEraziBase()
- MouseClick ( "left", 3163, 516, 1, $MOUSE_MOVE_SPEED) ; <- lvl 750 Erazi
- EndFunc
- Func CloseCombatResultsWindow()
- ;close level up if open
- MouseClick( "left", 3124, 408, 1, $MOUSE_MOVE_SPEED )
- Sleep($POST_CLICK_DELAY)
- ;close results window
- MouseClick ( "left", 3190, 186, 1 , $MOUSE_MOVE_SPEED)
- Sleep($BASE_LOAD_DELAY)
- EndFunc
- Func InitateAttack($warpGate)
- ;scroll enemy base down
- ScrollGameViewDown()
- If $warpGate = "A" Then
- ;click attack on warp A
- MouseClick ( "left", 2846, 174, 1 , $MOUSE_MOVE_SPEED)
- ElseIf $warpGate = "B" Then
- ;click attack on warp B
- MouseClick ( "left", 2908, 176, 1 , $MOUSE_MOVE_SPEED)
- EndIf
- Sleep($ATTACK_LOAD_DELAY)
- EndFunc
- Func AttackBase($type)
- If $type = "maar" Then
- AttackMaarBase()
- ElseIf $type = "helio" Then
- AttackHelioBase()
- ElseIf $type = "erazi" Then
- AttackEraziBase()
- EndIf
- EndFunc
- Func AttackHelioBase()
- ;select general
- MouseClick ( "left", 2611, 852, 2 , $MOUSE_MOVE_SPEED)
- ;deploy general
- ;MouseClick ( "left", 3228, 659, 1 , $MOUSE_MOVE_SPEED)
- ;Sleep($DEPLOY_GEN_DELAY)
- ;defocus general selection
- ;Sleep($POST_CLICK_DELAY)
- ;MouseClick ( "left", 2591, 242, 2 , $MOUSE_MOVE_SPEED)
- ;select and deploy sentinel (1)
- ;Send("b")
- ;MouseClick ( "left", 3439, 527, 1 , $MOUSE_MOVE_SPEED)
- ;Sleep($DEPLOY_SEN_DELAY)
- ;select and deploy sentinel (1)
- ;Send("b")
- ;MouseClick ( "left", 2978, 740, 1 , $MOUSE_MOVE_SPEED)
- ;Sleep($DEPLOY_SEN_DELAY)
- ;deploy three squandrons of devs
- Local $i = 0
- While $i < 3
- ;select and deploy devasators (3)
- ;Send("x")
- ;MouseClick ( "left", 3285, 714, 1 , $MOUSE_MOVE_SPEED)
- ;Sleep($DEPLOY_DEV_DELAY)
- $i = $i + 1
- WEnd
- EndFunc
- ;call the main method after script is initialized
- RunScript();
Advertisement
Add Comment
Please, Sign In to add comment