Advertisement
Guest User

Untitled

a guest
May 29th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 4.63 KB | None | 0 0
  1. PREPAIR WIRKLICH IMPLEMENTIEREN
  2.  
  3.  
  4. ___________________________________________________________________________________________
  5. ;ENSURE ENGLISH
  6.  
  7.  
  8.  
  9.  
  10. Func GuiButtonHandler()
  11.     If $BotRunning Then
  12.         GUICtrlSetData($Button, "Will pause after this run")
  13.         GUICtrlSetState($Button, $GUI_DISABLE)
  14.         $BotRunning = False
  15.     ElseIf $BotInitialized Then
  16.         GUICtrlSetData($Button, "Pause")
  17.         $BotRunning = True
  18.     Else
  19.         Out("Initializing")
  20.         Local $CharName = GUICtrlRead($Input)
  21.         If $CharName=="" Then
  22.             ;If Initialize(ProcessExists("gw.exe"), True, True, False) = False Then
  23.             If Initialize(ProcessExists("gw.exe"), True) = False Then
  24.                 MsgBox(0, "Error", "Guild Wars is not running.")
  25.                 Exit
  26.             EndIf
  27.         Else
  28.             ;If Initialize($CharName, True, True, False) = False Then
  29.             If Initialize($CharName, True) = False Then
  30.                 MsgBox(0, "Error", "Could not find a Guild Wars client with a character named '"&$CharName&"'")
  31.                 Exit
  32.             EndIf
  33.         EndIf
  34.         EnsureEnglish(True)
  35.         GUICtrlSetState($Checkbox, $GUI_ENABLE)
  36.         GUICtrlSetState($Leeching, $GUI_ENABLE)
  37.         GUICtrlSetState($MapPieces, $GUI_ENABLE)
  38.         GUICtrlSetState($Tomes, $GUI_ENABLE)
  39.         GUICtrlSetState($StoreGolds, $GUI_ENABLE)
  40.         GUICtrlSetState($Input, $GUI_DISABLE)
  41.         GUICtrlSetData($Button, "Pause")
  42.         WinSetTitle($mainGui, "", "VBot-" & GetCharname())
  43.         $BotRunning = True
  44.         $BotInitialized = True
  45.     EndIf
  46. EndFunc
  47. #EndRegion GUI
  48.  
  49. -----------------------------------------------------------------------------------
  50. ;PickUpCount
  51.  
  52. Global Const $shard = 945
  53.  
  54.  
  55. $shardlabel = GUICtrlCreateLabel("0", 48, 111, 20, 17)
  56. GUICtrlSetColor(-1, 0xFF0000)
  57.  
  58.  
  59.  
  60.  
  61.  
  62. Func canpickup($lItem)
  63.     $m = DllStructGetData($lItem, 'ModelID')
  64.     $c = DllStructGetData($lItem, 'ExtraID')
  65.    if  $m = $ruby Or $m = $obbykey Or $m = $saph Or $m = $darkremains Or $m = $dust Or $m = $scroll Then
  66.       Return True
  67.    ElseIf ($m = 146 And ($c = 10 Or $c = 12 Or $c = 13)) Or $m = 22751 Then ;Dyes/Lockpicks
  68.       Return True
  69.    ElseIf $m = $shard Then
  70.       $shardcount = $shardcount + 1
  71.       GUICtrlSetData($shardlabel,$shardcount)
  72.       Return True
  73.    Else
  74.       Return False
  75.    EndIf
  76. EndFunc   ;==>canpickup
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83. ----------------------------------------------------------------------------------
  84. enszre save enter
  85.  
  86.  
  87.  
  88. global  $ensuresafety = True  ; will zone  until it finds empty dis , and wont kneel if people in town
  89.  
  90.  
  91.  
  92.  
  93.  
  94. Func safety()
  95.     if GUICtrlRead($Checkbox1) = $gui_checked Then
  96.        $ensuresafety = True
  97.        out("safe mode")
  98.     Else
  99.        $ensuresafety = False
  100.        out("will ignore people")
  101.     EndIf
  102. EndFunc
  103.  
  104.  
  105.  
  106. func enterkneel()
  107.    if $ensuresafety  Then
  108.       do
  109.          rndtravel($town)
  110.          rndsleep(200)
  111.       until isdisempty()
  112.     else
  113.       rndtravel($town)
  114.    EndIf
  115.    if getmapid() = $chantry Then
  116.       out("zoning to chantry")
  117.       rndsleep(400)
  118.       kneel(-9979,1171)
  119.  
  120.    elseif getmapid() = $toa Then
  121.       out("zoning to toa")
  122.       rndsleep(200)
  123.       kneel(-2522,18731)
  124.  
  125.    EndIf
  126. EndFunc
  127.  
  128.  
  129.  
  130. unc moveandcheckdis($ax,$ay,$arandom = 65) ; for noids , replace this with moveto() in kneel,will change dis as soon as it detect s1
  131.     Local $lBlocked = 0
  132.     Local $lMe
  133.     Local $lMapLoading = GetMapLoading(), $lMapLoadingOld
  134.     Local $lDestX = $aX + Random(-$aRandom, $aRandom)
  135.     Local $lDestY = $aY + Random(-$aRandom, $aRandom)
  136.     $notalone  = False
  137.     Move($lDestX, $lDestY, 0)
  138.  
  139.     Do
  140.         Sleep(100)
  141.         $lMe = GetAgentByID(-2)
  142.  
  143.         If DllStructGetData($lMe, 'HP') <= 0 Then ExitLoop
  144.  
  145.         $lMapLoadingOld = $lMapLoading
  146.         $lMapLoading = GetMapLoading()
  147.         If $lMapLoading <> $lMapLoadingOld Then ExitLoop
  148.  
  149.         If DllStructGetData($lMe, 'MoveX') == 0 And DllStructGetData($lMe, 'MoveY') == 0 Then
  150.             $lBlocked += 1
  151.             $lDestX = $aX + Random(-$aRandom, $aRandom)
  152.             $lDestY = $aY + Random(-$aRandom, $aRandom)
  153.             Move($lDestX, $lDestY, 0)
  154.          EndIf
  155.         if not isdisempty() Then
  156.            enterfow()
  157.          EndIf
  158.       Until ComputeDistance(DllStructGetData($lMe, 'X'), DllStructGetData($lMe, 'Y'), $lDestX, $lDestY) < 100 Or $lBlocked > 14
  159.  
  160.  
  161.  
  162.  
  163. func isdisempty()
  164.    local  $peoplecount = -1
  165.    $lAgentArray = GetAgentArray()
  166.    For $i = 1 To $lAgentArray[0]
  167.       $aAgent = $lAgentArray[$i]
  168.       if isagenthuman($aagent) Then
  169.         $peoplecount += 1
  170.       EndIf
  171.    Next
  172.    if $peoplecount > 0 Then
  173.  
  174.       if $town = $chantry then
  175.          out("dis not empty, going toa")
  176.          $town = $toa
  177.       Else
  178.          out("dis not empty, going  chaantry")
  179.          $town = $chantry
  180.       EndIf
  181.        Return False
  182.     Else
  183.        out("dis empty")
  184.       return True
  185.    EndIf
  186.  
  187. EndFunc
  188.  
  189.  
  190.  
  191.  
  192. func isagenthuman($aagent)
  193.     if DllStructGetData($aagent,'Allegiance') <> 1 then Return
  194.     $thename = GetPlayerName($aAgent)
  195.     if $thename = "" then Return
  196.     Return True
  197. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement