Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_UseX64=n
- #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
- #endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
- Global $AttribInterop = ObjCreate("AttribVB.ClsAttribVB");
- #include "sequence.au3"
- WinActivate("Diablo III")
- Sleep(300)
- Local $sized3 = WinGetClientSize("Diablo III")
- if $sized3[0] <> 800 or $sized3[1] <> 600 Then
- MsgBox(0, "Il faut etre en 800 x 600 et non pas :", $sized3[0] & " x " & $sized3[1])
- Terminate()
- Endif
- ;;--------------------------------------------------------------------------------
- ;; Initialize MouseCoords
- ;;--------------------------------------------------------------1------------------
- Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client
- ;;--------------------------------------------------------------------------------
- ;; Initialize some Globals
- ;;--------------------------------------------------------------------------------
- Global Const $PI = 3.141593
- Global $Step = $PI / 6
- Global $games = 1
- Global $gamecounter = 0
- Global $timeforpotion = 0
- Global $timeforclick = 0
- Global $timeforskill = 0
- Global $timedifmaxgamelength = 0
- Global $timermaxgamelength = 0
- Global $hotkeycheck = 0
- Global $area = 0
- Global $Paused
- Global $GameOverTime = False
- Global $DebugMessage
- Global $fichierstat = "stat_" & @YEAR & "_" & @MON & "_" & @MDAY & "-" & @HOUR &"h"& @MIN & ".txt"
- Global $dif_timer_stat_formater = 0
- Global $dif_timer_stat_moyen = 0
- $DebugX = 920 ;position en X sur l'écran
- $DebugY = 0 ;position en Y sur l'écran
- $Totalruns = 1
- $Death = 0
- $RepairORsell = 0
- $ItemToStash = 0
- $ItemToSell = 0
- $GOLDInthepocket = 0
- $GOLDINI = 0
- $GOLD =0
- $GOLDMOY = 0
- $GF = 0
- $MF = 0
- $PR = 0
- $MS = 0
- $GOLDMOYbyH = 0
- $dif_timer_stat = 0
- $begin_timer_stat = 0
- $timer_stat_total = 0
- $timer_stat_run_moyen = 0
- ;;--------------------------------------------------------------------------------
- ;; Include some files
- ;;--------------------------------------------------------------------------------
- #include "settings.au3"
- #include "toolkit.au3"
- ;;================================================================================
- ;; Set Some Hotkey and set our act
- ;;================================================================================
- HotKeySet("{F2}", "Terminate")
- HotKeySet("{F3}", "TogglePause")
- SetAct()
- ;;--------------------------------------------------------------------------------
- ;; Initialize the offsets
- ;;--------------------------------------------------------------------------------
- offsetlist()
- Func _dorun()
- _log("======== new run ==========")
- While Not offsetlist()
- Sleep(10)
- WEnd
- ;;--------------------------------------------------------------------------------
- ;;############# Stats by YoPens
- ;;--------------------------------------------------------------------------------
- While 1
- IterateLocalActor()
- $foundobject = 0
- For $i = 0 To UBound($__ACTOR, 1) - 1
- If StringInStr($__ACTOR[$i][2], "GoldCoin-") Then
- $GOLD = IterateActorAtribs($__ACTOR[$i][1], $Atrib_ItemStackQuantityLo)
- ;ConsoleWrite("Current GOLD: " & $GOLD)
- ExitLoop
- EndIf
- Next
- If $foundobject = 0 Then ExitLoop
- WEnd
- If $Totalruns = 1 Then
- $GOLDINI=$GOLD
- $begin_timer_stat = TimerInit()
- While 1
- IterateLocalActor()
- $foundobject = 0
- For $i = 0 To UBound($__ACTOR, 1) - 1
- If StringInStr($__ACTOR[$i][2], "GoldCoin-") Then
- $GF = Ceiling (IterateActorAtribs(0x77BC0000, $Atrib_Gold_Find)*100)
- $MF = Ceiling (IterateActorAtribs(0x77BC0000, $Atrib_Magic_Find)*100)
- $PR = IterateActorAtribs(0x77BC0000, $Atrib_Gold_PickUp_Radius)
- $MS = (IterateActorAtribs(0x77BC0000, $Atrib_Movement_Scalar_Capped_Total)-1)*100
- ExitLoop
- EndIf
- Next
- If $foundobject = 0 Then ExitLoop
- WEnd
- Else
- $GOLDInthepocket = $GOLD - $GOLDINI
- $GOLDMOY = $GOLDInthepocket / ($Totalruns -1)
- $dif_timer_stat = TimerDiff($begin_timer_stat)
- $GOLDMOYbyH = $GOLDInthepocket * 3600000 / $dif_timer_stat
- EndIf
- _format_time($dif_timer_stat)
- $timer_stat_total = $dif_timer_stat_formater
- If $Totalruns = 1 Then
- $timer_stat_run_moyen = 0
- Else
- $dif_timer_stat_moyen = $dif_timer_stat / ($Totalruns-1)
- _format_time($dif_timer_stat_moyen)
- $timer_stat_run_moyen = $dif_timer_stat_formater
- EndIf
- $DebugMessage = "Nombre de Runs : " & $Totalruns & @CRLF
- $DebugMessage = $DebugMessage & "Nombre de Mort : " & $Death & @CRLF
- $DebugMessage = $DebugMessage & "Nombre de Réparation/Vente : " & $RepairORsell & @CRLF
- $DebugMessage = $DebugMessage & "Nombre d'objet stocké dans le Coffre : " & $ItemToStash & @CRLF
- $DebugMessage = $DebugMessage & "Nombre d'objet Vendu : " & $ItemToSell & @CRLF
- $DebugMessage = $DebugMessage & "GOLD Obtenu : " & $GOLDInthepocket & @CRLF
- $DebugMessage = $DebugMessage & "GOLD Moyen par run : " & Ceiling($GOLDMOY) & @CRLF
- $DebugMessage = $DebugMessage & "GOLD Moyen par heure : " & Ceiling($GOLDMOYbyH) & @CRLF
- $DebugMessage = $DebugMessage & "Durée Total : " & $timer_stat_total & @CRLF
- $DebugMessage = $DebugMessage & "Durée moyenne d'un run: " & $timer_stat_run_moyen & @CRLF
- $DebugMessage = $DebugMessage & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & @CRLF
- $DebugMessage = $DebugMessage & "Statistique du Personnage : " & @CRLF
- $DebugMessage = $DebugMessage & "Gold Find ( Hors Paragon & Compagnon ) : "& $GF & " %"& @CRLF
- $DebugMessage = $DebugMessage & "Magic Find ( Hors Paragon & Compagnon ) : "& $MF &" %"& @CRLF
- $DebugMessage = $DebugMessage & "PickUp Radius: "& $PR & @CRLF
- $DebugMessage = $DebugMessage & "Movement Speed: "& $MS &" %"& @CRLF
- $MESSAGE = $DebugMessage
- ToolTip($MESSAGE, $DebugX, $DebugY)
- $Totalruns = $Totalruns+1 ;compte le nombre de run
- ;;--------------------------------------------------------------------------------
- ;;############# END ########### of Stats by YoPens
- ;;--------------------------------------------------------------------------------
- If $hotkeycheck = 0 Then
- CheckHotkeys()
- EndIf
- If _checkRepair() = True Then
- _log("Need repair")
- Local $intown = False
- If _intown() = False Then
- $intown = True
- Attack($a_range, $monsterList)
- Sleep(500)
- $currentloc = getcurrentpos()
- MoveToPos($currentloc[0] + 5, $currentloc[1] + 5, $currentloc[2], 0, 6)
- _townportal()
- While Not offsetlist()
- Sleep(10)
- WEnd
- EndIf
- ;MoveToPos(2903.009765625,2785.84033203125,28.0814247131348,1,20) ;act 1
- ;MoveToPos(2903.009765625,2785.84033203125,28.0814247131348,1,10) ;act 1
- ;MoveToPos(403.055877685547, 371.524749755859, 0.326129168272018, 0, 2) ;act3
- ;MoveToPos(443.109527587891, 331.811401367188, 0.498693227767944, 0, 2) ;act3
- Sleep(Random(500, 1000))
- Repair($RepairVendor, $RepairTab)
- Send("{SPACE}")
- If $intown = True Then
- ;MoveToPos(403.055877685547, 371.524749755859, 0.326129168272018, 0, 2)
- ;MoveToPos(382.773223876953, 410.205902099609, 0.703640997409821, 0, 2)
- Sleep(Random(500, 1000))
- InteractByActorName('hearthPortal')
- Sleep(Random(500, 1000))
- While Not offsetlist()
- Sleep(10)
- WEnd
- EndIf
- EndIf
- Sleep(100)
- ;-----------------------------------------------
- Buffinit()
- ;-----------------------------------------------
- sequence()
- UnBuff()
- _log("End Run")
- Return True
- EndFunc ;==>_dorun
- Func _format_time($time_milisecond)
- Local $seconde_arrondi
- Local $minute
- Local $seconde
- Local $heure
- If( $time_milisecond < 60000 ) Then
- $dif_timer_stat_formater = Round( ($time_milisecond/1000), 2 ) & " secondes"
- ElseIf( ($time_milisecond >= 60000) AND ($time_milisecond < 3600000) ) Then
- $seconde_arrondi = Int( $time_milisecond / 1000 )
- $minute = Int( $seconde_arrondi / 60)
- $seconde = Round( (($time_milisecond / 1000) - $minute*60), 0 )
- $dif_timer_stat_formater = $minute & " min " & $seconde & " sec"
- Else
- $seconde_arrondi = Int( $time_milisecond / 1000 )
- $heure = Int( $seconde_arrondi / 3600)
- $minute = Int( (($seconde_arrondi - $heure*3600) / 60) )
- $seconde = Round( (($time_milisecond / 1000) - $heure*3600 - $minute*60), 0)
- $dif_timer_stat_formater = $heure&"h " &$minute & "m " & $seconde & "s"
- EndIf
- Return $dif_timer_stat_formater
- EndFunc ;==>_format_time
- Func _botting()
- _log("Start Botting")
- $bottingtime = TimerInit()
- While 1
- _log("new main loop")
- offsetlist()
- If _onloginscreen() Then
- _log("LOGIN")
- Sleep(Random(60000, 120000))
- ExitLoop
- ;_logind3()
- EndIf
- If _inmenu() And _onloginscreen() = False Then
- RandSleep()
- _resumegame()
- EndIf
- While _onloginscreen() = False And _ingame() = False
- _log("Ingame False")
- If _checkdisconnect() Then
- _log("Disconnected")
- _randomclick(398, 349)
- Sleep(Random(30000, 45000, 1))
- _logind3()
- Sleep(Random(30000, 35000, 1))
- ;_botting()
- ExitLoop
- EndIf
- _resumegame()
- WEnd
- If _onloginscreen() = False And _playerdead() = False And _ingame() = True Then
- Global $timermaxgamelength = TimerInit()
- Global $GameOverTime = False
- If _dorun() = True Then
- EndIf
- $games += 1
- $gamecounter += 1
- EndIf
- If _onloginscreen() = False And _intown() = False And _playerdead() = False Then
- _log("start loop _onloginscreen() = False And _intown() = False And _playerdead() = False")
- Dim $nbTriesTownPortal = 0
- While (_intown() = False And _inmenu() = False)
- $nbTriesTownPortal += 1
- Attack($a_range, $monsterList)
- Sleep(500)
- $currentloc = getcurrentpos()
- MoveToPos($currentloc[0] + 5, $currentloc[1] + 5, $currentloc[2], 0, 6)
- If $nbTriesTownPortal < 3 Then
- _townportal()
- Else
- _leaveGame()
- $nbTriesTownPortal = 0
- Sleep(10000)
- While _inmenu() = False
- Sleep(10)
- WEnd
- ExitLoop
- EndIf
- If _playerdead() Then
- _log("Player dead")
- ExitLoop
- EndIf
- If _checkdisconnect() Then
- _log("Disconnected")
- _randomclick(398, 349)
- Sleep(Random(30000, 45000, 1))
- _logind3()
- Sleep(Random(30000, 35000, 1))
- _botting()
- ExitLoop
- EndIf
- WEnd
- RandSleep()
- EndIf
- If _intown() Or _playerdead() And _onloginscreen() = False Then
- ;If _playerdead() = False And $games >= ($repairafterxxgames + Random(-2, 2, 1))Then
- If _playerdead() = False And $games >= $repairafterxxgames Then
- While Not offsetlist()
- Sleep(10)
- WEnd
- $RepairORsell = $RepairORsell+1
- _log('Filter Backpack')
- $Items = FilterBackpack()
- ;Storage
- $ToStash = _ArrayFindAll($Items, "Stash", 0, 0, 0, 1, 3)
- If $ToStash <> -1 Then
- Send("{SPACE}")
- ;MoveToPos(384.502319335938, 393.374298095703, 0.332142919301987, 0, 6)
- Sleep(500)
- InteractByActorName('Player_Shared_Stash')
- Sleep(700)
- Local $stashtry = 0
- While _checkStashopen() = False
- if $stashtry <= 4 then
- _log('Fail to open Stash')
- $stashtry = $stashtry + 1
- InteractByActorName("Player_Shared_Stash")
- EndIf
- if $stashtry > 4 then
- log('Failed to open Stash after 4 try')
- MsgBox(0, "Impossible d'ouvrir le stash :", "SVP, veuillez reporter ce problème sur le forum. Erreur : s001 ")
- Terminate()
- EndIf
- WEnd
- For $i = 0 To UBound($ToStash) - 1
- _log($Items[$ToStash[$i]][0] & " stash : " & $Items[$ToStash[$i]][1])
- InventoryMove($Items[$ToStash[$i]][0], $Items[$ToStash[$i]][1])
- Sleep(Random(100, 500))
- MouseClick('Right')
- $ItemToStash = $ItemToStash + 1
- Next
- Send("{SPACE}")
- EndIf
- ; MoveToPos(403.055877685547, 371.524749755859, 0.326129168272018, 0, 6)
- ; MoveToPos(443.109527587891, 331.811401367188, 0.498693227767944, 0, 6)
- Sleep(Random(500, 1000))
- Repair($RepairVendor, $RepairTab)
- Send("{SPACE}")
- ;Trash
- $ToTrash = _ArrayFindAll($Items, "Trash", 0, 0, 0, 1, 3)
- If $ToTrash <> -1 Then
- Send("{SPACE}")
- Sleep(500)
- InteractByActorName($RepairVendor)
- Sleep(700)
- Local $vendortry = 0
- While _checkVendoropen() = False
- if $vendortry <= 4 then
- _log('Fail to open vendor')
- $vendortry = $vendortry + 1
- InteractByActorName($RepairVendor)
- EndIf
- if $vendortry > 4 then
- _log('Failed to open Vendor after 4 try')
- MsgBox(0, "Impossible d'ouvrir le vendeur :", "SVP, veuillez reporter ce problème sur le forum. Erreur : v002 ")
- Terminate()
- ExitLoop
- EndIf
- WEnd
- For $i = 0 To UBound($ToTrash) - 1
- InventoryMove($Items[$ToTrash[$i]][0], $Items[$ToTrash[$i]][1])
- Sleep(Random(100, 500))
- $ItemToSell = $ItemToSell + 1
- MouseClick('Right')
- Next
- Send("{SPACE}")
- EndIf
- $games = 0
- ;$repairafterxxgames = Round(Random(15, 20))
- EndIf
- _leavegame()
- If _playerdead() Then
- Sleep(Random(11000, 13000))
- EndIf
- EndIf
- Sleep(1000)
- _log('loop _inmenu() = False And _onloginscreen()')
- While _inmenu() = False And _onloginscreen() = False
- Sleep(10)
- WEnd
- WEnd
- EndFunc ;==>_botting
- Func MarkPos()
- $currentloc = GetCurrentPos()
- ConsoleWrite("MoveToPos(" & $currentloc[0] & ", " & $currentloc[1] & ", " & $currentloc[2] & ",1,25)" & @CRLF);
- EndFunc ;==>MarkPos
- HotKeySet("{ù}", "MarkPos")
- Func MonsterListing()
- $Object = IterateObjectList(0)
- $foundtarget = 0
- ConsoleWrite("monster listing ===========================" & @CRLF)
- For $i = 0 To UBound($Object, 1) - 1
- _ArraySort($Object, 0, 0, 0, 8)
- ConsoleWrite($Object[$i][2] & @CRLF)
- If $Object[$i][1] <> 0xFFFFFFFF And $Object[$i][7] <> -1 And $Object[$i][8] < 100 Then
- ConsoleWrite($Object[$i][2] & @CRLF)
- EndIf
- Next
- EndFunc ;==>MonsterListing
- HotKeySet("{µ}", "MonsterListing")
- Func Testing()
- $GameOverTime=999999999999
- offsetlist()
- If _intown() Or _playerdead() And _onloginscreen() = False Then
- If _playerdead() = False Then
- ;If _playerdead() = False And $games >= $repairafterxxgames Then
- While Not offsetlist()
- Sleep(10)
- WEnd
- $RepairORsell = $RepairORsell+1
- _log('Filter Backpack')
- $Items = FilterBackpack()
- ;Storage
- $ToStash = _ArrayFindAll($Items, "Stash", 0, 0, 0, 1, 3)
- If $ToStash <> -1 Then
- Send("{SPACE}")
- ;MoveToPos(384.502319335938, 393.374298095703, 0.332142919301987, 0, 6)
- Sleep(500)
- InteractByActorName('Player_Shared_Stash')
- Sleep(700)
- Local $stashtry = 0
- While _checkStashopen() = False
- if $stashtry <= 4 then
- _log('Fail to open Stash')
- $stashtry = $stashtry + 1
- InteractByActorName("Player_Shared_Stash")
- EndIf
- if $stashtry > 4 then
- log('Failed to open Stash after 4 try')
- MsgBox(0, "Impossible d'ouvrir le stash :", "SVP, veuillez reporter ce problème sur le forum. Erreur : s001 ")
- Terminate()
- EndIf
- WEnd
- For $i = 0 To UBound($ToStash) - 1
- _log($Items[$ToStash[$i]][0] & " stash : " & $Items[$ToStash[$i]][1])
- InventoryMove($Items[$ToStash[$i]][0], $Items[$ToStash[$i]][1])
- Sleep(Random(100, 500))
- MouseClick('Right')
- $ItemToStash = $ItemToStash + 1
- Next
- Send("{SPACE}")
- EndIf
- ; MoveToPos(403.055877685547, 371.524749755859, 0.326129168272018, 0, 6)
- ; MoveToPos(443.109527587891, 331.811401367188, 0.498693227767944, 0, 6)
- Sleep(Random(500, 1000))
- Repair($RepairVendor, $RepairTab)
- Send("{SPACE}")
- ;Trash
- $ToTrash = _ArrayFindAll($Items, "Trash", 0, 0, 0, 1, 3)
- If $ToTrash <> -1 Then
- Send("{SPACE}")
- Sleep(500)
- InteractByActorName($RepairVendor)
- Sleep(700)
- Local $vendortry = 0
- While _checkVendoropen() = False
- if $vendortry <= 4 then
- _log('Fail to open vendor')
- $vendortry = $vendortry + 1
- InteractByActorName($RepairVendor)
- EndIf
- if $vendortry > 4 then
- _log('Failed to open Vendor after 4 try')
- MsgBox(0, "Impossible d'ouvrir le vendeur :", "SVP, veuillez reporter ce problème sur le forum. Erreur : v002 ")
- Terminate()
- ExitLoop
- EndIf
- WEnd
- For $i = 0 To UBound($ToTrash) - 1
- InventoryMove($Items[$ToTrash[$i]][0], $Items[$ToTrash[$i]][1])
- Sleep(Random(100, 500))
- $ItemToSell = $ItemToSell + 1
- MouseClick('Right')
- Next
- Send("{SPACE}")
- EndIf
- $games = 0
- ;$repairafterxxgames = Round(Random(15, 20))
- EndIf
- EndIf
- EndFunc ;==>Testing
- HotKeySet("{x}", "Testing")
- if $Devmode <> "true" Then
- _botting()
- Endif
- While 1
- WEnd
- ;;--------------------------------------------------------------------------------
- ;; Check KeyTo avoid sell of equiped stuff
- ;;--------------------------------------------------------------------------------
- Func CheckHotkeys()
- sleep(500)
- Send("i")
- sleep(100)
- if _checkInventoryopen() = False Then
- MsgBox(0, "Mauvais Hotkey" ,"La touche pour ouvrir l'inventaire doit être i" & @CRLF)
- Terminate()
- EndIf
- sleep(100)
- Send("{SPACE}") ; make sure we close everything
- if _checkInventoryopen() = True Then
- MsgBox(0, "Mauvais Hotkey" ,"La touche pour fermer l'inventaire doit être ESPACE" & @CRLF)
- Terminate()
- EndIf
- ConsoleWrite("Check des touches OK" & @CRLF)
- $hotkeycheck = 1
- EndFunc ;==>CheckHotkeys
- ;;--------------------------------------------------------------------------------
- ;; SetAct : change repair vendor and tab according to the act specified in settings
- ;;--------------------------------------------------------------------------------
- Func SetAct()
- Switch $Act
- Case 1
- Global $RepairVendor = "UniqueVendor_miner_InTown"
- Global $RepairTab = 2
- Case 2
- Global $RepairVendor = "UniqueVendor_Peddler_InTown" ; act 2 fillette
- Global $RepairTab = 3
- Case 3
- Global $RepairVendor = "UniqueVendor_Collector_InTown" ; act 3
- Global $RepairTab = 3
- Case 4
- Global $RepairVendor = "UniqueVendor_Collector_InTown" ; act 3
- Global $RepairTab = 3
- EndSwitch
- EndFunc ;==>SetAct
- ;;--------------------------------------------------------------------------------
- ;; Initialise Buffs while in training Area
- ;;--------------------------------------------------------------------------------
- Func Buffinit()
- If $delaiBuff1 then
- AdlibRegister("buff1", $delaiBuff1 * Random(1, 1.2))
- buff1()
- EndIf
- if $PreBuff1 = "true" Then
- buff1()
- sleep(150)
- EndIf
- If $delaiBuff2 then
- AdlibRegister("buff2", $delaiBuff2 * Random(1, 1.2))
- buff2()
- EndIf
- if $PreBuff2 = "true" Then
- buff2()
- sleep(150)
- EndIf
- If $delaiBuff3 then
- AdlibRegister("buff3", $delaiBuff3 * Random(1, 1.2))
- buff3()
- EndIf
- if $PreBuff3 = "true" Then
- buff3()
- sleep(150)
- EndIf
- If $delaiBuff4 then
- AdlibRegister("buff4", $delaiBuff1 * Random(1, 1.2))
- buff4()
- EndIf
- if $PreBuff4 = "true" Then
- buff4()
- sleep(150)
- EndIf
- EndFunc ;==>Buffinit
- ;;--------------------------------------------------------------------------------
- ;; Stop All buff timers
- ;;--------------------------------------------------------------------------------
- Func UnBuff()
- If $delaiBuff1 then
- AdlibUnRegister("buff1")
- Endif
- If $delaiBuff2 then
- AdlibUnRegister("buff2")
- Endif
- If $delaiBuff3 then
- AdlibUnRegister("buff3")
- Endif
- If $delaiBuff4 then
- AdlibUnRegister("buff4")
- Endif
- EndFunc ;==>UnBuff
- Func buff1()
- Send($ToucheBuff1)
- EndFunc ;==>buff1
- Func buff2()
- Send($ToucheBuff2)
- EndFunc ;==>buff2
- Func buff3()
- Send($ToucheBuff3)
- EndFunc ;==>buff3
- Func buff4()
- Send($ToucheBuff4)
- EndFunc ;==>buff4
Advertisement
Add Comment
Please, Sign In to add comment