Habe in einem anderen Forum einen Bot zum Drachenmoos farmen gefunden.
Allerdings scheint irgendwas nicht zu stimmen, wenn man auf Start klick kommt immer folgende Fehlermeldung
Func KeepBuff()
$old_cbtype = $cbType
If $dead Then Return
$cbType = "float"
$sh = CmdCB($CA_GetEffectDuration, 299)
$sa = CmdCB($CA_GetEffectDuration, 1399)
$ps = CmdCB($CA_GetEffectDuration, 245)
If $ps[1] < 7500 Then UseSkill(1)
If $sh[1] < 3000 And $sa[1] < 3000 Then
$cbType = "int"
$sh1 = CmdCB($CA_SkillRecharge, 2)
$sa1 = CmdCB($CA_SkillRecharge, 3)
If $sh1[0] = 0 Then
UseSkill(2)
ElseIf $sa1[0] = 0 Then
UseSkill(3)
EndIf
EndIf
$cbType = $old_cbtype
EndFunc ; => KeepBuff : Maintenir main du prot + Bouclier d'abso + esprit prot.
Func UseSkill($slot)
$old_cbtype = $cbType
$cbType = "int"
CmdCB($CA_SkillRecharge, $slot)
If $cbVar[0] = 0 And $dead = 0 Then
Cmd($CA_UseSkill, $slot)
$blurp2 = TimerInit()
Do
$cbType = "int"
CmdCB($CA_SkillRecharge, $slot)
Sleep(250)
Until $cbVar[0] <> 0 Or TimerDiff($blurp2) > 2500
EndIf
$cbType = $old_cbtype
EndFunc ; => UseSkill : Utiliser un skill s'il est recast et attendre qu'il soit en recast (donc utilis驍
Func DeathCheck()
$old_cbtype = $cbType
If $dead = 0 Then
$cbType = "float"
CmdCB($CA_GetDead)
If $cbVar[0] = 1 Or TimerDiff($runTime) > 150000 Then $dead = 1
EndIf
$cbType = $old_cbtype
EndFunc ; => DeathCheck : Check si t'es mort !
Func Timer()
_TicksToTime(Int(TimerDiff($timestart)), $Hour, $Mins, $Secs )
Local $sTime = $TotalTime; save current time to be able to test and avoid flicker..
$Time = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
GUICtrlSetData($GUI_TotalTime, $Time)
EndFunc
Func Farm()
$dead = 0
Global $runTime = TimerInit()
GuiUpdateStatus("Going out and waiting for map load")
MoveEx(-11242, -23500)
Do
$cbType = "int"
$hp = cmdCB($CA_GetMyMaxHP)
$map = CmdCB($CA_GetMapId)
sleep(250)
Until $hp[0] <> 0 And $map[0] = 195
Sleep(2500)
GuiUpdateStatus("Putting ench 7")
$cbType = "int"
Do
UseSkill(7) ; buffs
CmdCB($CA_GetEffectCount)
Until $cbVar[0] = 2
GuiUpdateStatus("Putting ench 8")
Do
UseSkill(8) ; buffs
CmdCB($CA_GetEffectCount)
Until $cbVar[0] = 3 ; buffs
GuiUpdateStatus("Moving to waypoint: FarmSpot 1")
MoveToEx(-8789.9,18906.1) ; move 1
GuiUpdateStatus("Moving to waypoint: FarmSpot 2")
MoveToEx(-8102.6,18965.2) ; move 2
GuiUpdateStatus("Moving to waypoint: FarmSpot 3")
MoveToEx(-7618,18600) ; move 3
GuiUpdateStatus("Moving to waypoint: FarmSpot 4")
MoveToEx(-7249.8,18406.8) ; move 4
GuiUpdateStatus("Moving to waypoint: FarmSpot 5")
MoveToEx(-6573,17207) ; adlib
GuiUpdateStatus("Putting protection ench")
AdlibRegister("KeepBuff", 1000)
AdlibRegister("DeathCheck", 1000)
GuiUpdateStatus("Moving to waypoint: Aggro 1")
If $dead = 0 Then MoveToEx(-5948.5,16253.3) ; aggro 1
GuiUpdateStatus("Moving to waypoint: Aggro 2")
If $dead = 0 Then MoveToEx(-5092.1,15772.3) ; aggro 2
GuiUpdateStatus("Moving to waypoint: Back 1")
If $dead = 0 Then MoveToEx(-6271,16624) ; back
GuiUpdateStatus("Moving to waypoint: Back 2")
If $dead = 0 Then MoveToEx(-7134.1,17502.2) ; back 2
GuiUpdateStatus("Moving to waypoint: Back 3")
If $dead = 0 Then MoveToEx(-7436,18397.9) ; back 3
;~ If $dead = 0 Then MoveToEx(-6718,17760) ; bad waypont, don't work
;~ If $dead = 0 Then MoveToEx(-6418.3,16931.7) ; bad waypont too
GuiUpdateStatus("Killing all Dragon Moss")
Do
$cbType = "float"
$sh2 = CmdCB($CA_GetEffectDuration, 299)
$sa2 = CmdCB($CA_GetEffectDuration, 1399)
$ps2 = CmdCB($CA_GetEffectDuration, 245)
If ($sh2[1] > 6000 Or $sa2[1] > 6000) And $ps2[1] > 12000 Then
If $dead = 0 Then UseSkill(4)
If $dead = 0 Then UseSkill(5)
EndIf
$cbType = "int"
$soj = CmdCB($CA_SkillRecharge, 5)
Until $soj[0] <> 0 Or $dead = 1
$blurp = TimerInit()
While TimerDiff($blurp) < 17000 And $dead = 0
Sleep(100)
WEnd
If $dead = 0 Then UseSkill(4)
$timetokill = TimerInit()
Do
UseSkill(6)
sleep(1000)
If TimerDiff($timetokill) > 25000 Then UseSkill(5)
$cbType = "float"
CmdCB($CA_GetNearestAliveEnemyToAgent, -2)
$distance = $cbVar[1]
Until $distance > 1800 Or $dead = 1 Or TimerDiff($timetokill) > 60000
AdlibUnRegister("KeepBuff")
GuiUpdateStatus("Picking up items")
$nbItems = 0
$deadlock = TimerInit()
Do
$cbType = "int"
$item = CmdCB($CA_GetNearestItemToAgentEx, -2)
If $item[0] = 0 Or _INTTOFLOAT($item[1]) > 1700 Or TimerDiff($deadlock) > 30000 Then ExitLoop
Cmd($CA_PickupItem, $item[0])
$deadlock2 = TimerInit()
Do
Sleep(500)
CmdCB($CA_GetAgentExist, $item[0])
If TimerDiff($deadlock2) > 5000 Then ContinueLoop 2
Until $cbVar[0] = 0
$nbItems += 1
Until $nbItems = -1 Or $dead = 1
AdlibUnRegister("DeathCheck")
GuiUpdateStatus("Traveling to outpost")
Travel(349)
EndFunc
Func Mercant()
GuiUpdateStatus("Going To Mercant")
$mercant = GetNearestNPCToCoords(11040,-18944)
Cmd($CA_GoNPC, $mercant)
Sleep(10000)
Dim $item[10][25][5]
For $bag = 0 To 4
$cbType = "int"
$bagsize = CmdCB($CA_GetBagSize, $bag)
For $slot = 0 to $bagsize[0]
$cbType = "int"
CmdCB($CA_GetItemId, $slot, $bag)
$item[$bag][$slot][0] = $cbVar[0] ; => item ID
$item[$bag][$slot][1] = $cbVar[1] ; => item ModelId
CmdCB($CA_GetItemInfo, $slot, $bag)
$item[$bag][$slot][2] = $cbVar[0] ; => item Rarity
CmdCB($CA_GetItemReq, $slot, $bag)
$item[$bag][$slot][3] = $cbVar[0] ; => item req
Next
Next
GuiUpdateStatus("Identifying all items")
If CountSlots() = 0 Then Cmd($CA_SellItem, 4, 9)
If CountSlots() = 0 Then Cmd($CA_SellItem, 4, 8)
For $bag = 0 To 4
$cbType = "int"
$bagsize = CmdCB($CA_GetBagSize, $bag)
For $slot = 0 to $bagsize[0]
$cbType = "int"
CmdCB($CA_GetIdKit)
If $cbVar[0] = 0 Then
Cmd($CA_BuyIdKit)
Sleep(Random(500,1000))
CmdCB($CA_GetIdKit)
Sleep(Random(500,1000))
MoveItemById($cbVar[0], 4, 1) ;Move IDKit to Spot (4, 1)
Sleep(Random(500,1000))
EndIf
If $item[$bag][$slot][2] <> 64 Or $storegolds <> $GUI_Checked Then Cmd($CA_IdentifyItem, $bag, $slot)
Sleep(Random(290, 310))
Next
Next
GuiUpdateStatus("Selling all items")
For $bag = 0 To 4
$cbType = "int"
$bagsize = CmdCB($CA_GetBagSize, $bag)
For $slot = 0 to $bagsize[0]
If $item[$bag][$slot][2] <> 64 Or $storegolds <> $GUI_Checked Then
If ($item[$bag][$slot][1] <> 934 Or $item[$bag][$slot][3] <> 0) And $item[$bag][$slot][1] <> 956 And $item[$bag][$slot][1] <> 819 And $item[$bag][$slot][1] <> 146 Then
Cmd($CA_SellItem, $bag, $slot)
Sleep(Random(500,750))
EndIf
EndIf
Next
Next
EndFunc
Func OutPost()
If CountSlots() < 4 Then
Travel(284)
If $storegolds = $GUI_Checked Then StoreGolds()
Mercant()
Travel(349)
EndIf
EndFunc
Func Travel($outpost)
TravelTo($outpost)
Do
$cbType = "int"
$hp = cmdCB($CA_GetMyMaxHP)
$map = CmdCB($CA_GetMapId)
sleep(250)
Until $hp[0] <> 0 And $map[0] = $outpost
Sleep(2000)
EndFunc
Func UpdateStats()
$TotalRuns += 1
;~ $TotalTime = TimerDiff($TimeStart)/60000
If $dead = 0 Then
$Successfull += 1
$AllTime += TimerDiff($runTime)
If $totalRuns = 1 Then $BestTime = Ceiling(TimerDiff($runTime)/1000)
If TimerDiff($runTime)/1000 > $WorstTime Then $WorstTime = Ceiling(TimerDiff($runTime)/1000)
If TimerDiff($runTime)/1000 < $BestTime Then $BestTime = Ceiling(TimerDiff($runTime)/1000)
Else
$Failed += 1
EndIf
$AverageTime = Ceiling($AllTime/(1000*$Successfull))
Func HM()
Cmd($CA_SwitchMode, 1)
GuiUpdateStatus("Switching to Hard Mode")
EndFunc
While 1
If $BotRunning Then
AdlibRegister("timer", 500)
If $DisableGraphics = $GUI_CHECKED Then PurgeEngineHook()
HM()
OutPost()
Farm()
UpdateStats()
AdlibUnRegister("timer")
EndIf
If $Stopped =1 Then
GuiUpdateStatus("Script not started yet")
GUICtrlSetState($GUI_ButtonStrat, $GUI_ENABLE)
$Stopped = 0
EndIf
WEnd
GWCAConstants.au3
PHP Code:
; # -+-+-+-+-+-+-+ #
; GWCA Constants
; By Sune C
; # +-+-+-+-+-+-+- #
Opt("WinTitleMatchMode", -1) ;Make sure that Guild Wars receives the messages (1 = match start, 2 = substring, 3 = exact)
Global $cbType = "int" ;What to read the callback values as
Global $cbVar[2] ;Array for callback wParam and lParam
Global $sGW = "Guild Wars -" ;Name of window
Global $hGWCA_STREAM = 0 ;Handle to the stream
Global $bGWCA_INTERNAL = False ;Is set to True when inside a Cmd() or CmdCB() call
Func Cmd($uMsg, $wparam = 0, $lparam = 0)
Local $iRead = 0
Local $OutBuffer = DllStructCreate("WORD header;WORD type;BYTE wparam[4];BYTE lparam[4]") ;Pipes sending buffer
Local $InBuffer = DllStructCreate("WORD header;WORD type;BYTE wparam[4];BYTE lparam[4]") ;Pipes incoming buffer
$bGWCA_INTERNAL = True
DllStructSetData($OutBuffer,"header",$uMsg)
DllStructSetData($OutBuffer,"type",BitOR($IS_COMMAND, $IS_NUMERIC))
DllStructSetData($OutBuffer,"wparam",Number($wparam)) ; set wparam
DllStructSetData($OutBuffer,"lparam",Number($lparam)) ; set lparam
If Not $hGWCA_STREAM Then
If Not _NamedPipes_WaitNamedPipe("\\.\pipe\GWCA_"&WinGetProcess($sGW), 1000) Then
Return
EndIf
$hGWCA_STREAM = _WinAPI_CreateFile("\\.\pipe\GWCA_"&WinGetProcess($sGW), 2, 6)
EndIf
If Not _WinAPI_WriteFile($hGWCA_STREAM,DllStructGetPtr($OutBuffer),12,$iRead) Then
_GWCA_CloseStream()
EndIf
If Not $hGWCA_STREAM Then
If Not _NamedPipes_WaitNamedPipe("\\.\pipe\GWCA_"&WinGetProcess($sGW), 1000) Then
Return SetError(1, 0, $cbVar)
EndIf
$hGWCA_STREAM = _WinAPI_CreateFile("\\.\pipe\GWCA_"&WinGetProcess($sGW), 2, 6)
EndIf
If Not _WinAPI_WriteFile($hGWCA_STREAM,DllStructGetPtr($OutBuffer),12,$iRead) Then
_GWCA_CloseStream()
EndIf
If Not _WinAPI_ReadFile($hGWCA_STREAM,DllStructGetPtr($InBuffer),12,$iRead) Then
_GWCA_CloseStream()
EndIf
$tDeadlock = TimerInit()
Do
$aItem = CmdCB($CA_GETNEARESTITEMTOAGENTEX, -2)
If $aItem[0] = 0 OR _IntToFloat($aItem[1]) > $fMaxDistance OR TimerDiff($tDeadlock) > 30000 Then ExitLoop
Cmd($CA_PICKUPITEM, $aItem[0])
$tDeadlock2 = TimerInit()
Do
Sleep(500)
CmdCB($CA_GETAGENTEXIST, $aItem[0])
If TimerDiff($tDeadlock2) > 5000 Then ContinueLoop 2
Until $cbVar[0] = 0
$tDeadlock = TimerInit()
$cbType = "int"
Cmd($CA_USESKILL, $iSkillSlot, $iTarget)
Do
Sleep(250)
CmdCB($CA_GETDEAD)
If $cbVar[0] = 1 Then ExitLoop
CmdCB($CA_GETSKILL, -2)
If $cbVar[0] = 0 AND TimerDiff($tDeadlock) > 1000 Then ExitLoop
CmdCB($CA_SKILLRECHARGE, $iSkillSlot)
Until $cbVar[0] <> 0 OR TimerDiff($tDeadlock) > 15000
$cbType = $oldCbType
EndFunc
Func _GWCAMemOpen($iv_Pid, $iv_DesiredAccess = 0x1F0FFF, $iv_InheritHandle = 1)
If Not ProcessExists($iv_Pid) Then
SetError(1)
Return 0
EndIf
If $MemPtr <> 0 Then Cmd($CA_FreeMem, $MemPtr)
If Not $ownHandle Then _GWCAMemClose($hprocess)
$cbType = $oldCbType
EndFunc
Func GetPlayerName($iAgent = -2)
Local $sRet = ""
$oldCbType = $cbType
$cbType = "int"
CmdCB($CA_GetName, $iAgent)
If Not @error AND $cbVar[0] <> 0 Then
$ahHndl = _GWCAMemOpen(WinGetProcess($sGW))
If Not @error Then
$sRet = _GWCAMemRead($cbVar[0], $ahHndl, "wchar[24]")
_GWCAMemClose($ahHndl)
EndIf
EndIf
$cbType = $oldCbType
Return $sRet
EndFunc
Func RechargeTimeLeft($iSkillSlot)
Local $iRet = 0
da ist ein ganz einfacher fehler drin.
relativ am anfang im GUI bereich sind ein paar zeilen hintereinander die mit ";~" anfangen. das musst du entfernen dann geht der error weg. Außerdem ist das GUI unsauber, weil 2 Labels übereinander liegen.
edit:
habs mal überarbeitet sodass du den fehler nicht mehr hast und die beiden sachen nicht mehr übereinander liegen.
Code:
#include "GWCAConstants.au3"
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <Date.au3>
Global $BotRunning = False, $Time, $Stopped = 0, $hour, $mins, $secs, $dead, $alltime = 0, $timeStart, $TotalRuns, $Successfull, $failed, $totaltime, $besttime, $worsttime, $averagetime, $storegolds, $disablegraphics, $charname
Opt("GUIOnEventMode", 1)
$GUI = GUICreate("Dragon Moss Bot", 303, 363, 848, 188)
GUICtrlCreateGroup(" Status : Runs ", 176, 8, 113, 81)
GUICtrlCreateLabel("Total Runs:", 192, 32, 59, 17)
GUICtrlCreateLabel("Successful:", 192, 48, 59, 17)
GUICtrlSetColor(-1, 0x008000)
GUICtrlCreateLabel("Failed:", 192, 64, 35, 17)
GUICtrlSetColor(-1, 0x800000)
$GUi_TotalRuns = GUICtrlCreateLabel("0", 254, 32, 20, 17, $SS_RIGHT)
$GUI_Successfull = GUICtrlCreateLabel("0", 254, 48, 20, 17, $SS_RIGHT)
$GUI_Failed = GUICtrlCreateLabel("0", 254, 64, 20, 17, $SS_RIGHT)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("Status : Time ", 8, 88, 281, 65)
GUICtrlCreateLabel("Total:", 24, 112, 31, 17)
GUICtrlCreateLabel("Best:", 24, 128, 28, 17)
GUICtrlSetColor(-1, 0x008000)
GUICtrlCreateLabel("Worst:", 168, 128, 35, 17)
GUICtrlSetColor(-1, 0x800000)
$GUI_TotalTime = GUICtrlCreateLabel("0", 70, 112, 60, 17, $SS_RIGHT)
$GUI_BestTime = GUICtrlCreateLabel("0", 70, 128, 60, 17, $SS_RIGHT)
$GUI_WorstTime = GUICtrlCreateLabel("0", 214, 128, 60, 17, $SS_RIGHT)
GUICtrlCreateLabel("Average:", 168, 112, 47, 17)
$GUI_AverageTime = GUICtrlCreateLabel("0", 214, 112, 60, 17, $SS_RIGHT)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateLabel("Dragon Moss Bot", 16, 24, 148, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUICtrlCreateLabel("By Nicolas210", 48, 56, 90, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlCreateGroup("Config : General ", 8, 152, 281, 123)
GUICtrlCreateLabel("Name :", 18, 234, 53, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$GUI_CHARNAME = GUICtrlCreateInput("My Char Name", 74, 234, 209, 21)
Global $GUI_CHARNAME = GUICtrlCreateCombo("", 18, 170, 192, 21, BitOR(3, 64))
GUICtrlSetTip(-1, "Choose which instance of the game you want to use")
Global $GUI_BUTTON_REFRESH = GUICtrlCreateButton("Refresh", 215, 169, 70, 23, 0)
GUICtrlSetOnEvent(-1, "gui_eventHandler")
$GUI_DisableGraphics = GUICtrlCreateCheckbox("Disable graphics", 18, 198, 105, 17, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_RIGHT))
GUICtrlSetOnEvent(-1, "gui_eventHandler")
$GUI_StoreGolds = GUICtrlCreateCheckbox("Store golds items", 146, 198, 105, 17, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_RIGHT))
GUICtrlSetOnEvent(-1, "gui_eventHandler")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("Status : Current Action ", 8, 276, 281, 49)
$GUI_CurrentAction = GUICtrlCreateLabel("Script not started yet", 16, 300, 250, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$GUI_ButtonStart = GUICtrlCreateButton("Start", 8, 332, 283, 25)
GUICtrlSetOnEvent(-1, "gui_eventHandler")
GUISetOnEvent($GUI_EVENT_CLOSE, "gui_eventHandler")
GUISetState(@SW_SHOW)
Func GUI_EVENTHANDLER()
Switch (@GUI_CtrlId)
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_ButtonStart
If $BotRunning = False Then
$TimeStart = TimerInit()
$BotRunning = True
$Stopped = 0
$TotalRuns = 0
$Successfull = 0
$failed = 0
$TotalTime = 0
$WorstTime = 0
$BestTime = 0
$AverageTime = 0
$storegolds = GUICtrlRead($GUI_StoreGolds)
$DisableGraphics = GUICtrlRead($GUI_DisableGraphics)
$CHARNAME = GUICtrlRead($GUI_CHARNAME)
GUICtrlSetState($GUI_CHARNAME, $GUI_DISABLE)
GUICtrlSetState($GUI_BUTTON_REFRESH, $GUI_DISABLE)
GUICtrlSetData($GUI_ButtonStart, "Stop")
_GWCA_CLOSESTREAM()
If $CHARNAME = "" Then
$SGW = "Guild Wars -"
Else
$SGW = $CHARNAME
EndIf
GUICtrlSetData($GUI_TotalRuns, 0)
GUICtrlSetData($GUI_Successfull, 0)
GUICtrlSetData($GUI_Failed, 0)
GUICtrlSetData($GUI_TotalTime, 0)
GUICtrlSetData($GUI_WorstTime, 0)
GUICtrlSetData($GUI_BestTime, 0)
GUICtrlSetData($GUI_AverageTime, 0)
$cbType = "int"
$map = CmdCB($CA_GetMapId)
If $map[0] <> 349 Then
GuiUpdateStatus("Traveling to outpost")
TravelTo(349)
Do
$cbType = "int"
$hp = cmdCB($CA_GetMyMaxHP)
$map = CmdCB($CA_GetMapId)
sleep(250)
Until $hp[0] <> 0 And $map[0] = 349
EndIf
Else
$BotRunning = False
GUICtrlSetState($GUI_CHARNAME, $GUI_ENABLE)
GUICtrlSetState($GUI_BUTTON_REFRESH, $GUI_ENABLE)
GUICtrlSetData($GUI_ButtonStart, "Start")
GUICtrlSetState($GUI_ButtonStart, $GUI_DISABLE)
$Stopped = 1
GuiUpdateStatus("Bot will stop after this run.")
EndIf
Case $GUI_DisableGraphics
$DisableGraphics = GUICtrlRead($GUI_DisableGraphics)
$CHARNAME = GUICtrlRead($GUI_CHARNAME)
If $CHARNAME = "" Then
$SGW = "Guild Wars -"
Else
$SGW = $CHARNAME
EndIf
If $DisableGraphics = $GUI_CHECKED Then
WinSetState($SGW, "", @SW_HIDE)
CMD($CA_SETENGINEHOOK, 1)
Else
CMD($CA_SETENGINEHOOK, 0)
WinSetState($SGW, "", @SW_SHOW)
EndIf
Case $GUI_StoreGolds
$StoreGolds = GUICtrlRead($GUI_StoreGolds)
EndSwitch
EndFunc
Func GuiUpdateStatus($msg)
GUICtrlSetData($GUI_CurrentAction, $msg)
EndFunc
Func KeepBuff()
$old_cbtype = $cbType
If $dead Then Return
$cbType = "float"
$sh = CmdCB($CA_GetEffectDuration, 299)
$sa = CmdCB($CA_GetEffectDuration, 1399)
$ps = CmdCB($CA_GetEffectDuration, 245)
If $ps[1] < 7500 Then UseSkill(1)
If $sh[1] < 3000 And $sa[1] < 3000 Then
$cbType = "int"
$sh1 = CmdCB($CA_SkillRecharge, 2)
$sa1 = CmdCB($CA_SkillRecharge, 3)
If $sh1[0] = 0 Then
UseSkill(2)
ElseIf $sa1[0] = 0 Then
UseSkill(3)
EndIf
EndIf
$cbType = $old_cbtype
EndFunc ; => KeepBuff : Maintenir main du prot + Bouclier d'abso + esprit prot.
Func UseSkill($slot)
$old_cbtype = $cbType
$cbType = "int"
CmdCB($CA_SkillRecharge, $slot)
If $cbVar[0] = 0 And $dead = 0 Then
Cmd($CA_UseSkill, $slot)
$blurp2 = TimerInit()
Do
$cbType = "int"
CmdCB($CA_SkillRecharge, $slot)
Sleep(250)
Until $cbVar[0] <> 0 Or TimerDiff($blurp2) > 2500
EndIf
$cbType = $old_cbtype
EndFunc ; => UseSkill : Utiliser un skill s'il est recast et attendre qu'il soit en recast (donc utilis?
Func DeathCheck()
$old_cbtype = $cbType
If $dead = 0 Then
$cbType = "float"
CmdCB($CA_GetDead)
If $cbVar[0] = 1 Or TimerDiff($runTime) > 150000 Then $dead = 1
EndIf
$cbType = $old_cbtype
EndFunc ; => DeathCheck : Check si t'es mort !
Func Timer()
_TicksToTime(Int(TimerDiff($timestart)), $Hour, $Mins, $Secs )
Local $sTime = $TotalTime; save current time to be able to test and avoid flicker..
$Time = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
GUICtrlSetData($GUI_TotalTime, $Time)
EndFunc
Func Farm()
$dead = 0
Global $runTime = TimerInit()
GuiUpdateStatus("Going out and waiting for map load")
MoveEx(-11242, -23500)
Do
$cbType = "int"
$hp = cmdCB($CA_GetMyMaxHP)
$map = CmdCB($CA_GetMapId)
sleep(250)
Until $hp[0] <> 0 And $map[0] = 195
Sleep(2500)
GuiUpdateStatus("Putting ench 7")
$cbType = "int"
Do
UseSkill(7) ; buffs
CmdCB($CA_GetEffectCount)
Until $cbVar[0] = 2
GuiUpdateStatus("Putting ench 8")
Do
UseSkill(8) ; buffs
CmdCB($CA_GetEffectCount)
Until $cbVar[0] = 3 ; buffs
GuiUpdateStatus("Moving to waypoint: FarmSpot 1")
MoveToEx(-8789.9,18906.1) ; move 1
GuiUpdateStatus("Moving to waypoint: FarmSpot 2")
MoveToEx(-8102.6,18965.2) ; move 2
GuiUpdateStatus("Moving to waypoint: FarmSpot 3")
MoveToEx(-7618,18600) ; move 3
GuiUpdateStatus("Moving to waypoint: FarmSpot 4")
MoveToEx(-7249.8,18406.8) ; move 4
GuiUpdateStatus("Moving to waypoint: FarmSpot 5")
MoveToEx(-6573,17207) ; adlib
GuiUpdateStatus("Putting protection ench")
AdlibRegister("KeepBuff", 1000)
AdlibRegister("DeathCheck", 1000)
GuiUpdateStatus("Moving to waypoint: Aggro 1")
If $dead = 0 Then MoveToEx(-5948.5,16253.3) ; aggro 1
GuiUpdateStatus("Moving to waypoint: Aggro 2")
If $dead = 0 Then MoveToEx(-5092.1,15772.3) ; aggro 2
GuiUpdateStatus("Moving to waypoint: Back 1")
If $dead = 0 Then MoveToEx(-6271,16624) ; back
GuiUpdateStatus("Moving to waypoint: Back 2")
If $dead = 0 Then MoveToEx(-7134.1,17502.2) ; back 2
GuiUpdateStatus("Moving to waypoint: Back 3")
If $dead = 0 Then MoveToEx(-7436,18397.9) ; back 3
;~ If $dead = 0 Then MoveToEx(-6718,17760) ; bad waypont, dont work
;~ If $dead = 0 Then MoveToEx(-6418.3,16931.7) ; bad waypont too
GuiUpdateStatus("Killing all Dragon Moss")
Do
$cbType = "float"
$sh2 = CmdCB($CA_GetEffectDuration, 299)
$sa2 = CmdCB($CA_GetEffectDuration, 1399)
$ps2 = CmdCB($CA_GetEffectDuration, 245)
If ($sh2[1] > 6000 Or $sa2[1] > 6000) And $ps2[1] > 12000 Then
If $dead = 0 Then UseSkill(4)
If $dead = 0 Then UseSkill(5)
EndIf
$cbType = "int"
$soj = CmdCB($CA_SkillRecharge, 5)
Until $soj[0] <> 0 Or $dead = 1
$blurp = TimerInit()
While TimerDiff($blurp) < 17000 And $dead = 0
Sleep(100)
WEnd
If $dead = 0 Then UseSkill(4)
$timetokill = TimerInit()
Do
UseSkill(6)
sleep(1000)
If TimerDiff($timetokill) > 25000 Then UseSkill(5)
$cbType = "float"
CmdCB($CA_GetNearestAliveEnemyToAgent, -2)
$distance = $cbVar[1]
Until $distance > 1800 Or $dead = 1 Or TimerDiff($timetokill) > 60000
AdlibUnRegister("KeepBuff")
GuiUpdateStatus("Picking up items")
$nbItems = 0
$deadlock = TimerInit()
Do
$cbType = "int"
$item = CmdCB($CA_GetNearestItemToAgentEx, -2)
If $item[0] = 0 Or _INTTOFLOAT($item[1]) > 1700 Or TimerDiff($deadlock) > 30000 Then ExitLoop
Cmd($CA_PickupItem, $item[0])
$deadlock2 = TimerInit()
Do
Sleep(500)
CmdCB($CA_GetAgentExist, $item[0])
If TimerDiff($deadlock2) > 5000 Then ContinueLoop 2
Until $cbVar[0] = 0
$nbItems += 1
Until $nbItems = -1 Or $dead = 1
AdlibUnRegister("DeathCheck")
GuiUpdateStatus("Traveling to outpost")
Travel(349)
EndFunc
Func StoreGolds()
GuiUpdateStatus("Going to storage")
$cbType = "int"
$storage = GetNearestNpcToCoords(8027, -18227)
Cmd($CA_GONPC, $storage)
Sleep(10000)
GuiUpdateStatus("Storing golds")
For $bag = 0 To 4
$cbType = "int"
$bagsize = CmdCB($CA_GetBagSize, $bag)
For $slot = 0 to $bagsize[0]
$cbType = "int"
CmdCB($CA_GetItemInfo, $slot, $bag)
If $cbvar[0] = 64 Then
$cbType = "int"
$emptystorage = CmdCB($CA_FindEmptySlot,8)
MoveItem($bag, $slot, $emptystorage[0], $emptystorage[1])
sleep(500)
EndIf
Next
Next
EndFunc ; => StoreGolds().
Func CountSlots()
Local $temp = 0
$cbType = "int"
$Bag1 = CmdCB($CA_GetBagSize, 1)
$temp += $Bag1[0] - $Bag1[1]
$Bag2 = CmdCB($CA_GetBagSize, 2)
$temp += $Bag2[0] - $Bag2[1]
$Bag3 = CmdCB($CA_GetBagSize, 3)
$temp += $Bag3[0] - $Bag3[1]
$Bag4 = CmdCB($CA_GetBagSize, 4)
$temp += $Bag4[0] - $Bag4[1]
Return $temp
EndFunc
Func Mercant()
GuiUpdateStatus("Going To Mercant")
$mercant = GetNearestNPCToCoords(11040,-18944)
Cmd($CA_GoNPC, $mercant)
Sleep(10000)
Dim $item[10][25][5]
For $bag = 0 To 4
$cbType = "int"
$bagsize = CmdCB($CA_GetBagSize, $bag)
For $slot = 0 to $bagsize[0]
$cbType = "int"
CmdCB($CA_GetItemId, $slot, $bag)
$item[$bag][$slot][0] = $cbVar[0] ; => item ID
$item[$bag][$slot][1] = $cbVar[1] ; => item ModelId
CmdCB($CA_GetItemInfo, $slot, $bag)
$item[$bag][$slot][2] = $cbVar[0] ; => item Rarity
CmdCB($CA_GetItemReq, $slot, $bag)
$item[$bag][$slot][3] = $cbVar[0] ; => item req
Next
Next
GuiUpdateStatus("Identifying all items")
If CountSlots() = 0 Then Cmd($CA_SellItem, 4, 9)
If CountSlots() = 0 Then Cmd($CA_SellItem, 4, 8)
For $bag = 0 To 4
$cbType = "int"
$bagsize = CmdCB($CA_GetBagSize, $bag)
For $slot = 0 to $bagsize[0]
$cbType = "int"
CmdCB($CA_GetIdKit)
If $cbVar[0] = 0 Then
Cmd($CA_BuyIdKit)
Sleep(Random(500,1000))
CmdCB($CA_GetIdKit)
Sleep(Random(500,1000))
MoveItemById($cbVar[0], 4, 1) ;Move IDKit to Spot (4, 1)
Sleep(Random(500,1000))
EndIf
If $item[$bag][$slot][2] <> 64 Or $storegolds <> $GUI_Checked Then Cmd($CA_IdentifyItem, $bag, $slot)
Sleep(Random(290, 310))
Next
Next
GuiUpdateStatus("Selling all items")
For $bag = 0 To 4
$cbType = "int"
$bagsize = CmdCB($CA_GetBagSize, $bag)
For $slot = 0 to $bagsize[0]
If $item[$bag][$slot][2] <> 64 Or $storegolds <> $GUI_Checked Then
If ($item[$bag][$slot][1] <> 934 Or $item[$bag][$slot][3] <> 0) And $item[$bag][$slot][1] <> 956 And $item[$bag][$slot][1] <> 819 And $item[$bag][$slot][1] <> 146 Then
Cmd($CA_SellItem, $bag, $slot)
Sleep(Random(500,750))
EndIf
EndIf
Next
Next
EndFunc
Func OutPost()
If CountSlots() < 4 Then
Travel(284)
If $storegolds = $GUI_Checked Then StoreGolds()
Mercant()
Travel(349)
EndIf
EndFunc
Func Travel($outpost)
TravelTo($outpost)
Do
$cbType = "int"
$hp = cmdCB($CA_GetMyMaxHP)
$map = CmdCB($CA_GetMapId)
sleep(250)
Until $hp[0] <> 0 And $map[0] = $outpost
Sleep(2000)
EndFunc
Func UpdateStats()
$TotalRuns += 1
;~ $TotalTime = TimerDiff($TimeStart)/60000
If $dead = 0 Then
$Successfull += 1
$AllTime += TimerDiff($runTime)
If $totalRuns = 1 Then $BestTime = Ceiling(TimerDiff($runTime)/1000)
If TimerDiff($runTime)/1000 > $WorstTime Then $WorstTime = Ceiling(TimerDiff($runTime)/1000)
If TimerDiff($runTime)/1000 < $BestTime Then $BestTime = Ceiling(TimerDiff($runTime)/1000)
Else
$Failed += 1
EndIf
$AverageTime = Ceiling($AllTime/(1000*$Successfull))
GuiUpdateStatus("Updating Stats")
GUICtrlSetData($GUI_TotalRuns, $TotalRuns)
GUICtrlSetData($GUI_Successfull, $Successfull)
GUICtrlSetData($GUI_Failed, $Failed)
;~ GUICtrlSetData($GUI_TotalTime, $TotalTime & " min")
GUICtrlSetData($GUI_WorstTime, $WorstTime & " secs")
GUICtrlSetData($GUI_BestTime, $BestTime & " secs")
GUICtrlSetData($GUI_AverageTime, $AverageTime & " secs")
EndFunc
Func PurgeEngineHook()
CMD($CA_SETENGINEHOOK, 0)
Sleep(150)
CMD($CA_SETENGINEHOOK, 1)
GuiUpdateStatus("Purging Engine Hook")
EndFunc
Func HM()
Cmd($CA_SwitchMode, 1)
GuiUpdateStatus("Switching to Hard Mode")
EndFunc
While 1
If $BotRunning Then
AdlibRegister("timer", 500)
If $DisableGraphics = $GUI_CHECKED Then PurgeEngineHook()
HM()
OutPost()
Farm()
UpdateStats()
AdlibUnRegister("timer")
EndIf
If $Stopped =1 Then
GuiUpdateStatus("Script not started yet")
GUICtrlSetState($GUI_ButtonStrat, $GUI_ENABLE)
$Stopped = 0
EndIf
WEnd
WTS Guild Wars Gold,Guild Wars Ectos,Guild Wars Zaishen Keys for sale 02/19/2013 - Guild Wars Trading - 4 Replies Hi, i want to sell Guild Wars Gold,Guild Wars Ectos,Guild Wars Zaishen Keys.If someone is interested , you can email me and add my msn. We can talk details there. I will give u a low price of Guild Wars Gold,Guild Wars Ectos,Guild Wars Zaishen Keys including weapons. I am serious.
Email:[email protected]
MSN:[email protected]
Thank you for reading my post.