Simple Presearing Lvl Bot GWA² based

01/05/2012 21:41 Jonas_93#16
update

New Gui with Status reports included
Summoning stone option included
Change Window Name option included
fixxed some bugs
01/05/2012 23:06 black_byte#17
Wenn du gerade eine map am laden bist und ein move packet sendest crashed der client.

MfG
black byte
01/06/2012 02:21 kendor#18
kills Charr much faster now with imp
01/06/2012 02:59 Jonas_93#19
update

will attack chaars now instead of following

useskill option included
survivor option included
stealth function included
time status included
01/13/2012 02:54 kendor#20
still crashing when leaving tow me. I got the 2.6 update too. not sure bud.
01/13/2012 10:33 vrijstoer#21
Still crashing when leaving, And I also got 2.6 :)
01/16/2012 23:43 solos#22
vlt mal mit WaitMapLoading($MapID) probieren, danach kannst ja immer noch ein RndSleep(500) einbauen... ich teste das gerade mal.

edit: Man könnte auch alle bis auf einen töten, dadurch fällt das aufgeben und neu annehmen weg, so wars zumindest bei den vorrangegangenen presearing bots.

edit2: naja da alle meine anderen bots momentan genau dasselbe problem mit dem wechseln von maps haben, denk ich dass es an gwa liegt. Mit einer einfachen Sleepfunktion statt der Memorygeschichten von gwa funktioniert es anscheinend.

This one should work:
If your loading Screen between two areas lasts longer than 3sec choose slow pc(random 5-6 seconds).
PHP Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=160px-Miniatur-Prinz_Rurik.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include "GWA².au3"

Opt("GUIOnEventMode",1)

FileInstall("C:\Dokumente und Einstellungen\Jonas\Desktop\GWA²\PresearingLvlBot\Rurik.jpg", @TempDir "Rurik.jpg")

Global 
$loopVar False
Global $questId 46
Global $ModelID 30847
Global $moveVar 7260
Global $health 51
Global $speed Random(200030001)
Global 
$runsDone 0
Global $startXp 0
Global $earnedXp 0
Global $timeElapsed 0

Global $listText

Global $windowName "Guild Wars"
Global $stealth
Global $timer


#Region ### START Koda GUI section ### Form=
$gui GUICreate("Presearing_LevelBot2.5 by Jonas93"425220195124)
GUISetOnEvent($GUI_EVENT_CLOSE"_eventHandler")
GUISetBkColor(0xFFFFFF)
$list GUICtrlCreateList(""88305150BitOR($LBS_NOTIFY,$WS_VSCROLL,$WS_BORDER))
$startButton GUICtrlCreateButton("start"81604021)
GUICtrlSetOnEvent(-1,"_eventHandler")
$infoButton GUICtrlCreateButton("info"551604021)
GUICtrlSetOnEvent(-1,"_eventHandler")
$windowButton GUICtrlCreateButton("set window name"2251609021)   ;320,10,
GUICtrlSetOnEvent(-1,"_eventHandler")
$stoneCheckBox GUICtrlCreateCheckbox("Summoning Stone",8,185)
$useSkillCheckBox GUICtrlCreateCheckbox("Use Skill",120,185)
$survivorCheckBox GUICtrlCreateCheckbox("Survivor",190,185)
$slowpcCheckBox GUICtrlCreateCheckbox("Slow Pc",260,185)
GUICtrlCreatePic(@TempDir "Rurik.jpg"3145123175)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

_startMessage()

HotKeySet("{F1}" "_stealth")

While 
1
    
If $loopVar Then _botLoop()
WEnd

Func _eventHandler
()
    Switch(@
GUI_CtrlId)
        Case 
$infoButton

                    
If $loopVar True Then
                        $milisecs 
TimerDiff($timer)
                        
$secs $milisecs /1000
                        $mins 
$secs/60
                        
If $secs 60 Then
                            $timeElapsed 
round($secs) & " secs"
                        
Else
                            
$timeElapsed round($mins) & " mins"
                        
EndIf
                    EndIf

                    
UpdateStatus("-------------BotStatus-------------")
                    
UpdateStatus("runs Done: " $runsDone )
                    
UpdateStatus("experience earned: " $earnedXp)
                    
UpdateStatus("time elapsed: " $timeElapsed)
                    
UpdateStatus("-------------BotStatus-------------")
        Case 
$startButton
                    Initialize
(WinGetProcess($windowName),TrueTrue)
                    
$startXp GetExperience()
                    
$timer TimerInit()
                    
$loopVar Not $loopVar
        
Case $windowButton
                    $windowName 
InputBox("Settings - WindowName","Please Insert your GuildWars window name")
        Case 
$GUI_EVENT_CLOSE
            
Exit
    EndSwitch
EndFunc


Func _botLoop
()
    If 
GUICtrlRead($slowpcCheckBox) = 1 Then
    $speed 
Random(500060001)
    endif
    
UpdateStatus("Abandon Quest")
    
AbandonQuest($questId)
    
UpdateStatus("Move to Rurik")
    
MoveTo(5740,10636)
    
UpdateStatus("Accept Quest")
    
$agent GetNearestNPCToAgent(-2)
    
GoToNPC($agent)
    
AcceptQuest($questId)
    
RndSleep(1000)
    
UpdateStatus("Move out of Ascalon")
    
MoveTo(7118,10695)
    
MoveTo(7483,10459)
    
MoveTo(7404,5933)
    
MoveTo($moveVar,5450)
    
UpdateStatus("Wait map to load")
    
Sleep($speed)
    Do
        
RndSleep(500)
        
$lMe GetAgentByID(-2)
        
$x DllStructGetData($lMe'X')
    
Until $x <> 0
    UpdateStatus
("Wait for Rurik")
    
MoveTo(5526,4505,100)
    
RndSleep(6000)
    
UpdateStatus("Move infront of Charr")
    
MoveTo(4498,5469,100)
    
MoveTo(3297,6157,100)
    
MoveTo(2149,6378,100)
    
MoveTo(836,6645,100)
    
MoveTo(-382,7450,100)
    
MoveTo(-1032,7992,100)
    
MoveTo(-2125,8739,100)
    
UpdateStatus("Follow Rurik")
    Do
        
$rurikAgent GetNearestNPCToAgent(-2)
        
$aX DllStructGetData($rurikAgent'X')
        
$aY DllStructGetData($rurikAgent'Y')
        
MoveTo($aX,$aY)
        
$nearestEnemy GetNearestEnemyToAgent()
        
$distance GetDistance($nearestEnemy,-2)
    
Until $distance 1800
    RndSleep
(250)

    If 
GUICtrlRead($stoneCheckbox) = 1 Then
        $id 
GetItemByModelID($ModelID)
        
UseItem($id)
    EndIf

    
UpdateStatus("Wait until all Charr are dead")
    Do
        
$nearestEnemy GetNearestEnemyToAgent()
        
Attack($nearestEnemy)
        If 
GUICtrlRead($useSkillCheckBox) = 1 then
            
If GetSkillbarSkillRecharge(1) = 0 Then
                
If GetEnergy() > 10 then UseSkill(1,$nearestEnemy)
            EndIf
        EndIf
        
$distance GetDistance($nearestEnemy,-2)
        
$living GetIsLiving(-2)
        If 
GUICtrlRead($survivorCheckBox) = 1 Then    $health GetHealth()
        
sleep(250)
    
Until $distance 3000 or $living <> True or $health 50
    UpdateStatus
("Travel back to Ascalon")
    
TravelTo(148)
    
Sleep($speed)
    Do
        
RndSleep(500)
        
$lMe GetAgentByID(-2)
        
$x DllStructGetData($lMe'X')
    
Until $x <> 0

    UpdateInfos
()

Endfunc

Func UpdateStatus
($text)
    
GUICtrlSetData($list"")
    
$listText $text "|" $listText
    GUICtrlSetData
($list,$listText)
EndFunc

Func UpdateInfos
()
    
$runsDone +=1

    $currentXp 
GetExperience()
    
$earnedXp $currentXp $startXp
EndFunc

Func _stealth
()

    If 
$stealth 0 Then
        WinSetState
($gui"", @SW_HIDE)
        
WinSetTrans($gui""0)
        
WinSetState($windowName"", @SW_HIDE)
        
WinSetTrans($windowName""0)
        
Opt("TrayIconHide"1)
                
$stealth =1

    
ElseIf $stealth 1 Then
        WinSetState
($gui"", @SW_SHOW)
        
WinSetTrans($gui""255)
        
WinSetState($windowName"", @SW_SHOW)
        
WinSetTrans($windowName""255)
        
Opt("TrayIconHide"0)
                 
$stealth 0
    
EndIf

Endfunc

Func _startMessage
()
    
GUICtrlSetData($list"                  Presearing_LevelBot2.5 by Jonas93")
    
GUICtrlSetData($list"_________________________________________________")
    
GUICtrlSetData($list"To hide and show the Bot window and Guild Wars window")
    
GUICtrlSetData($list"press F1")
    
GUICtrlSetData($list" ")
    
GUICtrlSetData($list'check "Summoning Stone" to use Summoning Stone.')
    
GUICtrlSetData($list'check "Use Skill" to Use 1. SkillbarSkill in fight.')
    
GUICtrlSetData($list'check "Survivor" to Travel back if your Health < 50')
EndFunc 
02/24/2012 17:02 Ibfjord#23
This bot crashes a lot for me too. I've tried it with original GWA and older versions. I'm using latest AutoIt. But even the older LDoA bot I have isn't working right so I'm not sure what's going on.
02/24/2012 17:28 einkeks95#24
Quote:
Originally Posted by Ibfjord View Post
This bot crashes a lot for me too. I've tried it with original GWA and older versions. I'm using latest AutoIt. But even the older LDoA bot I have isn't working right so I'm not sure what's going on.
Try this ;)
02/24/2012 20:08 ddarek#25
Hi
Tip:
1st - use strings instead of declaring $rurikAgent

2nd- whats the point od using stealth mode without Enable/Disable Rendering ?
02/25/2012 11:43 Nombies#26
Would it be possible to get an option for picking up dye drops? That'd be very nice. I like the bot (when it's not crashing).

Speaking of, the crashes don't seem to be an issue with timing or a speed setting. It seems that when it does crash upon leaving it does so the instant you hit the warp point, before the loading screen even appears. At least on my end.
02/25/2012 18:46 Ibfjord#27
@einkeks95, Thanks for posting that script. Working good. Does this bot automatically go to Foible's Fair and start doing farming bandits from Farmer Hamnet quest?
02/27/2012 18:53 einkeks95#28
Quote:
Originally Posted by Ibfjord View Post
@einkeks95, Thanks for posting that script. Working good. Does this bot automatically go to Foible's Fair and start doing farming bandits from Farmer Hamnet quest?
no, its the same Bot as from Jonas. I changed only 1 Line ;).
02/28/2012 04:29 Ibfjord#29
Quote:
Originally Posted by einkeks95 View Post
no, its the same Bot as from Jonas. I changed only 1 Line ;).
Okay, I see. It doesn't farm bandits for 10-20? If not does it do something else besides Charr At The Gate?
02/28/2012 20:27 Lordsocke#30
Still crashing when leaving, And I also got 2.6 ;(