Did you know? elitepvpers has its own image host, epvpimg.com.
Mein erster Bot
This is a discussion on Mein erster Bot within the GW Bot Discussions / Questions forum part of the Guild Wars category; Guten Abend :
Zuersteinmal möchte ich mich bei allen Bedanken die Tutorials bereitgestellt haben, vorallem das TT6 und GWCA hier ...
Zuersteinmal möchte ich mich bei allen Bedanken die Tutorials bereitgestellt haben, vorallem das TT6 und GWCA hier im Board haben mich sehr dafür begeistert mit dem Scripten anzufangen.
Nunden, alzuschlau wurde ich einfach nicht aus den Turorials ich wusste zwar grob um was es ging, hatte jedoch keinerlei Bezug damit etwas anzufangen..
Aller Anfang ist schwer und ich habe eine geschlagene Woche gebraucht rauszufinden was Parameter sind, das ich vor einem Befehl cmd( brauche etc und es hinzubekommen das mein "Bot" dafür sorgt das mein Charackter sich bewegt.
Nunja hier meine Version 1.0 eines Drachenmoos Farmbots ausgehend von Saint Anikas Shrine:
(erstellt mit rev280 und deren graphics.dll)
Spoiler:
; Drachenmoos Farm Monk/Mesm. HARDmode OwUUMQH/UoM1jVyddJYQSAyD9BA 55hp Vvz. 20% , Quest: Eine neue Eskorte
#include "GWCAConstants.au3"
$cbType = "float" ;Change return type to float value
$myCoords = CmdCB($CA_GETCOORDS, -2) ;Get your own coordinates
ConsoleWrite("[Check 1] X: "&$cbVar[0]&", Y: "&$cbVar[1]&@CRLF) ;Print to chat, notice that I use $cbVar array and not $myCoords. $cbVar only works until the next call to Cmd() or CmdCB(), but $myCoords will exist forever.
;MovetoPortal
Cmd($CA_Move, _FloatToInt(-11249), _FloatToInt(-23000))
MoveToEx(34534, 324523)
Sleep (8000) ; Need to be done Too long
Die erste Zahl steht für den minimalsten wert, der rauskommen kann.
Die zweite Zahl für den höchsten Wert.
Die Dritte gibt an, dass ganze Zahlen rauskommen sollen.
Da du 2 Laufwege hast musst du $random = Random(1, 2, 1) schreiben, damit eine 1 oder 2 rauskommt.
; Drachenmoos Farm Monk/Mesm. HARDmode OwUUMQ3+UoR1DrE3VLBGEJA5iAEA 55hp Vvz. 20% , Quest: Eine neue Eskorte
;Interclude
#include "GWCAConstants.au3"
$cbType = "float" ;Change return type to float value
;CheckCoordinates
$myCoords = CmdCB($CA_GETCOORDS, -2) ;Get your own coordinates
ConsoleWrite("[Check 1] X: "&$cbVar[0]&", Y: "&$cbVar[1]&@CRLF) ;Print to chat, notice that I use $cbVar array and not $myCoords. $cbVar only works until the next call to Cmd() or CmdCB(), but $myCoords will exist forever.
;Functions
While 1
Func _SleepUpToDungeon()
$load = CmdCB($CA_GetMapLoading)
While Not $load[0] = 1
Sleep(50)
$load = CmdCB($CA_GetMapLoading)
WEnd
Sleep(Random(4000, 6000, 1))
EndFunc ;==>_S
;X: -970051815, Y: -961359012
;MovetoPortal
$random = Random(1, 2, 1) ; Werte nochnicht "Random"
If $random = 1 Then
MoveToEx(-11240, -23500)
ElseIf $random = 2 Then
MoveToEx(-11231, -23500)
Endif
; Drachenmoos Farm Monk/Mesm. HARDmode OwUUMQ3+UoR1DrE3VLBGEJA5iAEA 55hp Vvz. 20% , Quest: Eine neue Eskorte
;Interclude
#include "GWCAConstants.au3"
$cbType = "float" ;Change return type to float value
;CheckCoordinates
$myCoords = CmdCB($CA_GETCOORDS, -2) ;Get your own coordinates
ConsoleWrite("[Check 1] X: "&$cbVar[0]&", Y: "&$cbVar[1]&@CRLF) ;Print to chat, notice that I use $cbVar array and not $myCoords. $cbVar only works until the next call to Cmd() or CmdCB(), but $myCoords will exist forever.
;Functions
Func wayout()
$LeftTown = 0;
While $LeftTown = 0
$random = Random(1, 2, 1) ; Werte nochnicht "Random"
If $random = 1 Then
MoveToEx(-11240, -23500)
ElseIf $random = 2 Then
MoveToEx(-11231, -23500)
Endif
WaitForLeave(1);
$cbType = "int"
$aTmpMap = CmdCB($CA_GETMAPID)
If $aTmpMap[0] = 31337 Then ;hier kommt die ID von deiner OuterArea rein, ka was die ist musst selber suchen
;LEFT TOWN ;einfach rausgehen $aTmpMap = CmdCB($CA_GETMAPID) aufrufen und du hast sie
$LeftTown = 1;
Else
;RETRY
Sleep(Random(1500,2000))
EndIf
WEnd
EndFunc
Func WaitForLeave($loading)
$MAX_WAIT_TIME = 0
;$loading should be "1" if waiting to load explorable area or "0" if outpost
Do
$cbType = "int"
CmdCB($CA_GETMAPLOADING)
sleep(Random(1000,1500))
$MAX_WAIT_TIME += 1500;
if $MAX_WAIT_TIME >= 40000 then
Return;
EndIf
Until ($cbVar[0] = $loading)
EndFunc
While 1
wayout();
;ThenCastBonds
;Cmd($CA_UseSkill, 7, -2)
Sleep (2500)
Cmd($CA_UseSkill, 8, -2)
Sleep (2500)
;MovetoCastspot
Cmd($CA_Move, _FloatToInt(-7390), _FloatToInt(18665)) ;1 Waypoint
Sleep (9000)
Cmd($CA_Move, _FloatToInt(-6498), _FloatToInt(17198)) ;2 Waypoint No Agro
Sleep (9000) ; Need to be done
Cmd($CA_UseSkill, 6, -2)
Cmd($CA_UseSkill, 1, -2)
Sleep (1000)
Cmd($CA_UseSkill, 2, -2)
Sleep (500)
;Pull
Cmd($CA_Move, _FloatToInt(-5185), _FloatToInt(15823)) ;3 Waypoint
Sleep (7000) ; Need to be done
cmd($CA_UseSkill, 3, -2)
Sleep (1500)
Cmd($CA_Move, _FloatToInt(-6379), _FloatToInt(18080)) ;4 Waypoint
Sleep (7000) ; Need to be done
cmd($CA_UseSkill, 1, -2)
Sleep (1000)
cmd($CA_UseSkill, 2, -2)
Sleep (500)
Cmd($CA_Move, _FloatToInt(-6596), _FloatToInt(18457)) ;5 Waypoint (last)
Sleep (8000)
; $CA_TargetNearestFoe(1)
; Cmd($CA_UseSkill, 7, -1)
; Cast
Cmd($CA_UseSkill, 3, -2)
Sleep (1100)
Cmd($CA_UseSkill, 4, -2)
Sleep (2100)
Cmd($CA_UseSkill, 5, -2)
Sleep (4100)
cmd($CA_UseSkill, 1, -2)
Sleep (1000)
cmd($CA_UseSkill, 2, -2)
Sleep (7500)
cmd($CA_UseSkill, 1, -2)
cmd($CA_UseSkill, 6, -2)
Sleep (500)
cmd($CA_UseSkill, 3, -2)
Sleep (6000)
cmd($CA_UseSkill, 1, -2)
cmd($CA_UseSkill, 2, -2)
Sleep (1000)
cmd($CA_UseSkill, 4, -2)
Sleep (2000)
cmd($CA_UseSkill, 2, -2)
Sleep (6000)
cmd($CA_UseSkill, 3, -2)
; Have A Break; Have a Kitka.... wait... ITEM!
Sleep (12000)
PickupItems(-1, 3500)
Sleep(1000)
Cmd($CA_Resign)
Sleep(1000)
$cbType = "int"
$WhileRuns = 0
while 1 And $WhileRuns < 100
$WhileRuns += 1
CmdCB($CA_GetMyMaxHP)
Sleep(200)
If $cbVar[1] = 0 Then
ExitLoop
EndIf
WEnd
Sleep(Random(1000,2000))
Cmd($CA_ReturnToOutpost)
WaitForLeave(0);
Sleep(Random(2000,4000))
WEnd
hab das nicht getestet hoffe da sind keine syntax fehler drin. Du musst nur noch die TownID vom Gebiet finden dann müsste es passen. Außerdem solltest du dich mal bisschen in Programmieren einlesen.
While 1
Func _SleepUpToDungeon()
$load = CmdCB($CA_GetMapLoading)
While Not $load[0] = 1
Sleep(50)
$load = CmdCB($CA_GetMapLoading)
WEnd
Sleep(Random(4000, 6000, 1))
EndFunc ;==>_S
du kannst nicht eine Funktion in einer While 1 Schleife deklarieren