Guest User

main

a guest
Sep 28th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 20.37 KB | None | 0 0
  1. #region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_UseX64=n
  3. #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
  4. #endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
  5.  
  6. Global $AttribInterop = ObjCreate("AttribVB.ClsAttribVB");
  7. #include "sequence.au3"
  8.  
  9. WinActivate("Diablo III")
  10. Sleep(300)
  11. Local $sized3 = WinGetClientSize("Diablo III")
  12. if $sized3[0] <> 800 or $sized3[1] <> 600 Then
  13. MsgBox(0, "Il faut etre en 800 x 600 et non pas :", $sized3[0] & " x " & $sized3[1])
  14. Terminate()
  15. Endif
  16.  
  17. ;;--------------------------------------------------------------------------------
  18. ;;      Initialize MouseCoords
  19. ;;--------------------------------------------------------------1------------------
  20. Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client
  21.  
  22.  
  23. ;;--------------------------------------------------------------------------------
  24. ;;      Initialize some Globals
  25. ;;--------------------------------------------------------------------------------
  26.  
  27.  
  28. Global Const $PI = 3.141593
  29. Global $Step = $PI / 6
  30.  
  31. Global $games = 1
  32. Global $gamecounter = 0
  33. Global $timeforpotion = 0
  34. Global $timeforclick = 0
  35. Global $timeforskill = 0
  36. Global $timedifmaxgamelength = 0
  37. Global $timermaxgamelength = 0
  38. Global $hotkeycheck = 0
  39. Global $area = 0
  40.  
  41. Global $Paused
  42. Global $GameOverTime = False
  43.  
  44. Global $DebugMessage
  45. Global $fichierstat = "stat_" & @YEAR & "_" & @MON & "_" & @MDAY & "-" & @HOUR &"h"& @MIN & ".txt"
  46. Global $dif_timer_stat_formater = 0
  47. Global $dif_timer_stat_moyen = 0
  48.  
  49. $DebugX = 920              ;position en X sur l'écran
  50. $DebugY = 0              ;position en Y sur l'écran
  51. $Totalruns = 1
  52. $Death = 0
  53. $RepairORsell = 0
  54. $ItemToStash = 0
  55. $ItemToSell = 0
  56. $GOLDInthepocket = 0
  57. $GOLDINI = 0
  58. $GOLD =0
  59. $GOLDMOY = 0
  60. $GF = 0
  61. $MF = 0
  62. $PR = 0
  63. $MS = 0
  64. $GOLDMOYbyH = 0
  65. $dif_timer_stat = 0
  66. $begin_timer_stat = 0
  67. $timer_stat_total = 0
  68. $timer_stat_run_moyen = 0
  69.  
  70. ;;--------------------------------------------------------------------------------
  71. ;;      Include some files
  72. ;;--------------------------------------------------------------------------------
  73. #include "settings.au3"
  74. #include "toolkit.au3"
  75.  
  76. ;;================================================================================
  77. ;; Set Some Hotkey and set our act
  78. ;;================================================================================
  79.  
  80. HotKeySet("{F2}", "Terminate")
  81. HotKeySet("{F3}", "TogglePause")
  82. SetAct()
  83.  
  84. ;;--------------------------------------------------------------------------------
  85. ;;      Initialize the offsets
  86. ;;--------------------------------------------------------------------------------
  87.     offsetlist()
  88.  
  89.  
  90. Func _dorun()
  91.  
  92.     _log("======== new run ==========")
  93.  
  94.  
  95.     While Not offsetlist()
  96.         Sleep(10)
  97.     WEnd
  98.  
  99. ;;--------------------------------------------------------------------------------
  100. ;;############# Stats by YoPens
  101. ;;--------------------------------------------------------------------------------
  102.  
  103.  
  104.  
  105.  
  106.          While 1
  107.                 IterateLocalActor()
  108.                 $foundobject = 0
  109.                 For $i = 0 To UBound($__ACTOR, 1) - 1
  110.                           If StringInStr($__ACTOR[$i][2], "GoldCoin-") Then
  111.                                  $GOLD = IterateActorAtribs($__ACTOR[$i][1], $Atrib_ItemStackQuantityLo)
  112.                                 ;ConsoleWrite("Current GOLD: " & $GOLD)
  113.                                  ExitLoop
  114.                           EndIf
  115.                 Next
  116.                 If $foundobject = 0 Then ExitLoop
  117.          WEnd
  118.  
  119.  
  120.  
  121.         If $Totalruns = 1 Then
  122.           $GOLDINI=$GOLD
  123.           $begin_timer_stat = TimerInit()
  124.           While 1
  125.                 IterateLocalActor()
  126.                 $foundobject = 0
  127.                 For $i = 0 To UBound($__ACTOR, 1) - 1
  128.                           If StringInStr($__ACTOR[$i][2], "GoldCoin-") Then
  129.                              $GF = Ceiling (IterateActorAtribs(0x77BC0000, $Atrib_Gold_Find)*100)
  130.                              $MF = Ceiling (IterateActorAtribs(0x77BC0000, $Atrib_Magic_Find)*100)
  131.                              $PR = IterateActorAtribs(0x77BC0000, $Atrib_Gold_PickUp_Radius)
  132.                              $MS = (IterateActorAtribs(0x77BC0000, $Atrib_Movement_Scalar_Capped_Total)-1)*100
  133.                              ExitLoop
  134.                           EndIf
  135.                 Next
  136.                 If $foundobject = 0 Then ExitLoop
  137.          WEnd
  138.  
  139.     Else
  140.           $GOLDInthepocket = $GOLD - $GOLDINI
  141.           $GOLDMOY = $GOLDInthepocket / ($Totalruns -1)
  142.           $dif_timer_stat = TimerDiff($begin_timer_stat)
  143.           $GOLDMOYbyH = $GOLDInthepocket * 3600000 / $dif_timer_stat
  144.         EndIf
  145.  
  146.  
  147.         _format_time($dif_timer_stat)
  148.                 $timer_stat_total = $dif_timer_stat_formater
  149.  
  150.         If $Totalruns = 1 Then
  151.                    $timer_stat_run_moyen = 0
  152.                    Else
  153.                    $dif_timer_stat_moyen = $dif_timer_stat / ($Totalruns-1)
  154.                    _format_time($dif_timer_stat_moyen)
  155.                    $timer_stat_run_moyen = $dif_timer_stat_formater
  156.         EndIf
  157.  
  158.  
  159.         $DebugMessage = "Nombre de Runs : " & $Totalruns & @CRLF
  160.         $DebugMessage = $DebugMessage & "Nombre de Mort : " & $Death & @CRLF
  161.         $DebugMessage = $DebugMessage & "Nombre de Réparation/Vente : " & $RepairORsell & @CRLF
  162.         $DebugMessage = $DebugMessage & "Nombre d'objet stocké dans le Coffre : " & $ItemToStash & @CRLF
  163.         $DebugMessage = $DebugMessage & "Nombre d'objet Vendu : " & $ItemToSell & @CRLF
  164.         $DebugMessage = $DebugMessage & "GOLD Obtenu : " & $GOLDInthepocket & @CRLF
  165.         $DebugMessage = $DebugMessage & "GOLD Moyen par run : " & Ceiling($GOLDMOY) & @CRLF
  166.         $DebugMessage = $DebugMessage & "GOLD Moyen par heure : " & Ceiling($GOLDMOYbyH) & @CRLF
  167.         $DebugMessage = $DebugMessage & "Durée Total : " & $timer_stat_total & @CRLF
  168.         $DebugMessage = $DebugMessage & "Durée moyenne d'un run: " & $timer_stat_run_moyen & @CRLF
  169.         $DebugMessage = $DebugMessage & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & @CRLF
  170.         $DebugMessage = $DebugMessage & "Statistique du Personnage : " & @CRLF
  171.         $DebugMessage = $DebugMessage & "Gold Find ( Hors Paragon & Compagnon ) : "& $GF & " %"& @CRLF
  172.         $DebugMessage = $DebugMessage & "Magic Find ( Hors Paragon & Compagnon ) : "& $MF &" %"& @CRLF
  173.         $DebugMessage = $DebugMessage & "PickUp Radius: "& $PR & @CRLF
  174.         $DebugMessage = $DebugMessage & "Movement Speed: "& $MS &" %"& @CRLF
  175.  
  176.     $MESSAGE = $DebugMessage
  177.     ToolTip($MESSAGE, $DebugX, $DebugY)
  178.  
  179.     $Totalruns = $Totalruns+1 ;compte le nombre de run
  180. ;;--------------------------------------------------------------------------------
  181. ;;############# END ########### of Stats by YoPens
  182. ;;--------------------------------------------------------------------------------
  183.  
  184.  
  185.     If $hotkeycheck = 0 Then
  186.     CheckHotkeys()
  187.     EndIf
  188.  
  189.     If _checkRepair() = True Then
  190.         _log("Need repair")
  191.         Local $intown = False
  192.         If _intown() = False Then
  193.             $intown = True
  194.             Attack($a_range, $monsterList)
  195.             Sleep(500)
  196.             $currentloc = getcurrentpos()
  197.             MoveToPos($currentloc[0] + 5, $currentloc[1] + 5, $currentloc[2], 0, 6)
  198.             _townportal()
  199.             While Not offsetlist()
  200.             Sleep(10)
  201.             WEnd
  202.     EndIf
  203.         ;MoveToPos(2903.009765625,2785.84033203125,28.0814247131348,1,20) ;act 1
  204.         ;MoveToPos(2903.009765625,2785.84033203125,28.0814247131348,1,10) ;act 1
  205.         ;MoveToPos(403.055877685547, 371.524749755859, 0.326129168272018, 0, 2) ;act3
  206.         ;MoveToPos(443.109527587891, 331.811401367188, 0.498693227767944, 0, 2) ;act3
  207.         Sleep(Random(500, 1000))
  208.         Repair($RepairVendor, $RepairTab)
  209.         Send("{SPACE}")
  210.         If $intown = True Then
  211.             ;MoveToPos(403.055877685547, 371.524749755859, 0.326129168272018, 0, 2)
  212.             ;MoveToPos(382.773223876953, 410.205902099609, 0.703640997409821, 0, 2)
  213.             Sleep(Random(500, 1000))
  214.             InteractByActorName('hearthPortal')
  215.             Sleep(Random(500, 1000))
  216.             While Not offsetlist()
  217.             Sleep(10)
  218.             WEnd
  219.         EndIf
  220.     EndIf
  221.  
  222.     Sleep(100)
  223.  
  224.  
  225.  
  226.     ;-----------------------------------------------
  227.     Buffinit()
  228.     ;-----------------------------------------------
  229. sequence()
  230.  
  231.     UnBuff()
  232.  
  233.  
  234.     _log("End Run")
  235.     Return True
  236.  
  237. EndFunc   ;==>_dorun
  238.  
  239. Func _format_time($time_milisecond)
  240.  
  241.     Local $seconde_arrondi
  242.     Local $minute
  243.     Local $seconde
  244.     Local $heure
  245.  
  246.     If( $time_milisecond < 60000 ) Then
  247.         $dif_timer_stat_formater = Round( ($time_milisecond/1000), 2 ) & " secondes"
  248.     ElseIf( ($time_milisecond >= 60000) AND ($time_milisecond < 3600000) ) Then
  249.         $seconde_arrondi = Int( $time_milisecond / 1000 )
  250.         $minute = Int( $seconde_arrondi / 60)
  251.         $seconde = Round( (($time_milisecond / 1000) - $minute*60), 0 )
  252.         $dif_timer_stat_formater = $minute & " min " & $seconde & " sec"
  253.     Else
  254.         $seconde_arrondi = Int( $time_milisecond / 1000 )
  255.         $heure = Int( $seconde_arrondi / 3600)
  256.         $minute = Int( (($seconde_arrondi - $heure*3600) / 60) )
  257.         $seconde = Round( (($time_milisecond / 1000) - $heure*3600 - $minute*60), 0)
  258.         $dif_timer_stat_formater = $heure&"h " &$minute & "m " & $seconde & "s"
  259.     EndIf
  260.  
  261.     Return $dif_timer_stat_formater
  262. EndFunc ;==>_format_time
  263.  
  264.  
  265. Func _botting()
  266.     _log("Start Botting")
  267.     $bottingtime = TimerInit()
  268.     While 1
  269.         _log("new main loop")
  270.             offsetlist()
  271.         If _onloginscreen() Then
  272.             _log("LOGIN")
  273.             Sleep(Random(60000, 120000))
  274.             ExitLoop
  275.             ;_logind3()
  276.         EndIf
  277.         If _inmenu() And _onloginscreen() = False Then
  278.             RandSleep()
  279.             _resumegame()
  280.         EndIf
  281.         While _onloginscreen() = False And _ingame() = False
  282.             _log("Ingame False")
  283.             If _checkdisconnect() Then
  284.                 _log("Disconnected")
  285.                 _randomclick(398, 349)
  286.                 Sleep(Random(30000, 45000, 1))
  287.                 _logind3()
  288.                 Sleep(Random(30000, 35000, 1))
  289.                 ;_botting()
  290.                 ExitLoop
  291.             EndIf
  292.             _resumegame()
  293.         WEnd
  294.         If _onloginscreen() = False And _playerdead() = False And _ingame() = True Then
  295.  
  296.             Global $timermaxgamelength = TimerInit()
  297.             Global $GameOverTime = False
  298.             If _dorun() = True Then
  299.             EndIf
  300.             $games += 1
  301.             $gamecounter += 1
  302.         EndIf
  303.         If _onloginscreen() = False And _intown() = False And _playerdead() = False Then
  304.             _log("start loop _onloginscreen() = False And _intown() = False And _playerdead() = False")
  305.  
  306.             Dim $nbTriesTownPortal = 0
  307.             While (_intown() = False And _inmenu() = False)
  308.                 $nbTriesTownPortal += 1
  309.                 Attack($a_range, $monsterList)
  310.                 Sleep(500)
  311.                 $currentloc = getcurrentpos()
  312.                 MoveToPos($currentloc[0] + 5, $currentloc[1] + 5, $currentloc[2], 0, 6)
  313.                 If $nbTriesTownPortal < 3 Then
  314.                     _townportal()
  315.                 Else
  316.                     _leaveGame()
  317.                     $nbTriesTownPortal = 0
  318.                     Sleep(10000)
  319.                     While _inmenu() = False
  320.                         Sleep(10)
  321.                     WEnd
  322.                     ExitLoop
  323.                 EndIf
  324.  
  325.                 If _playerdead() Then
  326.                     _log("Player dead")
  327.                     ExitLoop
  328.                 EndIf
  329.                 If _checkdisconnect() Then
  330.                     _log("Disconnected")
  331.                     _randomclick(398, 349)
  332.                     Sleep(Random(30000, 45000, 1))
  333.                     _logind3()
  334.                     Sleep(Random(30000, 35000, 1))
  335.                     _botting()
  336.                     ExitLoop
  337.                 EndIf
  338.             WEnd
  339.             RandSleep()
  340.         EndIf
  341.         If _intown() Or _playerdead() And _onloginscreen() = False Then
  342.             ;If _playerdead() = False And $games >= ($repairafterxxgames + Random(-2, 2, 1))Then
  343.             If _playerdead() = False And $games >= $repairafterxxgames Then
  344.                     While Not offsetlist()
  345.                     Sleep(10)
  346.                     WEnd
  347.                 $RepairORsell = $RepairORsell+1
  348.                 _log('Filter Backpack')
  349.                 $Items = FilterBackpack()
  350.                 ;Storage
  351.                 $ToStash = _ArrayFindAll($Items, "Stash", 0, 0, 0, 1, 3)
  352.                 If $ToStash <> -1 Then
  353.  
  354.                     Send("{SPACE}")
  355.                     ;MoveToPos(384.502319335938, 393.374298095703, 0.332142919301987, 0, 6)
  356.                     Sleep(500)
  357.                     InteractByActorName('Player_Shared_Stash')
  358.                         Sleep(700)
  359.                         Local $stashtry = 0
  360.                     While _checkStashopen() = False
  361.                         if $stashtry <= 4 then
  362.                         _log('Fail to open Stash')
  363.                         $stashtry = $stashtry + 1
  364.                         InteractByActorName("Player_Shared_Stash")
  365.                         EndIf
  366.                         if $stashtry > 4 then
  367.                         log('Failed to open Stash after 4 try')
  368.                         MsgBox(0, "Impossible d'ouvrir le stash :", "SVP, veuillez reporter ce problème sur le forum. Erreur : s001 ")
  369.                         Terminate()
  370.                         EndIf
  371.                     WEnd
  372.  
  373.                     For $i = 0 To UBound($ToStash) - 1
  374.                         _log($Items[$ToStash[$i]][0] & " stash : " & $Items[$ToStash[$i]][1])
  375.                         InventoryMove($Items[$ToStash[$i]][0], $Items[$ToStash[$i]][1])
  376.                         Sleep(Random(100, 500))
  377.                         MouseClick('Right')
  378.                         $ItemToStash = $ItemToStash + 1
  379.                     Next
  380.                     Send("{SPACE}")
  381.  
  382.                 EndIf
  383.  
  384.             ;   MoveToPos(403.055877685547, 371.524749755859, 0.326129168272018, 0, 6)
  385.             ;   MoveToPos(443.109527587891, 331.811401367188, 0.498693227767944, 0, 6)
  386.                 Sleep(Random(500, 1000))
  387.                 Repair($RepairVendor, $RepairTab)
  388.                 Send("{SPACE}")
  389.  
  390.                 ;Trash
  391.                 $ToTrash = _ArrayFindAll($Items, "Trash", 0, 0, 0, 1, 3)
  392.                 If $ToTrash <> -1 Then
  393.                     Send("{SPACE}")
  394.                     Sleep(500)
  395.                     InteractByActorName($RepairVendor)
  396.                     Sleep(700)
  397.                     Local $vendortry = 0
  398.                         While _checkVendoropen() = False
  399.                             if $vendortry <= 4 then
  400.                         _log('Fail to open vendor')
  401.                         $vendortry = $vendortry + 1
  402.                         InteractByActorName($RepairVendor)
  403.                             EndIf
  404.                             if $vendortry > 4 then
  405.                         _log('Failed to open Vendor after 4 try')
  406.                         MsgBox(0, "Impossible d'ouvrir le vendeur :", "SVP, veuillez reporter ce problème sur le forum. Erreur : v002 ")
  407.                         Terminate()
  408.                         ExitLoop
  409.                             EndIf
  410.                         WEnd
  411.  
  412.                     For $i = 0 To UBound($ToTrash) - 1
  413.                         InventoryMove($Items[$ToTrash[$i]][0], $Items[$ToTrash[$i]][1])
  414.                         Sleep(Random(100, 500))
  415.                         $ItemToSell = $ItemToSell + 1
  416.                         MouseClick('Right')
  417.                     Next
  418.                     Send("{SPACE}")
  419.                 EndIf
  420.  
  421.                 $games = 0
  422.                 ;$repairafterxxgames = Round(Random(15, 20))
  423.             EndIf
  424.             _leavegame()
  425.             If _playerdead() Then
  426.                 Sleep(Random(11000, 13000))
  427.             EndIf
  428.         EndIf
  429.         Sleep(1000)
  430.         _log('loop _inmenu() = False And _onloginscreen()')
  431.         While _inmenu() = False And _onloginscreen() = False
  432.             Sleep(10)
  433.         WEnd
  434.     WEnd
  435.  
  436. EndFunc   ;==>_botting
  437.  
  438.  
  439. Func MarkPos()
  440.     $currentloc = GetCurrentPos()
  441.     ConsoleWrite("MoveToPos(" & $currentloc[0] & ", " & $currentloc[1] & ", " & $currentloc[2] & ",1,25)" & @CRLF);
  442. EndFunc   ;==>MarkPos
  443. HotKeySet("{ù}", "MarkPos")
  444.  
  445. Func MonsterListing()
  446.     $Object = IterateObjectList(0)
  447.     $foundtarget = 0
  448.     ConsoleWrite("monster listing ===========================" & @CRLF)
  449.     For $i = 0 To UBound($Object, 1) - 1
  450.         _ArraySort($Object, 0, 0, 0, 8)
  451.         ConsoleWrite($Object[$i][2] & @CRLF)
  452.  
  453.         If $Object[$i][1] <> 0xFFFFFFFF And $Object[$i][7] <> -1 And $Object[$i][8] < 100 Then
  454.             ConsoleWrite($Object[$i][2] & @CRLF)
  455.         EndIf
  456.     Next
  457. EndFunc   ;==>MonsterListing
  458. HotKeySet("{µ}", "MonsterListing")
  459.  
  460. Func Testing()
  461. $GameOverTime=999999999999
  462. offsetlist()
  463.         If _intown() Or _playerdead() And _onloginscreen() = False Then
  464.             If _playerdead() = False Then
  465.             ;If _playerdead() = False And $games >= $repairafterxxgames Then
  466.                     While Not offsetlist()
  467.                     Sleep(10)
  468.                     WEnd
  469.                 $RepairORsell = $RepairORsell+1
  470.                 _log('Filter Backpack')
  471.                 $Items = FilterBackpack()
  472.                 ;Storage
  473.                 $ToStash = _ArrayFindAll($Items, "Stash", 0, 0, 0, 1, 3)
  474.                 If $ToStash <> -1 Then
  475.  
  476.                     Send("{SPACE}")
  477.                     ;MoveToPos(384.502319335938, 393.374298095703, 0.332142919301987, 0, 6)
  478.                     Sleep(500)
  479.                     InteractByActorName('Player_Shared_Stash')
  480.                         Sleep(700)
  481.                         Local $stashtry = 0
  482.                     While _checkStashopen() = False
  483.                         if $stashtry <= 4 then
  484.                         _log('Fail to open Stash')
  485.                         $stashtry = $stashtry + 1
  486.                         InteractByActorName("Player_Shared_Stash")
  487.                         EndIf
  488.                         if $stashtry > 4 then
  489.                         log('Failed to open Stash after 4 try')
  490.                         MsgBox(0, "Impossible d'ouvrir le stash :", "SVP, veuillez reporter ce problème sur le forum. Erreur : s001 ")
  491.                         Terminate()
  492.                         EndIf
  493.                     WEnd
  494.  
  495.                     For $i = 0 To UBound($ToStash) - 1
  496.                         _log($Items[$ToStash[$i]][0] & " stash : " & $Items[$ToStash[$i]][1])
  497.                         InventoryMove($Items[$ToStash[$i]][0], $Items[$ToStash[$i]][1])
  498.                         Sleep(Random(100, 500))
  499.                         MouseClick('Right')
  500.                         $ItemToStash = $ItemToStash + 1
  501.                     Next
  502.                     Send("{SPACE}")
  503.  
  504.                 EndIf
  505.  
  506.             ;   MoveToPos(403.055877685547, 371.524749755859, 0.326129168272018, 0, 6)
  507.             ;   MoveToPos(443.109527587891, 331.811401367188, 0.498693227767944, 0, 6)
  508.                 Sleep(Random(500, 1000))
  509.                 Repair($RepairVendor, $RepairTab)
  510.                 Send("{SPACE}")
  511.  
  512.                 ;Trash
  513.                 $ToTrash = _ArrayFindAll($Items, "Trash", 0, 0, 0, 1, 3)
  514.                 If $ToTrash <> -1 Then
  515.                     Send("{SPACE}")
  516.                     Sleep(500)
  517.                     InteractByActorName($RepairVendor)
  518.                     Sleep(700)
  519.                     Local $vendortry = 0
  520.                         While _checkVendoropen() = False
  521.                             if $vendortry <= 4 then
  522.                         _log('Fail to open vendor')
  523.                         $vendortry = $vendortry + 1
  524.                         InteractByActorName($RepairVendor)
  525.                             EndIf
  526.                             if $vendortry > 4 then
  527.                         _log('Failed to open Vendor after 4 try')
  528.                         MsgBox(0, "Impossible d'ouvrir le vendeur :", "SVP, veuillez reporter ce problème sur le forum. Erreur : v002 ")
  529.                         Terminate()
  530.                         ExitLoop
  531.                             EndIf
  532.                         WEnd
  533.  
  534.                     For $i = 0 To UBound($ToTrash) - 1
  535.                         InventoryMove($Items[$ToTrash[$i]][0], $Items[$ToTrash[$i]][1])
  536.                         Sleep(Random(100, 500))
  537.                         $ItemToSell = $ItemToSell + 1
  538.                         MouseClick('Right')
  539.                     Next
  540.                     Send("{SPACE}")
  541.                 EndIf
  542.  
  543.                 $games = 0
  544.                 ;$repairafterxxgames = Round(Random(15, 20))
  545.             EndIf
  546.  
  547.         EndIf
  548. EndFunc   ;==>Testing
  549. HotKeySet("{x}", "Testing")
  550.  
  551.  
  552. if $Devmode <> "true" Then
  553. _botting()
  554. Endif
  555.  
  556. While 1
  557. WEnd
  558.  
  559. ;;--------------------------------------------------------------------------------
  560. ;;     Check KeyTo avoid sell of equiped stuff
  561. ;;--------------------------------------------------------------------------------
  562. Func CheckHotkeys()
  563. sleep(500)
  564. Send("i")
  565. sleep(100)
  566. if _checkInventoryopen() = False Then
  567. MsgBox(0, "Mauvais Hotkey" ,"La touche pour ouvrir l'inventaire doit être i" & @CRLF)
  568. Terminate()
  569. EndIf
  570. sleep(100)
  571. Send("{SPACE}") ; make sure we close everything
  572. if _checkInventoryopen() = True Then
  573. MsgBox(0, "Mauvais Hotkey" ,"La touche pour fermer l'inventaire doit être ESPACE" & @CRLF)
  574. Terminate()
  575. EndIf
  576. ConsoleWrite("Check des touches OK" & @CRLF)
  577. $hotkeycheck = 1
  578. EndFunc   ;==>CheckHotkeys
  579.  
  580. ;;--------------------------------------------------------------------------------
  581. ;;     SetAct : change repair vendor and tab according to the act specified in settings
  582. ;;--------------------------------------------------------------------------------
  583. Func SetAct()
  584.     Switch $Act
  585.         Case 1
  586.             Global $RepairVendor = "UniqueVendor_miner_InTown"
  587.             Global $RepairTab = 2
  588.         Case 2
  589.             Global $RepairVendor = "UniqueVendor_Peddler_InTown" ; act 2 fillette
  590.             Global $RepairTab = 3
  591.         Case 3
  592.             Global $RepairVendor = "UniqueVendor_Collector_InTown" ; act 3
  593.             Global $RepairTab = 3
  594.         Case 4
  595.             Global $RepairVendor = "UniqueVendor_Collector_InTown" ; act 3
  596.             Global $RepairTab = 3
  597.     EndSwitch
  598. EndFunc   ;==>SetAct
  599.  
  600.  
  601.  
  602.  
  603. ;;--------------------------------------------------------------------------------
  604. ;;     Initialise Buffs while in training Area
  605. ;;--------------------------------------------------------------------------------
  606. Func Buffinit()
  607.  
  608.  If $delaiBuff1 then
  609.     AdlibRegister("buff1", $delaiBuff1 * Random(1, 1.2))
  610.     buff1()
  611.  EndIf
  612.  if $PreBuff1 = "true" Then
  613.     buff1()
  614.     sleep(150)
  615.  EndIf
  616.  
  617.  If $delaiBuff2 then
  618.     AdlibRegister("buff2", $delaiBuff2 * Random(1, 1.2))
  619.     buff2()
  620.  EndIf
  621.  if $PreBuff2 = "true" Then
  622.     buff2()
  623.     sleep(150)
  624. EndIf
  625.  
  626.  If $delaiBuff3 then
  627.     AdlibRegister("buff3", $delaiBuff3 * Random(1, 1.2))
  628.     buff3()
  629.  EndIf
  630.  if $PreBuff3 = "true" Then
  631.     buff3()
  632.     sleep(150)
  633. EndIf
  634.  
  635.  If $delaiBuff4 then
  636.     AdlibRegister("buff4", $delaiBuff1 * Random(1, 1.2))
  637.     buff4()
  638.  EndIf
  639.  if $PreBuff4 = "true" Then
  640.     buff4()
  641.     sleep(150)
  642.  EndIf
  643.  
  644. EndFunc   ;==>Buffinit
  645.  
  646.  
  647.  
  648. ;;--------------------------------------------------------------------------------
  649. ;;     Stop All buff timers
  650. ;;--------------------------------------------------------------------------------
  651. Func UnBuff()
  652.     If $delaiBuff1 then
  653.     AdlibUnRegister("buff1")
  654.     Endif
  655.     If $delaiBuff2 then
  656.     AdlibUnRegister("buff2")
  657.     Endif
  658.     If $delaiBuff3 then
  659.     AdlibUnRegister("buff3")
  660.     Endif
  661.     If $delaiBuff4 then
  662.     AdlibUnRegister("buff4")
  663.     Endif
  664. EndFunc   ;==>UnBuff
  665.  
  666.  
  667.  
  668.  
  669. Func buff1()
  670.     Send($ToucheBuff1)
  671. EndFunc   ;==>buff1
  672.  
  673. Func buff2()
  674.     Send($ToucheBuff2)
  675. EndFunc   ;==>buff2
  676.  
  677. Func buff3()
  678.     Send($ToucheBuff3)
  679. EndFunc   ;==>buff3
  680.  
  681. Func buff4()
  682.     Send($ToucheBuff4)
  683. EndFunc   ;==>buff4
Advertisement
Add Comment
Please, Sign In to add comment