Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "GWA².au3"
- Global $TLOAD = "4000"
- If WinExists("Guild Wars") Then
- Initialize(WinGetProcess("Guild Wars"))
- Else
- Exit
- EndIf
- While 1
- Kill()
- WEnd
- Func Kill()
- $MapID = GetMapID()
- If $MapID <> 165 Then
- TravelTo(165)
- EndIf
- RndSleep(1000)
- Do
- $oldX = DllStructGetData(GetAgentByID(-2), 'X')
- $oldY = DllStructGetData(GetAgentByID(-2), 'Y')
- Move(633,7270, 10)
- $newX = DllStructGetData(GetAgentByID(-2), 'X')
- $newY = DllStructGetData(GetAgentByID(-2), 'Y')
- Until $oldX <> $newX And $oldY <> $newY
- LOADOUT()
- RndSleep(100)
- $globaltime = TimerInit()
- waitMove(2425,5834)
- RndSleep(100)
- local $fireimp = GetItemBySlot(4, 1)
- UseItem ($fireimp)
- RndSleep(250)
- waitMove(2748,4199)
- $foe = DllStructGetData(GetNearestEnemyToAgent(-2), 'ID')
- Sleep(175)
- Do
- $foe = DllStructGetData(GetNearestEnemyToAgent(-2), 'ID')
- Sleep(250)
- If GetDistance($foe,-2) < 1500 Then
- Attack($foe)
- RndSleep(300)
- Else
- ExitLoop
- EndIf
- Until GetDistance($foe,-2) > 1500 Or TimerDiff($globaltime) > 125000
- rndSleep(750)
- abandon()
- EndFunc
- func waitMove($x, $y)
- ; set vars
- $var = 0
- if $var <> 0 then
- $vx = rndNum($var)
- $vy = rndNum($var)
- else
- $vx = 0
- $vy = 0
- endif
- $dist = 100
- $coords_x = $x + $vx
- $coords_y = $y + $vy
- $blocked = 0
- $complete = true
- $move_timer = TimerInit()
- ; start waiting
- do
- sleep(100)
- $cur_coordsx = DllStructGetData(GetAgentByID(-2), 'X')
- $cur_coordsy = DllStructGetData(GetAgentByID(-2), 'Y')
- $load_status = GetMapLoading()
- $moving = GetIsMoving(-2)
- $cur_dist = ComputeDistance($cur_coordsx, $cur_coordsy, $coords_x, $coords_y)
- $move_time = round(TimerDiff($move_timer)/1000)
- if $moving = 0 and $move_time > 1 and $cur_dist > $dist then
- ; increment block counter
- $blocked += 1
- RndSleep(100)
- if $blocked >= 4 and $load_status = 1 then
- $complete = false
- exitloop
- else
- $new_coords_x = DllStructGetData(GetAgentByID(-2), 'X') + rndNum(200)
- $new_coords_y = DllStructGetData(GetAgentByID(-2), 'Y') + rndNum(200)
- MoveTo($new_coords_x, $new_coords_y)
- rndSlp(250, 500, false)
- MoveTo($coords_x, $coords_y)
- endif
- endif
- until $cur_dist <= $dist or $move_time >= 60
- return $complete
- endfunc
- Func WaitForLoad($mapID)
- Do
- RndSleep(250)
- $newID = GetMapID()
- $loadStatus = GetMapLoading()
- $coordsx = DllStructGetData(GetAgentByID(-2), 'X')
- $coordsy = DllStructGetData(GetAgentByID(-2), 'Y')
- Until $newID = $mapID AND $coordsx <> 0 AND $coordsy <> 0
- RndSleep(5000)
- EndFunc
- Func RndSleep($x)
- Sleep(Random($x * 0.97, $x * 1.03, 1))
- EndFunc
- func rndSlp($min, $max, $ping=true)
- sleep(random($min, $max))
- if $ping then
- $ping = GetPing()
- if $ping > 300 then sleep($ping)
- endif
- endfunc
- func rndNum($val)
- $num = random(-$val, $val, 1);====================================here i added the 1 (for int)
- if $num = 0 then
- $num = 1
- endif
- return $num
- endfunc
- Func LOADOUT()
- Do
- Sleep(400)
- $load = GetMapLoading()
- Until $load = 1
- Sleep($TLOAD)
- EndFunc
- Func LOADIN()
- Do
- Sleep(400)
- $load = GetMapLoading()
- Until $load = 0
- Sleep($TLOAD)
- EndFunc
- Func abandon()
- $stuck = TimerInit ()
- Resign()
- If TimerDiff($stuck) > 7000 Then Resign()
- Do
- Sleep(500)
- $dead = GetIsDead(-2)
- Until $dead = 0 Or TimerDiff($stuck) > 7000
- Do
- Sleep(1000)
- ReturnToOutpost()
- Sleep(1000)
- $load = GetMapLoading()
- Until $load = 0 Or TimerDiff($stuck) > 15000
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement