# \[Fonction\] Recycler Les Items Bot (8.1)

**URL:** <https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993>\
**Category:** Assistance Bot & Programmes\
**Created:** [Mai 17, 2013, 12:27 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993 "2013-05-17T12:27:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![math95](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/m/ad7895/32.png) [@math95](https://forum.gmstemple.com/u/math95)\
**Post date:** [Mai 17, 2013, 12:27 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/1 "2013-05-17T12:27:36Z")

</div>

Bonjours a tous   
  
j'aimerais rajouter la Fonction Recycler avec le live qui identifie les rare et légendaire   
  
j'ai chercher sur le forum j'ai trouver une fonction mes elle utilise l'ancien méthode   
  
[[Fonction] Recycler Les Items (7.2A)](https://forum.gmstemple.com/t/11846)  
  
mes elle fonction très bien même depuis la mise a jours   
  
j'aurais voulu avoir des info sur les ligne a modifier  
  
je vous remerci d’avance

---

<div class="post-metadata">

**Author:** ![Neodream](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/n/e47774/32.png) [@Neodream](https://forum.gmstemple.com/u/Neodream)\
**Post date:** [Mai 22, 2013, 3:35 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/2 "2013-05-22T15:35:43Z")

</div>

Bonjour bonjour,  
  
Alors voilà, je sais je ne suis pas passé par la section présentation, je suis ancien informaticien en reconversion qui aime beaucoup votre travail !  
J'avais testé votre bot sous D2 en offline il n'y a pas si lgtps et c'était assez fou ce que vous réussissiez à faire.  
Bref on est dans un topic sur le recycle... Alors voilà simplement comment faire pour la version 8.1 du bot, je vais essayer d'expliquer simplement.   
  
J'aimerais avoir des retours car flémar de tester en debug mes tests se font en jeu, en mettant tout simplement la fonction repairafterxxgames dans le setting à 1, comme ça j'observe le comportement du bot.  
Actuellement je suis sûr que cela fonctionne dans les cas suivants :  
  
-Action automatique du bot suite au repairafterxxgames  
-Inventaire plein  
  
Alors effectivement suite à mes premiers tests je l'ai vu parfaitement réaliser ce qu'il fallait l'inventaire plein, mais je l'ai choppé à déco au lieu de reprendre le tp le petit coquin, donc si l'un d'entre-vous trouve d'où cela peut venir. Je suis déjà en train d'y jeter un oeil. D'ailleurs si vous chercher là où la vérification du if plante c'est sur la fonction TpRepairAndBack, vu que je n'ai pas eu le temps de tester mes modifications sur cette fonction je préfère ne pas vous faire part de conneries.  
  
Bon maintenant que j'ai expliqué à vos risques et périls l'utilisation de ce code très très inspiré du code utilisé pour la version 7.2, voici ce que votre bot doit normalement réaliser :  
-tp en ville  
-book of cain ( + vérification des items in avec grablist)  
-coffre  
-recycle  
-répare  
-vends  
-ouvre l'inventaire, je crois que cette étape passe en un clin d’œil, j'ai du oublié un ou deux Sleep ^^ ( pour vérification des items avec grablist)  
-coffre (Dépose nos belles petites fioles/sabots/oeil etc.)  
-reviens en zone/quitte  
  
Maintenant vous vous demandé mais comment faire ? Alors j'ai vu une méthode tout d'abord pour obtenir une variable modifiable recycle à true or false que l'on peut implémenter dans le setting.au3 [ici](https://forum.gmstemple.com/t/11846), mais je ne vois pas comment l'utiliser dans le code en lui même pour qu'il choisisse par la suite de recycler ou de revendre, alors faites une copie de votre dossier du bot avant de faire les manips suivantes. ![:)](https://forum.gmstemple.com/uploads/default/original/2X/f/f31646767a12ff3f4d6b8c4766d2ea41b23d4ab9.gif)  
  
Dans le toolkit.au3 :  
  
-Remplacer la fonction FilterBackPack par :  

> **Spoiler**
>
> Func FilterBackpack()  
>   
> $Uni\_manuel = false  
> Local $\_\_ACDACTOR = triBackPack(IterateBackpack(0))  
> Local $iMax = UBound($\_\_ACDACTOR)  
>   
> If $iMax \> 0 Then  
>   
> Local $return[$iMax][4]  
>   
> Send("{SPACE}") ; make sure we close everything  
> Send("i") ; open the inventory  
> Sleep(100)  
>   
> CheckWindowD3Size()  
> \_checkbackpacksize()  
>   
> For $i = 0 To $iMax - 1 ;c'est ici que l'on parcour (tours a tours) l'ensemble des items contenut dans notres bag  
>   
> $ACD = GetACDOffsetByACDGUID($\_\_ACDACTOR[$i][0])  
> $CurrentIdAttrib = \_memoryread($ACD + 0x120, $d3, "ptr")  
> $quality = GetAttribute($CurrentIdAttrib, $Atrib\_Item\_Quality\_Level) ;on definit la quality de l'item traiter ici  
>   
> $itemDestination = CheckItem($\_\_ACDACTOR[$i][0], $\_\_ACDACTOR[$i][1], 1) ;on recupere ici ce que l'on doit faire de l'objet (stash/inventaire/trash)  
>   
> If $Uni\_manuel = true Then  
> If $quality \>= 6 And \_MemoryRead($\_\_ACDACTOR[$i][7] + 0x164, $d3, 'int') \> 0 And ($itemDestination \<\> "Stash" Or trim(StringLower($Unidentified)) = "false") Then  
> ;Ici on verifie que la qualité est bien superieur a 6 et que l'item as besoin d'etre identifier, si l'item doit aller dans le stash ou si on definit Unidentified a false  
> ;Il faudra modifier/ajouter quelque chose ici pour gerer les uni sur les oranges et modifier le nom de la variable Unidentified !  
>   
>   
> ; InventoryMove($\_\_ACDACTOR[$i][3], $\_\_ACDACTOR[$i][4]) ;met la souris sur l'item  
>   
> ; If IterateActorAtribs($\_\_ACDACTOR[$i][0], $Atrib\_Item\_Quality\_Level) \> 8 Then ;verifie la quality de l'item pour connaitre le temps necessaire a l'identification de ce dernier  
> ; Sleep(Random(250, 400))  
> ; MouseClick("Right")  
> ; Sleep(Random(4000, 4500))  
> ; Else  
> ; Sleep(Random(250, 400))  
> ; MouseClick("Right")  
> ; Sleep(Random(1000, 1500))  
> ; EndIf  
>   
> EndIf  
> EndIf  
>   
> $return[$i][0] = $\_\_ACDACTOR[$i][3] ;definit la collone de l'item  
> $return[$i][1] = $\_\_ACDACTOR[$i][4] ;definit la ligne de l'item  
> $return[$i][3] = $quality  
>   
> If $itemDestination = "Stash\_Filtre" And trim(StringLower($Unidentified)) = "false" Then ;Si c'est un item à filtrer et que l'on a definit Unidentified sur false (il faudra juste changer le nom de la variable Unidentifier)  
> If checkFiltreFromtable($GrabListTab, $\_\_ACDACTOR[$i][1], $CurrentIdAttrib) Then ;on lance le filtre sur l'item  
> \_log('valide', 1)  
> \_log(' - ', 1)  
> $return[$i][2] = "Stash"  
> Else  
> $return[$i][2] = "Trash"  
> \_log('invalide', 1)  
> \_log(' - ', 1)  
> EndIf  
>   
> Else  
> $return[$i][2] = $itemDestination ;row  
> EndIf  
>   
> Next  
>   
> For $i=0 To UBound($return) -1  
> if $return[$i][2]="Trash" and $return[$i][3]\>2 Then ; si trash + qualité \>2, soit les bleus et jaunes, mettre 5 pour ne recycler que les jaunes.  
> $return[$i][2]="Recycle"  
> EndIf  
>   
> Next   
>   
> Send("{SPACE}") ; make sure we close everything  
>   
>   
>   
> Return $return  
> EndIf  
> Return False  
> EndFunc ;==\>FilterBackpack

  
  
-Remplacer la fonction StashAndRepair par :  

> **Spoiler**
>
> Func StashAndRepair()  
>   
> if trim(StringLower($Unidentified)) = "false" Then  
> Take\_BookOfCain()  
> Else  
> $Uni\_manuel = true  
> EndIF  
>   
> \_log("Func StashAndRepair")  
> $RepairORsell += 1  
> $item\_to\_stash = 0  
>   
> While \_checkInventoryopen() = False  
> Send("i")  
> Sleep(Random(200, 300))  
> WEnd  
>   
> While Not offsetlist()  
> Sleep(10)  
> WEnd  
>   
> Sleep(Random(100, 400))  
>   
> \_log('Filter Backpack')  
> $items = FilterBackpack()  
> $ToStash = \_ArrayFindAll($items, "Stash", 0, 0, 0, 1, 2)  
>   
> Sleep(Random(100, 400))  
>   
> If $ToStash \<\> -1 Then  
> Send("{SPACE}")  
> Sleep(500)  
> InteractByActorName('Player\_Shared\_Stash')  
> Sleep(700)  
> Local $stashtry = 0  
>   
> While \_checkStashopen() = False  
> If $stashtry \<= 4 Then  
> \_log('Fail to open Stash')  
> $stashtry += 1  
> InteractByActorName("Player\_Shared\_Stash")  
> Sleep(Random(100, 200))  
>   
> Else  
> Send("{PRINTSCREEN}")  
> Sleep(200)  
> Log('Failed to open Stash after 4 try')  
> WinSetOnTop("Diablo III", "", 0)  
> MsgBox(0, "Impossible d'ouvrir le stash :", "SVP, veuillez reporter ce problème sur le forum. Erreur : s001 ")  
> Terminate()  
>   
> EndIf  
> WEnd  
> $tabfull = 0  
> CheckWindowD3Size()  
>   
> For $i = 0 To UBound($ToStash) - 1  
> \_log($items[$ToStash[$i]][0] & " stash : " & $items[$ToStash[$i]][1])  
>   
> Sleep(Random(100, 200))  
> InventoryMove($items[$ToStash[$i]][0], $items[$ToStash[$i]][1])  
> Sleep(Random(100, 500))  
>   
> If $items[$ToStash[$i]][3] \>= 6 Then  
> #cs $item\_name = fastCheckuiValue("Root.TopLayer.item 2.stack.top\_wrapper.stack.name", 1, 354)  
> $item\_stats = fastCheckuiValue("Root.TopLayer.item 2.stack.frame body.stack.stats", 1, 827)  
> $item\_to\_stash += 1  
> ;\_log("name file -\> " & $ftpfilename)  
>   
> Xml\_To\_Str(xml\_to\_item($item\_name, $item\_stats), $ftpfilename)  
> #ce  
>   
> EndIf  
>   
> MouseClick('Right')  
> Sleep(Random(50, 200))  
> If Detect\_UI\_error(1) Then  
> \_log('Tab is full : Switching tab')  
> CheckWindowD3Size()  
> $i = $i - 1  
> If $tabfull = 0 Then  
> MouseClick('left', 286, 194, 5)  
> $tabfull = 1  
> ElseIf $tabfull = 1 Then  
> MouseClick('left', 282, 266, 5)  
> $tabfull = 2  
> ElseIf $tabfull = 2 Then  
> \_log('Stash is full : Botting stopped')  
> Terminate()  
> EndIf  
>   
> Sleep(5000)  
>   
> Else  
> $ItemToStash = $ItemToStash + 1  
> EndIf  
> Next  
>   
> ;If $item\_to\_stash \> 0 Then  
> ;Ftp\_Upload\_To\_Xml($ftpfilename)  
> ;EndIf  
>   
> Sleep(Random(50, 100))  
> Send("{SPACE}")  
> Sleep(Random(100, 150))  
>   
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> If NOT Verif\_Attrib\_GlobalStuff() Then  
> \_log("CHANGEMENT DE STUFF ON TOURNE EN ROND (Stash and Repair - Stash)!!!!!")  
> antiidle()  
> EndIf  
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
>   
> EndIf  
>   
> $ToRecycle = \_ArrayFindAll($items, "Recycle", 0, 0, 0, 1, 2)  
>   
> If $ToRecycle \<\> -1 Then  
> Send("{SPACE}")  
> Sleep(Random(100, 200))  
> InteractByActorName('Blacksmith\_RepairShortcut')  
> Sleep(Random(100, 200))  
> Local $stashtry = 0  
>   
> #cs While \_checkStashopen() = False  
> If $stashtry \<= 4 Then  
> \_log('Fail to open Stash')  
> $stashtry += 1  
> InteractByActorName("Blacksmith\_RepairShortcut")  
> Sleep(Random(100, 200))  
>   
> Else  
> Send("{PRINTSCREEN}")  
> Sleep(200)  
> Log('Failed to open Stash after 4 try')  
> WinSetOnTop("Diablo III", "", 0)  
> MsgBox(0, "Impossible d'ouvrir le stash :", "SVP, veuillez reporter ce problème sur le forum. Erreur : s001 ")  
> Terminate()  
>   
> EndIf  
> WEnd  
> #ce  
> $tabfull = 0  
> CheckWindowD3Size()  
> MouseMove(150,150, 2) ; clic sur dez  
> MouseClick('Left')  
>   
> For $i = 0 To UBound($ToRecycle) - 1  
>   
> \_log($items[$ToRecycle[$i]][0] & " stash : " & $items[$ToRecycle[$i]][1])  
> Sleep(Random(100, 200))  
> InventoryMove($items[$ToRecycle[$i]][0], $items[$ToRecycle[$i]][1]);dez l'objet  
> Sleep(Random(100, 200))  
>   
> MouseClick('Left')  
> Sleep(Random(150, 300))  
>   
> if $items[$ToRecycle[$i]][3] \> 5 then ; si jaune ou plus, clique sur OK  
> MouseMove(300,210, 2)  
> Sleep(Random(100, 250))  
> MouseClick('Left')  
> endif  
>   
> Next  
>   
> ;If $item\_to\_stash \> 0 Then  
> ;Ftp\_Upload\_To\_Xml($ftpfilename)  
> ;EndIf  
>   
> Sleep(Random(50, 100))  
> Send("{SPACE}")  
> Sleep(Random(100, 150))  
>   
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> If Not Verif\_Attrib\_GlobalStuff() Then  
> \_log("CHANGEMENT DE STUFF ON TOURNE EN ROND (Stash and Repair - Stash)!!!!!")  
> antiidle()  
> EndIf  
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
>   
> EndIf  
>   
> Sleep(Random(100, 200))  
> Send("{SPACE}")  
> Sleep(Random(100, 200))  
>   
> Repair()  
>   
> Sleep(Random(100, 200))  
> Send("{SPACE}")  
> Sleep(Random(100, 200))  
>   
>   
> ;Trash  
> $ToTrash = \_ArrayFindAll($items, "Trash", 0, 0, 0, 1, 2)  
> If $ToTrash \<\> -1 Then  
> Sleep(Random(100, 200))  
> Send("{SPACE}")  
> Sleep(500)  
> InteractByActorName($RepairVendor)  
> Sleep(700)  
> Local $vendortry = 0  
> While \_checkVendoropen() = False  
> If $vendortry \<= 5 Then  
> \_log('Fail to open vendor')  
> $vendortry = $vendortry + 1  
> InteractByActorName($RepairVendor)  
>   
>   
> Else  
> Send("{PRINTSCREEN}")  
> Sleep(200)  
> \_log('Failed to open Vendor after 5 try')  
> WinSetOnTop("Diablo III", "", 0)  
> MsgBox(0, "Impossible d'ouvrir le vendeur :", "SVP, veuillez reporter ce problème sur le forum. Erreur : v002 ")  
> Terminate()  
> ExitLoop  
> EndIf  
> WEnd  
> CheckWindowD3Size()  
> 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')  
> Sleep(Random(100, 200))  
> Next  
> Sleep(Random(100, 200))  
> Send("{SPACE}")  
> Sleep(Random(100, 200))  
>   
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> If NOT Verif\_Attrib\_GlobalStuff() Then  
> \_log("CHANGEMENT DE STUFF ON TOURNE EN ROND (Stash and Repair - vendeur)!!!!!")  
> antiidle()  
> EndIf  
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
>   
> EndIf  
>   
> Sleep(Random(100, 500))  
> Send("{SPACE}")  
> Sleep(Random(100, 500))  
>   
> \_log('Filter Backpack')  
> $items = FilterBackpack()  
> $ToStash = \_ArrayFindAll($items, "Stash", 0, 0, 0, 1, 2)  
>   
> If $ToStash \<\> -1 Then  
> Sleep(500)  
> InteractByActorName('Player\_Shared\_Stash')  
> Sleep(700)  
> Local $stashtry = 0  
>   
> While \_checkStashopen() = False  
> If $stashtry \<= 4 Then  
> \_log('Fail to open Stash')  
> $stashtry += 1  
> InteractByActorName("Player\_Shared\_Stash")  
> Sleep(Random(100, 200))  
>   
> Else  
> Send("{PRINTSCREEN}")  
> Sleep(200)  
> Log('Failed to open Stash after 4 try')  
> WinSetOnTop("Diablo III", "", 0)  
> MsgBox(0, "Impossible d'ouvrir le stash :", "SVP, veuillez reporter ce problème sur le forum. Erreur : s001 ")  
> Terminate()  
>   
> EndIf  
> WEnd  
> $tabfull = 0  
> CheckWindowD3Size()  
> For $i = 0 To UBound($ToStash) - 1  
> \_log($items[$ToStash[$i]][0] & " stash : " & $items[$ToStash[$i]][1])  
>   
> Sleep(Random(100, 200))  
> InventoryMove($items[$ToStash[$i]][0], $items[$ToStash[$i]][1])  
> Sleep(Random(100, 500))  
>   
> If $items[$ToStash[$i]][3] \>= 6 Then  
> #cs $item\_name = fastCheckuiValue("Root.TopLayer.item 2.stack.top\_wrapper.stack.name", 1, 354)  
> $item\_stats = fastCheckuiValue("Root.TopLayer.item 2.stack.frame body.stack.stats", 1, 827)  
> $item\_to\_stash += 1  
> ;\_log("name file -\> " & $ftpfilename)  
>   
> Xml\_To\_Str(xml\_to\_item($item\_name, $item\_stats), $ftpfilename)  
> #ce  
>   
> EndIf  
>   
> MouseClick('Right')  
> Sleep(Random(50, 200))  
> If Detect\_UI\_error(1) Then  
> \_log('Tab is full : Switching tab')  
> CheckWindowD3Size()  
> $i = $i - 1  
> If $tabfull = 0 Then  
> MouseClick('left', 286, 194, 5)  
> $tabfull = 1  
> ElseIf $tabfull = 1 Then  
> MouseClick('left', 282, 266, 5)  
> $tabfull = 2  
> ElseIf $tabfull = 2 Then  
> \_log('Stash is full : Botting stopped')  
> Terminate()  
> EndIf  
>   
> Sleep(5000)  
>   
> Else  
> $ItemToStash = $ItemToStash + 1  
> EndIf  
> Next  
>   
> ;If $item\_to\_stash \> 0 Then  
> ;Ftp\_Upload\_To\_Xml($ftpfilename)  
> ;EndIf  
>   
> Sleep(Random(50, 100))  
> Send("{SPACE}")  
> Sleep(Random(100, 150))  
>   
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> If NOT Verif\_Attrib\_GlobalStuff() Then  
> \_log("CHANGEMENT DE STUFF ON TOURNE EN ROND (Stash and Repair - Stash)!!!!!")  
> antiidle()  
> EndIf  
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
>   
> EndIf  
>   
> EndFunc ;==\>StashAndRepair

  
  
-Enfin dans votre grablist, sur la ligne où il y a l'or, les gemmes, les plans, les clés etc rajouter :  

> **Spoiler**
>
> |Crafting\_Tier|

  
  
Sur ce je vous souhaite une excellente après-midi, en espérant que certains pourront craft tranquillement, tandis que des devs bien plus expérimentés pourront en faire une simple variable modifiable dans le settings. ![:D](https://forum.gmstemple.com/uploads/default/original/2X/4/4e279733a789da83bda5b44aedcf6a0d5178edcb.gif)  
  
A Bientôt !

---

<div class="post-metadata">

**Author:** ![math95](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/m/ad7895/32.png) [@math95](https://forum.gmstemple.com/u/math95)\
**Post date:** [Mai 23, 2013, 6:22 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/3 "2013-05-23T18:22:45Z")

</div>

j'ai teste tes fonction mes j'ai un problème il passe pas cher l'artisan sois il stock ou vend tu serrai dou pourrais venir le problème ???

---

<div class="post-metadata">

**Author:** ![nicof79](https://forum.gmstemple.com/user_avatar/forum.gmstemple.com/nicof79/32/4561_2.png) [@nicof79](https://forum.gmstemple.com/u/nicof79)\
**Post date:** [Mai 23, 2013, 7:21 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/4 "2013-05-23T19:21:27Z")

</div>

Pas moins de 25 fautes en 3 lignes.... merci de faire un effort sur la rédaction car c est franchement désagréable.

---

<div class="post-metadata">

**Author:** ![nicof79](https://forum.gmstemple.com/user_avatar/forum.gmstemple.com/nicof79/32/4561_2.png) [@nicof79](https://forum.gmstemple.com/u/nicof79)\
**Post date:** [Mai 25, 2013, 7:30 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/5 "2013-05-25T07:30:23Z")

</div>

> j'ai teste tes fonction mes j'ai un problème il passe pas cher l'artisan sois il stock ou vend tu serrai dou pourrais venir le problème ???

mdr... le mec efface les 3 lignes en question et mets un autre message a la place... un vrai plus... le ratio faute par ligne est quasi identique.  
Si tu ne fais pas d effort sur l orthographe tu auras peu de réponse.

---

<div class="post-metadata">

**Author:** ![madmax666](https://forum.gmstemple.com/user_avatar/forum.gmstemple.com/madmax666/32/4581_2.png) [@madmax666](https://forum.gmstemple.com/u/madmax666)\
**Post date:** [Mai 31, 2013, 6:09 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/6 "2013-05-31T18:09:49Z")

</div>

Bonsoir à tous,  
  
J'ai un petit problème, j'ai bien respecté toute la démarche pour la modification des toolkit.au3 et Grablist, mais il continu à bien vendre tout les items, y a t'il une solution ou c'est du à la MAJ ?

---

<div class="post-metadata">

**Author:** ![Harruli](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/h/c67d28/32.png) [@Harruli](https://forum.gmstemple.com/u/Harruli)\
**Post date:** [Mai 31, 2013, 6:55 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/7 "2013-05-31T18:55:00Z")

</div>

Bonsoir  
  
Est-ce que c'est possible que le bot fasse: Tp -\> Stash (Pour ma part leg/ring q6/amu q6 NON identifiés + mets les ressources des précédents recyclages) -\> BookOfCain -\> Recycle et retourne au champ de bataille ? Si c'est possible j'en aurais grandement besoin !  
  
Grand merci ![:D](https://forum.gmstemple.com/uploads/default/original/2X/4/4e279733a789da83bda5b44aedcf6a0d5178edcb.gif)

---

<div class="post-metadata">

**Author:** ![fidjo](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/f/41988e/32.png) [@fidjo](https://forum.gmstemple.com/u/fidjo)\
**Post date:** [Juin 6, 2013, 4:57 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/8 "2013-06-06T16:57:12Z")

</div>

Bonjour, j'ai effectué toutes les modifications mais j'ai un souci... le Bot lorsqu'il veut recycler il clique sur forger une amure du coup bah ça ne recycle rien du tout  
  
avez vous une solution ? je vous poste en spoil mon Toolkit et mon settings  
  

> **Spoiler**
>
> [Account info]  
> pass=  
>   
> [Run info]  
> SequenceFile=act1-putride|act1-Haute-Terre|act1-champs-du-malheur|act1-manoir|act1-Val  
>   
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
> ;;;;;;;;;;;;;;;;;;; Grab and monsters ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
>   
>   
> monsterList=  
> specialmonsterList=Goblin|brickhouse\_|woodwraith\_|WoodWraith\_B\_01|WoodWraith\_B\_02|WoodWraith\_B\_03|WoodWraith\_A\_01|WoodWraith\_A\_02|WoodWraith\_A\_03  
> grabListFile=grablist\_file.txt  
> QualiteItem=9  
> Potions=healthPotion\_Mythic  
>   
>   
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
> ;;;;;;;;;;;;;;;;;;; Stat Energy ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
>   
> ;Mettre le nombre d energie maximum que possede votre character.  
>   
> MaximumHatred=125  
> MaximumDiscipline=25   
> MaximumSpirit=150  
> MaximumFury=100  
> MaximumArcane=100  
> MaximumMana=100  
>   
>   
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
> ;;;;;;;;;;;;;;;;;;; SPELL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
>   
> key1=1  
> key2=2  
> key3=3  
> key4=4  
>   
> SpellOnLeft=true  
> SpellDelayLeft=  
> SpellTypeLeft=physical  
> SpellEnergyNeedsLeft=  
> SpellLifeLeft=  
> SpellDistanceLeft=  
>   
> SpellOnRight=true  
> SpellDelayRight=20000  
> SpellTypeRight=life  
> SpellEnergyNeedsRight=35  
> SpellLifeRight=40  
> SpellDistanceRight=44  
>   
> SpellOn1=true  
> SpellDelay1=  
> SpellType1=  
> SpellEnergyNeeds1=  
> SpellLife1=  
> SpellDistance1=  
>   
> SpellOn2=true  
> SpellDelay2=  
> SpellType2=  
> SpellEnergyNeeds2=  
> SpellLife2=  
> SpellDistance2=  
>   
> SpellOn3=true  
> SpellDelay3=  
> SpellType3=  
> SpellEnergyNeeds3=  
> SpellLife3=  
> SpellDistance3=  
>   
> SpellOn4=true  
> SpellDelay4=  
> SpellType4=  
> SpellEnergyNeeds4=  
> SpellLife4=  
> SpellDistance4=  
>   
>   
>   
> ;% de vie avant de prendre une potion  
> LifeForPotion=45  
> PotionStock=100  
>   
>   
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
> ;;;;;;;;;;;;;;;;;;; Routines ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
>   
> Unidentified=false  
>   
> TakeShrines=true  
>   
> repairafterxxgames=2  
> maxgamelength=3000000  
> attackRange=50  
> grabRange=130  
>   
> MonsterTri=True  
> MonsterRefresh=True  
> ItemRefresh=True  
> MonsterPriority=False  
> InventoryCheck=True  
>   
> Gest\_affixe\_ByClass=true  
> Gestion\_affixe=true  
> Gestion\_affixe\_loot=true  
> BanAffixList=poison|spore  
>   
> attacktimeout=14000  
> grabtimeout=10000  
>   
>   
> UsePath=true  
> ResActivated=true  
> ResLife=4  
>   
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
> ;;;;;;;;;;;;;;;;;;; Advanced ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
>   
> ;### Devmode : false pour botter / true pour passer en mode dev (testing, position, monsterlist etc)  
> Devmode=false

  
  
  
ToolKit :   
  

> **Spoiler**
>
> #region ;\*\*\*\* Directives created by AutoIt3Wrapper\_GUI \*\*\*\*  
> #AutoIt3Wrapper\_UseX64=n  
> #AutoIt3Wrapper\_Res\_requestedExecutionLevel=asInvoker  
> #endregion ;\*\*\*\* Directives created by AutoIt3Wrapper\_GUI \*\*\*\*  
> ;;================================================================================  
> ;;================================================================================  
> ;; Diablo 3 Au3 ToolKit  
> ;; Based on Unkn0wned, voxatu & the RE community works  
> ;;  
> ;; By Opkllhibus, Leo11173, Kickbar  
> ;;================================================================================  
> ;;================================================================================  
> ;;================================================================================  
> ;; PRE FUNCTIONS  
> ;;================================================================================  
> ;;--------------------------------------------------------------------------------  
> ;; Make sure you are running as admin  
> ;;--------------------------------------------------------------------------------  
>   
>   
>   
> $\_debug = 1  
> #RequireAdmin  
> $Admin = IsAdmin()  
> If $Admin \<\> 1 Then  
> MsgBox(0x30, "ERROR", "This program require administrative rights you fool!")  
> Exit  
> EndIf  
>   
> Global $hDll = DllOpen("ntdll.dll")  
>   
> Func \_HighPrecisionSleep($iMicroSeconds)  
> Local $hStruct  
> $hStruct = DllStructCreate("int64 time;")  
> DllStructSetData($hStruct, "time", -1 \* ($iMicroSeconds \* 10))  
> DllCall($hDll, "dword", "ZwDelayExecution", "int", 0, "ptr", DllStructGetPtr($hStruct))  
> EndFunc ;==\>\_HighPrecisionSleep  
>   
> ;;--------------------------------------------------------------------------------  
> ;; Includes  
> ;;--------------------------------------------------------------------------------  
> #include "lib\NomadMemory.au3" ;THIS IS EXTERNAL, GET IT AT THE AUTOIT WEBSITE  
> #include \<math.au3\>  
> #include \<String.au3\>  
> #include \<Array.au3\>  
> #include "lib\constants.au3"  
> #include "lib\FTP.au3"  
>   
> ;;--------------------------------------------------------------------------------  
> ;; Initialize MouseCoords  
> ;;--------------------------------------------------------------------------------  
> Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client  
> Opt("MouseClickDownDelay", Random(10, 20))  
> Opt("SendKeyDownDelay", Random(10, 20))  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; Open the process  
> ;;--------------------------------------------------------------------------------  
> Opt("WinTitleMatchMode", -1)  
> SetPrivilege("SeDebugPrivilege", 1)  
> Global $ProcessID = WinGetProcess("[CLASS:D3 Main Window Class]", "")  
> Local $d3 = \_MemoryOpen($ProcessID)  
> If @error Then  
> WinSetOnTop("[CLASS:D3 Main Window Class]", "", 0)  
> MsgBox(4096, "ERROR", "Failed to open memory for process;" & $ProcessID)  
> Exit  
> EndIf  
>   
> ;OffsetList()  
>   
> ;;================================================================================  
> ;; FUNCTIONS  
> ;;================================================================================  
>   
> Func CheckWindowD3()  
> If WinExists("[CLASS:D3 Main Window Class]") Then  
> WinActivate("[CLASS:D3 Main Window Class]")  
> WinSetOnTop("[CLASS:D3 Main Window Class]", "", 1)  
> Sleep(300)  
> Else  
> MsgBox(0, Default, "Fenêtre Diablo III absente.")  
> Terminate()  
> EndIf  
> Global $sized3 = WinGetClientSize("[CLASS:D3 Main Window Class]")  
> If $sized3[0] \<\> 800 Or $sized3[1] \<\> 600 Then  
> WinSetOnTop("[CLASS:D3 Main Window Class]", "", 0)  
> MsgBox(0, Default, "Erreur Dimension : Il faut être en 800 x 600 et non pas en " & $sized3[0] & " x " & $sized3[1] & ".")  
> Terminate()  
> Else  
> \_log("Setting Window Diablo III OK")  
> EndIf  
> EndFunc ;==\>CheckWindowD3  
>   
> Func CheckWindowD3Size()  
> Global $sized3 = WinGetClientSize("[CLASS:D3 Main Window Class]")  
> If $sized3[0] \<\> 800 Or $sized3[1] \<\> 600 Then  
> WinSetOnTop("[CLASS:D3 Main Window Class]", "", 0)  
> MsgBox(0, Default, "Erreur Dimension : Il faut être en 800 x 600 et non pas en " & $sized3[0] & " x " & $sized3[1] & ".")  
> Terminate()  
>   
> EndIf  
> EndFunc ;==\>CheckWindowD3Size  
> ;;--------------------------------------------------------------------------------  
> ; Function: FindActor()  
> ; Description: Check if an actor is present or not  
> ;  
> ; Note(s): Return 1 if found in range or 0 if absent  
> ;;--------------------------------------------------------------------------------  
> Func FindActor($name, $maxRange = 400)  
>   
> If \_ingame() Then  
> While Not offsetlist()  
> Sleep(10)  
> WEnd  
> Else  
> offsetlist()  
> EndIF  
>   
> mesurestart()  
> Local $index, $offset, $count, $item[10], $find = 0  
> startIterateObjectsList($index, $offset, $count)  
> \_log("FinActor -\> number -\> " & $count)  
> While iterateObjectsList($index, $offset, $count, $item)  
> If StringInStr($item[1], $name) And $item[9] \< $maxRange Then  
> $find = 1  
> mesureEnd("FindActor trouver")  
> Return 1  
> EndIf  
> WEnd  
>   
> Return 0  
> EndFunc ;==\>FindActor  
>   
> ;;--------------------------------------------------------------------------------  
> ; Function: checkuiitemvisible()  
> ; Description: search a value in the object manager  
> ;;--------------------------------------------------------------------------------  
> Func checkuiitemvisible($valuetocheckfor, $visibility)  
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 2420, $d3, "ptr")  
> $ptr3 = \_memoryread($ptr2 + 0, $d3, "ptr")  
> $ofs\_uielements = \_memoryread($ptr3 + 8, $d3, "ptr")  
> $uielementcount = \_memoryread($ptr3 + 64, $d3, "int")  
> $counter = 0  
> While ($counter \< $uielementcount)  
> $counter += 1  
> $uielemepointer = \_memoryread($ofs\_uielements + $counter \* 4, $d3, "ptr")  
> While ($uielemepointer \<\> 0)  
> $npnt = \_memoryread($uielemepointer + 528, $d3, "ptr")  
> $name = BinaryToString(\_memoryread($npnt + 56, $d3, "byte[256]"), 4)  
> $visible = \_memoryread($npnt + 40, $d3, "int")  
> If ($visible = $visibility) Then  
> $foundvalue = StringInStr($name, $valuetocheckfor)  
> If ($foundvalue \>= 1) Then  
> Return True  
> EndIf  
> EndIf  
> $uielemepointer = \_memoryread($uielemepointer, $d3, "ptr")  
> WEnd  
> WEnd  
> Return False  
> EndFunc ;==\>checkuiitemvisible  
>   
> Func listuiitemvisible()  
> ;output kinda buggy but does the job  
> ;use for dev only  
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 2420, $d3, "ptr")  
> $ptr3 = \_memoryread($ptr2 + 0, $d3, "ptr")  
> $ofs\_uielements = \_memoryread($ptr3 + 8, $d3, "ptr")  
> $uielementcount = \_memoryread($ptr3 + 64, $d3, "int")  
> $counter = 0  
> While ($counter \< $uielementcount)  
> $counter += 1  
> $uielemepointer = \_memoryread($ofs\_uielements + $counter \* 4, $d3, "ptr")  
> While ($uielemepointer \<\> 0)  
> $npnt = \_memoryread($uielemepointer + 528, $d3, "ptr")  
> $name = BinaryToString(\_memoryread($npnt + 56, $d3, "byte[256]"), 4)  
> $uitextptr = \_memoryread($npnt + 0xAE0, $d3, "ptr")  
> $uitext = BinaryToString(\_memoryread($uitextptr, $d3, "byte[1024]"), 4)  
> $visible = \_memoryread($npnt + 40, $d3, "int")  
> If ($visible = 1) Then  
> ConsoleWrite(@CRLF & "count aka bucket: " & $counter & " " & $uitext)  
> ConsoleWrite(@CRLF & "count aka bucket: " & $counter & " " & $name)  
>   
> EndIf  
>   
> $uielemepointer = \_memoryread($uielemepointer, $d3, "ptr")  
> WEnd  
>   
> WEnd  
>   
> EndFunc ;==\>listuiitemvisible  
>   
>   
> Func fastcheckuiitemvisible($valuetocheckfor, $visibility, $bucket)  
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 2420, $d3, "ptr")  
> $ptr3 = \_memoryread($ptr2 + 0, $d3, "ptr")  
> $ofs\_uielements = \_memoryread($ptr3 + 8, $d3, "ptr")  
> $uielementpointer = \_memoryread($ofs\_uielements + 4 \* $bucket, $d3, "ptr")  
> While $uielementpointer \<\> 0  
> $npnt = \_memoryread($uielementpointer + 528, $d3, "ptr")  
> $name = BinaryToString(\_memoryread($npnt + 56, $d3, "byte[256]"), 4)  
> If StringInStr($name, $valuetocheckfor) Then  
> If \_memoryread($npnt + 40, $d3, "int") = $visibility Then  
> Return True  
> Else  
> Return False  
> EndIf  
> EndIf  
> $uielementpointer = \_memoryread($uielementpointer, $d3, "ptr")  
> WEnd  
> Return False  
> EndFunc ;==\>fastcheckuiitemvisible  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ; Function: fastCheckuiValue()  
> ; Description: Get value of an UI element  
> ;  
> ; Note(s): Return checked UI value or return Fasle  
> ;;--------------------------------------------------------------------------------  
> Func fastCheckuiValue($valuetocheckfor, $visibility, $bucket)  
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 2420, $d3, "ptr")  
> $ptr3 = \_memoryread($ptr2 + 0, $d3, "ptr")  
> $ofs\_uielements = \_memoryread($ptr3 + 8, $d3, "ptr")  
> $uielementpointer = \_memoryread($ofs\_uielements + 4 \* $bucket, $d3, "ptr")  
> While $uielementpointer \<\> 0  
> $npnt = \_memoryread($uielementpointer + 528, $d3, "ptr")  
> $name = BinaryToString(\_memoryread($npnt + 56, $d3, "byte[1024]"), 4)  
> If StringInStr($name, $valuetocheckfor) Then  
> If \_memoryread($npnt + 40, $d3, "int") = $visibility Then  
> $uitextptr = \_memoryread($npnt + 0xAE0, $d3, "ptr")  
> $uitext = BinaryToString(\_memoryread($uitextptr, $d3, "byte[1024]"), 4)  
> ; ConsoleWrite(@CRLF & $uitext)  
> Return $uitext  
>   
> Else  
> \_log($valuetocheckfor & " is invisible")  
> Return False  
> EndIf  
> EndIf  
> $uielementpointer = \_memoryread($uielementpointer, $d3, "ptr")  
> WEnd  
> \_log($valuetocheckfor & " not found")  
> Return False  
> EndFunc ;==\>fastCheckuiValue  
>   
>   
> Func \_playerdead()  
>   
> $playerdeadlookfor = "NormalLayer.deathmenu\_dialog"  
> $return = fastcheckuiitemvisible($playerdeadlookfor, 1, 969)  
> If ($return And $DeathCountToggle) Then  
> $Death += 1  
> $Die2FastCount += 1  
> $DeathCountToggle = False  
> EndIf  
> Return $return  
> EndFunc ;==\>\_playerdead  
> Func \_inmenu()  
> $lobbylookfor = "Menu.PlayGameButton"  
> Return fastcheckuiitemvisible($lobbylookfor, 1, 654)  
> EndFunc ;==\>\_inmenu  
> Func \_checkdisconnect()  
> $disclookfor = "Root.TopLayer.BattleNetModalNotifications\_main.ModalNotification.Buttons.ButtonList.OkButton"  
> Return fastcheckuiitemvisible($disclookfor, 1, 1073)  
> EndFunc ;==\>\_checkdisconnect  
> Func \_checkRepair()  
> $replookfor = "Root.NormalLayer.DurabilityIndicator"  
> Return fastcheckuiitemvisible($replookfor, 1, 239)  
> EndFunc ;==\>\_checkRepair  
> Func \_onloginscreen()  
> $loginlookfor = "Root.NormalLayer.BattleNetLogin\_main.LayoutRoot"  
> Return fastcheckuiitemvisible($loginlookfor, 1, 174)  
> EndFunc ;==\>\_onloginscreen  
> Func \_escmenu()  
> $escmenuelookfor = "Root.TopLayer.gamemenu\_dialog.gamemenu\_bkgrnd.ButtonStackContainer.button\_leaveGame"  
> Return fastcheckuiitemvisible($escmenuelookfor, 1, 1447)  
> EndFunc ;==\>\_escmenu  
> Func \_ingame()  
> $gamelookfor = "Root.NormalLayer.minimap\_dialog\_backgroundScreen.minimap\_dialog\_pve.area\_name"  
> Return fastcheckuiitemvisible($gamelookfor, 1, 1403)  
> EndFunc ;==\>\_ingame  
> Func \_checkWPopen()  
> $checkWPopenlookfor = "Root.NormalLayer.waypoints\_dialog\_mainPage"  
> Return fastcheckuiitemvisible($checkWPopenlookfor, 1, 1398)  
> EndFunc ;==\>\_checkWPopen  
> Func \_checkVendoropen()  
> $checkVendorOpenlookfor = "Root.NormalLayer.shop\_dialog\_mainPage"  
> Return fastcheckuiitemvisible($checkVendorOpenlookfor, 1, 1814)  
> EndFunc ;==\>\_checkVendoropen  
> Func \_checkStashopen()  
> $\_checkStashopenlookfor = "Root.NormalLayer.stash\_dialog\_mainPage"  
> Return fastcheckuiitemvisible($\_checkStashopenlookfor, 1, 1291)  
> EndFunc ;==\>\_checkStashopen  
> Func \_checkInventoryopen()  
> $\_checkInventoryopenlookfor = "Root.NormalLayer.inventory\_dialog\_mainPage"  
> Return fastcheckuiitemvisible($\_checkInventoryopenlookfor, 1, 1622)  
> EndFunc ;==\>\_checkInventoryopen  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ; Function: IsInArea($area)  
> ; Description: Check where we are  
> ;  
> ;;--------------------------------------------------------------------------------  
> Func IsInArea($area)  
> $area = GetLevelAreaId()  
> ConsoleWrite("Area " & $area & @CRLF)  
> Return $area = GetLevelAreaId()  
> EndFunc ;==\>IsInArea  
>   
> Func GetLevelAreaId()  
> Return \_MemoryRead(\_MemoryRead(0x183E9E4 , $d3, "int") + 0x44, $d3, "int")  
> EndFunc ;==\>GetLevelAreaId  
>   
> Func LevelAreaConstants()  
> Global $A1\_C6\_SpiderCave\_01\_Entrance = 0xE3A6  
> Global $A1\_C6\_SpiderCave\_01\_Main = 0x132EC  
> Global $A1\_C6\_SpiderCave\_01\_Queen = 0xF506  
> Global $A1\_Dun\_Crypt\_Dev\_Hell = 0x36581  
> Global $A1\_Fields\_Cave\_SwordOfJustice\_Level01 = 0x1D455  
> Global $A1\_Fields\_Den = 0x21045  
> Global $A1\_Fields\_Den\_Level02 = 0x2F6b8  
> Global $A1\_Fields\_RandomDRLG\_CaveA\_Level01 = 0x141C4  
> Global $A1\_Fields\_RandomDRLG\_CaveA\_Level02 = 0x141C5  
> Global $A1\_Fields\_RandomDRLG\_ScavengerDenA\_Level01 = 0x13D0D  
> Global $A1\_Fields\_RandomDRLG\_ScavengerDenA\_Level02 = 0x13D17  
> Global $A1\_Fields\_Vendor\_Tinker\_Exterior = 0x2bC0C  
> Global $A1\_Highlands\_RandomDRLG\_GoatmanCaveA\_Level01 = 0x14286  
> Global $A1\_Highlands\_RandomDRLG\_GoatmanCaveA\_Level02 = 0x14287  
> Global $A1\_Highlands\_RandomDRLG\_WestTower\_Level01 = 0x14196  
> Global $A1\_Highlands\_RandomDRLG\_WestTower\_Level02 = 0x14197  
> Global $A1\_Random\_Level01 = 0x33A17  
> Global $A1\_trDun\_Blacksmith\_Cellar = 0x144A6  
> Global $A1\_trDun\_ButchersLair\_02 = 0x16301  
> Global $A1\_trDun\_Cain\_Intro = 0xED2A  
> Global $A1\_trDun\_Cave\_Highlands\_Random01\_VendorRescue = 0x21310  
> Global $A1\_trdun\_Cave\_Nephalem\_01 = 0xEBEC  
> Global $A1\_trdun\_Cave\_Nephalem\_02 = 0xEBED  
> Global $A1\_trdun\_Cave\_Nephalem\_03 = 0xEBEE  
> Global $A1\_trDun\_Cave\_Old\_Ruins\_Random01 = 0x278AC  
> Global $A1\_trDun\_CrownRoom = 0x18FDA  
> Global $A1\_trDun\_Crypt\_Event\_Tower\_Of\_Power = 0x138F4  
> Global $A1\_trDun\_Crypt\_Flooded\_Memories\_Level01 = 0x18F9c  
> Global $A1\_trDun\_Crypt\_Flooded\_Memories\_Level02 = 0x287A6  
> Global $A1\_trdun\_Crypt\_Special\_00 = 0x25BDC  
> Global $A1\_trdun\_Crypt\_Special\_01 = 0xECB9  
> Global $A1\_trDun\_Event\_JarOfSouls = 0x2371E  
> Global $A1\_trDun\_FalseSecretPassage\_01 = 0x14540  
> Global $A1\_trDun\_FalseSecretPassage\_02 = 0x14541  
> Global $A1\_trDun\_FalseSecretPassage\_03 = 0x14542  
> Global $A1\_trDun\_Jail\_Level01 = 0x171d0  
> Global $A1\_trDun\_Jail\_Level01\_Cells = 0x1783D  
> Global $A1\_trDun\_Leoric01 = 0x4D3E  
> Global $A1\_trDun\_Leoric02 = 0x4D3F  
> Global $A1\_trDun\_Leoric03 = 0x4D40  
> Global $A1\_trDun\_Level01 = 0x4D44  
> Global $A1\_trDun\_Level04 = 0x4D47  
> Global $A1\_trDun\_Level05\_Templar = 0x15763  
> Global $A1\_trDun\_Level06 = 0x4D49  
> Global $A1\_trDun\_Level07B = 0x4D4B  
> Global $A1\_trDun\_Level07D = 0x4D4D  
> Global $A1\_trDun\_Tyrael\_Level09 = 0x1CAA3  
> Global $A1\_trDun\_TyraelJail = 0x24447  
> Global $A1\_trOut\_AdriasCellar = 0xF5F8  
> Global $A1\_trOUT\_AdriasHut = 0x4DD9  
> Global $A1\_trOut\_BatesFarmCellar = 0x248A5  
> Global $A1\_trOUT\_Church = 0x4DDD  
> Global $A1\_trOut\_Fields\_Vendor\_Curios = 0x1A3B7  
> Global $A1\_trOut\_Fields\_Vendor\_Curios\_Exterior = 0x2BE7B  
> Global $A1\_trOUT\_FishingVillage = 0x4DDF  
> Global $A1\_trOUT\_FishingVillageHeights = 0x1FB03  
> Global $A1\_trOut\_ForlornFarm = 0x20B72  
> Global $A1\_trOUT\_Graveyard = 0x4DE2  
> Global $A1\_trOUT\_Highlands = 0x4DE4  
> Global $A1\_trOUT\_Highlands\_Bridge = 0x16DC0  
> Global $A1\_trOut\_Highlands\_DunExterior\_A = 0x15718  
> Global $A1\_trOUT\_Highlands\_ServantHouse\_Cellar\_Vendor = 0x29CD1  
> Global $A1\_trOUT\_Highlands\_Sub240\_GoatmanGraveyard = 0x1F95F  
> Global $A1\_trOUT\_Highlands2 = 0x4DE5  
> Global $A1\_trOUT\_Highlands3 = 0x4AF  
> Global $A1\_trOut\_Leoric\_Manor\_Int = 0x189F6  
> Global $A1\_trOUT\_LeoricsManor = 0x4DE7  
> Global $A1\_trOut\_MysticWagon = 0x20F08  
> Global $A1\_trOUT\_NewTristram = 0x4DEB  
> Global $A1\_trOUT\_NewTristram\_AttackArea = 0x316CE  
> Global $A1\_trOUT\_NewTristramOverlook = 0x26186  
> Global $A1\_trOut\_Old\_Tristram = 0x163FD  
> Global $A1\_trOut\_Old\_Tristram\_Road = 0x164BC  
> Global $A1\_trOut\_Old\_Tristram\_Road\_Cath = 0x18BE7  
> Global $A1\_trOut\_OldTristram\_Cellar = 0x1A22B  
> Global $A1\_trOut\_OldTristram\_Cellar\_1 = 0x1A104  
> Global $A1\_trOut\_OldTristram\_Cellar\_2 = 0x1A105  
> Global $A1\_trOut\_OldTristram\_Cellar\_3 = 0x19322  
> Global $A1\_trOut\_oldTristram\_TreeCave = 0x19C87  
> Global $A1\_trOut\_Scoundrel\_Event\_Old\_Mill\_2 = 0x35556  
> Global $A1\_trOut\_TownAttack\_ChapelCellar = 0x1D43E  
> Global $A1\_trOut\_Tristram\_CainsHouse = 0x1FC73  
> Global $A1\_trOut\_Tristram\_Inn = 0x1AB91  
> Global $A1\_trOut\_Tristram\_LeahsRoom = 0x15349  
> Global $A1\_trOut\_TristramFields\_A = 0x4DF0  
> Global $A1\_trOut\_TristramFields\_B = 0x4DF1  
> Global $A1\_trOut\_TristramFields\_ExitA = 0xF085  
> Global $A1\_trOut\_TristramFields\_Forsaken\_Grounds = 0x2BD6F  
> Global $A1\_trOut\_TristramFields\_Secluded\_Grove = 0x2BD6E  
> Global $A1\_trOut\_TristramWilderness = 0x4DF2  
> Global $A1\_trOut\_TristramWilderness\_SubScenes = 0x236AA  
> Global $A1\_trOut\_Vendor\_Tinker\_Room = 0x19821  
> Global $A1\_trOut\_Wilderness\_BurialGrounds = 0x11C08  
> Global $A1\_trOut\_Wilderness\_CorpseHouse = 0x30ADF  
> Global $A1\_trOut\_Wilderness\_Sub80\_FamilyTree = 0x236A1  
> Global $A2\_Belial\_Room\_01 = 0xED55  
> Global $A2\_Belial\_Room\_Intro = 0x13D1A  
> Global $A2\_c1Dun\_Swr\_Caldeum\_01 = 0x4D4F  
> Global $A2\_c2dun\_Zolt\_TreasureHunter = 0x4D53  
> Global $A2\_c3Dun\_Aqd\_Oasis\_Level01 = 0xE069  
> Global $A2\_cadun\_Zolt\_Timed01\_Level01 = 0x4D52  
> Global $A2\_cadun\_Zolt\_Timed01\_Level02 = 0x29108  
> Global $A2\_Caldeum = 0x19234  
> Global $A2\_Caldeum\_Uprising = 0x33613  
> Global $A2\_caOut\_Alcarnus\_RandomCellar\_1 = 0x245A7  
> Global $A2\_caOut\_Alcarnus\_RandomCellar\_2 = 0x245A8  
> Global $A2\_caOut\_Alcarnus\_RandomCellar\_3 = 0x245A9  
> Global $A2\_caOUT\_Boneyard\_01 = 0xD24A  
> Global $A2\_caOUT\_Borderlands\_Khamsin\_Mine = 0xEE8A  
> Global $A2\_caOUT\_BorderlandsKhamsin = 0xF8B2  
> Global $A2\_caOut\_Cellar\_Alcarnus\_Main = 0x2FAC4  
> Global $A2\_caOut\_CT\_RefugeeCamp = 0xD811  
> Global $A2\_caOut\_CT\_RefugeeCamp\_Gates = 0x318FD  
> Global $A2\_caOut\_CT\_RefugeeCamp\_Hub = 0x2917A  
> Global $A2\_caOut\_Hub\_Inn = 0x2AA00  
> Global $A2\_caOut\_Interior\_C\_DogBite = 0x2D7BB  
> Global $A2\_caOut\_Interior\_H\_RockWorm = 0x232F5  
> Global $A2\_caOut\_Mine\_Abandoned\_Cellar = 0x4D81  
> Global $A2\_caOut\_Oasis = 0xE051  
> Global $A2\_caOut\_Oasis\_Exit = 0x2ACE2  
> Global $A2\_caOut\_Oasis\_Exit\_A = 0x2AD07  
> Global $A2\_caOut\_Oasis\_Rakanishu = 0x33BDD  
> Global $A2\_caOut\_Oasis\_RandomCellar\_1 = 0x27099  
> Global $A2\_caOut\_Oasis\_RandomCellar\_2 = 0x2709A  
> Global $A2\_caOut\_Oasis\_RandomCellar\_3 = 0x2709B  
> Global $A2\_caOut\_Oasis\_RandomCellar\_4 = 0x27bE7  
> Global $A2\_caOut\_Oasis1\_Water = 0xE664  
> Global $A2\_caOut\_Oasis2 = 0xE058  
> Global $A2\_caOut\_OasisCellars = 0x1B100  
> Global $A2\_caOUT\_StingingWinds = 0x4D7F  
> Global $A2\_caOUT\_StingingWinds\_Alcarnus\_Tier1 = 0x4D71  
> Global $A2\_caOUT\_StingingWinds\_Alcarnus\_Tier2 = 0x4D72  
> Global $A2\_caOUT\_StingingWinds\_Bridge = 0x29886  
> Global $A2\_caOUT\_StingingWinds\_Canyon = 0x4D7C  
> Global $A2\_caOUT\_StingingWinds\_FallenCamp01 = 0x288EF  
> Global $A2\_caOUT\_StingingWinds\_PostBridge = 0x4D7E  
> Global $A2\_caOUT\_StingingWinds\_PreAlcarnus = 0x4D7B  
> Global $A2\_caOUT\_StingingWinds\_PreBridge = 0x4D7D  
> Global $A2\_caOut\_Stranded2 = 0x1DA4A  
> Global $A2\_caOut\_ZakarwaMerchantCellar = 0x1BEBB  
> Global $A2\_Cave\_Random01 = 0x26F64  
> Global $A2\_Cave\_Random01\_Level02 = 0x35E85  
> Global $A2\_CultistCellarEast = 0x19218  
> Global $A2\_CultistCellarWest = 0x19214  
> Global $A2\_dun\_Aqd\_Control\_A = 0xF9F3  
> Global $A2\_dun\_Aqd\_Control\_B = 0xF9F4  
> Global $A2\_dun\_Aqd\_Oasis\_RandomFacePuzzle\_Large = 0x26B82  
> Global $A2\_dun\_Aqd\_Oasis\_RandomFacePuzzle\_Small = 0x26AB0  
> Global $A2\_dun\_Aqd\_Special\_01 = 0xF520  
> Global $A2\_dun\_Aqd\_Special\_A = 0xF53A  
> Global $A2\_dun\_Aqd\_Special\_B = 0xF53C  
> Global $A2\_Dun\_Aqd\_Swr\_to\_Oasis\_Level01 = 0x23D96  
> Global $A2\_dun\_Cave\_BloodVial\_01 = 0x31F55  
> Global $A2\_dun\_Cave\_BloodVial\_02 = 0x31F83  
> Global $A2\_dun\_Oasis\_Cave\_MapDungeon = 0x29616  
> Global $A2\_dun\_Oasis\_Cave\_MapDungeon\_Level02 = 0x2F6bF  
> Global $A2\_dun\_PortalRoulette\_A = 0x1B37F  
> Global $A2\_Dun\_Swr\_Adria\_Level01 = 0xE47E  
> Global $A2\_Dun\_Swr\_Caldeum\_Sewers\_01 = 0x1B205  
> Global $A2\_dun\_Zolt\_Blood02\_Level01\_Part1 = 0x1E12E  
> Global $A2\_dun\_Zolt\_Blood02\_Level01\_Part2 = 0x25872  
> Global $A2\_Dun\_Zolt\_BossFight\_Level04 = 0xEB22  
> Global $A2\_dun\_Zolt\_Head\_Random01 = 0xF0C0  
> Global $A2\_Dun\_Zolt\_Level01 = 0x4D55  
> Global $A2\_Dun\_Zolt\_Level02 = 0x4D56  
> Global $A2\_Dun\_Zolt\_Level03 = 0x4D57  
> Global $A2\_Dun\_Zolt\_Lobby = 0x4D58  
> Global $A2\_Dun\_Zolt\_LobbyCenter = 0x2AFBA  
> Global $A2\_Dun\_Zolt\_Random\_Level01 = 0x4D59  
> Global $A2\_Dun\_Zolt\_Random\_Level02 = 0x36571  
> Global $A2\_dun\_Zolt\_Random\_PortalRoulette\_02 = 0x2FDCF  
> Global $A2\_Dun\_Zolt\_ShadowRealm\_Level01 = 0x13AD0  
> Global $A2\_Event\_DyingManMine = 0x2270B  
> Global $A2\_Event\_PriceOfMercy\_Cellar = 0x2FD9E  
> Global $A2\_Rockworm\_Cellar\_Cave = 0x2FE81  
> Global $A2\_trDun\_Boneyard\_Spider\_Cave\_01 = 0x1B437  
> Global $A2\_trDun\_Boneyard\_Spider\_Cave\_02 = 0x35758  
> Global $A2\_trDun\_Boneyard\_Worm\_Cave\_01 = 0x1B433  
> Global $A2\_trDun\_Boneyard\_Worm\_Cave\_02 = 0x35759  
> Global $A2\_trDun\_Cave\_Oasis\_Random01 = 0xF46F  
> Global $A2\_trDun\_Cave\_Oasis\_Random01\_Level02 = 0x2F6C2  
> Global $A2\_trDun\_Cave\_Oasis\_Random02 = 0xF46E  
> Global $A2\_trDun\_Cave\_Oasis\_Random02\_Level02 = 0x27551  
> Global $A2\_dun\_Aqd\_Oasis\_Level00 = 0x2F0B6  
> Global $A2\_dun\_Aqd\_Oasis\_Level01 = 0x2F0B1  
> Global $A3\_AzmodanFight = 0x1B39C  
> Global $A3\_Battlefield\_A = 0x1B7A4  
> Global $A3\_Battlefield\_B = 0x1B7B5  
> Global $A3\_Battlefield\_C = 0x1B7C4  
> Global $A3\_Bridge\_01 = 0x10F80  
> Global $A3\_Bridge\_Choke\_A = 0x25DA8  
> Global $A3\_Dun\_Battlefield\_Gate = 0x25C14  
> Global $A3\_dun\_Bridge\_Interior\_Random01 = 0x224ad  
> Global $A3\_dun\_Bridge\_Interior\_Random02 = 0x32270  
> Global $A3\_Dun\_Crater\_Level\_01 = 0x15040  
> Global $A3\_Dun\_Crater\_Level\_02 = 0x1d209  
> Global $A3\_Dun\_Crater\_Level\_03 = 0x1d20a  
> Global $A3\_dun\_Crater\_ST\_Level01 = 0x13b97  
> Global $A3\_dun\_Crater\_ST\_Level01B = 0x1d365  
> Global $A3\_dun\_Crater\_ST\_Level02 = 0x13b98  
> Global $A3\_dun\_Crater\_ST\_Level02B = 0x2200a  
> Global $A3\_dun\_Crater\_ST\_Level04 = 0x14cd2  
> Global $A3\_dun\_Crater\_ST\_Level04B = 0x1d368  
> Global $A3\_dun\_IceCaves\_Random\_01 = 0x2e3a1  
> Global $A3\_dun\_IceCaves\_Random\_01\_Level\_02 = 0x36206  
> Global $A3\_dun\_IceCaves\_Timed\_01 = 0x2ea66  
> Global $A3\_dun\_IceCaves\_Timed\_01\_Level\_02 = 0x36207  
> Global $A3\_Dun\_Keep\_Hub = 0x16b11  
> Global $A3\_Dun\_Keep\_Hub\_Inn = 0x2d38c  
> Global $A3\_Dun\_Keep\_Level03 = 0x126ac  
> Global $A3\_Dun\_Keep\_Level04 = 0x16baf  
> Global $A3\_Dun\_Keep\_Level05 = 0x21500  
> Global $A3\_Dun\_Keep\_Random\_01 = 0x2aa4a  
> Global $A3\_Dun\_Keep\_Random\_01\_Level\_02 = 0x36238  
> Global $A3\_Dun\_Keep\_Random\_02 = 0x2c7f2  
> Global $A3\_Dun\_Keep\_Random\_02\_Level\_02 = 0x36239  
> Global $A3\_Dun\_Keep\_Random\_03 = 0x2c802  
> Global $A3\_Dun\_Keep\_Random\_03\_Level\_02 = 0x3623a  
> Global $A3\_Dun\_Keep\_Random\_04 = 0x2c8e6  
> Global $A3\_Dun\_Keep\_Random\_04\_Level\_02 = 0x36241  
> Global $A3\_Dun\_Keep\_Random\_Cellar\_01 = 0x35ee9  
> Global $A3\_Dun\_Keep\_Random\_Cellar\_02 = 0x35ee8  
> Global $A3\_Dun\_Keep\_Random\_Cellar\_03 = 0x303f7  
> Global $A3\_Dun\_Keep\_TheBreach\_Level04 = 0x3558f  
> Global $A3\_dun\_rmpt\_Level01 = 0x16b20  
> Global $A3\_dun\_rmpt\_Level02 = 0x16bf5  
> Global $A3\_Gluttony\_Boss = 0x1b280  
> Global $A3\_dun\_Hub\_Adria\_Tower = 0x31222  
> Global $A3\_dun\_hub\_AdriaTower\_Intro\_01 = 0x3253e  
> Global $A4\_dun\_Diablo\_Arena = 0x1abfb  
> Global $A4\_dun\_Diablo\_Arena\_Phase3 = 0x348c3  
> Global $A4\_dun\_Garden\_of\_Hope\_01 = 0x1abca  
> Global $A4\_dun\_Garden\_of\_Hope\_02 = 0x1abcc  
> Global $A4\_dun\_Garden3\_SpireEntrance = 0x1d44a  
> Global $A4\_dun\_Heaven\_1000\_Monsters\_Fight = 0x1aa5d  
> Global $A4\_dun\_Heaven\_1000\_Monsters\_Fight\_Entrance = 0x2f169  
> Global $A4\_dun\_Hell\_Portal\_01 = 0x1abd6  
> Global $A4\_dun\_Hell\_Portal\_02 = 0x1abdb  
> Global $A4\_Dun\_Keep\_Hub = 0x301ed  
> Global $A4\_dun\_LibraryOfFate = 0x23120  
> Global $A4\_dun\_Spire\_00 = 0x307a4  
> Global $A4\_dun\_Spire\_01 = 0x1abe2  
> Global $A4\_dun\_Spire\_02 = 0x1abe4  
> Global $A4\_dun\_Spire\_03 = 0x1abe6  
> Global $A4\_dun\_Spire\_04 = 0x33728  
> Global $A4\_dun\_Spire\_SigilRoom\_A = 0x313c4  
> Global $A4\_dun\_Spire\_SigilRoom\_B = 0x2ae7a  
> Global $A4\_dun\_Spire\_SigilRoom\_C = 0x313c6  
> Global $A4\_dun\_Spire\_SigilRoom\_D = 0x313c7  
> Global $A4\_dun\_Diablo\_ShadowRealm\_01 = 0x25845  
> Global $A4\_dun\_spire\_DiabloEntrance = 0x3227a  
> Global $A4\_dun\_spire\_exterior = 0x34964  
> Global $Axe\_Bad\_Data = 0x4d60  
> Global $PvP\_Maze\_01 = 0x4da2  
> Global $PvP\_Octogon\_01 = 0x4da3  
> Global $PvP\_Pillar\_01 = 0x4da4  
> Global $PvP\_Stairs\_01 = 0x4da5  
> Global $PvP\_Test\_BlueTeam = 0x4da6  
> Global $PvP\_Test\_Neutral = 0x4da7  
> Global $PvP\_Test\_RedTeam = 0x4da8  
> Global $PvPArena = 0x4d9c  
> EndFunc ;==\>LevelAreaConstants  
>   
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; Find which Act we are in  
> ;;--------------------------------------------------------------------------------  
> Func GetAct()  
> If $Act = 0 Then  
> $arealist = FileRead("lib\area.txt")  
> $area = GetLevelAreaId()  
>   
> \_log(" We are in map : " & $area)  
> Local $pattern = "([\w'-]{5,80})\t\W\t" & $area  
> $asResult = StringRegExp($arealist, $pattern, 1)  
> If @error == 0 Then  
> Global $MyArea = $asResult[0]  
>   
> If StringInStr($MyArea, "a1") Then  
> $Act = 1  
> ElseIf StringInStr($MyArea, "a2") Then  
> $Act = 2  
> ElseIf StringInStr($MyArea, "a3") Then  
> $Act = 3  
> ElseIf StringInStr($MyArea, "a4") Then  
> $Act = 4  
>   
> EndIf  
> ; \_log("We are in map : " & $area &" " & $asResult[0])  
>   
>   
> ;set our vendor aaccording to the act we are in as we know it.  
> Switch $Act  
> Case 1  
> Global $RepairVendor = "UniqueVendor\_miner\_InTown"  
>   
> Case 2  
> Global $RepairVendor = "UniqueVendor\_Peddler\_InTown" ; act 2 fillette  
>   
> Case 3  
> Global $RepairVendor = "UniqueVendor\_Collector\_InTown" ; act 3  
>   
> Case 4  
> Global $RepairVendor = "UniqueVendor\_Collector\_InTown" ; act 3  
>   
> EndSwitch  
> \_log("Our Current Act is : " & $Act & " ---\> So our vendor is : " & $RepairVendor)  
>   
> EndIf  
> EndIf  
> EndFunc ;==\>GetAct  
>   
> ;;--------------------------------------------------------------------------------  
> ;; Adapt repair tab aaccording to MP act and diff  
> ;;--------------------------------------------------------------------------------  
> Func GetRepairTab()  
> GetMonsterPow2()  
> GetDifficulty()  
> GetAct()  
>   
> If $MP \> 0 And $GameDifficulty = 4 Then  
> Switch $Act  
> Case 1  
> Global $RepairTab = 2  
> Case 2 To 4  
> Global $RepairTab = 3  
> EndSwitch  
> Else  
> Switch $Act  
> Case 1  
> Global $RepairTab = 2  
> Case 2 To 4  
> Global $RepairTab = 3  
> EndSwitch  
>   
> EndIf  
> \_log("RepairTab : " & $RepairTab & " ---\> MP : " & $MP & " GameDiff : " & $GameDifficulty)  
>   
> EndFunc ;==\>GetRepairTab  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; Find MP MF handicap  
> ;; Get MF handicap and deduce game MP from it  
> ;;  
> ;;--------------------------------------------------------------------------------  
> Func GetMonsterPow()  
> $MfCap = (IterateActorAtribs($\_MyGuid, $Atrib\_Magic\_Find\_Handicap) \* 10)  
> $MP = Round($MfCap, 0)  
> \_log("Power monster : " & $MP)  
> EndFunc ;==\>GetMonsterPow  
>   
> ;;--------------------------------------------------------------------------------  
> ;; Find MonsterPower  
> ;; Get it Via UI element  
> ;;  
> ;;--------------------------------------------------------------------------------  
> Func GetMonsterPow2()  
>   
> $GetMonsterPow2 = fastCheckuiValue('Root.NormalLayer.minimap\_dialog\_backgroundScreen.minimap\_dialog\_pve.clock', 1, 28)  
> $asMpResult = StringRegExp($GetMonsterPow2, '(\()([0-9]{1,2})(\))', 1)  
> If @error == 0 Then  
> $MP = Number($asMpResult[1])  
> Else  
> $MP = 0  
> EndIf  
> \_log("Power monster : " & $MP)  
> ;\_log("Power monster : " & $GetMonsterPow2)  
> EndFunc ;==\>GetMonsterPow2  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; Find Difficulty from vendor  
> ;; Get vendor Level and deduce game difficulty from it  
> ;; $GameDifficulty = not yet determined, 1 = Norm, 2 = Nm, 3 = Hell, 4 = Inferno  
> ;;--------------------------------------------------------------------------------  
> Func GetDifficulty()  
> If $GameDifficulty = 0 Then  
>   
> Local $index, $offset, $count, $item[4]  
> startIterateLocalActor($index, $offset, $count)  
> While iterateLocalActorList($index, $offset, $count, $item)  
> If StringInStr($item[1], $RepairVendor) Then  
> Global $npclevel = IterateActorAtribs($item[0], $Atrib\_Level)  
>   
> Switch $npclevel  
> Case 1 To 59  
> Global $GameDifficulty = 1  
> Case 60 To 70  
> Global $GameDifficulty = 4  
> EndSwitch  
>   
> ExitLoop  
> EndIf  
> WEnd  
> \_log("Game Difficulty is : " & $GameDifficulty)  
> EndIf  
> EndFunc ;==\>GetDifficulty  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ; Function: TownStateCheck()  
> ; Description: Check if we are in town or not by comparing distance from stash  
> ;  
> ;;--------------------------------------------------------------------------------  
> Func \_intown()  
> If $\_debug Then \_log("-----Checking if In Town------")  
> $town = findActor('Player\_Shared\_Stash', 448)  
> If $town = 1 Then  
> \_log("We are in town ")  
> Return True  
> Else  
> \_log("We are NOT in town ")  
> Return False  
> EndIf  
> EndFunc ;==\>\_intown  
> ;==\>TownStateCheck  
>   
> ;;--------------------------------------------------------------------------------  
> ;; Getting Backpack Item Info  
> ;;--------------------------------------------------------------------------------  
> Func IterateBackpack($bag = 0, $rlvl = 0)  
> ;$bag = 0 for backpack and 15 for stash  
> ;$rlvl = 1 for actual level requirement of item and 0 for base required level  
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 0x8a0, $d3, "ptr")  
> $ptr3 = \_memoryread($ptr2 + 0x0, $d3, "ptr")  
> $\_Count = \_memoryread($ptr3 + 0x108, $d3, "int")  
> $CurrentOffset = \_memoryread(\_memoryread($ptr3 + 0x148, $d3, "ptr") + 0x0, $d3, "ptr");$\_LocalActor\_3  
> Local $\_\_ACDACTOR[$\_Count + 1][9]  
> ;\_log(" IterateBackpack 1 ")  
> For $i = 0 To $\_Count  
> Local $iterateItemListStruct = DllStructCreate("ptr;char[64];byte[112];int;byte[92];int;int;int;ptr")  
>   
> DllCall($d3[0], 'int', 'ReadProcessMemory', 'int', $d3[1], 'int', $CurrentOffset, 'ptr', DllStructGetPtr($iterateItemListStruct), 'int', DllStructGetSize($iterateItemListStruct), 'int', '')  
>   
>   
> $\_\_ACDACTOR[$i][0] = DllStructGetData($iterateItemListStruct, 1)  
> $\_\_ACDACTOR[$i][1] = DllStructGetData($iterateItemListStruct, 2)  
> $\_\_ACDACTOR[$i][8] = DllStructGetData($iterateItemListStruct, 4)  
> $\_\_ACDACTOR[$i][2] = DllStructGetData($iterateItemListStruct, 6)  
> $\_\_ACDACTOR[$i][3] = DllStructGetData($iterateItemListStruct, 7)  
> $\_\_ACDACTOR[$i][4] = DllStructGetData($iterateItemListStruct, 8)  
> $\_\_ACDACTOR[$i][5] = 0  
> $\_\_ACDACTOR[$i][6] = DllStructGetData($iterateItemListStruct, 9)  
> $\_\_ACDACTOR[$i][7] = $CurrentOffset  
> $CurrentOffset = $CurrentOffset + $ofs\_LocalActor\_StrucSize  
> $iterateItemListStruct = ""  
>   
> Next  
>   
>   
> For $i = $\_Count To 0 Step -1  
> If $\_\_ACDACTOR[$i][2] \<\> $bag Then  
> \_ArrayDelete($\_\_ACDACTOR, $i)  
> EndIf  
> Next  
>   
> ;\_Arraydisplay($\_\_ACDACTOR)  
> Return $\_\_ACDACTOR  
>   
> EndFunc ;==\>IterateBackpack  
>   
> Func Iteratestuff()  
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 0x8a0, $d3, "ptr")  
> $ptr3 = \_memoryread($ptr2 + 0x0, $d3, "ptr")  
> $\_Count = \_memoryread($ptr3 + 0x108, $d3, "int")  
> $count = 0  
> $CurrentOffset = \_memoryread(\_memoryread($ptr3 + 0x148, $d3, "ptr") + 0x0, $d3, "ptr");$\_LocalActor\_3  
> Local $\_\_ACDACTOR[1][9]  
> ;\_log(" IterateBackpack 1 ")  
> For $i = 0 To $\_Count  
> Local $iterateItemListStruct = DllStructCreate("ptr;char[64];byte[112];int;byte[92];int;int;int;ptr")  
> DllCall($d3[0], 'int', 'ReadProcessMemory', 'int', $d3[1], 'int', $CurrentOffset, 'ptr', DllStructGetPtr($iterateItemListStruct), 'int', DllStructGetSize($iterateItemListStruct), 'int', '')  
>   
> if DllStructGetData($iterateItemListStruct, 6) \>= 1 AND DllStructGetData($iterateItemListStruct, 6) \<= 13 Then  
> Redim $\_\_ACDACTOR[$count+1][9]  
> $\_\_ACDACTOR[$count][0] = DllStructGetData($iterateItemListStruct, 1)  
> $\_\_ACDACTOR[$count][1] = DllStructGetData($iterateItemListStruct, 2)  
> $\_\_ACDACTOR[$count][8] = DllStructGetData($iterateItemListStruct, 4)  
> $\_\_ACDACTOR[$count][2] = DllStructGetData($iterateItemListStruct, 6)  
> $\_\_ACDACTOR[$count][3] = DllStructGetData($iterateItemListStruct, 7)  
> $\_\_ACDACTOR[$count][4] = DllStructGetData($iterateItemListStruct, 8)  
> $\_\_ACDACTOR[$count][5] = 0  
> $\_\_ACDACTOR[$count][6] = DllStructGetData($iterateItemListStruct, 9)  
> $\_\_ACDACTOR[$count][7] = $CurrentOffset  
> $count += 1  
> EndIf  
>   
> $CurrentOffset = $CurrentOffset + $ofs\_LocalActor\_StrucSize  
> $iterateItemListStruct = ""  
>   
> Next  
>   
> Return $\_\_ACDACTOR  
> EndFunc  
>   
> Func Load\_Attrib\_GlobalStuff()  
>   
> Global $Check\_HandLeft\_Seed = 0  
> Global $Check\_HandRight\_Seed = 0  
> Global $Check\_RingLeft\_Seed = 0  
> Global $Check\_RingRight\_Seed = 0  
> Global $Check\_Amulet\_Seed = 0  
> Global $Check\_ArmorTotal = 0  
>   
> $table = Iteratestuff()  
> for $i=0 to ubound($table) - 1  
> if ($table[$i][2] \>= 3 AND $table[$i][2] \<= 4) OR $table[$i][2] \>= 11 Then  
> If $table[$i][2] = 3 Then ;Weapon1  
> $Check\_HandLeft\_Seed = GetAttribute(\_memoryread(GetACDOffsetByACDGUID($table[$i][0]) + 0x120, $d3, "ptr"), $Atrib\_Seed)  
> ElseIf $table[$i][2] = 4 Then ;Weapon2  
> $Check\_HandRight\_Seed = GetAttribute(\_memoryread(GetACDOffsetByACDGUID($table[$i][0]) + 0x120, $d3, "ptr"), $Atrib\_Seed)  
> ElseIf $table[$i][2] = 11 Then ;Ring1  
> $Check\_RingLeft\_Seed = GetAttribute(\_memoryread(GetACDOffsetByACDGUID($table[$i][0]) + 0x120, $d3, "ptr"), $Atrib\_Seed)  
> ElseIf $table[$i][2] = 12 Then ;Ring  
> $Check\_RingRight\_Seed = GetAttribute(\_memoryread(GetACDOffsetByACDGUID($table[$i][0]) + 0x120, $d3, "ptr"), $Atrib\_Seed)  
> ElseIf $table[$i][2] = 13 Then ;Amulette  
> $Check\_Amulet\_Seed = GetAttribute(\_memoryread(GetACDOffsetByACDGUID($table[$i][0]) + 0x120, $d3, "ptr"), $Atrib\_Seed)  
> EndIf  
> EndIf  
> Next  
> $Check\_ArmorTotal = GetAttribute($\_myguid, $Atrib\_Armor\_Item\_Total)  
>   
> \_log("Load\_Attrib\_GlobalStuff() Result :")  
> \_log("$Check\_HandLeft\_Seed -\> " & $Check\_HandLeft\_Seed)  
> \_log("$Check\_HandRight\_Seed -\> " & $Check\_HandRight\_Seed)  
> \_log("$Check\_RingLeft\_Seed -\> " & $Check\_RingLeft\_Seed)  
> \_log("$Check\_RingRight\_Seed -\> " & $Check\_RingRight\_Seed)  
> \_log("$Check\_Amulet\_Seed -\> " & $Check\_Amulet\_Seed)  
> \_log("$Check\_ArmorTotal -\> " & $Check\_ArmorTotal)  
>   
> EndFunc  
>   
> Func Verif\_Attrib\_GlobalStuff()  
>   
> If Trim(StringLower($InventoryCheck)) = "true" Then  
>   
> Local $HandLeft\_Seed = 0  
> Local $HandRight\_Seed = 0  
> Local $RingLeft\_Seed = 0  
> Local $RingRight\_Seed = 0  
> Local $Amulet\_Seed = 0  
> Local $ArmorTotal = 0  
>   
> $table = Iteratestuff()  
> for $i=0 to ubound($table) - 1  
> if ($table[$i][2] \>= 3 AND $table[$i][2] \<= 4) OR $table[$i][2] \>= 11 Then  
> If $table[$i][2] = 3 Then ;Weapon1  
> $HandLeft\_Seed = GetAttribute(\_memoryread(GetACDOffsetByACDGUID($table[$i][0]) + 0x120, $d3, "ptr"), $Atrib\_Seed)  
> ElseIf $table[$i][2] = 4 Then ;Weapon2  
> $HandRight\_Seed = GetAttribute(\_memoryread(GetACDOffsetByACDGUID($table[$i][0]) + 0x120, $d3, "ptr"), $Atrib\_Seed)  
> ElseIf $table[$i][2] = 11 Then ;Ring1  
> $RingLeft\_Seed = GetAttribute(\_memoryread(GetACDOffsetByACDGUID($table[$i][0]) + 0x120, $d3, "ptr"), $Atrib\_Seed)  
> ElseIf $table[$i][2] = 12 Then ;Ring  
> $RingRight\_Seed = GetAttribute(\_memoryread(GetACDOffsetByACDGUID($table[$i][0]) + 0x120, $d3, "ptr"), $Atrib\_Seed)  
> ElseIf $table[$i][2] = 13 Then ;Amulette  
> $Amulet\_Seed = GetAttribute(\_memoryread(GetACDOffsetByACDGUID($table[$i][0]) + 0x120, $d3, "ptr"), $Atrib\_Seed)  
> EndIf  
> EndIf  
> Next  
> $ArmorTotal = GetAttribute($\_myguid, $Atrib\_Armor\_Item\_Total)  
>   
> if $HandLeft\_Seed \<\> $Check\_HandLeft\_Seed Then  
> If $HandLeft\_Seed = 0 AND $Check\_HandLeft\_Seed \<\> 0 Then  
> \_log("-\> Weapon Left Dropped")  
> Else  
> \_log("-\> Weapon Left switched")  
> EndIf  
> return False  
> ElseIf $HandRight\_Seed \<\> $Check\_HandRight\_Seed Then  
> If $HandRight\_Seed = 0 AND $Check\_HandRight\_Seed \<\> 0 Then  
> \_log("-\> Weapon Right Dropped")  
> Else  
> \_log("-\> Weapon Right switched")  
> EndIf  
> return False  
> ElseIf $RingLeft\_Seed \<\> $Check\_RingLeft\_Seed Then  
> If $RingLeft\_Seed = 0 AND $Check\_RingLeft\_Seed \<\> 0 Then  
> \_log("-\> Ring Left Dropped")  
> Else  
> \_log("-\> Ring Left switched")  
> EndIf  
> return False  
> ElseIf $RingRight\_Seed \<\> $Check\_RingRight\_Seed Then  
> If $RingRight\_Seed = 0 AND $Check\_RingRight\_Seed \<\> 0 Then  
> \_log("-\> Ring Right Dropped")  
> Else  
> \_log("-\> Ring Right switched")  
> EndIf  
> return False  
> ElseIF $ArmorTotal \<\> $Check\_ArmorTotal Then  
> \_log("-\> Armor Total changed")  
> return False  
> EndIf  
>   
> \_log("Checking stuff successful")  
> return true  
>   
> Else  
> \_log("Checking stuff Disable")  
> return true  
> EndIF  
> EndFunc  
>   
> Func antiidle()  
> global $shrinebanlist = 0  
> $warnloc = GetCurrentPos()  
> $warnarea = GetLevelAreaId()  
> \_log("Lost detected at : " & $warnloc[0] & ", " & $warnloc[1] & ", " & $warnloc[2],1);  
> \_log("Lost area : " & $warnarea,1);  
>   
>   
> If \_checkInventoryopen() = False Then  
> Send("i")  
> Sleep(150)  
> Endif  
>   
> Send("{PRINTSCREEN}")  
> sleep(150)  
> Send("{SPACE}")  
>   
> ToolTip("Detection de stuff modifié !" & @CRLF & "Zone : " & $warnarea & @CRLF & "Position : " & $warnloc[0] & ", " & $warnloc[1] & ", " & $warnloc[2] & @CRLF & "Un screenshot a été pris, il se situe dans document/diablo 3" , 15, 15)  
>   
>   
> While Not \_intown()  
> \_TownPortalnew()  
> sleep(100)  
> WEnd  
>   
> ;idleing  
> While 1  
> MouseClick("middle", Random(100, 200), Random(100, 200), 1, 6)  
> Sleep(Random(40000, 180000))  
> MouseClick("middle", Random(600, 700), Random(100, 200), 1, 6)  
> Sleep(Random(40000, 180000))  
> MouseClick("middle", Random(600, 700), Random(400, 500), 1, 6)  
> Sleep(Random(40000, 180000))  
> MouseClick("middle", Random(100, 200), Random(400, 500), 1, 6)  
> Sleep(Random(40000, 180000))  
> Wend  
>   
> Endfunc  
> ;;--------------------------------------------------------------------------------  
> ; Function: GetPackItemLevel($ACD, $\_REQ)  
> ;;--------------------------------------------------------------------------------  
> Func GetPackItemLevel($ACD, $\_REQ)  
> ;IterateLocalActor()  
> ;$ACDIndex = \_ArraySearch($\_\_ACTOR, "0x" & Hex($\_guid), 0, 0, 0, 1, 1, 1) ;this bitch is slow as hell  
> If $ACD = -1 Then Return False  
> $\_Count = \_MemoryRead($\_ActorAtrib\_Count, $d3, 'int')  
> If $\_Count \> 500 Then  
> \_log("Attention la valeur de Count était de " & $\_Count)  
> $\_Count = 500  
> EndIf  
>   
> $CurrentOffset = $\_ActorAtrib\_4  
> Dim $ACTORatrib  
> For $i = 0 To $\_Count  
> $ACTORatrib = \_MemoryRead($CurrentOffset, $d3, 'ptr')  
> If $ACTORatrib = $ACD Then  
> $test = \_MemoryRead($CurrentOffset + 0x10, $d3, 'ptr')  
> $CurretOffset = $test  
> For $i = 0 To 825  
> $data = \_MemoryRead($CurretOffset, $d3, 'ptr')  
> $CurretOffset = $CurretOffset + 0x4  
> If $data \<\> 0x0 Then  
> $AtribData = \_MemoryRead($data + 0x4, $d3, 'ptr')  
> If StringLeft($AtribData, 7) = "0x0003B" Then  
> ;ConsoleWrite("Debug :" &$data+0x4 & " : " & \_MemoryRead($data+0x4, $d3, 'int') &@crlf) ;FOR DEBUGGING  
> If "0x" & StringRight($AtribData, 3) = $\_REQ[0] Then  
> Return \_MemoryRead($data + 0x8, $d3, $\_REQ[1])  
> EndIf  
> EndIf  
> If StringLeft($AtribData, 7) = "0xFFFFF" Then  
> ;ConsoleWrite("Debug :" &$data+0x4 & " : " & \_MemoryRead($data+0x4, $d3, 'int') &@crlf) ;FOR DEBUGGING  
> If "0x" & StringRight($AtribData, 3) = $\_REQ[0] Then  
> Return \_MemoryRead($data + 0x8, $d3, $\_REQ[1])  
> EndIf  
> EndIf  
> EndIf  
> Next  
> Return False  
> EndIf  
> $CurrentOffset = $CurrentOffset + $ofs\_ActorAtrib\_StrucSize  
> Next  
> Return False  
> EndFunc ;==\>GetPackItemLevel  
> ;;--------------------------------------------------------------------------------  
> ;; Getting Backpack Item Info, extended to show some more info  
> ;; $bag = 0 for backpack and 15 for stash  
> ;;--------------------------------------------------------------------------------  
> Func IterateBackpackExtendedWithLvl($bag = 0)  
> $list = IndexSNO($gameBalance)  
> $armorOffs = 0  
> $weaponOffs = 0  
> $otherOffs = 0  
> For $j = 0 To UBound($list) - 1  
> ;19750 = armor, 19754 = weapon, 1953 = other  
> If ($list[$j][1] = 19750) Then  
> $armorOffs = $list[$j][0]  
> EndIf  
> If ($list[$j][1] = 19754) Then  
> $weaponOffs = $list[$j][0]  
> EndIf  
> If ($list[$j][1] = 19753) Then  
> $otherOffs = $list[$j][0]  
> EndIf  
> Next  
> Local $armorItems = GetLevels($armorOffs)  
> Local $weaponItems = GetLevels($weaponOffs)  
> Local $otherItems = GetLevels($otherOffs)  
> Local $data = IterateBackpack($bag)  
> Local $armorItemsWithLvl = MapItemWithLvl($data, $armorItems, 8)  
> Local $weaponItemsWithLvl = MapItemWithLvl($data, $weaponItems, 8)  
> Local $otherItemsWithLvl = MapItemWithLvl($data, $otherItems, 8)  
> Local $allItems[UBound($armorItemsWithLvl, 1)][UBound($armorItemsWithLvl, 2)]  
> For $i = 0 To UBound($allItems) - 1 Step 1  
> If $armorItemsWithLvl[$i][9] \<\> "" Then  
> ;copy from $armorItemsWithLvl to all items  
> For $j = 0 To UBound($armorItemsWithLvl, 2) - 1 Step 1  
> $allItems[$i][$j] = $armorItemsWithLvl[$i][$j]  
> Next  
> ElseIf $weaponItemsWithLvl[$i][9] \<\> "" Then  
> ;copy from $weaponItemsWithLvl to all items  
> For $j = 0 To UBound($weaponItemsWithLvl, 2) - 1 Step 1  
> $allItems[$i][$j] = $weaponItemsWithLvl[$i][$j]  
> Next  
> ElseIf $otherItemsWithLvl[$i][9] \<\> "" Then  
> ;copy from $otherItemsWithLvl to all items  
> For $j = 0 To UBound($otherItemsWithLvl, 2) - 1 Step 1  
> $allItems[$i][$j] = $otherItemsWithLvl[$i][$j]  
> Next  
> EndIf  
> Next  
> Return $allItems  
> EndFunc ;==\>IterateBackpackExtendedWithLvl  
>   
> ;;--------------------------------------------------------------------------------  
> ;; Maps snos containg a lvl to the item with that snoid  
> ;;--------------------------------------------------------------------------------  
> Func MapItemWithLvl($items, $snowithlvl, $indexForBGID)  
> Local $newItems = $items  
> ReDim $newItems[UBound($items, 1)][UBound($items, 2) + UBound($snowithlvl, 2) + 9] ;add size for some new variables  
> For $i = 0 To UBound($items) - 1 Step 1  
> For $j = 0 To UBound($snowithlvl) - 1 Step 1  
> If $snowithlvl[$j][0] = $items[$i][$indexForBGID] Then  
> $newItems[$i][$indexForBGID + 1] = $snowithlvl[$j][1] ;ilvl  
> $newItems[$i][$indexForBGID + 2] = $snowithlvl[$j][2] ;min dmg  
> $newItems[$i][$indexForBGID + 3] = $snowithlvl[$j][3] ;;max dmg  
> $newItems[$i][$indexForBGID + 4] = $snowithlvl[$j][4] ;;min armor  
> $newItems[$i][$indexForBGID + 5] = $snowithlvl[$j][5] ;max armor  
> $newItems[$i][$indexForBGID + 6] = $snowithlvl[$j][6] ;min dmg modifier  
> $newItems[$i][$indexForBGID + 7] = $snowithlvl[$j][7] ;max dmg modifier  
> $newItems[$i][$indexForBGID + 8] = $snowithlvl[$j][8] ;gold  
> $newItems[$i][$indexForBGID + 9] = $snowithlvl[$j][9] ;weapon speed  
> ;;some extra attributes  
> $newItems[$i][$indexForBGID + 10] = IterateActorAtribs($newItems[$i][0], $Atrib\_Item\_Quality\_Level) ;quality lvl  
> $newItems[$i][$indexForBGID + 11] = IterateActorAtribs($newItems[$i][0], $Atrib\_Strength\_Item) ;str  
> $newItems[$i][$indexForBGID + 12] = IterateActorAtribs($newItems[$i][0], $Atrib\_Vitality\_Item) ;vit  
> $newItems[$i][$indexForBGID + 12] = IterateActorAtribs($newItems[$i][0], $Atrib\_Intelligence\_Item) ;int  
> $newItems[$i][$indexForBGID + 13] = IterateActorAtribs($newItems[$i][0], $Atrib\_Dexterity\_Item) ;dex  
> $newItems[$i][$indexForBGID + 15] = IterateActorAtribs($newItems[$i][0], $Atrib\_Resistance\_All) ;all res  
> $newItems[$i][$indexForBGID + 16] = Round(IterateActorAtribs($newItems[$i][0], $Atrib\_Gold\_Find) \* 100) ;gf in %  
> $newItems[$i][$indexForBGID + 17] = Round(IterateActorAtribs($newItems[$i][0], $Atrib\_Magic\_Find) \* 100) ;mf in %  
> $newItems[$i][$indexForBGID + 18] = Round(IterateActorAtribs($newItems[$i][0], $Atrib\_Hitpoints\_Max\_Percent\_Bonus\_Item) \* 100) ;life %  
> $newItems[$i][$indexForBGID + 19] = \_MemoryRead($newItems[$i][7] + 0x164, $d3, 'int') \> 0 ;0ffset + 164 ;true=unid, false=identified  
> ExitLoop  
> EndIf  
> Next  
> Next  
> Return $newItems  
> EndFunc ;==\>MapItemWithLvl  
>   
> ;;--------------------------------------------------------------------------------  
> ;; Gets levels from Gamebalance file, returns a list with snoid and lvl  
> ;;--------------------------------------------------------------------------------  
> Func GetLevels($offset)  
> If $offset \<\> 0 Then  
> $ofs = $offset + 0x218;  
> $read = \_MemoryRead($ofs, $d3, 'int')  
> While $read = 0  
> $ofs += 0x4  
> $read = \_MemoryRead($ofs, $d3, 'int')  
> WEnd  
> $size = \_MemoryRead($ofs + 0x4, $d3, 'int')  
> $size -= 0x5F8  
> $ofs = $offset + \_MemoryRead($ofs, $d3, 'int')  
> $nr = $size / 0x5F8  
> Local $snoItems[$nr + 1][10]  
> $j = 0  
> For $i = 0 To $size Step 0x5F8  
> $ofs\_address = $ofs + $i  
> $snoItems[$j][0] = \_MemoryRead($ofs\_address, $d3, 'ptr')  
> $snoItems[$j][1] = \_MemoryRead($ofs\_address + 0x114, $d3, 'int') ;lvl  
> $snoItems[$j][2] = \_MemoryRead($ofs\_address + 0x1C8, $d3, 'float') ;min dmg  
> $snoItems[$j][3] = $snoItems[$j][2] + \_MemoryRead($ofs\_address + 0x1CC, $d3, 'float') ;max dmg  
> $snoItems[$j][4] = \_MemoryRead($ofs\_address + 0x224, $d3, 'float') ;min armor  
> $snoItems[$j][5] = $snoItems[$j][4] + \_MemoryRead($ofs\_address + 0x228, $d3, 'float') ;max armor  
> $snoItems[$j][6] = \_MemoryRead($ofs\_address + 0x32C, $d3, 'float') ;min dmg modifier  
> $snoItems[$j][7] = $snoItems[$j][4] + \_MemoryRead($ofs\_address + 0x330, $d3, 'float') ;max dmg modifier  
> $snoItems[$j][8] = \_MemoryRead($ofs\_address + 0x12C, $d3, 'int') ;gold price  
> $snoItems[$j][9] = \_MemoryRead($ofs\_address + 0x2D4, $d3, 'float') ;wpn speed  
> $j += 1  
> Next  
> EndIf  
> Return $snoItems  
> EndFunc ;==\>GetLevels  
>   
>   
>   
> Func triBackPack($avArray)  
>   
> Dim $tab0[1][8]  
> Dim $tab1[1][8]  
> Dim $tab2[1][8]  
> Dim $tab3[1][8]  
> Dim $tab4[1][8]  
> Dim $tab5[1][8]  
>   
> Dim $tab\_final[1][8]  
>   
> local $compt5=0, $compt4=0, $compt3=0, $compt2=0, $compt1=0, $compt0=0, $compt\_total=0  
>   
> \_ArraySort($avArray, 0, 0, 0, 4)  
>   
>   
> for $i=0 to Ubound($avArray) - 1  
>   
> If $avArray[$i][4] = 0 Then  
> $compt0 += 1  
> Redim $tab0[$compt0][8]  
> for $y=0 to 7  
> $tab0[$compt0-1][$y] = $avArray[$i][$y]  
> Next  
> ElseIf $avArray[$i][4] = 1 Then  
> $compt1 += 1  
> Redim $tab1[$compt1][8]  
> for $y=0 to 7  
> $tab1[$compt1-1][$y] = $avArray[$i][$y]  
> Next  
> ElseIf $avArray[$i][4] = 2 Then  
> $compt2 += 1  
> Redim $tab2[$compt2][8]  
> for $y=0 to 7  
> $tab2[$compt2-1][$y] = $avArray[$i][$y]  
> Next  
> ElseIf $avArray[$i][4] = 3 Then  
> $compt3 += 1  
> Redim $tab3[$compt3][8]  
> for $y=0 to 7  
> $tab3[$compt3-1][$y] = $avArray[$i][$y]  
> Next  
> ElseIf $avArray[$i][4] = 4 Then  
> $compt4 += 1  
> Redim $tab4[$compt4][8]  
> for $y=0 to 7  
> $tab4[$compt4-1][$y] = $avArray[$i][$y]  
> Next  
> ElseIf $avArray[$i][4] = 5 Then  
> $compt5 += 1  
> Redim $tab5[$compt5][8]  
> for $y=0 to 7  
> $tab5[$compt5-1][$y] = $avArray[$i][$y]  
> Next  
> EndIf  
> Next  
>   
> \_ArraySort($tab0, 0, 0, 0, 3)  
> \_ArraySort($tab1, 0, 0, 0, 3)  
> \_ArraySort($tab2, 0, 0, 0, 3)  
> \_ArraySort($tab3, 0, 0, 0, 3)  
> \_ArraySort($tab4, 0, 0, 0, 3)  
> \_ArraySort($tab5, 0, 0, 0, 3)  
>   
> for $i=0 To Ubound($tab0) - 1  
>   
> if $tab0[$i][0] \<\> "" Then  
> $compt\_total +=1  
> Redim $tab\_final[$compt\_total][8]  
> for $y=0 To 7  
> $tab\_final[$compt\_total-1][$y] = $tab0[$i][$y]  
> Next  
> EndIf  
> Next  
>   
> for $i=0 To Ubound($tab1) - 1  
>   
> if $tab1[$i][0] \<\> "" Then  
> $compt\_total +=1  
> Redim $tab\_final[$compt\_total][8]  
> for $y=0 To 7  
> $tab\_final[$compt\_total-1][$y] = $tab1[$i][$y]  
> Next  
> EndIf  
> Next  
>   
> for $i=0 To Ubound($tab2) - 1  
>   
> if $tab2[$i][0] \<\> "" Then  
> $compt\_total +=1  
> Redim $tab\_final[$compt\_total][8]  
> for $y=0 To 7  
> $tab\_final[$compt\_total-1][$y] = $tab2[$i][$y]  
> Next  
> EndIf  
> Next  
>   
> for $i=0 To Ubound($tab3) - 1  
>   
> if $tab3[$i][0] \<\> "" Then  
> $compt\_total +=1  
> Redim $tab\_final[$compt\_total][8]  
> for $y=0 To 7  
> $tab\_final[$compt\_total-1][$y] = $tab3[$i][$y]  
> Next  
> EndIf  
> Next  
>   
> for $i=0 To Ubound($tab4) - 1  
>   
> if $tab4[$i][0] \<\> "" Then  
> $compt\_total +=1  
> Redim $tab\_final[$compt\_total][8]  
> for $y=0 To 7  
> $tab\_final[$compt\_total-1][$y] = $tab4[$i][$y]  
> Next  
> EndIf  
> Next  
>   
> for $i=0 To Ubound($tab5) - 1  
>   
> if $tab5[$i][0] \<\> "" Then  
> $compt\_total +=1  
> Redim $tab\_final[$compt\_total][8]  
> for $y=0 To 7  
> $tab\_final[$compt\_total-1][$y] = $tab5[$i][$y]  
> Next  
> EndIf  
> Next  
>   
> return $tab\_final  
> EndFunc  
>   
> Func FilterBackpack()  
>   
> $Uni\_manuel = false  
> Local $\_\_ACDACTOR = triBackPack(IterateBackpack(0))  
> Local $iMax = UBound($\_\_ACDACTOR)  
>   
> If $iMax \> 0 Then  
>   
> Local $return[$iMax][4]  
>   
> Send("{SPACE}") ; make sure we close everything  
> Send("i") ; open the inventory  
> Sleep(100)  
>   
> CheckWindowD3Size()  
> \_checkbackpacksize()  
>   
> For $i = 0 To $iMax - 1 ;c'est ici que l'on parcour (tours a tours) l'ensemble des items contenut dans notres bag  
>   
> $ACD = GetACDOffsetByACDGUID($\_\_ACDACTOR[$i][0])  
> $CurrentIdAttrib = \_memoryread($ACD + 0x120, $d3, "ptr")  
> $quality = GetAttribute($CurrentIdAttrib, $Atrib\_Item\_Quality\_Level) ;on definit la quality de l'item traiter ici  
>   
> $itemDestination = CheckItem($\_\_ACDACTOR[$i][0], $\_\_ACDACTOR[$i][1], 1) ;on recupere ici ce que l'on doit faire de l'objet (stash/inventaire/trash)  
>   
> If $Uni\_manuel = true Then  
> If $quality \>= 6 And \_MemoryRead($\_\_ACDACTOR[$i][7] + 0x164, $d3, 'int') \> 0 And ($itemDestination \<\> "Stash" Or trim(StringLower($Unidentified)) = "false") Then  
> ;Ici on verifie que la qualité est bien superieur a 6 et que l'item as besoin d'etre identifier, si l'item doit aller dans le stash ou si on definit Unidentified a false  
> ;Il faudra modifier/ajouter quelque chose ici pour gerer les uni sur les oranges et modifier le nom de la variable Unidentified !  
>   
>   
> ; InventoryMove($\_\_ACDACTOR[$i][3], $\_\_ACDACTOR[$i][4]) ;met la souris sur l'item  
>   
> ; If IterateActorAtribs($\_\_ACDACTOR[$i][0], $Atrib\_Item\_Quality\_Level) \> 8 Then ;verifie la quality de l'item pour connaitre le temps necessaire a l'identification de ce dernier  
> ; Sleep(Random(250, 400))  
> ; MouseClick("Right")  
> ; Sleep(Random(4000, 4500))  
> ; Else  
> ; Sleep(Random(250, 400))  
> ; MouseClick("Right")  
> ; Sleep(Random(1000, 1500))  
> ; EndIf  
>   
> EndIf  
> EndIf  
>   
> $return[$i][0] = $\_\_ACDACTOR[$i][3] ;definit la collone de l'item  
> $return[$i][1] = $\_\_ACDACTOR[$i][4] ;definit la ligne de l'item  
> $return[$i][3] = $quality  
>   
> If $itemDestination = "Stash\_Filtre" And trim(StringLower($Unidentified)) = "false" Then ;Si c'est un item à filtrer et que l'on a definit Unidentified sur false (il faudra juste changer le nom de la variable Unidentifier)  
> If checkFiltreFromtable($GrabListTab, $\_\_ACDACTOR[$i][1], $CurrentIdAttrib) Then ;on lance le filtre sur l'item  
> \_log('valide', 1)  
> \_log(' - ', 1)  
> $return[$i][2] = "Stash"  
> Else  
> $return[$i][2] = "Trash"  
> \_log('invalide', 1)  
> \_log(' - ', 1)  
> EndIf  
>   
> Else  
> $return[$i][2] = $itemDestination ;row  
> EndIf  
>   
> Next  
>   
> For $i=0 To UBound($return) -1  
> if $return[$i][2]="Trash" and $return[$i][3]\>2 Then ; si trash + qualité \>2, soit les bleus et jaunes, mettre 5 pour ne recycler que les jaunes.  
> $return[$i][2]="Recycle"  
> EndIf  
>   
> Next   
>   
> Send("{SPACE}") ; make sure we close everything  
>   
>   
>   
> Return $return  
> EndIf  
> Return False  
> EndFunc ;==\>FilterBackpack  
>   
>   
> Func \_filter2attrib($CurrentIdAttrib, $filter2read)  
> If StringInStr($filter2read, "DPS") Then  
> ;\_log("Handling special attrib : "& $filter2read)  
> $result = GetAttribute($CurrentIdAttrib, $Atrib\_Damage\_Weapon\_Average\_Total\_All) \* GetAttribute($CurrentIdAttrib, $Atrib\_Attacks\_Per\_Second\_Item\_Total)  
> ;\_log("the value you search is : "& $result)  
> Return $result  
> Else  
> ;\_log("will find : "& $filter2read)  
> $currattrib = Eval($filter2read)  
> If IsArray($currattrib) Then  
> $result = Round((GetAttribute($CurrentIdAttrib, $currattrib[0])) \* $currattrib[1], 2)  
> ; \_log("the value you search is : "& $result)  
> Return $result  
> Else  
> Return 0  
> EndIf  
> EndIf  
> EndFunc ;==\>\_filter2attrib  
>   
> ;;--------------------------------------------------------------------------------  
> ;; Stop()  
> ;;--------------------------------------------------------------------------------  
> Func Stop()  
> Exit  
> EndFunc ;==\>Stop  
>   
>   
>   
> ;;================================================================================  
> ; Function: LocateMyToon  
> ; Note(s): This function is used by the OffsetList to  
> ; get the current player data.  
> ;==================================================================================  
> Func LocateMyToon()  
> $count\_locatemytoon = 0  
> $idarea = 0  
> If \_ingame() Then  
>   
> While $count\_locatemytoon \<= 1000  
>   
> $idarea = GetLevelAreaId()  
>   
> if $idarea \<\> -1 Then  
> If $\_debug Then \_log("Looking for local player")  
> Global $\_Myoffset = "0x" & Hex(GetPlayerOffset(), 8) ; pour convertir valeur  
> Global $\_MyGuid = \_MemoryRead($\_Myoffset + 0x4, $d3, 'ptr')  
> $\_NAME = \_MemoryRead($\_Myoffset + 0x8, $d3, 'char[64]')  
> $\_SNO = \_MemoryRead($\_Myoffset + 0x88, $d3, 'ptr')  
> setChararacter($\_NAME)  
>   
>   
> $ACD = GetACDOffsetByACDGUID($\_MyGuid)  
> $name\_by\_acd = \_MemoryRead($ACD + 0x4, $d3, 'char[64]')  
>   
> $\_MyGuid = \_memoryread($ACD + 0x120, $d3, "ptr")  
> Global $\_MyACDWorld = \_memoryread($ACD + 0x108, $d3, "ptr")  
>   
> If NOT trim($\_NAME) = "" Then  
> If trim($\_NAME) = trim($name\_by\_acd) Then  
> Global $\_MyCharType = $\_NAME  
>   
> If $hotkeycheck = 1 Then  
> If Verif\_Attrib\_GlobalStuff() Then  
> return true  
> Else  
> \_log("CHANGEMENT DE STUFF ON TOURNE EN ROND (locatemytoon)!!!!!")  
> antiidle()  
> EndIf  
> Else  
> return true  
> EndIf  
> else  
> ;\_log("Fail LocateMyToon, $\_NAME \<\> $name\_by\_acd -\> " & $count\_locatemytoon)  
> $count\_locatemytoon += 1  
> EndIf  
> else  
> ;\_log("Fail LocateMyToon, Empty $\_NAME -\> " & $count\_locatemytoon)  
> $count\_locatemytoon += 1  
> EndIf  
>   
> Else  
> ;\_log("Fail LocateMyToon, Fail AreaId -\> " & $idarea)  
> $count\_locatemytoon += 1  
> EndIf  
>   
> Sleep(50)  
>   
>   
> WEnd  
>   
>   
>   
>   
> EndIf  
> EndFunc ;==\>LocateMyToon  
>   
> Func GetACDByGuid($Guid, $\_displayInfo = 0)  
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 0x8a0, $d3, "ptr")  
> $ptr3 = \_memoryread($ptr2 + 0x0, $d3, "ptr")  
> $\_Count = \_memoryread($ptr3 + 0x108, $d3, "int")  
> $CurrentOffset = \_memoryread(\_memoryread($ptr3 + 0x148, $d3, "ptr") + 0x0, $d3, "ptr");$\_LocalActor\_3  
> Global $\_\_ACTOR[$\_Count + 1][4]  
> For $i = 0 To $\_Count  
> $\_\_ACTOR[$i][1] = \_MemoryRead($CurrentOffset, $d3, 'ptr')  
> $\_\_ACTOR[$i][2] = \_MemoryRead($CurrentOffset + 0x4, $d3, 'char[64]')  
> $\_\_ACTOR[$i][3] = \_MemoryRead($CurrentOffset + $ofs\_LocalActor\_atribGUID, $d3, 'ptr')  
> $CurrentOffset = $CurrentOffset + $ofs\_LocalActor\_StrucSize  
> If $\_\_ACTOR[$i][1] = $Guid Then  
> If $\_displayInfo = 1 Then ConsoleWrite('Count : "' & $i & '" ' & $\_\_ACTOR[$i][1] & "' '" & $\_\_ACTOR[$i][2] & "' '" & $\_\_ACTOR[$i][3] & "'" & @CRLF)  
> Global $GetACD = $i  
> Return True  
> EndIf  
> Next  
> ConsoleWrite("Get ACD By Guid was failed" & @CRLF)  
> EndFunc ;==\>GetACDByGuid  
>   
> ;;================================================================================  
> ; Function: IterateLocalActor  
> ; Note(s): Iterates through all the local actors.  
> ; Used by IterateActorAtribs  
> ; This is bad use of variables, should be fixed!  
> ;==================================================================================  
> Func IterateLocalActor()  
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 0x8a0, $d3, "ptr")  
> $ptr3 = \_memoryread($ptr2 + 0x0, $d3, "ptr")  
> $\_Count = \_memoryread($ptr3 + 0x108, $d3, "int")  
> $CurrentOffset = \_memoryread(\_memoryread($ptr3 + 0x148, $d3, "ptr") + 0x0, $d3, "ptr");$\_LocalActor\_3  
> Global $\_\_ACTOR[$\_Count + 1][4]  
> For $i = 0 To $\_Count  
> $\_\_ACTOR[$i][1] = \_MemoryRead($CurrentOffset, $d3, 'ptr')  
> $\_\_ACTOR[$i][2] = \_MemoryRead($CurrentOffset + 0x4, $d3, 'char[64]')  
> $\_\_ACTOR[$i][3] = \_MemoryRead($CurrentOffset + $ofs\_LocalActor\_atribGUID, $d3, 'ptr')  
> ;\_log($\_\_ACTOR[$i][1] & " : " & $\_\_ACTOR[$i][2] & " : " & $\_\_ACTOR[$i][3])  
> $CurrentOffset = $CurrentOffset + $ofs\_LocalActor\_StrucSize  
> Next  
> EndFunc ;==\>IterateLocalActor  
> Func startIterateLocalActor(ByRef $index, ByRef $offset, ByRef $count)  
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 0x8a0, $d3, "ptr")  
> $ptr3 = \_memoryread($ptr2 + 0x0, $d3, "ptr")  
> $count = \_memoryread($ptr3 + 0x108, $d3, "int")  
> $index = 0  
> $offset = \_memoryread(\_memoryread($ptr3 + 0x148, $d3, "ptr") + 0x0, $d3, "ptr")  
> EndFunc ;==\>startIterateLocalActor  
> Func iterateLocalActorList(ByRef $index, ByRef $offset, ByRef $count, ByRef $item)  
> Local $iterateLocalActorListStruct = DllStructCreate("ptr;char[64];byte[" & Int($ofs\_LocalActor\_atribGUID) - 68 & "];ptr")  
> If $index \> $count Then Return False  
> $index += 1  
> DllCall($d3[0], 'int', 'ReadProcessMemory', 'int', $d3[1], 'int', $offset, 'ptr', DllStructGetPtr($iterateLocalActorListStruct), 'int', DllStructGetSize($iterateLocalActorListStruct), 'int', '')  
> $item[0] = DllStructGetData($iterateLocalActorListStruct, 1)  
> $item[1] = DllStructGetData($iterateLocalActorListStruct, 2)  
> $item[2] = DllStructGetData($iterateLocalActorListStruct, 4)  
>   
> $item[3] = $offset ; Item Offset  
> ;\_log('kick: ' &$item[0] & " : " & $item[1] & " : " & $item[2] & " : " & $item[3])  
> $offset = $offset + $ofs\_LocalActor\_StrucSize  
> Return True  
> EndFunc ;==\>iterateLocalActorList  
>   
> ;;================================================================================  
> ; Function: IterateActorAtribs($\_GUID,$\_REQ)  
> ; Description: Read the requested attribute data from a actor defined by GUID  
> ; Parameter(s): $\_GUID - The GUID of the object you want the data from  
> ; $\_REQ - The data you want to request (the variable)  
> ;  
> ; Note(s): You can find a list of all the $\_REQ variables in the Constants() function  
> ; It should be noted that i have not checked them all through  
> ; so the type ("float" or "int") might be wrong.  
> ; This function will always return "false" if the requested atribute does not exsist  
> ;==================================================================================  
> Func IterateActorAtribs($\_GUID, $\_REQ)  
> Local $index, $offset, $count, $item[4]  
> startIterateLocalActor($index, $offset, $count)  
> While iterateLocalActorList($index, $offset, $count, $item)  
> If $item[0] = "0x" & Hex($\_GUID) Then  
> If $\_REQ[1] = 'float' Then  
> Return GetAttributeFloat($item[2], $\_REQ[0])  
> Else  
> Return GetAttributeInt($item[2], $\_REQ[0])  
> EndIf  
> ExitLoop  
> EndIf  
> WEnd  
> Return False  
>   
>   
> EndFunc ;==\>IterateActorAtribs  
>   
> ;;================================================================================  
> ; Function: LinkActors  
> ; Description: Read and index data from the specified offset  
> ; Parameter(s): $\_offset - The offset linking to the file def  
> ; be in hex format (0x00000000).  
> ; $\_displayInfo - Setting this to 1 will make the function spit  
> ; out the results while running  
> ; Note(s): This function is used to index data from the MPQ files that  
> ; that have been loaded into memory.  
> ; Im not sure why the count doesnt go beyond 256.  
> ; So for the time being if the count goes beyond 256 the size  
> ; is set to a specified count and then the array will be scaled  
> ; after when data will stop being available.  
> ;==================================================================================  
> Func LinkActors($OBject, $\_displayInfo = 0)  
> Global $OBject\_Mem\_Actor = $OBject  
> Global $Object\_File\_Actor = IndexSNO($ofs\_ActorDef, 0)  
> Global $Object\_File\_Monster = IndexSNO($ofs\_MonsterDef, 0)  
> Dim $\_\_outputdata[UBound($OBject\_Mem\_Actor, 1) - 1][2]  
> For $i = 0 To UBound($OBject\_Mem\_Actor, 1) - 1  
> If $OBject\_Mem\_Actor[$i][9] \<\> -1 Then  
> $ItemIndex = \_ArraySearch($Object\_File\_Actor, $OBject\_Mem\_Actor[$i][9], 0, 0, 0, 1, 1, 1)  
> If $ItemIndex \> 0 Then  
> $MonsterID = \_MemoryRead($Object\_File\_Actor[$ItemIndex][0] + 0x6c, $d3, 'ptr')  
> $ItemIndex = \_ArraySearch($Object\_File\_Monster, $MonsterID, 0, 0, 0, 1, 1, 1)  
> If $ItemIndex \> 0 Then  
> $Type = \_MemoryRead($Object\_File\_Monster[$ItemIndex][0] + $\_ofs\_FileMonster\_MonsterType, $d3, 'int')  
> $MonsterType = $\_Const\_MonsterType[$Type + 1]  
> $Race = \_MemoryRead($Object\_File\_Monster[$ItemIndex][0] + $\_ofs\_FileMonster\_MonsterRace, $d3, 'int')  
> $MonsterRace = $\_Const\_MonsterRace[$Race + 1]  
> $LevelNormal = \_MemoryRead($Object\_File\_Monster[$ItemIndex][0] + $\_ofs\_FileMonster\_LevelNormal, $d3, 'int') ;//Here are some data you can use if you want,  
> $LevelNightmare = \_MemoryRead($Object\_File\_Monster[$ItemIndex][0] + $\_ofs\_FileMonster\_LevelNightmare, $d3, 'int') ;//...it gives info about levels based on dificulty  
> $LevelHell = \_MemoryRead($Object\_File\_Monster[$ItemIndex][0] + $\_ofs\_FileMonster\_LevelHell, $d3, 'int')  
> $LevelInferno = \_MemoryRead($Object\_File\_Monster[$ItemIndex][0] + $\_ofs\_FileMonster\_LevelInferno, $d3, 'int')  
> $OBject\_Mem\_Actor[$i][11] = $Type  
> $OBject\_Mem\_Actor[$i][12] = $Race  
> ;if $\_displayInfo = 1 Then ConsoleWrite($i & " " & $Object\_File\_Actor[$ItemIndex][0] & @tab & " " &$MonsterType &@tab & " " & $MonsterRace &@tab & " Level Normal:" & $LevelNormal &@tab & " " & $StringListDB[$Name][1] &" " & @TAB &$OBject\_Mem\_Actor[$i][2] &@crlf)  
> EndIf  
> EndIf  
> EndIf  
> Next  
> Return $OBject\_Mem\_Actor  
> EndFunc ;==\>LinkActors  
>   
> ;;================================================================================  
> ; Function: IndexSNO($\_offset[,$\_displayInfo = 0])  
> ; Description: Read and index data from the specified offset  
> ; Parameter(s): $\_offset - The offset linking to the file def  
> ; be in hex format (0x00000000).  
> ; $\_displayInfo - Setting this to 1 will make the function spit  
> ; out the results while running  
> ; Note(s): This function is used to index data from the MPQ files that  
> ; that have been loaded into memory.  
> ; Im not sure why the count doesnt go beyond 256.  
> ; So for the time being if the count goes beyond 256 the size  
> ; is set to a specified count and then the array will be scaled  
> ; after when data will stop being available.  
> ;==================================================================================  
> Func IndexSNO($\_offset, $\_displayInfo = 0)  
>   
> Local $CurrentSnoOffset = 0x0  
> $\_MainOffset = \_MemoryRead($\_offset, $d3, 'ptr')  
> $\_Pointer = \_MemoryRead($\_MainOffset + $\_defptr, $d3, 'ptr')  
> $\_SnoCount = \_MemoryRead($\_Pointer + $\_defcount, $d3, 'ptr') ;//Doesnt seem to go beyond 256 for some wierd reason  
> If $\_SnoCount \>= 256 Then ;//So incase it goes beyond...  
> $ignoreSNOcount = 1 ;//This enables a redim after the for loop  
> $\_SnoCount = 4056 ;//We put a limit to avoid overflow here  
> Else  
> $ignoreSNOcount = 0  
> EndIf  
>   
> $\_SnoIndex = \_MemoryRead($\_Pointer + $\_deflink, $d3, 'ptr') ;//Moving from the static into the index  
> $\_SNOName = \_MemoryRead($\_Pointer, $d3, 'char[64]') ;//Usually something like "Something" + Def  
> $TempWindex = $\_SnoIndex + 0xC ;//The header is 0xC in size  
> If $\_displayInfo = 1 Then ConsoleWrite("-----\* Indexing " & $\_SNOName & " \*-----" & @CRLF)  
> Dim $\_OutPut[$\_SnoCount + 1][2] ;//Setting the size of the output array  
>   
> For $i = 1 To $\_SnoCount Step +1 ;//Iterating through all the elements  
> $\_CurSnoOffset = \_MemoryRead($TempWindex, $d3, 'ptr') ;//Getting the offset for the item  
> $\_CurSnoID = \_MemoryRead($\_CurSnoOffset, $d3, 'ptr') ;//Going into the item and grapping the GUID which is located at 0x0  
> If $ignoreSNOcount = 1 And $\_CurSnoOffset = 0x00000000 And $\_CurSnoID = 0x00000000 Then ExitLoop ;//Untill i find a way to get the real count we do this instead.  
> If $ignoreSNOcount = 1 Then $CurIndex = $i  
> $\_OutPut[$i][0] = $\_CurSnoOffset ;//Poping the data into the output array  
> $\_OutPut[$i][1] = $\_CurSnoID  
> If $\_displayInfo = 1 Then ConsoleWrite($i & " Offset: " & $\_CurSnoOffset & " SNOid: " & $\_CurSnoID & @CRLF)  
> $TempWindex = $TempWindex + 0x10 ;//Next item is located 0x10 later  
> Next  
>   
> If $ignoreSNOcount = 1 Then ReDim $\_OutPut[$CurIndex][2] ;//Here we do the resizing of the array, to minimize memory footprint!?.  
>   
> Return $\_OutPut  
> EndFunc ;==\>IndexSNO  
>   
> ;;================================================================================  
> ; Function: IndexStringList($\_offset)  
> ; Description: Read and index data from the specified offset  
> ; Parameter(s): $\_offset - The offset linking to the file def  
> ; be in hex format (0x00000000).  
> ; $\_displayInfo - Setting this to 1 will make the function spit  
> ; out the results while running  
> ;  
> ; Note(s): This function is made specificly to index string lists.  
> ; This is usefull for getting real localized names from the  
> ; proxy names you get from the objectmanager strucs.  
> ; i have only test this on monster names but it should work for all.  
> ;==================================================================================  
> Func IndexStringList($\_offset, $\_displayInfo = 0)  
>   
> $\_offset\_FileMonster\_StrucSize = 0x50  
> $\_StringCount = \_MemoryRead($\_offset + 0xc, $d3, 'int')  
> $\_CurrentOffset = $\_offset + 0x28  
> Dim $\_OutPut[$\_StringCount][2]  
>   
> For $i = 0 To $\_StringCount - 1  
> $\_OutPut[$i][0] = \_MemoryRead(\_MemoryRead($\_CurrentOffset, $d3, 'int'), $d3, 'char[32]') ;Proxy Name, like "Priest\_Male\_B\_NoLook"  
> $\_OutPut[$i][1] = \_MemoryRead(\_MemoryRead($\_CurrentOffset + 0x10, $d3, 'int'), $d3, 'char[34]') ;Localized name, like "Brother Malachi the Healer"  
> Assign("\_\_" & $\_OutPut[$i][0], $\_OutPut[$i][1], 2)  
>   
> $\_CurrentOffset = $\_CurrentOffset + $\_offset\_FileMonster\_StrucSize  
> If $\_displayInfo = 1 Then ConsoleWrite($\_CurrentOffset & " ProxyName: " & $\_OutPut[$i][0] & @TAB & " LocalizedName: " & $\_OutPut[$i][1] & @CRLF)  
> Next  
>   
> Return $\_OutPut  
> EndFunc ;==\>IndexStringList  
>   
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; OffsetList()  
> ;;--------------------------------------------------------------------------------  
> Func offsetlist()  
> \_log("offsetlist")  
> ;//FILE DEFS  
> Global $ofs\_MonsterDef = 0x18EC4C0 ; 0x18CBE70 ;1.0.6 0x15DBE00 ;0x015DCE00 ;0x15DBE00  
> Global $ofs\_StringListDef = 0x18DD188;0x18DC188;0x18A2558 ; 0x0158C240 ;0x015E8808 ;0x015E9808  
> Global $ofs\_ActorDef = 0x18E73F0 ; 0x18C6AD8 ;1.0.6 0x15EC108 ;0x015ED108 ;0x15EC108  
> Global $\_defptr = 0x10  
> Global $\_defcount = 0x108  
> Global $\_deflink = 0x148  
> Global $\_ofs\_FileMonster\_StrucSize = 0x50  
> Global $\_ofs\_FileActor\_LinkToMonster = 0x6C  
> Global $\_ofs\_FileMonster\_MonsterType = 0x18  
> Global $\_ofs\_FileMonster\_MonsterRace = 0x1C  
> Global $\_ofs\_FileMonster\_LevelNormal = 0x44  
> Global $\_ofs\_FileMonster\_LevelNightmare = 0x48  
> Global $\_ofs\_FileMonster\_LevelHell = 0x4c  
> Global $\_ofs\_FileMonster\_LevelInferno = 0x50  
>   
> ;//GET ACTORATRIB  
> Global $ofs\_ActorAtrib\_Base = 0x0196644C ;0x1544E54 ;0x15A1EA4 ;0x015A2EA4;0x015A1EA4  
> Global $ofs\_ActorAtrib\_ofs1 = 0x390  
> Global $ofs\_ActorAtrib\_ofs2 = 0x2E8  
> Global $ofs\_ActorAtrib\_ofs3 = 0x148  
> Global $ofs\_ActorAtrib\_Count = 0x108 ; 0x0 0x0  
> Global $ofs\_ActorAtrib\_Indexing\_ofs1 = 0x10  
> Global $ofs\_ActorAtrib\_Indexing\_ofs2 = 0x8  
> Global $ofs\_ActorAtrib\_Indexing\_ofs3 = 0x250  
> Global $ofs\_ActorAtrib\_StrucSize = 0x180  
> Global $ofs\_LocalPlayer\_HPBARB = 0x34  
> Global $ofs\_LocalPlayer\_HPWIZ = 0x38  
>   
>   
> ;//GET LOCAL ACTOR STRUC  
> Global $ofs\_LocalActor\_ofs1 = 0x378 ;instead of $ofs\_ActorAtrib\_ofs2  
> Global $ofs\_LocalActor\_ofs2 = 0x148  
> Global $ofs\_LocalActor\_Count = 0x108  
> Global $ofs\_LocalActor\_atribGUID = 0x120  
> Global $ofs\_LocalActor\_StrucSize = 0x2D0 ; 0x0 0x0  
>   
>   
> ;//OBJECT MANAGER  
> Global $ofs\_objectmanager = 0x18CE394;0x018CD394 ;0x18939C4 ;0x1873414 ;0x0186FA3C ;0x1543B9C ;0x15A0BEC ;0x015A1BEC;0x15A0BEC  
> Global $ofs\_\_ObjmanagerActorOffsetA = 0x900 ;0x8C8 ;0x8b0  
> Global $ofs\_\_ObjmanagerActorCount = 0x108  
> Global $ofs\_\_ObjmanagerActorOffsetB = 0x148 ;0x148  
> Global $ofs\_\_ObjmanagerActorLinkToCTM = 0x384  
> Global $\_ObjmanagerStrucSize = 0x42C ;0x42C ;0x428  
>   
>   
> ;//CameraDef  
> Global $VIewStatic = 0x015A0BEC  
> Global $DebugFlags = $VIewStatic + 0x20  
> Global $vftableSubA = \_MemoryRead($VIewStatic, $d3, 'ptr')  
> Global $vftableSubA = \_MemoryRead($vftableSubA + 0x928, $d3, 'ptr')  
> Global $ViewOffset = $vftableSubA  
> Global $Ofs\_CameraRotationA = $ViewOffset + 0x4  
> Global $Ofs\_CameraRotationB = $ViewOffset + 0x8  
> Global $Ofs\_CameraRotationC = $ViewOffset + 0xC  
> Global $Ofs\_CameraRotationD = $ViewOffset + 0x10  
> Global $Ofs\_CameraPosX = $ViewOffset + 0x14  
> Global $Ofs\_CameraPosY = $ViewOffset + 0x18  
> Global $Ofs\_CameraPosZ = $ViewOffset + 0x1C  
> Global $Ofs\_CameraFOV = $ViewOffset + 0x30  
> Global $Ofs\_CameraFOVB = $ViewOffset + 0x30  
> Global $ofs\_InteractBase = 0x18CD364 ;0x1543B84 ;0x15A0BD4 ;0x015A1BD4;0x15A0BD4  
> Global $ofs\_\_InteractOffsetA = 0xC4 ;0xA8  
> Global $ofs\_\_InteractOffsetB = 0x58  
> Global $ofs\_\_InteractOffsetUNK1 = 0x7F20 ;Set to 777c  
> Global $ofs\_\_InteractOffsetUNK2 = 0x7F44 ;Set to 1 for NPC interaction  
> Global $ofs\_\_InteractOffsetUNK3 = 0x7F7C ;Set to 7546 for NPC interaction, 7545 for loot interaction  
> Global $ofs\_\_InteractOffsetUNK4 = 0x7F80 ;Set to 7546 for NPC interaction, 7545 for loot interaction  
> Global $ofs\_\_InteractOffsetMousestate = 0x7F84 ;Mouse state 1 = clicked, 2 = mouse down  
> Global $ofs\_\_InteractOffsetGUID = 0x7F88 ;Set to the GUID of the actor you want to interact with  
> $FixSpeed = 0x20 ;69736  
> $ToggleMove = 0x34  
> $MoveToXoffset = 0x40  
> $MoveToYoffset = 0x44  
> $MoveToZoffset = 0x48  
> $CurrentX = 0xA8  
> $CurrentY = 0xAc  
> $CurrentZ = 0xb0  
> $RotationOffset = 0x174  
> Global $\_ActorAtrib\_Base = \_MemoryRead($ofs\_ActorAtrib\_Base, $d3, 'ptr')  
> Global $\_ActorAtrib\_1 = \_MemoryRead($\_ActorAtrib\_Base + $ofs\_ActorAtrib\_ofs1, $d3, 'ptr')  
> Global $\_ActorAtrib\_2 = \_MemoryRead($\_ActorAtrib\_1 + $ofs\_ActorAtrib\_ofs2, $d3, 'ptr')  
> Global $\_ActorAtrib\_3 = \_MemoryRead($\_ActorAtrib\_2 + $ofs\_ActorAtrib\_ofs3, $d3, 'ptr')  
> Global $\_ActorAtrib\_4 = \_MemoryRead($\_ActorAtrib\_3, $d3, 'ptr')  
> Global $\_ActorAtrib\_Count = $\_ActorAtrib\_2 + $ofs\_ActorAtrib\_Count  
> Global $\_LocalActor\_1 = \_MemoryRead($\_ActorAtrib\_1 + $ofs\_LocalActor\_ofs1, $d3, 'ptr')  
> Global $\_LocalActor\_2 = \_MemoryRead($\_LocalActor\_1 + $ofs\_LocalActor\_ofs2, $d3, 'ptr')  
> Global $\_LocalActor\_3 = \_MemoryRead($\_LocalActor\_2, $d3, 'ptr')  
> Global $\_LocalActor\_Count = $\_LocalActor\_1 + $ofs\_LocalActor\_Count  
> Global $\_itrObjectManagerA = \_MemoryRead($ofs\_objectmanager, $d3, 'ptr')  
> Global $\_itrObjectManagerB = \_MemoryRead($\_itrObjectManagerA + $ofs\_\_ObjmanagerActorOffsetA, $d3, 'ptr')  
> Global $\_itrObjectManagerCount = $\_itrObjectManagerB + $ofs\_\_ObjmanagerActorCount  
> Global $\_itrObjectManagerC = \_MemoryRead($\_itrObjectManagerB + $ofs\_\_ObjmanagerActorOffsetB, $d3, 'ptr')  
> Global $\_itrObjectManagerD = \_MemoryRead($\_itrObjectManagerC, $d3, 'ptr')  
> Global $\_itrObjectManagerE = \_MemoryRead($\_itrObjectManagerD, $d3, 'ptr')  
> Global $\_itrInteractA = \_MemoryRead($ofs\_InteractBase, $d3, 'ptr')  
> Global $\_itrInteractB = \_MemoryRead($\_itrInteractA, $d3, 'ptr')  
> Global $\_itrInteractC = \_MemoryRead($\_itrInteractB, $d3, 'ptr')  
> Global $\_itrInteractD = \_MemoryRead($\_itrInteractC + $ofs\_\_InteractOffsetA, $d3, 'ptr')  
> Global $\_itrInteractE = $\_itrInteractD + $ofs\_\_InteractOffsetB  
>   
>   
> If LocateMyToon() Then  
> Global $ClickToMoveMain = \_MemoryRead($\_Myoffset + $ofs\_\_ObjmanagerActorLinkToCTM, $d3, 'ptr')  
> Global $ClickToMoveRotation = $ClickToMoveMain + $RotationOffset  
> Global $ClickToMoveCurX = $ClickToMoveMain + $CurrentX  
> Global $ClickToMoveCurY = $ClickToMoveMain + $CurrentY  
> Global $ClickToMoveCurZ = $ClickToMoveMain + $CurrentZ  
> Global $ClickToMoveToX = $ClickToMoveMain + $MoveToXoffset  
> Global $ClickToMoveToY = $ClickToMoveMain + $MoveToYoffset  
> Global $ClickToMoveToZ = $ClickToMoveMain + $MoveToZoffset  
> Global $ClickToMoveToggle = $ClickToMoveMain + $ToggleMove  
> Global $ClickToMoveFix = $ClickToMoveMain + $FixSpeed  
> If $\_debug Then \_log("My toon located at: " & $\_Myoffset & ", GUID: " & $\_MyGuid & ", NAME: " & $\_MyCharType & @CRLF)  
> Return True  
> Else  
> Return False  
> EndIf  
>   
> EndFunc ;==\>offsetlist  
>   
> ;;--------------------------------------------------------------------------------  
> ;; IterateAllObjectList()  
> ;; Description: Iterate object even if they dont have guid, also provide true names  
> ;;--------------------------------------------------------------------------------  
> Func IterateAllObjectList($\_displayInfo)  
> If $\_displayInfo = 1 Then ConsoleWrite("-----Iterating through Actors------" & @CRLF)  
> If $\_displayInfo = 1 Then ConsoleWrite("First Actor located at: " & $\_itrObjectManagerD & @CRLF)  
> $\_CurOffset = $\_itrObjectManagerD  
> $\_Count = \_MemoryRead($\_itrObjectManagerCount, $d3, 'int')  
> Dim $OBJ[$\_Count + 1][10]  
> If $\_displayInfo = 1 Then ConsoleWrite("Number of Actors : " & $\_Count & @CRLF)  
> For $i = 0 To $\_Count Step +1  
> $\_GUID = \_MemoryRead($\_CurOffset + 0x4, $d3, 'ptr')  
> $\_NAME = \_MemoryRead($\_CurOffset + 0x8, $d3, 'char[64]')  
> $\_POS\_X = \_MemoryRead($\_CurOffset + 0xB0, $d3, 'float')  
> $\_POS\_Y = \_MemoryRead($\_CurOffset + 0xB4, $d3, 'float')  
> $\_POS\_Z = \_MemoryRead($\_CurOffset + 0xB8, $d3, 'float')  
> $\_DATA = \_MemoryRead($\_CurOffset + 0x200, $d3, 'int')  
> $\_DATA2 = \_MemoryRead($\_CurOffset + 0x1D0, $d3, 'int')  
> $\_DATA3 = \_MemoryRead($\_CurOffset + 0x1C4, $d3, 'int')  
> $CurrentLoc = GetCurrentPos()  
> $xd = $\_POS\_X - $CurrentLoc[0]  
> $yd = $\_POS\_Y - $CurrentLoc[1]  
> $zd = $\_POS\_Z - $CurrentLoc[2]  
> $Distance = Sqrt($xd \* $xd + $yd \* $yd + $zd \* $zd)  
> $OBJ[$i][0] = $i  
> $OBJ[$i][1] = $\_GUID  
> $OBJ[$i][2] = $\_NAME  
> $OBJ[$i][3] = $\_POS\_X  
> $OBJ[$i][4] = $\_POS\_Y  
> $OBJ[$i][5] = $\_POS\_Z  
> $OBJ[$i][6] = $\_DATA  
> $OBJ[$i][7] = $\_DATA2  
> $OBJ[$i][8] = $Distance  
> $OBJ[$i][9] = $\_CurOffset  
> If $\_displayInfo = 1 Then ConsoleWrite($i & @TAB & " : " & $\_CurOffset & " " & $\_GUID & " : " & $\_DATA & " " & $\_DATA2 & " " & @TAB & $\_POS\_X & " " & $\_POS\_Y & " " & $\_POS\_Z & " Dist: " & $Distance & @TAB & $\_NAME & " data3: " & $\_DATA3 & @CRLF)  
> ;if $\_displayINFO = 1 then ConsoleWrite($i & @TAB&" : " & $\_POS\_X & @TAB& $\_POS\_Y & @TAB & $\_POS\_Z & @TAB& $\_NAME & @crlf)  
> $\_CurOffset = $\_CurOffset + $\_ObjmanagerStrucSize  
> Next  
> Return $OBJ  
> EndFunc ;==\>IterateAllObjectList  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; IterateObjectList()  
> ;;--------------------------------------------------------------------------------  
> Func IterateObjectList($\_displayInfo = 0)  
> ; Local $mesureobj = TimerInit() ;;;;;;;;;;;;;;  
> If $\_displayInfo = 1 Then ConsoleWrite("-----Iterating through Actors------" & @CRLF)  
> If $\_displayInfo = 1 Then ConsoleWrite("First Actor located at: " & $\_itrObjectManagerD & @CRLF)  
> $\_CurOffset = $\_itrObjectManagerD  
> $\_Count = \_MemoryRead($\_itrObjectManagerCount, $d3, 'int')  
> Dim $OBJ[$\_Count + 1][13]  
> If $\_displayInfo = 1 Then ConsoleWrite("Number of Actors : " & $\_Count & @CRLF)  
> ;$init = TimerInit()  
> For $i = 0 To $\_Count Step +1  
> $\_GUID = \_MemoryRead($\_CurOffset + 0x4, $d3, 'ptr')  
> If $\_GUID = 0xffffffff Then ;no need to go through objects without a GUID!  
> $\_PROXY\_NAME = -1  
> $\_REAL\_NAME = -1  
> $\_ACTORLINK = -1  
> $\_POS\_X = -1  
> $\_POS\_Y = -1  
> $\_POS\_Z = -1  
> $\_DATA = -1  
> $\_DATA2 = -1  
> Else  
> $\_PROXY\_NAME = \_MemoryRead($\_CurOffset + 0x8, $d3, 'char[64]')  
> $TmpString = StringSplit($\_PROXY\_NAME, "-")  
> If IsDeclared("\_\_" & $TmpString[1]) Then  
> $\_REAL\_NAME = Eval("\_\_" & $TmpString[1])  
> Else  
> $\_REAL\_NAME = $\_PROXY\_NAME  
> EndIf  
> $\_ACTORLINK = \_MemoryRead($\_CurOffset + 0x88, $d3, 'ptr')  
> $\_POS\_X = \_MemoryRead($\_CurOffset + 0xB0, $d3, 'float')  
> $\_POS\_Y = \_MemoryRead($\_CurOffset + 0xB4, $d3, 'float')  
> $\_POS\_Z = \_MemoryRead($\_CurOffset + 0xB8, $d3, 'float')  
> $\_DATA = \_MemoryRead($\_CurOffset + 0x200, $d3, 'int')  
> $\_DATA2 = \_MemoryRead($\_CurOffset + 0x1D0, $d3, 'int')  
> If $\_displayInfo = 1 Then ConsoleWrite($i & @TAB & " : " & $\_CurOffset & " " & $\_GUID & " " & $\_ACTORLINK & " : " & $\_DATA & " " & $\_DATA2 & " " & @TAB & $\_POS\_X & " " & $\_POS\_Y & " " & $\_POS\_Z & @TAB & $\_REAL\_NAME & @CRLF)  
> EndIf  
>   
> ;Im too lazy to do this but the following code needs cleanup and restructure more than anything.  
> ;You want to include all the data into this one structure rather than having it at multiple locations  
> ;and the useless things should be removed.  
> $CurrentLoc = GetCurrentPos()  
> $xd = $\_POS\_X - $CurrentLoc[0]  
> $yd = $\_POS\_Y - $CurrentLoc[1]  
> $zd = $\_POS\_Z - $CurrentLoc[2]  
> $Distance = Sqrt($xd \* $xd + $yd \* $yd + $zd \* $zd)  
> $OBJ[$i][0] = $\_CurOffset  
> $OBJ[$i][1] = $\_GUID  
> $OBJ[$i][2] = $\_PROXY\_NAME  
> $OBJ[$i][3] = $\_POS\_X  
> $OBJ[$i][4] = $\_POS\_Y  
> $OBJ[$i][5] = $\_POS\_Z  
> $OBJ[$i][6] = $\_DATA  
> $OBJ[$i][7] = $\_DATA2  
> $OBJ[$i][8] = $Distance  
> $OBJ[$i][9] = $\_ACTORLINK  
> $OBJ[$i][10] = $\_REAL\_NAME  
> $OBJ[$i][11] = -1  
> $OBJ[$i][12] = -1  
> $\_CurOffset = $\_CurOffset + $\_ObjmanagerStrucSize  
> Next  
> ;$OBJv2 = LinkActors($OBJ) ;//Would be a waste to do this in the main operation so we add more data to the object here after the main operation.  
> IterateLocalActor()  
> ; Local $difmesureobj = TimerDiff($mesureobj) ;;;;;;;;;;;;;  
> ;ConsoleWrite("Mesure iterOBJ :" & $difmesureobj &@crlf) ;FOR DEBUGGING;;;;;;;;;;;;  
> Return $OBJ  
> EndFunc ;==\>IterateObjectList  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; Function to iterate all objects()  
> ;;--------------------------------------------------------------------------------  
> Func startIterateObjectsList(ByRef $index, ByRef $offset, ByRef $count)  
> $count = \_MemoryRead($\_itrObjectManagerCount, $d3, 'int')  
> $index = 0  
> $offset = $\_itrObjectManagerD  
> EndFunc ;==\>startIterateObjectsList  
>   
> ;;--------------------------------------------------------------------------------  
> ;; FromD3toScreenCoords()  
> ;;--------------------------------------------------------------------------------  
> Func FromD3toScreenCoords($\_x, $\_y, $\_z)  
> Dim $return[2]  
> $size = WinGetClientSize("[CLASS:D3 Main Window Class]")  
> $resolutionX = $size[0]  
> $resolutionY = $size[1]  
> $aspectChange = ($resolutionX / $resolutionY) / (800 / 600)  
> $CurrentLoc = GetCurrentPos()  
> $xd = $\_x - $CurrentLoc[0]  
> $yd = $\_y - $CurrentLoc[1]  
> $zd = $\_z - $CurrentLoc[2]  
> $w = -0.515 \* $xd + - 0.514 \* $yd + - 0.686 \* $zd + 97.985  
> $x = (-1.682 \* $xd + 1.683 \* $yd + 0 \* $zd + 7.045E-3) / $w  
> $y = (-1.54 \* $xd + - 1.539 \* $yd + 2.307 \* $zd + 6.161) / $w  
> $Z = (-0.515 \* $xd + - 0.514 \* $yd + - 0.686 \* $zd + 97.002) / $w  
> $x /= $aspectChange  
> While Abs($x) \>= 1 Or Abs($y) \>= 0.7 Or $Z \<= 0  
> ; specified point is not on screen  
> $xd = $xd / 2  
> $yd = $yd / 2  
> $zd = $zd / 2  
> $w = -0.515 \* $xd + - 0.514 \* $yd + - 0.686 \* $zd + 97.985  
> $x = (-1.682 \* $xd + 1.683 \* $yd + 0 \* $zd + 7.045E-3) / $w  
> $y = (-1.54 \* $xd + - 1.539 \* $yd + 2.307 \* $zd + 6.161) / $w  
> $Z = (-0.515 \* $xd + - 0.514 \* $yd + - 0.686 \* $zd + 97.002) / $w  
> $x /= $aspectChange  
> WEnd  
> $return[0] = ($x + 1) / 2 \* $resolutionX  
> $return[1] = (1 - $y) / 2 \* $resolutionY  
> If $return[0] \> 790 Then  
> $return[0] = 790  
> ElseIf $return[0] \< 40 Then ;car on a pas l'envie de cliquer dans les icone du chat  
> $return[0] = 40  
> EndIf  
> If $return[1] \> 540 Then ;car on a pas l'envie de cliquer dans la bare des skills  
> $return[1] = 540  
> ElseIf $return[1] \< 10 Then  
> $return[1] = 10  
> EndIf  
> Return $return  
> EndFunc ;==\>FromD3toScreenCoords  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; UiRatio()  
> ;;--------------------------------------------------------------------------------  
> Func UiRatio($\_x, $\_y)  
> Dim $return[2]  
> $size = WinGetClientSize("[CLASS:D3 Main Window Class]")  
> $return[0] = $size[1] \* ($\_x / 600)  
> $return[1] = $size[1] \* ($\_y / 600)  
> Return $return  
> EndFunc ;==\>UiRatio  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; GetCurrentPos()  
> ;;--------------------------------------------------------------------------------  
> Func GetCurrentPos()  
> ; Local $mesurepos = TimerInit() ;;;;;;;;;;;;;;  
> Dim $return[3]  
>   
> $return[0] = \_MemoryRead($\_Myoffset + 0x0A0, $d3, 'float')  
> $return[1] = \_MemoryRead($\_Myoffset + 0x0A4, $d3, 'float')  
> $return[2] = \_MemoryRead($\_Myoffset + 0x0A8, $d3, 'float')  
>   
> $Current\_Hero\_X = $return[0]  
> $Current\_Hero\_Y = $return[1]  
> $Current\_Hero\_Z = $return[2]  
>   
> ; Local $difmesurepos = TimerDiff($mesurepos) ;;;;;;;;;;;;;  
> ;ConsoleWrite("Mesure getcurrentpos :" & $difmesurepos &@crlf) ;FOR DEBUGGING;;;;;;;;;;;;  
> Return $return  
> EndFunc ;==\>GetCurrentPos  
>   
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; MoveToPos()  
> ;;--------------------------------------------------------------------------------  
> Func MoveToPos($\_x, $\_y, $\_z, $\_a, $m\_range)  
> Local $TimeOut = TimerInit()  
> $grabtimeout = 0  
> $killtimeout = 0  
> If \_playerdead() Or $GameOverTime = True Or $GameFailed = 1 Or $SkippedMove \> 6 Then  
> $GameFailed = 1  
> Return  
> EndIf  
> Local $toggletry = 0  
> Global $lastwp\_x = $\_x  
> Global $lastwp\_y = $\_y  
> Global $lastwp\_z = $\_z  
> If $\_a = 1 Then Attack()  
> $Coords = FromD3toScreenCoords($\_x, $\_y, $\_z)  
> MouseMove($Coords[0], $Coords[1], 3)  
> $LastCP = GetCurrentPos()  
> MouseDown("middle")  
> Sleep(10)  
> While 1  
>   
> GameOverTime()  
> If $GameOverTime = True Then  
> ExitLoop  
> EndIf  
>   
> GestSpellcast(0, 0, 0)  
>   
> $CurrentLoc = GetCurrentPos()  
> $xd = $lastwp\_x - $CurrentLoc[0]  
> $yd = $lastwp\_y - $CurrentLoc[1]  
> $zd = $lastwp\_z - $CurrentLoc[2]  
> $Distance = Sqrt($xd \* $xd + $yd \* $yd + $zd \* $zd)  
> If $Distance \< $m\_range Then ExitLoop  
> ;If \_MemoryRead($ClickToMoveToggle, $d3, 'float') = 0 Then ExitLoop  
> Local $angle = 1  
> Local $Radius = 25  
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
> While \_MemoryRead($ClickToMoveToggle, $d3, 'float') = 0  
> ;\_log("Togglemove : " & \_MemoryRead($ClickToMoveToggle, $d3, 'float'))  
> $Coords = FromD3toScreenCoords($\_x, $\_y, $\_z)  
> $angle += $Step  
> $Radius += 45  
>   
>   
> ;MouseMove($Coords[0] - (Cos($angle) \* $Radius), $Coords[1] - (Sin($angle) \* $Radius), 3)  
> ; ci desssous du dirty code pour eviter de cliquer n'importe ou hos de la fenetre du jeu  
> $Coords[0] = $Coords[0] - (Cos($angle) \* $Radius)  
> $Coords[1] = $Coords[1] - (Sin($angle) \* $Radius)  
> If $Coords[0] \> 790 Then  
> $Coords[0] = 790  
> ElseIf $Coords[0] \< 40 Then ;car on a pas l'envie de cliquer dans les icone du chat  
> $Coords[0] = 40  
> EndIf  
> If $Coords[1] \> 540 Then ;car on a pas l'envie de cliquer dans la bare des skills  
> $Coords[1] = 540  
> ElseIf $Coords[1] \< 10 Then  
> $Coords[1] = 10  
> EndIf  
> MouseMove($Coords[0], $Coords[1], 3)  
> $toggletry += 1  
> ;\_log("Tryin move :" & " x:" & $\_x & " y:" & $\_y & "coords: " & $Coords[0] & "-" & $Coords[1] & " angle: " & $angle & " Toggle try: " & $toggletry)  
>   
> If \_playerdead\_revive() Then  
> ExitLoop 2  
> EndIf  
>   
> If $angle \>= 2.0 \* $PI Or $toggletry \> 9 Or \_playerdead() Then  
> $SkippedMove += 1  
> \_log("Toggle try: " & $toggletry & " Movement Skipped : " & $SkippedMove)  
> ExitLoop 2 ; le 2 signifie que l'on quitte 2 loop  
> EndIf  
> Sleep(10)  
> WEnd  
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
> Sleep(10)  
> $Coords = FromD3toScreenCoords($lastwp\_x, $lastwp\_y, $lastwp\_z)  
> ;ConsoleWrite("currentloc: " & $\_Myoffset & " - "&$CurrentLoc[0] & " : " & $CurrentLoc[1] & " : " & $CurrentLoc[2] &@CRLF)  
> ;ConsoleWrite("distance/m range: " & $Distance & " : " & $m\_range & @CRLF)  
> If $\_a = 1 And GetDistance($LastCP[0], $LastCP[1], $LastCP[2]) \>= $a\_range / 2 Then  
> MouseUp("middle")  
> $LastCP = GetCurrentPos()  
> If $\_a = 1 Then Attack()  
> ;ConsoleWrite("Last check: " & $Distance & @CRLF)  
> ;MouseMove($Coords[0], $Coords[1], 3)  
>   
> $Coords\_RndX = Random($Coords[0] - 20, $Coords[0] + 20)  
> $Coords\_RndY = Random($Coords[1] - 20, $Coords[1] + 15)  
>   
> If $Coords\_RndX \< 40 Then  
> $Coords\_RndX = 40  
> ElseIf $Coords\_RndX \> 790 Then  
> $Coords\_RndX = 790  
> EndIf  
>   
> If $Coords\_RndY \< 10 Then  
> $Coords\_RndY = 10  
> ElseIf $Coords\_RndY \> 540 Then  
> $Coords\_RndY = 540  
> EndIf  
>   
>   
> MouseMove($Coords\_RndX, $Coords\_RndY, 3) ;little randomisation  
> MouseDown("middle")  
> EndIf  
> MouseMove($Coords[0], $Coords[1], 3)  
> If TimerDiff($TimeOut) \> 75000 Then  
> \_log("MoveToPos Timed out ! ! ! ")  
> If \_checkdisconnect() Then  
> $GameFailed = 1  
> EndIf  
>   
> ExitLoop  
> EndIf  
> WEnd  
> MouseUp("middle")  
> ;;  
> ;Sleep(100)  
> EndFunc ;==\>MoveToPos  
>   
> ;;--------------------------------------------------------------------------------  
> ;; Interact()  
> ;;--------------------------------------------------------------------------------  
> Func Interact($\_x, $\_y, $\_z)  
> ; MoveToPos($\_x, $\_y, $\_z, 0, 25)  
> $Coords = FromD3toScreenCoords($\_x, $\_y, $\_z)  
> MouseClick("left", $Coords[0], $Coords[1], 1, 2)  
> ;While \_MemoryRead($\_itrInteractE + $ofs\_\_InteractOffsetUNK2, $d3, 'int') = 1  
> ; Sleep(50)  
> ;WEnd  
> EndFunc ;==\>Interact  
>   
> ;;--------------------------------------------------------------------------------  
> ;; Approach() Approach a NPC without left clicking  
> ;;--------------------------------------------------------------------------------  
> Func Approach($\_x, $\_y, $\_z)  
> ; MoveToPos($\_x, $\_y, $\_z, 0, 25)  
> ;While \_MemoryRead($\_itrInteractE + $ofs\_\_InteractOffsetUNK2, $d3, 'int') = 1  
> ; Sleep(50)  
> ;WEnd  
> EndFunc ;==\>Approach  
>   
> ;;--------------------------------------------------------------------------------  
> ;; InteractByActorName()  
> ;;--------------------------------------------------------------------------------  
> Func InteractByActorName($a\_name, $dist = 300)  
> Local $index, $offset, $count, $item[10], $foundobject = 0  
> Local $maxtry = 0  
> startIterateObjectsList($index, $offset, $count)  
> If \_playerdead() = False Then  
> While iterateObjectsList($index, $offset, $count, $item)  
> If StringInStr($item[1], $a\_name) And $item[9] \< $dist Then  
> \_log($item[1] & " distance : " & $item[9])  
> While getDistance($item[2], $item[3], $item[4]) \> 40 And $maxtry \<= 15  
> $Coords = FromD3toScreenCoords($item[2], $item[3], $item[4])  
> MouseClick("middle", $Coords[0], $Coords[1], 1, 10)  
> $maxtry += 1  
> \_log('interactbyactor: click x : ' & $Coords[0] & " y : " & $Coords[1])  
> Sleep(800)  
> WEnd  
> Sleep(800)  
> Interact($item[2], $item[3], $item[4])  
> $foundobject = 1  
> Sleep(100)  
> ExitLoop  
> EndIf  
> WEnd  
> EndIf  
> Return $foundobject  
> EndFunc ;==\>InteractByActorName  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; GetLifep()  
> ;;--------------------------------------------------------------------------------  
> Func GetLifep()  
> $curhp = GetAttribute($\_MyGuid, $Atrib\_Hitpoints\_Cur)  
> Return ($curhp / $maxhp)  
> EndFunc ;==\>GetLifep  
>   
> Func GetAttribute($idAttrib, $attrib)  
> Return \_memoryread(GetAttributeOfs($idAttrib, BitOR($attrib[0], 0xFFFFF000)), $d3, $attrib[1])  
> EndFunc ;==\>GetAttribute  
>   
> Func Resistance($idAttrib, $resistance)  
> Return \_memoryread(GetAttributeOfs($idAttrib, BitOR($Atrib\_Resistance[0], BitShift($resistance, -12))), $d3, "float")  
> ;0 : physical  
> ;1 : fire  
> ;2 : lightning  
> ;3 : cold  
> ;4 : poison  
> ;5 : arcane  
> ;6 : holy  
> EndFunc ;==\>Resistance  
>   
> Func GetACDOffsetByACDGUID($Guid)  
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 0x8a0, $d3, "ptr")  
> $ptr3 = \_memoryread($ptr2 + 0x0, $d3, "int")  
> $index = BitAND($Guid, 0xFFFF)  
>   
> $bitshift = \_memoryread($ptr3 + 0x18C, $d3, "int")  
> $group1 = 4 \* BitShift($index, $bitshift)  
> $group2 = BitShift(1, -$bitshift) - 1  
> $group3 = \_memoryread(\_memoryread($ptr3 + 0x148, $d3, "int"), $d3, "int")  
> $group4 = 0x2D0 \* BitAND($index, $group2)  
> Return $group3 + $group1 + $group4  
> EndFunc ;==\>GetACDOffsetByACDGUID  
>   
> ;----------------------------------------------------------------------------------------------------------------------  
> ; Fuction \_Array2DDelete(ByRef $ARRAY, $iDEL, $bCOL=False)  
> ;  
> ; Description Delete one row on a given index in an 1D/2D -Array  
> ;  
> ; Parameter $ARRAY the array, where one row will deleted  
> ; $iDEL Row(Column)-Index to delete  
> ; $bCOL If True, delete column instead of row (default False)  
> ;  
> ; Return Succes 0 ByRef $ARRAY  
> ; Failure 1 set @error = 1; given array are not array  
> ; set @error = 2; want delete column, but not 2D-array  
> ; set @error = 3; index is out of range  
> ;  
> ; Author BugFix (bugfix@autoit.de)  
> ;----------------------------------------------------------------------------------------------------------------------  
> Func \_Array2DDelete(ByRef $ARRAY, $iDEL, $bCOL = False)  
> If (Not IsArray($ARRAY)) Then Return SetError(1, 0, 1)  
> Local $UBound2nd = UBound($ARRAY, 2), $k  
> If $bCOL Then  
> If $UBound2nd = 0 Then Return SetError(2, 0, 1)  
> If ($iDEL \< 0) Or ($iDEL \> $UBound2nd - 1) Then Return SetError(3, 0, 1)  
> Else  
> If ($iDEL \< 0) Or ($iDEL \> UBound($ARRAY) - 1) Then Return SetError(3, 0, 1)  
> EndIf  
> If $UBound2nd = 0 Then  
> Local $arTmp[UBound($ARRAY) - 1]  
> $k = 0  
> For $i = 0 To UBound($ARRAY) - 1  
> If $i \<\> $iDEL Then  
> $arTmp[$k] = $ARRAY[$i]  
> $k += 1  
> EndIf  
> Next  
> Else  
> If $bCOL Then  
> Local $arTmp[UBound($ARRAY)][$UBound2nd - 1]  
> For $i = 0 To UBound($ARRAY) - 1  
> $k = 0  
> For $l = 0 To $UBound2nd - 1  
> If $l \<\> $iDEL Then  
> $arTmp[$i][$k] = $ARRAY[$i][$l]  
> $k += 1  
> EndIf  
> Next  
> Next  
> Else  
> Local $arTmp[UBound($ARRAY) - 1][$UBound2nd]  
> $k = 0  
> For $i = 0 To UBound($ARRAY) - 1  
> If $i \<\> $iDEL Then  
> For $l = 0 To $UBound2nd - 1  
> $arTmp[$k][$l] = $ARRAY[$i][$l]  
> Next  
> $k += 1  
> EndIf  
> Next  
> EndIf  
> EndIf  
> $ARRAY = $arTmp  
> Return $ARRAY  
> EndFunc ;==\>\_Array2DDelete  
>   
>   
> Func iterateObjectsList(ByRef $index, ByRef $offset, ByRef $count, ByRef $item)  
> If $index \> $count Then  
> Return False  
> EndIf  
> $index += 1  
> Local $iterateObjectsListStruct = DllStructCreate("byte[4];ptr;char[64];byte[104];float;float;float;byte[264];int;byte[8];int;byte[44];int")  
> DllCall($d3[0], 'int', 'ReadProcessMemory', 'int', $d3[1], 'int', $offset, 'ptr', DllStructGetPtr($iterateObjectsListStruct), 'int', DllStructGetSize($iterateObjectsListStruct), 'int', '')  
> $item[0] = DllStructGetData($iterateObjectsListStruct, 2) ; Guid  
> $item[1] = DllStructGetData($iterateObjectsListStruct, 3) ; Name  
> $item[2] = DllStructGetData($iterateObjectsListStruct, 5) ; x  
> $item[3] = DllStructGetData($iterateObjectsListStruct, 6) ; y  
> $item[4] = DllStructGetData($iterateObjectsListStruct, 7) ; z  
> $item[5] = DllStructGetData($iterateObjectsListStruct, 13) ; data 1  
> $item[6] = DllStructGetData($iterateObjectsListStruct, 11) ; data 2  
> $item[7] = DllStructGetData($iterateObjectsListStruct, 9) ; data 3  
> $item[8] = $offset  
> $item[9] = getDistance($item[2], $item[3], $item[4]) ; Distance  
> $iterateObjectsListStruct = ""  
>   
> $offset = $offset + $\_ObjmanagerStrucSize  
>   
> Return True  
>   
> EndFunc ;==\>iterateObjectsList  
>   
>   
>   
>   
> Func IterateFilterAttack($IgnoreList)  
> Local $index, $offset, $count, $item[10]  
> startIterateObjectsList($index, $offset, $count)  
> Dim $item\_buff\_2D[1][10]  
> Local $i = 0  
>   
> $compt = 0  
>   
> While iterateObjectsList($index, $offset, $count, $item)  
> $compt += 1  
> If Is\_Interact($item, $IgnoreList) Then  
> If Is\_Shrine($item) Or Is\_Mob($item) Or Is\_Loot($item) or Is\_Decor\_Breakable($item) Then  
> ReDim $item\_buff\_2D[$i + 1][10]  
> For $x = 0 To 9  
> $item\_buff\_2D[$i][$x] = $item[$x]  
> Next  
> $i += 1  
> EndIf  
>   
> EndIf  
> WEnd  
>   
> If $i = 0 Then  
> Return False  
> Else  
>   
> If trim(StringLower($MonsterTri)) = "true" Then  
> \_ArraySort($item\_buff\_2D, 0, 0, 0, 9)  
> EndIf  
>   
> If trim(StringLower($MonsterPriority)) = "true" Then  
> Dim $item\_buff\_2D\_buff = TriObjectMonster($item\_buff\_2D)  
> Dim $item\_buff\_2D = $item\_buff\_2D\_buff  
> EndIf  
> Return $item\_buff\_2D  
> EndIf  
>   
> EndFunc ;==\>IterateFilterAttack  
>   
> Func IterateFilterZone($dist,$n=2)  
> Local $index, $offset, $count, $item[10]  
> startIterateObjectsList($index, $offset, $count)  
> ;~ Dim $item\_buff\_2D[1][10]  
> Local $i = 0  
> $my\_pos\_zone=getcurrentpos()  
> $compt = 0  
>   
> While iterateObjectsList($index, $offset, $count, $item)  
> $compt += 1  
> If Is\_Interact($item, "") Then  
> If Is\_Mob($item) and sqrt(($item[2]-$my\_pos\_zone[0])^2 + ($item[3]-$my\_pos\_zone[1])^2 ) \< $dist and $item[4]\<10 Then  
> ;~ ReDim $item\_buff\_2D[$i + 1][10]  
> ;~ For $x = 0 To 9  
> ;~ $item\_buff\_2D[$i][$x] = $item[$x]  
> ;~ Next  
> $i += 1  
> EndIf  
>   
> EndIf  
> WEnd  
> ;= 0 or ubound($item\_buff\_2D)  
> If $i \<2 Then  
> ;~ \_log("pas assez de mob proche")  
> Return False  
> Else  
> ;~ \_log("nombre : " & $i)  
> return True  
>   
> EndIf  
> EndFunc ;==\>IterateFilterAttack  
>   
> Func UpdateArrayAttack($array\_obj, $IgnoreList, $update\_attrib = 0)  
>   
> If UBound($array\_obj) \<= 1 Or Not IsArray($array\_obj) Then  
> Return False  
> EndIf  
>   
>   
> If $update\_attrib = 0 Then  
> Return UpdateObjectsList(\_Array2DDelete($array\_obj, 0))  
> Else  
>   
> Local $buff2 = IterateFilterAttack($IgnoreList)  
> If trim(StringLower($MonsterTri)) = "true" Then  
> \_ArraySort($buff2, 0, 0, 0, 9)  
> EndIf  
>   
> If trim(StringLower($MonsterPriority)) = "true" Then  
> Dim $buff2\_buff = TriObjectMonster($buff2)  
> Dim $buff2 = $buff2\_buff  
> EndIf  
>   
> Return $buff2  
> EndIf  
> EndFunc ;==\>UpdateArrayAttack  
>   
> Func TriObjectMonster($item)  
>   
> Dim $tab\_monster[1][10]  
> Dim $tab\_other[1][10]  
> Dim $tab\_mixte[1][10]  
> Dim $tab\_elite[1][10]  
> Dim $item\_temp[10]  
> $compt\_monster = 0  
> $compt\_other = 0  
> $compt\_elite = 0  
> $compt\_mixte = 0  
>   
> For $i = 0 To UBound($item) - 1  
>   
> For $z = 0 to 9  
> $item\_temp[$z] = $item[$i][$z]  
> Next  
>   
>   
> ;~  
> ;~ If DetectElite($item[$i][0]) then  
>   
> ;~ If UBound($tab\_elite) \> 1 Or $compt\_elite \<\> 0 Then  
> ;~ ReDim $tab\_elite[UBound($tab\_elite) + 1][10]  
> ;~ EndIf  
> ;~ For $y = 0 To 9  
> ;~ $tab\_elite[UBound($tab\_elite) - 1][$y] = $item[$i][$y]  
> ;~ Next  
> ;~ $compt\_elite += 1  
>   
> ;~ Else  
> if Is\_Mob($item\_temp) Then  
>   
> If UBound($tab\_monster) \> 1 Or $compt\_monster \<\> 0 Then  
> ReDim $tab\_monster[UBound($tab\_monster) + 1][10]  
> EndIf  
> For $y = 0 To 9  
> $tab\_monster[UBound($tab\_monster) - 1][$y] = $item[$i][$y]  
> Next  
> $compt\_monster += 1  
>   
> Else  
>   
> If UBound($tab\_other) \> 1 Or $compt\_other \<\> 0 Then  
> ReDim $tab\_other[UBound($tab\_other) + 1][10]  
> EndIf  
> For $y = 0 To 9  
> $tab\_other[UBound($tab\_other) - 1][$y] = $item[$i][$y]  
> Next  
> $compt\_other += 1  
> EndIf  
>   
> Next  
>   
> ;~ For $i = 0 To UBound($tab\_elite) - 1  
>   
> ;~ If UBound($tab\_mixte) \> 1 Or $compt\_mixte \<\> 0 Then  
> ;~ ReDim $tab\_mixte[UBound($tab\_mixte) + 1][10]  
> ;~ EndIf  
> ;~ For $y = 0 To 9  
> ;~ $tab\_mixte[UBound($tab\_mixte) - 1][$y] = $tab\_elite[$i][$y]  
> ;~ Next  
> ;~ $compt\_mixte += 1  
> ;~ Next  
>   
>   
> For $i = 0 To UBound($tab\_monster) - 1  
>   
> If UBound($tab\_mixte) \> 1 Or $compt\_mixte \<\> 0 Then  
> ReDim $tab\_mixte[UBound($tab\_mixte) + 1][10]  
> EndIf  
> For $y = 0 To 9  
> $tab\_mixte[UBound($tab\_mixte) - 1][$y] = $tab\_monster[$i][$y]  
> Next  
> $compt\_mixte += 1  
> Next  
>   
> For $i = 0 To UBound($tab\_other) - 1  
>   
> If UBound($tab\_mixte) \> 1 Or $compt\_mixte \<\> 0 Then  
> ReDim $tab\_mixte[UBound($tab\_mixte) + 1][10]  
> EndIf  
> For $y = 0 To 9  
> $tab\_mixte[UBound($tab\_mixte) - 1][$y] = $tab\_other[$i][$y]  
> Next  
> $compt\_mixte += 1  
> Next  
>   
> Return $tab\_mixte  
>   
> EndFunc ;==\>TriObjectMonster  
>   
> Func UpdateObjectsList($item)  
> For $i = 0 To UBound($item) - 1  
> Dim $buff\_item[4]  
> Local $pos = DllStructCreate("byte[176];float;float;float")  
> DllCall($d3[0], 'int', 'ReadProcessMemory', 'int', $d3[1], 'int', $item[$i][8], 'ptr', DllStructGetPtr($pos), 'int', DllStructGetSize($pos), 'int', '')  
> $item[$i][2] = DllStructGetData($pos, 2)  
> $item[$i][3] = DllStructGetData($pos, 3)  
> $item[$i][4] = DllStructGetData($pos, 4)  
> $item[$i][9] = getDistance($item[$i][2], $item[$i][3], $item[$i][4]) ; Distance  
> $pos = ""  
> Next  
> Return $item  
> EndFunc ;==\>UpdateObjectsList  
>   
> Func UpdateObjectsPos($offset)  
> Local $obj\_pos[4]  
> Local $pos = DllStructCreate("byte[176];float;float;float")  
> DllCall($d3[0], 'int', 'ReadProcessMemory', 'int', $d3[1], 'int', $offset, 'ptr', DllStructGetPtr($pos), 'int', DllStructGetSize($pos), 'int', '')  
> $obj\_pos[0] = DllStructGetData($pos, 2)  
> $obj\_pos[1] = DllStructGetData($pos, 3)  
> $obj\_pos[2] = DllStructGetData($pos, 4)  
> $obj\_pos[3] = getDistance($obj\_pos[0], $obj\_pos[1], $obj\_pos[2]) ; Distance  
> $pos = ""  
> Return $obj\_pos  
> EndFunc ;==\>UpdateObjectsPos  
>   
> Func Is\_Shrine($item)  
> If StringInStr($item[1], "shrine") and $item[9]\<35 Then  
> Return True  
> Else  
> Return False  
> EndIf  
> EndFunc ;==\>Is\_Shrine  
>   
> Func Is\_Mob($item)  
> If checkfromlist($BanmonsterList, $item[1]) = 0 And checkFromList($monsterList, $item[1]) And $item[6] \<\> -1 And $item[9] \< $a\_range Or checkFromList($SpecialmonsterList, $item[1]) And $item[9] \< $a\_range Then  
> Return True  
> Else  
> Return False  
> EndIf  
> EndFunc ;==\>Is\_Mob  
>   
> global $decorlist=""  
> global $bandecorlist=""  
> Func Is\_Decor\_Breakable($item)  
> If checkfromlist($BandecorList, $item[1]) = 0 And checkFromList($decorList, $item[1]) And $item[6] \<\> -1 And $item[9] \< 18 Then  
> Return True  
> Else  
> Return False  
> EndIf  
> EndFunc ;==\>Is\_Mob  
>   
> Func Is\_Loot($item)  
>   
> If ($item[5] = 2 And $item[6] = -1) Or (StringInStr($item[1], "orb") And StringInStr($item[1], "unique")) Or (StringInStr($item[1], "Spear") And StringInStr($item[1], "unique")) Then  
> ;\_log("Is\_Loot de l'item -\> " & $item[0] & "-" & $item[1] & "-" & $item[2] & " - " & $item[3] & " - " & $item[4] & " - " & $item[5] & " - " & $item[6] & " - " & $item[8] & " - " & $item[9])  
> Return True  
> Else  
> Return False  
> EndIf  
> EndFunc ;==\>Is\_Loot  
>   
> Func Is\_Interact($item, $IgnoreList)  
> If $item[0] \<\> "" And $item[0] \<\> 0xFFFFFFFF And ($item[9] \< $g\_range Or $item[9] \< $a\_range) And StringInStr($IgnoreList, $item[8]) == 0 And StringInStr($handle\_banlistdef, $item[2]&"-"&$item[3]&"-"&$item[4]) == 0 And StringInStr($IgnoreItemList, $item[1]) = 0 And checkfromlist($shrinebanlist, $item[8]) = 0 And Abs($Current\_Hero\_Z - $item[4]) \<= 10 Then  
> If Not Checkstartlist\_regex($Ban\_startstrItemList, $item[1]) And Not Checkendlist\_regex("\_projectile", $item[1]) Then  
> Return True  
> Else  
> Return False  
> EndIf  
> Else  
> Return False  
> EndIf  
> EndFunc ;==\>Is\_Interact  
>   
> Func handle\_Shrine(ByRef $item)  
> If $TakeShrines = "True" Then  
> $CurrentACD = GetACDOffsetByACDGUID($item[0]); ###########  
> $CurrentIdAttrib = \_memoryread($CurrentACD + 0x120, $d3, "ptr"); ###########  
> If GetAttribute($CurrentIdAttrib, $Atrib\_gizmo\_state) \<\> 1 Then  
> If shrine($item[1], $item[8], $item[0]) = False Then  
> $shrinebanlist = $shrinebanlist & "|" & $item[8]  
> EndIf  
> EndIf  
> EndIf  
> EndFunc ;==\>handle\_Shrine  
>   
> Func handle\_Mob(ByRef $item, ByRef $IgnoreList, ByRef $test\_iterateallobjectslist)  
> ; we have a monster  
> $CurrentACD = GetACDOffsetByACDGUID($item[0]); ###########  
> $CurrentIdAttrib = \_memoryread($CurrentACD + 0x120, $d3, "ptr"); ###########  
> If GetAttribute($CurrentIdAttrib, $Atrib\_Hitpoints\_Cur) \> 0 And GetAttribute($CurrentIdAttrib, $Atrib\_Invulnerable) = 0 Then  
>   
> $foundobject = 1  
> If KillMob($item[1], $item[8], $item[0],$test\_iterateallobjectslist) = False Then  
> \_log('ignoring ' & $item[1])  
> $IgnoreList = $IgnoreList & $item[8]  
>   
> If $killtimeout \> 2 Or $grabtimeout \> 2 Then  
> \_log("\_checkdisconnect Cuz :If $killtimeout \> 2 or $grabtimeout \> 2 Then")  
> If \_checkdisconnect() Or \_playerdead() Then  
> $GameFailed = 1  
> EndIf  
> EndIf  
> EndIf  
> If trim(StringLower($MonsterRefresh)) = "true" Then  
> Dim $buff\_array = UpdateArrayAttack($test\_iterateallobjectslist, $IgnoreList, 1)  
> $test\_iterateallobjectslist = $buff\_array  
> EndIf  
> Else  
> \_log('ignoring ' & $item[1])  
> $IgnoreList = $IgnoreList & $item[8]  
> ;\_log("Grabtimeout : " & $grabtimeout & " killtimeout: "& $killtimeout)  
> If $killtimeout \> 2 Or $grabtimeout \> 2 Then  
> If \_checkdisconnect() Or \_playerdead() Then  
> $GameFailed = 1  
> EndIf  
> EndIf  
> EndIf  
> EndFunc ;==\>handle\_Mob  
>   
> Func Checkqual($\_GUID)  
> ; \_log("guid: "&$\_GUID &" name: "& $\_NAME & " qual: "&IterateActorAtribs($\_GUID, $Atrib\_Item\_Quality\_Level))  
> $ACD = GetACDOffsetByACDGUID($\_GUID)  
> $CurrentIdAttrib = \_memoryread($ACD + 0x120, $d3, "ptr");  
> $quality = GetAttribute($CurrentIdAttrib, $Atrib\_Item\_Quality\_Level)  
>   
>   
> Return $quality  
> EndFunc ;==\>CheckItem  
> Func handle\_Loot(ByRef $item, ByRef $IgnoreList, ByRef $test\_iterateallobjectslist)  
> $grabit = False  
> If \_MemoryRead($item[8] + 0x4, $d3, 'ptr') \<\> 0xFFFFFFFF Then  
> ConsoleWrite("Checking " & $item[1] & @CRLF)  
>   
> If $gestion\_affixe\_loot="true" Then  
> Dim $item\_aff\_verif = IterateFilterAffix()  
> Else  
> $item\_aff\_verif = ""  
> EndIf  
>   
> If IsArray($item\_aff\_verif) and $gestion\_affixe\_loot="true" Then  
> if is\_zone\_safe($item[2],$item[3],$item[4],$item\_aff\_verif) or Checkqual($item[0])=9 then  
> $itemDestination = CheckItem($item[0], $item[1])  
> If $itemDestination == "Stash" Or $itemDestination == "Salvage" Or ($itemDestination == "Inventory" And $takepot = True) Then  
> ; this loot is interesting  
> $foundobject = 1  
> If Grabit($item[1], $item[8]) = False Then  
> \_log('ignoring ' & $item[1])  
> $IgnoreList = $IgnoreList & $item[8]  
> handle\_banlist($item[2]&"-"&$item[3]&"-"&$item[4])  
> ;\_log("Grabtimeout : " & $grabtimeout & " killtimeout: "& $killtimeout)  
> If $killtimeout \> 2 Or $grabtimeout \> 2 Then  
> If \_checkdisconnect() Or \_playerdead() Then  
> \_log('\_checkdisconnect A or player D')  
> $GameFailed = 1  
> EndIf  
> EndIf  
>   
> EndIf  
>   
> If Trim(StringLower($ItemRefresh)) = "true" Then  
> Dim $buff\_array = UpdateArrayAttack($test\_iterateallobjectslist, $IgnoreList, 1)  
> $test\_iterateallobjectslist = $buff\_array  
> EndIf  
> Else  
> If checkFromList($monsterList, $item[1]) = False Then  
> $IgnoreItemList = $IgnoreItemList & $item[1] & "-"  
> ;\_log('ignoring ' & $item[8] & " : " & $item[1] & " :::::" &$IgnoreItemList)  
> EndIf  
> EndIf  
> EndIf  
> Else  
> $itemDestination = CheckItem($item[0], $item[1])  
> If $itemDestination == "Stash" Or $itemDestination == "Salvage" Or ($itemDestination == "Inventory" And $takepot = True) Then  
> ; this loot is interesting  
> $foundobject = 1  
> If Grabit($item[1], $item[8]) = False Then  
> \_log('ignoring ' & $item[1])  
> $IgnoreList = $IgnoreList & $item[8]  
> handle\_banlist($item[2]&"-"&$item[3]&"-"&$item[4])  
> ;\_log("Grabtimeout : " & $grabtimeout & " killtimeout: "& $killtimeout)  
> If $killtimeout \> 2 Or $grabtimeout \> 2 Then  
> If \_checkdisconnect() Or \_playerdead() Then  
> \_log('\_checkdisconnect A or player D')  
> $GameFailed = 1  
> EndIf  
> EndIf  
>   
> EndIf  
>   
> If Trim(StringLower($ItemRefresh)) = "true" Then  
> Dim $buff\_array = UpdateArrayAttack($test\_iterateallobjectslist, $IgnoreList, 1)  
> $test\_iterateallobjectslist = $buff\_array  
> EndIf  
> Else  
> If checkFromList($monsterList, $item[1]) = False Then  
> $IgnoreItemList = $IgnoreItemList & $item[1] & "-"  
> ;\_log('ignoring ' & $item[8] & " : " & $item[1] & " :::::" &$IgnoreItemList)  
> EndIf  
> EndIf  
> EndIf  
> EndIf  
> EndFunc ;==\>handle\_Loot  
>   
> Func handle\_banlist($coords\_ban)  
> If StringInStr($handle\_banlist1, $coords\_ban) = false Then  
> \_log("banlist 1 -\> " & $coords\_ban)  
> $handle\_banlist1 = $handle\_banlist1 & "|" & $coords\_ban  
> ElseIf StringInStr($handle\_banlist1, $coords\_ban) And StringInStr($handle\_banlist2, $coords\_ban) = false Then  
> \_log("banlist 2 -\> " & $coords\_ban)  
> $handle\_banlist2 = $handle\_banlist2 & "|" & $coords\_ban  
> ElseIf StringInStr($handle\_banlist2, $coords\_ban) Then  
> \_log("banlist def -\> " & $coords\_ban)  
> $handle\_banlistdef = $handle\_banlistdef & "|" & $coords\_ban  
> EndIf  
> \_log("banlist 1 -\> " & $handle\_banlist1)  
>   
> \_log("banlist 2 -\> " & $handle\_banlist2)  
>   
> \_log("banlist def -\> " & $handle\_banlistdef)  
>   
> EndFunc ;==\>handle\_banlist  
>   
> ;;--------------------------------------------------------------------------------  
> ;; Attack()  
> ;;--------------------------------------------------------------------------------  
> Func Attack()  
> If \_playerdead\_revive() Then  
> Return  
> EndIf  
>   
> If \_playerdead() Or ($GameFailed = 1) Then  
> $GameFailed = 1  
> \_log("Return Cuz : If \_playerdead or gamefailed ")  
> Return  
> EndIf  
> Local $IgnoreList = ""  
> Local $item[10]  
> Dim $test\_iterateallobjectslist = IterateFilterAttack($IgnoreList)  
> If IsArray($test\_iterateallobjectslist) Then  
> While IsArray($test\_iterateallobjectslist)  
> If \_playerdead\_revive() Then  
> ExitLoop  
> EndIf  
> If \_playerdead() Or ($GameFailed = 1) Then  
> $GameFailed = 1  
> \_log("Return Cuz : If \_playerdead or gamefailed ")  
> ExitLoop  
> EndIf  
> For $i = 0 To 9  
> $item[$i] = $test\_iterateallobjectslist[0][$i]  
> Next  
> If Is\_Interact($item, $IgnoreList) Then  
> If Is\_Shrine($item) Then  
> handle\_Shrine($item)  
> ElseIf Is\_Mob($item) or Is\_Decor\_Breakable($item) Then  
> handle\_Mob($item, $IgnoreList, $test\_iterateallobjectslist)  
> ElseIf Is\_Loot($item) Then  
> handle\_Loot($item, $IgnoreList, $test\_iterateallobjectslist)  
> EndIf  
> EndIf  
> Dim $buff\_array = UpdateArrayAttack($test\_iterateallobjectslist, $IgnoreList)  
> Dim $test\_iterateallobjectslist = $buff\_array  
>   
> WEnd  
>   
> EndIf  
> EndFunc ;==\>Attack  
>   
> Func DetectElite($Guid)  
> Return \_MemoryRead(GetACDOffsetByACDGUID($Guid) + 0xB8, $d3, 'int')  
> EndFunc ;==\>DetectElite  
>   
> ;;--------------------------------------------------------------------------------  
> ;; KillMob()  
> ;;--------------------------------------------------------------------------------  
> Func KillMob($name, $offset, $Guid,$test\_iterateallobjectslist2)  
> $return = True  
> $begin = TimerInit()  
>   
>   
> Dim $pos = UpdateObjectsPos($offset)  
>   
>   
> $Coords = FromD3toScreenCoords($pos[0], $pos[1], $pos[2])  
> MouseMove($Coords[0], $Coords[1], 3)  
>   
> $elite = DetectElite($Guid)  
> ;loop the attack until the mob is dead  
>   
> \_log("Attacking : " & $name & "; Type : " & $elite);  
> While IterateActorAtribs($Guid, $Atrib\_Hitpoints\_Cur) \> 0  
> $myposs\_aff = getcurrentpos()  
>   
> If \_playerdead\_revive() Then  
> $return = False  
> ExitLoop  
> EndIf  
> Dim $pos = UpdateObjectsPos($offset)  
>   
> if $gestion\_affixe="true" then maffmove($myposs\_aff[0],$myposs\_aff[1],$myposs\_aff[2],$pos[0],$pos[1])  
> for $a=0 to ubound($test\_iterateallobjectslist2)-1  
> $CurrentACD = GetACDOffsetByACDGUID($test\_iterateallobjectslist2[$a][0]); ###########  
> $CurrentIdAttrib = \_memoryread($CurrentACD + 0x120, $d3, "ptr"); ###########  
> If GetAttribute($CurrentIdAttrib, $Atrib\_Hitpoints\_Cur) \> 0 then  
> dim $dist\_maj=UpdateObjectsPos($test\_iterateallobjectslist2[$a][8])  
> $test\_iterateallobjectslist2[$a][9]=$dist\_maj[3]  
> Else  
> $test\_iterateallobjectslist2[$a][9]=10000  
> endif  
> Next  
> \_ArraySort($test\_iterateallobjectslist2, 0, 0, 0, 9)  
> $dist\_verif= getDistance($test\_iterateallobjectslist2[0][2], $test\_iterateallobjectslist2[0][3], $test\_iterateallobjectslist2[0][4])  
> Dim $pos = UpdateObjectsPos($offset)  
> if $pos[3]\>$dist\_verif+5 then exitloop  
>   
> ;if getDistance($pos[0], $pos[1], $pos[2])\>20 and IterateFilterZone(30,1) then exitloop  
>   
>   
> $Coords = FromD3toScreenCoords($pos[0], $pos[1], $pos[2])  
> MouseMove($Coords[0], $Coords[1], 3)  
> GestSpellcast($pos[3], 1, $elite, $Guid, $offset)  
> If TimerDiff($begin) \> $a\_time Then  
> $killtimeout += 1  
> ; after this time, the mob should be dead, otherwise he is probly unkillable  
> $return = False  
> ExitLoop  
> EndIf  
> WEnd  
> Return $return  
> EndFunc ;==\>KillMob  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; Grabit()  
> ;;--------------------------------------------------------------------------------  
> Func Grabit($name, $offset)  
> Local $OriginalOffsetValue = \_MemoryRead($offset + 0x4, $d3, 'ptr')  
> $begin = TimerInit()  
> Dim $CoordVerif[3]  
>   
>   
> ConsoleWrite("Grabbing :" & ($name) & @CRLF) ;FOR DEBUGGING  
>   
> Dim $pos = UpdateObjectsPos($offset)  
>   
> If (StringInStr($name, "gold")) Then  
> $Coords = FromD3toScreenCoords($pos[0], $pos[1], $pos[2])  
> $CoordVerif[0] = $pos[0]  
> $CoordVerif[1] = $pos[1]  
> $CoordVerif[2] = $pos[2]  
> MouseClick("middle", $Coords[0], $Coords[1], 1, 5)  
> Else  
> Interact($pos[0], $pos[1], $pos[2])  
> EndIf  
> While \_MemoryRead($offset + 0x4, $d3, 'ptr') = $OriginalOffsetValue  
> If \_MemoryRead($offset + 0x4, $d3, 'ptr') = 0xFFFFFFFF Then  
> ExitLoop  
> EndIf  
>   
> If \_playerdead\_revive() Then  
> $return = False  
> ExitLoop  
> EndIf  
> GestSpellcast(0, 2, 0)  
>   
> If TimerDiff($begin) \> $g\_time Then  
> $grabtimeout += 1  
> ; After this time we should already had the item  
> Return False  
> EndIf  
>   
> If $grabskip = 1 Then  
> Return False  
> ExitLoop  
> EndIf  
>   
> Dim $pos = UpdateObjectsPos($offset)  
>   
> If (StringInStr($name, "gold")) Then  
>   
>   
> $Coords = FromD3toScreenCoords($pos[0], $pos[1], $pos[2])  
>   
> ;Check if the coord X y z havn't changed.  
>   
>   
> If ($CoordVerif[0] \<\> $pos[0] Or $CoordVerif[1] \<\> $pos[1] Or $CoordVerif[2] \<\> $pos[2]) Then  
> \_log("Fake GOLD")  
> Return False  
> Else  
> MouseClick("middle", $Coords[0], $Coords[1], 1, 5)  
> EndIf  
> Else  
>   
> Interact($pos[0], $pos[1], $pos[2])  
>   
>   
> ;If \_inventoryfull() Then  
> If Detect\_UI\_error(0) Then  
> Unbuff()  
> TpRepairAndBack()  
> Buffinit()  
> EndIf  
>   
> EndIf  
> Sleep(50)  
> WEnd  
> Return True  
> EndFunc ;==\>Grabit  
>   
> Func GetIlvlFromACD($\_ACDid)  
>   
> $ActorStructure = DllStructCreate("int;int;char[128];int;byte[36];float;float;float")  
> $ACDStructure = DllStructCreate("int;char[128];byte[12];int;byte[32];int;int")  
> $itemsAcdOfs = $\_ACDid  
> $CurrentIdAttrib = \_memoryread($itemsAcdOfs + 0x120, $d3, "ptr"); ###########  
>   
> DllCall($d3[0], 'int', 'ReadProcessMemory', 'int', $d3[1], 'int', $itemsAcdOfs, 'ptr', DllStructGetPtr($ACDStructure), 'int', DllStructGetSize($ACDStructure), 'int', '')  
> $idsnogball = Hex(DllStructGetData($ACDStructure, 6), 8)  
> Local $iIndex = \_ArraySearch($allSNOitems, $idsnogball, 0, 0, 1, 1)  
>   
> If Int($iIndex) \< UBound($allSNOitems) Then  
> ;\_log("iIndex - \> " & $iIndex)  
> Return $allSNOitems[$iIndex][1]  
> Else  
> Return 0  
> EndIf  
>   
> EndFunc ;==\>GetIlvlFromACD  
>   
> ;;================================================================================  
> ; Function: CheckItem  
> ; Description: This will check a single item and tell if we keep it or not  
> ; This function will be the core of the item filtering  
> ;  
> ; Return: Trash  
> ; Stash  
> ; Salvage  
> ; Inventory  
> ;==================================================================================  
> Func CheckItem($\_GUID, $\_NAME, $\_MODE = 0)  
> ; \_log("guid: "&$\_GUID &" name: "& $\_NAME & " qual: "&IterateActorAtribs($\_GUID, $Atrib\_Item\_Quality\_Level))  
> \_log("checkitem -\> " & $\_NAME)  
>   
> If checkFromList($Potions, $\_NAME) Then  
> \_log($\_NAME & " ==\> It's a pot")  
> Return "Inventory"  
> ElseIf checkFromList($grablist, $\_NAME) Then  
> Return "Stash"  
> EndIf  
>   
>   
> If Not Checkstartlist\_regex($Ban\_ItemACDCheckList, $\_NAME) Then  
> $ACD = GetACDOffsetByACDGUID($\_GUID)  
> $CurrentIdAttrib = \_memoryread($ACD + 0x120, $d3, "ptr");  
> $quality = GetAttribute($CurrentIdAttrib, $Atrib\_Item\_Quality\_Level)  
>   
> If $quality \>= $QualityLevel Then ;filter the magic and higher  
> \_log($\_NAME & " ==\> It's the quality level \>" & $QualityLevel)  
> Return "Stash"  
> EndIf  
>   
>   
> If checkFromtable($GrabListTab, $\_NAME, $quality) Then  
> If checkIlvlFromtable($GrabListTab, $ACD, $\_NAME) Then  
>   
> If $\_MODE = 0 Then  
> \_log($\_NAME & " ==\> It's a rare in our list ")  
> Return "Stash"  
> Else  
> \_log($\_NAME & " ==\> It's a rare in our list for filterbackpack")  
> Return "Stash\_filtre"  
> EndIf  
>   
> EndIf  
> EndIf  
> EndIf  
>   
> \_log($\_NAME & " ==\> Trash item")  
> Return "Trash"  
> EndFunc ;==\>CheckItem  
>   
> Func InventoryMove($col = 0, $row = 0)  
> $Coords = UiRatio(530 + ($col \* 27), 338 + ($row \* 27))  
> MouseMove($Coords[0], $Coords[1], 2)  
> EndFunc ;==\>InventoryMove  
>   
> ;;--------------------------------------------------------------------------------  
> ;; checkForPotion()  
> ;;--------------------------------------------------------------------------------  
> Func checkForPotion()  
>   
> $life = GetLifep()  
> $diff = TimerDiff($timeforpotion)  
> If $life \< $LifeForPotion / 100 And $diff \> 1500 Then  
> Send("q")  
> $timeforpotion = TimerInit()  
> EndIf  
>   
> EndFunc ;==\>checkForPotion  
>   
> ;;--------------------------------------------------------------------------------  
> ;; checkFromList()  
> ;;--------------------------------------------------------------------------------  
> Func checkFromList($list, $compare, $delimiter = '|')  
> Local $arrayList = StringSplit($list, $delimiter)  
> For $i = 1 To $arrayList[0]  
> If StringInStr($compare, $arrayList[$i]) Then  
> Return 1  
> EndIf  
> Next  
> Return 0  
> EndFunc ;==\>checkFromList  
>   
> Global $Ban\_startstrItemList = "barbarian\_|Demonhunter\_|Monk\_|WitchDoctor\_|WD\_|Enchantress\_|Scoundrel\_|Templar\_|Wizard\_|monsterAffix\_|Demonic\_|Generic\_|fallenShaman\_fireBall\_impact|demonFlyer\_B\_clickable\_corpse\_01|grenadier\_proj\_trail"  
> Global $Ban\_endstrItemList = "\_projectile"  
> Global $Ban\_ItemACDCheckList = "a1\_|a3\_|a2\_|a4\_|Lore\_Book\_Flippy|Topaz\_|Emeraude\_|Rubis\_|Amethyste\_|healthPotion\_Mythic|GoldCoins|GoldSmall|GoldMedium|GoldLarge"  
>   
> Func Checkstartlist\_regex($compare, $\_NAME)  
> Dim $tab\_temp = StringSplit($compare, "|", 2)  
> $count = UBound($tab\_temp)  
> For $i = 0 To $count - 1  
> If StringRegExp($\_NAME, "(?i)^" & $tab\_temp[$i] & "") = 1 Then  
> Return True  
> EndIf  
> Next  
> Return False  
> EndFunc ;==\>Checkstartlist\_regex  
>   
> Func Checkendlist\_regex($compare, $\_NAME)  
> Dim $tab\_temp = StringSplit($compare, "|", 2)  
> $count = UBound($tab\_temp)  
> For $i = 0 To $count - 1  
> If StringRegExp($\_NAME, "(?i)" & $tab\_temp[$i] & "$") = 1 Then  
> Return True  
> EndIf  
> Next  
> Return False  
> EndFunc ;==\>Checkendlist\_regex  
>   
>   
> Func Checkendstr\_regex($compare, $\_NAME)  
> If StringRegExp($\_NAME, "(?i)$" & $compare & "$") = 1 Then  
> Return True  
> EndIf  
> EndFunc ;==\>Checkendstr\_regex  
>   
> Func Checkstartstr\_regex($compare, $\_NAME)  
> If StringRegExp($\_NAME, "(?i)^" & $compare & "") = 1 Then  
> Return True  
> EndIf  
> EndFunc ;==\>Checkstartstr\_regex  
>   
>   
> Func checkFromTable($table, $compare, $quality)  
> For $i = 0 To UBound($table) - 1  
> If StringRegExp($compare, "(?i)^" & $table[$i][0] & "") = 1 And $quality \>= $table[$i][2] Then  
> ;If StringInStr($compare, $table[$i][0]) And $quality \>= $table[$i][2] Then  
> Return 1  
> EndIf  
> Next  
> Return 0  
> EndFunc ;==\>checkFromTable  
>   
> Func checkIlvlFromTable($table, $ACD, $compare)  
> For $i = 0 To UBound($table) - 1  
> If StringRegExp($compare, "(?i)^" & $table[$i][0] & "") = 1 Then  
> ;If StringInStr($compare, $table[$i][0]) Then  
> If $table[$i][1] \> 0 Then  
> $ilvl = GetILvlFromACD($ACD)  
> If $ilvl \>= $table[$i][1] Then  
> Return 1  
> EndIf  
> Else  
> Return 1  
> EndIf  
> EndIf  
> Next  
> Return 0  
> EndFunc ;==\>checkIlvlFromTable  
>   
> Func checkFiltreFromtable($table, $name, $CurrentIdAttrib)  
> For $i = 0 To UBound($table) - 1  
> If StringRegExp($name, "(?i)^" & $table[$i][0] & "") = 1 Then  
> If Not $table[$i][3] = 0 Then  
> $filtre\_buff = $table[$i][3]  
> $tab\_filter = StringSplit($table[$i][4], "|", 2)  
> \_log("filtre avant : " & $filtre\_buff, 1)  
> For $y = 0 To UBound($tab\_filter) - 1  
> $const\_result = \_filter2attrib($CurrentIdAttrib, $tab\_filter[$y])  
> $filtre\_buff = StringReplace($filtre\_buff, $tab\_filter[$y], $const\_result, 0, 2)  
> $filtre\_buff = StringReplace($filtre\_buff, ":", "\>=", 0, 2)  
> Next  
> \_log("filtre apres : " & $filtre\_buff, 1)  
> If Execute($filtre\_buff) Then  
> \_log("execute donne true")  
> Return True  
> Else  
> \_log("execute donne false")  
> Return False  
> EndIf  
> EndIf  
> EndIf  
> Next  
>   
> EndFunc ;==\>checkFiltreFromtable  
>   
> ;;--------------------------------------------------------------------------------  
> ;; SkipDialog()  
> ;;--------------------------------------------------------------------------------  
> Func SkipDialog($\_Count)  
> For $i = 1 To $\_Count  
> Send("{SPACE}")  
> Sleep(100)  
> Next  
> EndFunc ;==\>SkipDialog  
>   
> Func OpenWp(ByRef $item)  
> Local $maxtry = 0  
> If \_playerdead() = False Then  
> \_log($item[1] & " distance : " & $item[9])  
> While getDistance($item[2], $item[3], $item[4]) \> 40 And $maxtry \<= 15  
> $Coords = FromD3toScreenCoords($item[2], $item[3], $item[4])  
> MouseClick("middle", $Coords[0], $Coords[1], 1, 10)  
> $maxtry += 1  
> \_log('interactbyactor: click x : ' & $Coords[0] & " y : " & $Coords[1])  
> Sleep(500)  
> WEnd  
> ;Sleep(500)  
> Interact($item[2], $item[3], $item[4])  
> Sleep(100)  
> EndIf  
>   
> EndFunc ;==\>OpenWp  
>   
> ;;--------------------------------------------------------------------------------  
> ;; TakeWP()  
> ;;--------------------------------------------------------------------------------  
> Func TakeWP($tarChapter, $tarNum, $curChapter, $curNum)  
> If $GameFailed = 0 Then  
> Local $Waypoint = ""  
> While Not offsetlist()  
> Sleep(10)  
> WEnd  
>   
> #cs  
> If FindActor("waypoint\_arrival\_ribbonGeo", 80) Then  
> $Waypoint = "waypoint\_arrival\_ribbonGeo"  
> ElseIf FindActor("waypoint\_neutral\_ringGlow", 80) Then  
> $Waypoint = "waypoint\_neutral\_ringGlow"  
> ElseIf FindActor("Waypoint\_Town", 80) Then  
> $Waypoint = "Waypoint\_Town"  
> Else  
> $Waypoint = "waypoint"  
> EndIf  
> #ce  
>   
>   
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> Local $index, $offset, $count, $item[10], $maxRange = 80  
> startIterateObjectsList($index, $offset, $count)  
> While iterateObjectsList($index, $offset, $count, $item)  
> If (StringInStr($item[1], "waypoint\_arrival\_ribbonGeo") And $item[9] \< $maxRange) Or (StringInStr($item[1], "waypoint\_neutral\_ringGlow") And $item[9] \< $maxRange) Or (StringInStr($item[1], "waypoint\_neutral\_ringGlow") And $item[9] \< $maxRange) Then  
> If StringInStr($item[1], "waypoint\_arrival\_ribbonGeo") Then  
> $Waypoint = "waypoint\_arrival\_ribbonGeo"  
> ElseIf StringInStr($item[1], "waypoint\_neutral\_ringGlow") Then  
> $Waypoint = "waypoint\_neutral\_ringGlow"  
> Else  
> $Waypoint = "Waypoint\_Town"  
> EndIf  
> ExitLoop  
> EndIf  
> WEnd  
>   
> If $Waypoint = "" Then  
> $Waypoint = "waypoint"  
> EndIf  
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
>   
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
>   
> If $Waypoint = "waypoint" Then ;WAYPOINT PAR DEFAUT ON a PAS TROUVER ITEM  
> \_log("enclenchement Old waypoint")  
> InteractByActorName($Waypoint)  
> Sleep(350)  
> Local $wptry = 0  
> While \_checkWPopen() = False And \_playerdead() = False  
> If $wptry \<= 6 Then  
> \_log('Fail to open wp')  
> $wptry = $wptry + 1  
> InteractByActorName($Waypoint)  
> EndIf  
> If $wptry \> 6 Then  
> $GameFailed = 1  
> \_log('Failed to open wp after 6 try')  
> ExitLoop  
> EndIf  
> WEnd  
>   
> Else ;WAYPOINT DEFINIT, ON A ITEM  
> \_log("enclechement new waypoint")  
> OpenWp($item)  
> Sleep(350)  
> Local $wptry = 0  
> While \_checkWPopen() = False And \_playerdead() = False  
> If $wptry \<= 6 Then  
> \_log('Fail to open wp')  
> $wptry = $wptry + 1  
> OpenWp($item)  
> EndIf  
> If $wptry \> 6 Then  
> $GameFailed = 1  
> \_log('Failed to open wp after 6 try')  
> ExitLoop  
> EndIf  
> WEnd  
>   
> EndIf  
>   
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
>   
>   
> #cs  
> InteractByActorName($Waypoint)  
> Sleep(350)  
> Local $wptry = 0  
> While \_checkWPopen() = False And \_playerdead() = False  
> If $wptry \<= 6 Then  
> \_log('Fail to open wp')  
> $wptry = $wptry + 1  
> InteractByActorName($Waypoint)  
> EndIf  
> If $wptry \> 6 Then  
> $GameFailed = 1  
> \_log('Failed to open wp after 6 try')  
> ExitLoop  
> EndIf  
> WEnd  
> #ce  
>   
> If $tarChapter \<\> $curChapter Or ($tarChapter = $curChapter And $tarChapter \< $curChapter) Then  
> For $i = 0 To $tarChapter - 1  
> $coord = UiRatio(35, 100 + ($i \* 12.5))  
> MouseClick("left", $coord[0], $coord[1], 1, 3) ; Close chapters  
> Next  
> $coord = UiRatio(145, 100 + ($tarChapter \* 12.5) + 23 + ($tarNum \* 32))  
> MouseClick("left", $coord[0], $coord[1], 1, 3) ; Click wp  
> EndIf  
> If $tarChapter = $curChapter And $tarChapter \> $curChapter Then  
> For $i = 0 To $tarChapter - 1  
> $coord = UiRatio(35, 100 + ($i \* 12.5))  
> MouseClick("left", $coord[0], $coord[1], 1, 3) ; Close chapters  
> Next  
> $coord = UiRatio(145, 100 + ($tarChapter \* 12.5) + 23 + 12 + ($tarNum \* 32))  
> MouseClick("left", $coord[0], $coord[1], 1, 3) ; Click wp  
> EndIf  
> Sleep(1500)  
>   
> While Not offsetlist()  
> Sleep(10)  
> WEnd  
> $SkippedMove = 0 ;reset ouur skipped move count cuz we should be in brand new area  
> EndIf  
> EndFunc ;==\>TakeWP  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; \_resumegame()  
> ;;--------------------------------------------------------------------------------  
> Func \_resumegame()  
> \_log("Resume Game")  
> Sleep(Random(500, 1000, 1))  
> If $Try\_ResumeGame \> 2 Then  
> Local $wait\_aftertoomanytry = Random(($Try\_ResumeGame \* 2) \* 60000, ($Try\_ResumeGame \* 2) \* 120000, 1)  
> \_log("Sleep after too many \_resumegame -\> " & $wait\_aftertoomanytry)  
> Sleep($wait\_aftertoomanytry)  
> EndIf  
> \_randomclick(106, 233)  
> $Try\_ResumeGame += 1  
> Sleep(4000)  
> EndFunc ;==\>\_resumegame  
>   
> Func \_logind3()  
>   
> If $Try\_Logind3 \> 2 Then  
> Local $wait\_aftertoomanytry = Random(($Try\_Logind3 \* 2) \* 60000, ($Try\_Logind3 \* 2) \* 120000, 1)  
> \_log("Sleep after too many \_logind3 -\> " & $wait\_aftertoomanytry)  
> Sleep($wait\_aftertoomanytry)  
> EndIf  
>   
> WinActivate("[CLASS:D3 Main Window Class]")  
> \_log("Login")  
> Sleep(20)  
> Send($d3pass)  
> Sleep(2000)  
> Send("{ENTER}")  
> Sleep(Random(5000, 6000, 1))  
>   
> $Try\_Logind3 += 1  
> EndFunc ;==\>\_logind3  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; \_leavegame()  
> ;;--------------------------------------------------------------------------------  
> Func \_leavegame()  
> If \_ingame() Then  
> \_log("Leave Game")  
> Send("{SPACE}") ; to make sure everything is closed  
> Send("{ESCAPE}")  
> Sleep(Random(200, 300, 1))  
> While \_escmenu() = False  
> Send("{ESCAPE}")  
> Sleep(Random(200, 300, 1))  
> WEnd  
> \_randomclick(420, 323)  
> Sleep(Random(500, 1000, 1))  
> \_log("Leave Game Done")  
> EndIf  
> EndFunc ;==\>\_leavegame  
>   
> ;;--------------------------------------------------------------------------------  
> ;; Repair()  
> ;;--------------------------------------------------------------------------------  
> Func Repair()  
> 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  
> Send("{PRINTSCREEN}")  
> Sleep(200)  
> \_log('Failed to open Vendor after 4 try')  
> WinSetOnTop("[CLASS:D3 Main Window Class]", "", 0)  
> MsgBox(0, "Impossible d'ouvrir le vendeur :", "SVP, veuillez reporter ce problème sur le forum. Erreur : v001 ")  
> Terminate()  
> ExitLoop  
> EndIf  
> WEnd  
> GetRepairTab()  
>   
> $coord = UiRatio(290, 130 + ($RepairTab \* 70))  
> MouseClick("left", $coord[0], $coord[1], 1, 3) ; Repair tab  
> Sleep(100)  
> $coord = UiRatio(150, 330)  
> MouseClick("left", $coord[0], $coord[1], 1, 3) ; Repair Button  
> Sleep(100)  
> Send("{SPACE}")  
> EndFunc ;==\>Repair  
>   
> ;;================================================================================  
> ; Function: GetDistance($\_x,$\_y,$\_z)  
> ; Description: Check distance between you and a desired position.  
> ; Parameter(s): $\_x,$\_y and $\_z - the target position  
> ;  
> ; Note(s): Returns a distance in float  
> ;==================================================================================  
> Func GetDistance($\_x, $\_y, $\_z)  
> $CurrentLoc = GetCurrentPos()  
> $xd = $\_x - $CurrentLoc[0]  
> $yd = $\_y - $CurrentLoc[1]  
> $zd = $\_z - $CurrentLoc[2]  
> $Distance = Sqrt($xd \* $xd + $yd \* $yd + $zd \* $zd)  
> Return $Distance  
> EndFunc ;==\>GetDistance  
>   
> ;;================================================================================  
> ; Function: GetDistance($\_x,$\_y,$\_z)  
> ; Description: Check distance between you and a desired position.  
> ; Parameter(s): $\_x,$\_y and $\_z - the target position  
> ;  
> ; Note(s): Returns a distance in float  
> ;==================================================================================  
> Func GetMyStats()  
> Local $index, $offset, $count, $item[4]  
> startIterateLocalActor($index, $offset, $count)  
> While iterateLocalActorList($index, $offset, $count, $item)  
> If StringInStr($item[2], "GoldCoin-") Then  
> \_log("Current GOLD: " & IterateActorAtribs($item[1], $Atrib\_ItemStackQuantityLo))  
> ExitLoop  
> EndIf  
> WEnd  
> \_log("Power Disabled: " & IterateActorAtribs($\_MyGuid, $Atrib\_Magic\_Find\_Handicap))  
> \_log("Difficulty: " & IterateActorAtribs($\_MyGuid, $Atrib\_Difficulty))  
> \_log("Act: " & IterateActorAtribs($\_MyGuid, $Atrib\_Act))  
> \_log("Current Level: " & IterateActorAtribs($\_MyGuid, $Atrib\_Level))  
> \_log("Strength: " & IterateActorAtribs($\_MyGuid, $Atrib\_Strength\_Total))  
> \_log("Dexterity: " & IterateActorAtribs($\_MyGuid, $Atrib\_Dexterity\_Total))  
> \_log("Inteligence: " & IterateActorAtribs($\_MyGuid, $Atrib\_Intelligence\_Total))  
> \_log("Vitality: " & IterateActorAtribs($\_MyGuid, $Atrib\_Vitality\_Total))  
> \_log("Gold find: " & IterateActorAtribs($\_MyGuid, $Atrib\_Gold\_Find))  
> \_log("Magic find: " & IterateActorAtribs($\_MyGuid, $Atrib\_Magic\_Find))  
> \_log("Pickup Radius : " & IterateActorAtribs($\_MyGuid, $Atrib\_Gold\_PickUp\_Radius))  
> \_log("Movement speed : " & IterateActorAtribs($\_MyGuid, $Atrib\_Movement\_Scalar\_Capped\_Total))  
>   
> EndFunc ;==\>GetMyStats  
> Func GameOverTime()  
> Global $timedifmaxgamelength = TimerDiff($timermaxgamelength)  
> If $timedifmaxgamelength \> $maxgamelength Then  
> \_log('game over time !')  
> Global $GameOverTime = True  
> EndIf  
> EndFunc ;==\>GameOverTime  
>   
> Func Terminate()  
> \_MemoryClose($d3)  
> If $checkx64 = 1 Then  
> MouseUp("middle")  
> MouseUp("left")  
> Send("{SHIFTUP}")  
> Exit 0  
>   
> Else  
>   
>   
> WinSetOnTop("[CLASS:D3 Main Window Class]", "", 0)  
> If Not FileExists(@ScriptDir & ".\stats") Then  
> DirCreate(@ScriptDir & ".\stats")  
> EndIf  
> $file = FileOpen(@ScriptDir & ".\stats\" & $fichierstat, 1)  
> FileWriteLine($file, $DebugMessage)  
> FileClose($file)  
> extendedstats()  
> MouseUp("middle")  
> MouseUp("left")  
> Send("{SHIFTUP}")  
> Exit 0  
> EndIf  
> EndFunc ;==\>Terminate  
>   
> Func extendedstats()  
> If $Totalruns \>= 15 Then  
>   
>   
>   
> $sessionstats = "data.addRow([new Date(" & @YEAR & "," & @MON & "," & @MDAY & "," & @HOUR & "," & @MIN & ")," & ($dif\_timer\_stat / ($Totalruns) / 1000) & "," & $GOLDMOYbyH / 1000 & "," & ($Xp\_Moy\_Hrs / 100000) & "," & (($Death\*3 + $Res\_compt) / $Totalruns)\*100 & "," & $successratio \* 1000 & "]);"  
> $szFile = "statscontrol.html"  
> $szText = FileRead($szFile)  
> $szText = StringReplace($szText, "//GoGoAu3End", $sessionstats & @CRLF & "//GoGoAu3End")  
> FileDelete($szFile)  
> FileWrite($szFile,$szText)  
> EndIf  
> EndFunc ;==\>extendedstats  
>   
> Func TogglePause()  
> $Paused = Not $Paused  
> If $Paused Then  
> WinSetOnTop("[CLASS:D3 Main Window Class]", "", 0)  
> While $Paused  
> Sleep(100)  
> TrayTip("", 'Script is "Paused"', 5)  
> WEnd  
> EndIf  
> CheckWindowD3()  
> EndFunc ;==\>TogglePause  
>   
> Func \_log($text, $write = 0)  
>   
> $texte\_write = @MDAY & "/" & @MON & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & " | " & $text  
>   
> If $write == 1 Then  
> $file = FileOpen(@ScriptDir & "\log\" & $fichierlog, 1)  
> If $file = -1 Then  
> \_log("Log file error, cant be open")  
> Else  
> FileWrite($file, $texte\_write & @CRLF)  
> EndIf  
> FileClose($file)  
> EndIf  
>   
> ConsoleWrite(@MDAY & "/" & @MON & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & " | " & $text & @CRLF)  
> EndFunc ;==\>\_log  
>   
> Func RandSleep($min = 5, $max = 45, $chance = 3)  
> $randNum = Round(Random(1, 100))  
> If $randNum \<= $chance Then  
> $sleepTime = Random($min \* 1000, $max \* 1000)  
> \_log("Sleeping " & $sleepTime & "ms")  
> For $c = 0 To 10  
> Sleep($sleepTime / 10)  
> Next  
> EndIf  
> EndFunc ;==\>RandSleep  
> Func \_randomclick($x, $y, $button = "left")  
> $coord = UiRatio($x, $y)  
> MouseClick($button, Random($coord[0] - 3, $coord[0] + 3), Random($coord[1] - 3, $coord[1] + 3))  
> EndFunc ;==\>\_randomclick  
>   
> ;;--------------------------------------------------------------------------------  
> ;;############# Speels by Xoum  
> ;;--------------------------------------------------------------------------------  
>   
> ;--------------------------------------------------------------------------------  
> ;; setChararacter()  
> ;;--------------------------------------------------------------------------------  
>   
> Func setChararacter($nameChar)  
> $splitName = StringSplit($nameChar, "\_")  
> $nameCharacter = $splitName[1]  
> ;\_log($nameCharacter)  
> EndFunc ;==\>setChararacter  
>   
> ;;--------------------------------------------------------------------------------  
> ;; Getfury()  
> ;;--------------------------------------------------------------------------------  
> Func GetFury()  
> Local $index, $offset, $count, $item[10], $foundobject = 0  
> startIterateObjectsList($index, $offset, $count)  
> While iterateObjectsList($index, $offset, $count, $item)  
> If StringInStr($item[1], "furyBall\_liquid") Then  
> Return \_MemoryRead($item[8] + 0x40C, $d3, 'float')  
> EndIf  
> WEnd  
> EndFunc ;==\>GetFury  
> ;;  
>   
> ;--------------------------------------------------------------------------------  
> ;; Gethatred()  
> ;;--------------------------------------------------------------------------------  
> Func GetHatred()  
> Local $index, $offset, $count, $item[10], $foundobject = 0  
> startIterateObjectsList($index, $offset, $count)  
> While iterateObjectsList($index, $offset, $count, $item)  
> If StringInStr($item[1], "hatred") Then  
> Return \_MemoryRead($item[8] + 0x40C, $d3, 'float')  
> EndIf  
> WEnd  
> EndFunc ;==\>GetHatred  
> ;;  
>   
> ;--------------------------------------------------------------------------------  
> ;; Getdisc()  
> ;;--------------------------------------------------------------------------------  
> Func GetDisc()  
> Local $index, $offset, $count, $item[10], $foundobject = 0  
> startIterateObjectsList($index, $offset, $count)  
> While iterateObjectsList($index, $offset, $count, $item)  
> If StringInStr($item[1], "discipline") Then  
> Return \_MemoryRead($item[8] + 0x40C, $d3, 'float')  
> EndIf  
> WEnd  
> EndFunc ;==\>GetDisc  
> ;;  
>   
> ;--------------------------------------------------------------------------------  
> ;; Getspirit()  
> ;;--------------------------------------------------------------------------------  
> Func GetSpirit()  
> Local $index, $offset, $count, $item[10], $foundobject = 0  
> startIterateObjectsList($index, $offset, $count)  
> While iterateObjectsList($index, $offset, $count, $item)  
> If StringInStr($item[1], "Monk\_Spirit") Then  
> Return \_MemoryRead($item[8] + 0x40C, $d3, 'float')  
> EndIf  
> WEnd  
> EndFunc ;==\>GetSpirit  
> ;;  
>   
> ;--------------------------------------------------------------------------------  
> ;; Getmana()  
> ;;--------------------------------------------------------------------------------  
> Func GetMana()  
> Local $index, $offset, $count, $item[10], $foundobject = 0  
> startIterateObjectsList($index, $offset, $count)  
> While iterateObjectsList($index, $offset, $count, $item)  
> If StringInStr($item[1], "mana") Then  
> Return \_MemoryRead($item[8] + 0x40C, $d3, 'float')  
> EndIf  
> WEnd  
> EndFunc ;==\>GetMana  
> ;;  
>   
> ;--------------------------------------------------------------------------------  
> ;; Getarcane()  
> ;;--------------------------------------------------------------------------------  
> Func GetArcane()  
> Local $index, $offset, $count, $item[10], $foundobject = 0  
> startIterateObjectsList($index, $offset, $count)  
> While iterateObjectsList($index, $offset, $count, $item)  
> If StringInStr($item[1], "instability") Then  
> Return \_MemoryRead($item[8] + 0x40C, $d3, 'float')  
> EndIf  
> WEnd  
> EndFunc ;==\>GetArcane  
>   
> ;;--------------------------------------------------------------------------------  
> ;; checkForSpell()  
> ;;--------------------------------------------------------------------------------  
> #cs  
> Func checkForSpell()  
> checkForPotion()  
> ;Local $mesurepot = TimerInit() ;;;;;;;;;;;;;;  
> Local $source  
> Local $MaximumSource  
> Switch $nameCharacter  
> Case "DemonHunter"  
> $discipline = GetDisc()  
> $hatred = GetHatred()  
> $life = GetLifep()  
>   
> $diffRightClick = TimerDiff($timeforRightclick)  
> If $RightClickSpell = "True" And $life \<= $LifeForRightClickSpell / 100 And $diffRightClick \> $RightClickSpellDelay Then  
> If $RightClickSpellEnergy \<\> "" Then  
> If $RightClickSpellEnergy = "hatred" Then  
> If $hatred \> $RightClickSpellEnergyNeeds / $MaximumHatred Then  
> MouseClick("right")  
> $timeforRightclick = TimerInit()  
> EndIf  
> Else  
> If $discipline \> $RightClickSpellEnergyNeeds / $MaximumDiscipline Then  
> MouseClick("right")  
> $timeforRightclick = TimerInit()  
> EndIf  
> EndIf  
> Else  
> MouseClick("right")  
> $timeforRightclick = TimerInit()  
> EndIf  
> EndIf  
>   
>   
> $discipline = GetDisc()  
> $hatred = GetHatred()  
> $life = GetLifep()  
>   
> $diffSpell1 = TimerDiff($timeforSpell1)  
> If $Spell1Activated = "True" And $life \<= $LifeForSpell1 / 100 And $diffSpell1 \> $DefayForSpell1 Then  
> If $EnergySpell1 \<\> "" Then  
> If $EnergySpell1 = "hatred" Then  
> If $hatred \> $EnergyNeedsSpell1 / $MaximumHatred Then  
> Send($KeyForSpell1)  
> $timeforSpell1 = TimerInit()  
> EndIf  
> Else  
> If $discipline \> $EnergyNeedsSpell1 / $MaximumDiscipline Then  
> Send($KeyForSpell1)  
> $timeforSpell1 = TimerInit()  
> EndIf  
> EndIf  
> Else  
> Send($KeyForSpell1)  
> $timeforSpell1 = TimerInit()  
> EndIf  
> EndIf  
>   
> $discipline = GetDisc()  
> $hatred = GetHatred()  
> $life = GetLifep()  
>   
> $diffSpell2 = TimerDiff($timeforSpell2)  
> If $Spell2Activated = "True" And $life \<= $LifeForSpell2 / 100 And $diffSpell2 \> $DefayForSpell2 Then  
> If $EnergySpell2 \<\> "" Then  
> If $EnergySpell2 = "hatred" Then  
> If $hatred \> $EnergyNeedsSpell2 / $MaximumHatred Then  
> Send($KeyForSpell2)  
> $timeforSpell2 = TimerInit()  
> EndIf  
> Else  
> If $discipline \> $EnergyNeedsSpell2 / $MaximumDiscipline Then  
> Send($KeyForSpell2)  
> $timeforSpell2 = TimerInit()  
> EndIf  
> EndIf  
> Else  
> Send($KeyForSpell2)  
> $timeforSpell2 = TimerInit()  
> EndIf  
> EndIf  
>   
> $discipline = GetDisc()  
> $hatred = GetHatred()  
> $life = GetLifep()  
>   
> $diffSpell3 = TimerDiff($timeforSpell3)  
> If $Spell3Activated = "True" And $life \<= $LifeForSpell3 / 100 And $diffSpell3 \> $DefayForSpell3 Then  
> If $EnergySpell3 \<\> "" Then  
> If $EnergySpell3 = "hatred" Then  
> If $hatred \> $EnergyNeedsSpell3 / $MaximumHatred Then  
> Send($KeyForSpell3)  
> $timeforSpell3 = TimerInit()  
> EndIf  
> Else  
> If $discipline \> $EnergyNeedsSpell3 / $MaximumDiscipline Then  
> Send($KeyForSpell3)  
> $timeforSpell3 = TimerInit()  
> EndIf  
> EndIf  
> Else  
> Send($KeyForSpell3)  
> $timeforSpell3 = TimerInit()  
> EndIf  
> EndIf  
>   
> $discipline = GetDisc()  
> $hatred = GetHatred()  
> $life = GetLifep()  
>   
> $diffSpell4 = TimerDiff($timeforSpell4)  
> If $Spell4Activated = "True" And $life \<= $LifeForSpell4 / 100 And $diffSpell4 \> $DefayForSpell4 Then  
> If $EnergySpell4 \<\> "" Then  
> If $EnergySpell4 = "hatred" Then  
> If $hatred \> $EnergyNeedsSpell4 / $MaximumHatred Then  
> Send($KeyForSpell4)  
> $timeforSpell4 = TimerInit()  
> EndIf  
> Else  
> If $discipline \> $EnergyNeedsSpell4 / $MaximumDiscipline Then  
> Send($KeyForSpell4)  
> $timeforSpell4 = TimerInit()  
> EndIf  
> EndIf  
> Else  
> Send($KeyForSpell4)  
> $timeforSpell4 = TimerInit()  
> EndIf  
> EndIf  
>   
>   
> Case "Monk"  
> $MaximumSource = $MaximumSpirit  
> actionForSpell($MaximumSource)  
> Case "Barbarian"  
> $MaximumSource = $MaximumFury  
> actionForSpell($MaximumSource)  
> Case "wizard"  
> $MaximumSource = $MaximumArcane  
> actionForSpell($MaximumSource)  
> Case "WitchDoctor"  
> $MaximumSource = $MaximumMana  
> actionForSpell($MaximumSource)  
> EndSwitch  
>   
> EndFunc ;==\>checkForSpell  
>   
>   
> Func actionForSpell($MaximumSource)  
>   
> $life = GetLifep()  
> Switch $nameCharacter  
> Case "Monk"  
> $source = GetSpirit()  
> Case "Barbarian"  
> $source = GetFury()  
> Case "wizard"  
> $source = GetArcane()  
> Case "WitchDoctor"  
> $source = GetMana()  
> EndSwitch  
> $diffRightClick = TimerDiff($timeforRightclick)  
> If $RightClickSpell = "True" And $life \<= $LifeForRightClickSpell / 100 And $diffRightClick \> $RightClickSpellDelay Then  
> If $RightClickSpellEnergy \<\> "" Then  
> If $source \> $RightClickSpellEnergyNeeds / $MaximumSource Then  
> MouseClick("right")  
> $timeforRightclick = TimerInit()  
> EndIf  
> Else  
> MouseClick("right")  
> $timeforRightclick = TimerInit()  
> EndIf  
> EndIf  
>   
> $life = GetLifep()  
> Switch $nameCharacter  
> Case "Monk"  
> $source = GetSpirit()  
> Case "Barbarian"  
> $source = GetFury()  
> Case "wizard"  
> $source = GetArcane()  
> Case "WitchDoctor"  
> $source = GetMana()  
> EndSwitch  
>   
> $diffSpell1 = TimerDiff($timeforSpell1)  
> If $Spell1Activated = "True" And $life \<= $LifeForSpell1 / 100 And $diffSpell1 \> $DefayForSpell1 Then  
> If $EnergySpell1 \<\> "" Then  
> If $source \> $EnergyNeedsSpell1 / $MaximumSource Then  
> Send($KeyForSpell1)  
> $timeforSpell1 = TimerInit()  
> EndIf  
> Else  
> Send($KeyForSpell1)  
> $timeforSpell1 = TimerInit()  
> EndIf  
> EndIf  
>   
> $life = GetLifep()  
> Switch $nameCharacter  
> Case "Monk"  
> $source = GetSpirit()  
> Case "Barbarian"  
> $source = GetFury()  
> Case "wizard"  
> $source = GetArcane()  
> Case "WitchDoctor"  
> $source = GetMana()  
> EndSwitch  
>   
> $diffSpell2 = TimerDiff($timeforSpell2)  
> If $Spell2Activated = "True" And $life \<= $LifeForSpell2 / 100 And $diffSpell2 \> $DefayForSpell2 Then  
> If $EnergySpell2 \<\> "" Then  
> If $source \> $EnergyNeedsSpell2 / $MaximumSource Then  
> Send($KeyForSpell2)  
> $timeforSpell2 = TimerInit()  
> EndIf  
> Else  
> Send($KeyForSpell2)  
> $timeforSpell2 = TimerInit()  
> EndIf  
> EndIf  
>   
> $life = GetLifep()  
> Switch $nameCharacter  
> Case "Monk"  
> $source = GetSpirit()  
> Case "Barbarian"  
> $source = GetFury()  
> Case "wizard"  
> $source = GetArcane()  
> Case "WitchDoctor"  
> $source = GetMana()  
> EndSwitch  
>   
> $diffSpell3 = TimerDiff($timeforSpell3)  
> If $Spell3Activated = "True" And $life \<= $LifeForSpell3 / 100 And $diffSpell3 \> $DefayForSpell3 Then  
> If $EnergySpell3 \<\> "" Then  
> If $source \> $EnergyNeedsSpell3 / $MaximumSource Then  
> Send($KeyForSpell3)  
> $timeforSpell3 = TimerInit()  
> EndIf  
> Else  
> Send($KeyForSpell3)  
> $timeforSpell3 = TimerInit()  
> EndIf  
> EndIf  
>   
> $life = GetLifep()  
> Switch $nameCharacter  
> Case "Monk"  
> $source = GetSpirit()  
> Case "Barbarian"  
> $source = GetFury()  
> Case "wizard"  
> $source = GetArcane()  
> Case "WitchDoctor"  
> $source = GetMana()  
> EndSwitch  
>   
> $diffSpell4 = TimerDiff($timeforSpell4)  
> If $Spell4Activated = "True" And $life \<= $LifeForSpell4 / 100 And $diffSpell4 \> $DefayForSpell4 Then  
> If $EnergySpell4 \<\> "" Then  
> If $source \> $EnergyNeedsSpell4 / $MaximumSource Then  
> Send($KeyForSpell4)  
> $timeforSpell4 = TimerInit()  
> EndIf  
> Else  
> Send($KeyForSpell4)  
> $timeforSpell4 = TimerInit()  
> EndIf  
> EndIf  
>   
> EndFunc ;==\>actionForSpell  
> #ce  
> ;;--------------------------------------------------------------------------------  
> ;;############# Stats by YoPens  
> ;;--------------------------------------------------------------------------------  
> Func FormatNumber($StringToFormat)  
> Local $StringFormatted = ""  
> Local $ArrayStringToFormat = StringSplit($StringToFormat, "")  
> Local $counterForSeparator = 1  
> For $i = $ArrayStringToFormat[0] To 1 Step -1  
> If $counterForSeparator = 3 Then  
> $StringFormatted = " " & $ArrayStringToFormat[$i] & $StringFormatted  
> $counterForSeparator = 0  
> Else  
> $StringFormatted = $ArrayStringToFormat[$i] & $StringFormatted  
> EndIf  
> $counterForSeparator += 1  
> Next  
> Return $StringFormatted  
> EndFunc ;==\>FormatNumber  
>   
>   
> Func StatsDisplay()  
>   
> Local $index, $offset, $count, $item[4]  
> startIterateLocalActor($index, $offset, $count)  
> While iterateLocalActorList($index, $offset, $count, $item)  
> If StringInStr($item[1], "GoldCoin-") Then  
> $GOLD = IterateActorAtribs($item[0], $Atrib\_ItemStackQuantityLo)  
> ExitLoop  
> EndIf  
> WEnd  
>   
> If $Totalruns = 1 Then  
> $GOLDINI = $GOLD  
> $begin\_timer\_stat = TimerInit()  
> $GF = Ceiling(GetAttribute($\_MyGuid, $Atrib\_Gold\_Find) \* 100)  
> $MF = Ceiling(GetAttribute($\_MyGuid, $Atrib\_Magic\_Find) \* 100)  
> $PR = GetAttribute($\_MyGuid, $Atrib\_Gold\_PickUp\_Radius)  
> $MS = (GetAttribute($\_MyGuid, $Atrib\_Movement\_Scalar\_Capped\_Total) - 1) \* 100  
> Else  
> $GOLDInthepocket = $GOLD - $GOLDINI  
> $GOLDMOY = $GOLDInthepocket / ($Totalruns - 1)  
> $dif\_timer\_stat = TimerDiff($begin\_timer\_stat)  
> $GOLDMOYbyH = $GOLDInthepocket \* 3600000 / $dif\_timer\_stat  
>   
>   
> EndIf  
>   
> ;stat XP  
>   
> ;Xp nécessaire pour passer un niveau de paragon  
>   
> If $Totalruns = 1 Then  
> Global $level[102]  
> $level[1] = 7200000  
> $level[2] = 8640000  
> $level[3] = 10080000  
> $level[4] = 11520000  
> $level[5] = 12960000  
> $level[6] = 14400000  
> $level[7] = 15840000  
> $level[8] = 17280000  
> $level[9] = 18720000  
> $level[10] = 20160000  
> $level[11] = 21600000  
> $level[12] = 23040000  
> $level[13] = 24480000  
> $level[14] = 25920000  
> $level[15] = 27360000  
> $level[16] = 28800000  
> $level[17] = 30240000  
> $level[18] = 31680000  
> $level[19] = 33120000  
> $level[20] = 34560000  
> $level[21] = 36000000  
> $level[22] = 37440000  
> $level[23] = 38880000  
> $level[24] = 40320000  
> $level[25] = 41760000  
> $level[26] = 43200000  
> $level[27] = 44640000  
> $level[28] = 46080000  
> $level[29] = 47520000  
> $level[30] = 48960000  
> $level[31] = 50400000  
> $level[32] = 51840000  
> $level[33] = 53280000  
> $level[34] = 54720000  
> $level[35] = 56160000  
> $level[36] = 57600000  
> $level[37] = 59040000  
> $level[38] = 60480000  
> $level[39] = 61920000  
> $level[40] = 63360000  
> $level[41] = 64800000  
> $level[42] = 66240000  
> $level[43] = 67680000  
> $level[44] = 69120000  
> $level[45] = 70560000  
> $level[46] = 72000000  
> $level[47] = 73440000  
> $level[48] = 74880000  
> $level[49] = 76320000  
> $level[50] = 77760000  
> $level[51] = 79200000  
> $level[52] = 80640000  
> $level[53] = 82080000  
> $level[54] = 83520000  
> $level[55] = 84960000  
> $level[56] = 86400000  
> $level[57] = 87840000  
> $level[58] = 89280000  
> $level[59] = 90720000  
> $level[60] = 92160000  
> $level[61] = 95040000  
> $level[62] = 97920000  
> $level[63] = 100800000  
> $level[64] = 103680000  
> $level[65] = 106560000  
> $level[66] = 109440000  
> $level[67] = 112320000  
> $level[68] = 115200000  
> $level[69] = 118080000  
> $level[70] = 120960000  
> $level[71] = 126000000  
> $level[72] = 131040000  
> $level[73] = 136080000  
> $level[74] = 141120000  
> $level[75] = 146160000  
> $level[76] = 151200000  
> $level[77] = 156240000  
> $level[78] = 161280000  
> $level[79] = 166320000  
> $level[80] = 171360000  
> $level[81] = 177840000  
> $level[82] = 184320000  
> $level[83] = 190800000  
> $level[84] = 197280000  
> $level[85] = 203760000  
> $level[86] = 210240000  
> $level[87] = 216720000  
> $level[88] = 223200000  
> $level[89] = 229680000  
> $level[90] = 236160000  
> $level[91] = 244800000  
> $level[92] = 253440000  
> $level[93] = 262080000  
> $level[94] = 270720000  
> $level[95] = 279360000  
> $level[96] = 288000000  
> $level[97] = 296640000  
> $level[98] = 305280000  
> $level[99] = 313920000  
> $level[100] = 322560000  
> $level[101] = 0  
> EndIf  
>   
> If $Totalruns = 1 Then  
>   
> $NiveauParagon = GetAttribute($\_MyGuid, $Atrib\_Alt\_Level)  
> $ExperienceNextLevel = GetAttribute($\_MyGuid, $Atrib\_Alt\_Experience\_Next)  
> $Expencours = $level[$NiveauParagon + 1] - $ExperienceNextLevel  
> $Xp\_Run = 0  
> $Xp\_Total = 0  
> $Xp\_Moy\_Run = 0  
> $Xp\_Moy\_Hrs = 0  
> $time\_Xp = 0  
> \_format\_time($time\_Xp)  
>   
> Else  
>   
>   
>   
> ;calcul de l'xp du run  
> If $NiveauParagon = GetAttribute($\_MyGuid, $Atrib\_Alt\_Level) Then; verification de level up (égalité =\> pas de level up  
>   
> $Xp\_Run = ($level[GetAttribute($\_MyGuid, $Atrib\_Alt\_Level) + 1] - GetAttribute($\_MyGuid, $Atrib\_Alt\_Experience\_Next)) - $Expencours;experience run n - experience run n-1  
>   
> EndIf  
>   
> $Expencours = $level[GetAttribute($\_MyGuid, $Atrib\_Alt\_Level) + 1] - GetAttribute($\_MyGuid, $Atrib\_Alt\_Experience\_Next)  
>   
> If $NiveauParagon \<\> GetAttribute($\_MyGuid, $Atrib\_Alt\_Level) Then  
>   
> $Xp\_Run = $ExperienceNextLevel + $Expencours  
>   
> EndIf  
>   
>   
> $Xp\_Total = $Xp\_Total + $Xp\_Run  
> $Xp\_Moy\_Run = $Xp\_Total / ($Totalruns - 1)  
> $Xp\_Moy\_Hrs = $Xp\_Total \* 3600000 / $dif\_timer\_stat  
> $NiveauParagon = GetAttribute($\_MyGuid, $Atrib\_Alt\_Level)  
> $ExperienceNextLevel = GetAttribute($\_MyGuid, $Atrib\_Alt\_Experience\_Next)  
>   
> ;calcul temps avant prochain niveau  
> $Xp\_Moy\_Sec = $Xp\_Total \* 1000 / $dif\_timer\_stat  
> $time\_Xp = Int($ExperienceNextLevel / $Xp\_Moy\_Sec) \* 1000  
> \_format\_time($time\_Xp)  
> $time\_Xp = $dif\_timer\_stat\_formater  
>   
> EndIf  
> ;########  
>   
> \_format\_time($dif\_timer\_stat)  
> $timer\_stat\_total = $dif\_timer\_stat\_formater  
>   
> If $Totalruns = 1 Then  
> $timer\_stat\_run\_moyen = 0  
> ;Lv\_stat=lv  
> ;Xp\_next\_stat=Xp\_next  
> ;Xprun=0  
> ;Xptotal=0  
> ;Xpmoyen=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 resurrection: " & $Res\_compt & @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 & " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & @CRLF  
> $DebugMessage = $DebugMessage & "GOLD Obtenu : " & formatNumber(Ceiling($GOLDInthepocket)) & @CRLF  
> $DebugMessage = $DebugMessage & "GOLD Moyen par run : " & formatNumber(Ceiling($GOLDMOY)) & @CRLF  
> $DebugMessage = $DebugMessage & "GOLD Moyen par heure : " & formatNumber(Ceiling($GOLDMOYbyH)) & @CRLF  
>   
> ;stats XP  
> $DebugMessage = $DebugMessage & " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & @CRLF  
>   
> If ($Xp\_Total \< 1000000) Then ;afficher en "K"  
> $DebugMessage = $DebugMessage & "XP Obtenu : " & Int($Xp\_Total / 1000) & " K" & @CRLF  
> EndIf  
> If ($Xp\_Total \> 999999) Then ;afficher en "M"  
> $DebugMessage = $DebugMessage & "XP Obtenu : " & Int($Xp\_Total / 1000) / 1000 & " M" & @CRLF  
> EndIf  
>   
> If ($Xp\_Moy\_Run \< 1000000) Then ;afficher en "K"  
> $DebugMessage = $DebugMessage & "XP Moyen par run : " & Int($Xp\_Moy\_Run / 1000) & " K" & @CRLF  
> EndIf  
> If ($Xp\_Moy\_Run \> 999999) Then ;afficher en "M"  
> $DebugMessage = $DebugMessage & "XP Moyen par run : " & Int($Xp\_Moy\_Run / 1000) / 1000 & " M" & @CRLF  
> EndIf  
>   
> If ($Xp\_Moy\_Hrs \< 1000000) Then ;afficher en "K"  
> $DebugMessage = $DebugMessage & "XP Moyen par heure : " & Int($Xp\_Moy\_Hrs / 1000) & " K" & @CRLF  
> EndIf  
> If ($Xp\_Moy\_Hrs \> 999999) Then ;afficher en "M"  
> $DebugMessage = $DebugMessage & "XP Moyen par heure : " & Int($Xp\_Moy\_Hrs / 1000) / 1000 & " M" & @CRLF  
> EndIf  
> ;$DebugMessage = $DebugMessage & "temps avant prochain niveau : " $ExperienceNextLevel/ & " M" & @CRLF  
> $DebugMessage = $DebugMessage & "temps avant prochain niveau : " & $time\_Xp & @CRLF  
> $DebugMessage = $DebugMessage & " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & @CRLF  
> ;$DebugMessage = $DebugMessage & "XP Moyen par heure : " & $Xp\_Moy\_Hrs & @CRLF  
> ;$DebugMessage = $DebugMessage & "XP avant prochain niveau : " & int($ExperienceNextLevel/1000)/1000 &" M" & @CRLF  
> ;$DebugMessage = $DebugMessage & "niveau paragon actuel : " & $NiveauParagon & @CRLF  
>   
> ;$DebugMessage = $DebugMessage & "#################################"& @CRLF  
>   
> ;$DebugMessage = $DebugMessage & "test 1 : " & $level[$NiveauParagon+1] & @CRLF  
> ;$DebugMessage = $DebugMessage & "exp en cours : " & int($Expencours/1000)/1000 &" M" &@CRLF  
> ;$DebugMessage = $DebugMessage & "Xp\_Run : " & int($Xp\_Run/1000)/1000 &" M" &@CRLF  
> ;$DebugMessage = $DebugMessage & "#################################"& @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 & "success ratio : " & $successratio & @CRLF  
> $DebugMessage = $DebugMessage & "Nombre de déconnections : " & $disconnectcount & @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  
> $DebugMessage = $DebugMessage & " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & @CRLF  
> $DebugMessage = $DebugMessage & "Heure début run: " & @HOUR & ":" & @MIN & @CRLF  
>   
> $MESSAGE = $DebugMessage  
> ToolTip($MESSAGE, $DebugX, $DebugY)  
>   
> $Totalruns = $Totalruns + 1 ;compte le nombre de run  
>   
> EndFunc ;==\>StatsDisplay  
>   
> ;;--------------------------------------------------------------------------------  
> ;;############# END ########### of Stats by YoPens  
> ;;--------------------------------------------------------------------------------  
> 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  
>   
> ;;--------------------------------------------------------------------------------  
> ; Function: EmergencyStopCheck()  
> ; Description: Check for dangerous behavior and stop bot if needed to prevent problems  
> ;  
> ; Note(s):  
> ;;--------------------------------------------------------------------------------  
> Func EmergencyStopCheck()  
>   
> If $Die2FastCount \> 6 Then  
> WinSetOnTop("[CLASS:D3 Main Window Class]", "", 0)  
> MsgBox(4096, "Arret d'urgence", "Nombre de mort : " & $Death)  
> Terminate()  
> EndIf  
>   
> If $NeedRepairCount \> 4 Then  
> WinSetOnTop("[CLASS:D3 Main Window Class]", "", 0)  
> MsgBox(4096, "Arret d'urgence", "Nombre de tentatives de repair a la suite : " & $NeedRepairCount)  
> Terminate()  
> EndIf  
>   
> EndFunc ;==\>EmergencyStopCheck  
>   
> ;;--------------------------------------------------------------------------------  
> ; Function: enoughtPotions()  
> ; Description: Read amount of pot in inv. Compare with Potionstock and set takepot to true of false.  
> ;  
> ;  
> ;;--------------------------------------------------------------------------------  
> Func enoughtPotions()  
> Local $potinstock = Number(fastCheckuiValue('Root.NormalLayer.game\_dialog\_backgroundScreenPC.game\_potion.text', 1, 875))  
> If $potinstock \> $PotionStock Then  
> \_log("I have more than " & $PotionStock & " potions. I will not take more until next check " & "(" & $potinstock & ")")  
> $takepot = False  
> Else  
> \_log("I have less than " & $PotionStock & " potions. I will grab them until next check " & "pot:" & "(" & $potinstock & ")")  
> $takepot = True  
> EndIf  
> EndFunc ;==\>enoughtPotions  
>   
> ;;--------------------------------------------------------------------------------  
> ; Function: Shrine()  
> ; Description: Take Bonus shrine  
> ;;--------------------------------------------------------------------------------  
> Func shrine($name, $offset, $Guid)  
>   
> Local $begin = TimerInit()  
>   
> While iterateactoratribs($Guid, $Atrib\_gizmo\_state) \<\> 1 And \_playerdead() = False  
>   
> If getdistance(\_MemoryRead($offset + 0xB0, $d3, 'float'), \_MemoryRead($offset + 0xB4, $d3, 'float'), \_MemoryRead($offset + 0xB8, $d3, 'float')) \>= 8 Then  
> If TimerDiff($begin) \> 4000 Then  
> \_log('shrine is banned because time out')  
> Return False  
> ExitLoop  
> Else  
>   
> $Coords = FromD3toScreenCoords(\_MemoryRead($offset + 0xB0, $d3, 'float'), \_MemoryRead($offset + 0xB4, $d3, 'float'), \_MemoryRead($offset + 0xB8, $d3, 'float'))  
> MouseMove($Coords[0], $Coords[1], 3)  
>   
> EndIf  
>   
> EndIf  
>   
> If TimerDiff($begin) \> 6000 Then  
> \_log('Fake shrine')  
> Return false  
> EndIf  
>   
> Interact(\_MemoryRead($offset + 0xB0, $d3, 'float'), \_MemoryRead($offset + 0xB4, $d3, 'float'), \_MemoryRead($offset + 0xB8, $d3, 'float'))  
>   
> WEnd  
>   
> EndFunc ;==\>shrine  
>   
>   
>   
> ;;--------------------------------------------------------------------------------  
> ; Function: Die2Fast()  
> ; Description: Cette fonction est appelée toute les 20 min.  
> ;  
> ; Note(s): Permet de detecter un nombre de mort a la suite trop important  
> ;;--------------------------------------------------------------------------------  
> Func Die2Fast()  
> $Die2FastCount = 0  
> EndFunc ;==\>Die2Fast  
>   
>   
> ;;--------------------------------------------------------------------------------  
> ; Functions: mesurestart() mesureend()  
> ; Description: Mesurer...  
> ;;--------------------------------------------------------------------------------  
> Func mesureStart()  
> Global $mesuredebug = TimerInit() ;;;;;;;;;;;;;;  
> $init = TimerInit()  
> EndFunc ;==\>mesureStart  
>   
> Func mesureEnd($nom)  
> Local $difmesuredebug = TimerDiff($mesuredebug) ;;;;;;;;;;;;;  
> ConsoleWrite("Mesure " & $nom & " : " & $difmesuredebug & @CRLF) ;FOR DEBUGGING;;;;;;;;;;;;  
> EndFunc ;==\>mesureEnd  
>   
>   
>   
> ;;--------------------------------------------------------------------------------  
> ; Functions: Attrib STUFF  
> ; Description: Read Atrib without dll  
> ;;--------------------------------------------------------------------------------  
>   
> Func GetFAG($idAttrib)  
> $c = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $c1 = \_memoryread($c + 0x894, $d3, "ptr")  
> $c2 = \_memoryread($c1 + 0x70, $d3, "ptr")  
>   
> $id = BitAND($idAttrib, 0xFFFF)  
>   
> $bitshift = \_memoryread($c2 + 0x18C, $d3, "int")  
> $group1 = \_memoryread(\_memoryread($c2 + 0x148, $d3, "ptr"), $d3, "int")  
> $group2 = 4 \* BitShift($id, $bitshift)  
> $group3 = BitShift(1, -$bitshift) - 1  
> $group4 = 0x180 \* BitAND($id, $group3)  
> Return $group2 + $group4 + $group1  
> EndFunc ;==\>GetFAG  
>   
> Func GetAttributeOfs($idAttrib, $attrib)  
> $FAG = GetFAG($idAttrib)  
> $temp1 = \_memoryread(\_memoryread($FAG + 0x10, $d3, "ptr") + 8, $d3, "int")  
> $temp2 = \_memoryread(\_memoryread($FAG + 0x10, $d3, "ptr") + 0x418, $d3, "int")  
> $temp3 = BitXOR($attrib, BitShift($attrib, 16))  
> $temp4 = 4 \* BitAND($temp2, $temp3)  
> $attribEntry = \_memoryread($temp1 + $temp4, $d3, "int")  
>   
> If $attribEntry \<\> 0 Then  
> While \_memoryread($attribEntry + 4, $d3, "int") \<\> $attrib  
> $attribEntry = \_memoryread($attribEntry, $d3, "int")  
> If $attribEntry == 0 Then  
> Return -1  
> EndIf  
> WEnd  
> Return $attribEntry + 8  
> EndIf  
> Return -1  
> EndFunc ;==\>GetAttributeOfs  
>   
> Func GetAttributeInt($idAttrib, $attrib)  
> Return \_memoryread(GetAttributeOfs($idAttrib, BitOR($attrib, 0xFFFFF000)), $d3, "int")  
> EndFunc ;==\>GetAttributeInt  
>   
> Func GetAttributeFloat($idAttrib, $attrib)  
> Return \_memoryread(GetAttributeOfs($idAttrib, BitOR($attrib, 0xFFFFF000)), $d3, "float")  
> EndFunc ;==\>GetAttributeFloat  
>   
>   
> Func IsPowerReady($idAttrib, $idPower)  
> Return \_memoryread(GetAttributeOfs($idAttrib, BitOR($Atrib\_Power\_Cooldown[0], BitShift($idPower, -12))), $d3, "int") \<= 0  
> EndFunc ;==\>IsPowerReady  
>   
> Func IsBuffActive($idAttrib, $idPower)  
> Return \_memoryread(GetAttributeOfs($idAttrib, BitOR($Atrib\_Buff\_Active[0], BitShift($idPower, -12))), $d3, "int") == 1  
> EndFunc ;==\>IsBuffActive  
>   
>   
> Func \_inventoryfull()  
>   
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 2420, $d3, "ptr")  
> $ptr3 = \_memoryread($ptr2 + 0, $d3, "ptr")  
> $ofs\_uielements = \_memoryread($ptr3 + 8, $d3, "ptr")  
> $uielementpointer = \_memoryread($ofs\_uielements + 4 \* 1185, $d3, "ptr")  
>   
> While $uielementpointer \<\> 0  
> $npnt = \_memoryread($uielementpointer + 528, $d3, "ptr")  
> $name = BinaryToString(\_memoryread($npnt + 56, $d3, "byte[256]"), 4)  
> If StringInStr($name, "Root.TopLayer.error\_notify.error\_text") Then  
> If \_memoryread($npnt + 40, $d3, "int") = 1 Then  
> $uitextptr = \_memoryread($npnt + 0xAE0, $d3, "ptr")  
> $uitext = BinaryToString(\_memoryread($uitextptr, $d3, "byte[1024]"), 4)  
> ;~ ConsoleWrite(@CRLF & $uitext)  
> If StringInStr($uitext, 'nulle part') Or StringInStr($uitext, 'inventaire') Or StringInStr($uitext, 'no place') Or StringInStr($uitext, 'enough inventory') Then  
> ConsoleWrite(@CRLF & $uitext)  
> Return True  
> EndIf  
>   
> Else  
> ;~ \_log($valuetocheckfor & " is invisible")  
> Return False  
> EndIf  
> EndIf  
> $uielementpointer = \_memoryread($uielementpointer, $d3, "ptr")  
> WEnd  
> ;~ \_log($valuetocheckfor & " not found")  
> Return False  
> EndFunc ;==\>\_inventoryfull  
>   
> Func launch\_spell($i)  
>   
> Dim $buff\_table[11]  
> Switch $i  
>   
> case 0  
> $buff\_table = $Skill1  
> case 1  
> $buff\_table = $Skill2  
> case 2  
> $buff\_table = $Skill3  
> case 3  
> $buff\_table = $Skill4  
> case 4  
> $buff\_table = $Skill5  
> case 5  
> $buff\_table = $Skill6  
> Endswitch  
>   
> If $buff\_table[1] = False Then  
> Switch $buff\_table[6]  
> Case "right"  
> MouseClick("right")  
> Case "left"  
> MouseClick("left")  
> Case Else  
> Send($buff\_table[6])  
> EndSwitch  
> Sleep(10)  
>   
> ElseIf $buff\_table[1] and IsPowerReady($\_MyGuid, $buff\_table[9]) Then  
> Switch $buff\_table[6]  
> Case "right"  
> MouseClick("right")  
> Case "left"  
> MouseClick("left")  
> Case Else  
>   
> Send($buff\_table[6])  
>   
> EndSwitch  
> ;~ Sleep(10)  
>   
> EndIf  
>   
> EndFunc ;==\>launch\_spell  
>   
> Func GetResource($idAttrib, $resource)  
> if $resource\<\>"" then  
> Switch $resource  
> Case "spirit"  
> $source = 0x3000  
> $MaximumSource = $MaximumSpirit  
> Case "fury"  
> $source = 0x2000  
> $MaximumSource = $MaximumFury  
> Case "arcane"  
> $source = 0x1000  
> $MaximumSource = $MaximumArcane  
> Case "mana"  
> $source = 0  
> $MaximumSource = $MaximumMana  
> Case "hatred"  
> $source = 0x5000  
> $MaximumSource = $MaximumHatred  
> Case "discipline"  
> $MaximumSource = $MaximumDiscipline  
> $source = 0x6000  
> EndSwitch  
> Return \_memoryread(GetAttributeOfs($idAttrib, BitOR($Atrib\_Resource\_Cur[0], $source)), $d3, "float")/$MaximumSource  
> else  
> return 1  
> endif  
> EndFunc ;==\>GetResource  
>   
> Func GestSpellcast($Distance, $action\_spell, $elite, $Guid=0, $Offset=0)  
>   
> ; $action\_spell = 0 -\> movetopos  
> ; $action\_spell = 1 -\> attack  
> ; $action\_spell = 2 -\> grab  
>   
> checkForPotion()  
>   
> For $i = 0 To 5  
>   
> Dim $buff\_table[11]  
>   
> Switch $i  
>   
> case 0  
> $buff\_table = $Skill1  
> case 1  
> $buff\_table = $Skill2  
> case 2  
> $buff\_table = $Skill3  
> case 3  
> $buff\_table = $Skill4  
> case 4  
> $buff\_table = $Skill5  
> case 5  
> $buff\_table = $Skill6  
> Endswitch  
>   
>   
>   
> Switch $buff\_table[5]  
> Case "spirit"  
> ;~ $source = 0x3000  
> $MaximumSource = $MaximumSpirit  
> Case "fury"  
> ;~ $source = 0x2000  
> $MaximumSource = $MaximumFury  
> Case "arcane"  
> ;~ $source = 0x1000  
> $MaximumSource = $MaximumArcane  
> Case "mana"  
> ;~ $source = 0  
> $MaximumSource = $MaximumMana  
> Case "hatred"  
> ;~ $source = 0x5000  
> $MaximumSource = $MaximumHatred  
> Case "discipline"  
> $MaximumSource = $MaximumDiscipline  
> ;~ $source = 0x6000  
> Case Else  
> $MaximumSource = 15000  
> ;~ $source = 5000  
> EndSwitch  
>   
> $source= GetResource( $\_MyGuid, $buff\_table[5])  
>   
> If $buff\_table[0] And ($source \> $buff\_table[4] / $MaximumSource Or $buff\_table[5] = "") And (TimerDiff($buff\_table[10]) \> $buff\_table[2] or $buff\_table[2]="") Then ;skill Activé  
>   
> switch $action\_spell  
>   
> case 0  
> Switch $buff\_table[3]  
> case 0  
> If GetLifep() \<= $buff\_table[7] / 100 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 7  
> If Not IsBuffActive($\_MyGuid, $buff\_table[9]) Then  
> ;~ $timer\_buff = TimerInit()  
> If $nameCharacter = "DemonHunter" Then  
> if IsBuffActive($\_MyGuid,$DemonHunter\_Chakram )=False then  
>   
> Send("1")  
>   
> endif  
> endif  
> launch\_spell($i)  
>   
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
>   
> case 9  
> If GetLifep() \<= $buff\_table[7] / 100 Or ($Distance \<= $buff\_table[8] Or $buff\_table[8] = "") Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 10  
> If ($Distance \<= $buff\_table[8] Or $buff\_table[8] = "") or $action\_spell \<\> 1 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 11  
> If IsBuffActive($\_MyGuid, $buff\_table[9]) = False Or GetLifep() \<= $buff\_table[7] / 100 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 12  
> If IsBuffActive($\_MyGuid, $buff\_table[9]) = False Or GetLifep() \<= $buff\_table[7] / 100 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
>   
> case 16  
> If GetLifep() \<= $buff\_table[7] / 100 Or $elite \> 0 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 22  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
>   
>   
> endswitch  
>   
> case 1  
>   
>   
> Switch $buff\_table[3]  
> case 0  
> If GetLifep() \<= $buff\_table[7] / 100 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 1  
> If $Distance \<= $buff\_table[8] Or $buff\_table[8] = "" Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
>   
> case 2  
> launch\_spell($i)  
>   
> case 3  
> if $elite \> 0 then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
>   
> endif  
>   
> case 4  
> If Not IsBuffActive($\_MyGuid, $buff\_table[9]) And $action\_spell = 1 Then  
>   
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
>   
> case 5  
> ;~ local $IgnoreList=""  
> ;Not IsBuffActive($\_MyGuid, $buff\_table[9]) And  
> if $buff\_table[8]="" Then  
> $dist=20  
> Else  
> $dist=$buff\_table[8]  
> EndIf  
>   
> If $action\_spell = 1 and IterateFilterZone($dist) Then  
> \_log("mauvais click droit")  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
>   
> case 6  
> ;~ local $IgnoreList=""  
> if IsBuffActive($\_MyGuid, $buff\_table[9])=false then  
> if $buff\_table[8]="" Then  
> $dist=20  
> Else  
> $dist=$buff\_table[8]  
> EndIf  
> If IterateFilterZone($dist) Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
> endif  
>   
>   
> case 8  
> If GetLifep() \<= $buff\_table[7] / 100 And ($Distance \<= $buff\_table[8] Or $buff\_table[8] = "") Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
> case 11  
> If IsBuffActive($\_MyGuid, $buff\_table[9]) = False Or GetLifep() \<= $buff\_table[7] / 100 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 13  
> If IsBuffActive($\_MyGuid, $buff\_table[9]) = False And GetLifep() \<= $buff\_table[7] / 100 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 14  
> If IsBuffActive($\_MyGuid, $buff\_table[9]) = False Or ($Distance \<= $buff\_table[8] Or $buff\_table[8] = "") Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 15  
> If IsBuffActive($\_MyGuid, $buff\_table[9]) = False And ($Distance \<= $buff\_table[8] Or $buff\_table[8] = "") Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
>   
> case 17  
> If GetLifep() \<= $buff\_table[7] / 100 And $elite \> 0 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 18  
> If ($Distance \<= $buff\_table[8] Or $buff\_table[8] = "") Or $elite \> 0 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 19  
> If ($Distance \<= $buff\_table[8] Or $buff\_table[8] = "") And $elite \> 0 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 20  
> If IsBuffActive($\_MyGuid, $buff\_table[9]) = False And $elite \> 0 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 21  
> If IsBuffActive($\_MyGuid, $buff\_table[9]) = False Or $elite \> 0 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> case 22  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
>   
> ;~ case 23  
> ;~ ;or ($buff\_table[1] and IsPowerReady($\_MyGuid, $buff\_table[9]))  
> ;~ If $buff\_table[1] \<\> False Then  
> ;~ Switch $buff\_table[6]  
> ;~ Case "right"  
> ;~ MouseDown("right")  
> ;~ Case "left"  
> ;~ MouseDown("left")  
> ;~ Case Else  
> ;~ Send("{" & $buff\_table[6] & " down}")  
> ;~ EndSwitch  
> ;~ send("{shiftdown}")  
> ;~ $check\_source=GetResource( $\_MyGuid, $buff\_table[5])  
> ;~ $vie=getlifep()  
> ;~ if IterateActorAtribs($Guid, $Atrib\_Hitpoints\_Cur) \> 0 and $check\_source\>$buff\_table[4]/$MaximumSource and $vie\>$buff\_table[7]/100 then  
> ;~ $cana=true  
> ;~ Else  
> ;~ $cana=False  
> ;~ EndIf  
>   
> ;~ while $cana=true  
> ;~ Dim $pos = UpdateObjectsPos($offset)  
> ;~ $Coords = FromD3toScreenCoords($pos[0], $pos[1], $pos[2])  
> ;~ MouseMove($Coords[0], $Coords[1], 3)  
> ;~ sleep(10)  
> ;~ $check\_source=GetResource( $\_MyGuid, $buff\_table[5])  
> ;~ $vie=getlifep()  
> ;~ if IterateActorAtribs($Guid, $Atrib\_Hitpoints\_Cur) \> 0 and $check\_source\>$buff\_table[4]/$MaximumSource and $vie\>$buff\_table[7]/100 then  
> ;~ $cana=true  
> ;~ Else  
> ;~ $cana=False  
> ;~ EndIf  
> ;~  
> ;~ For $ii = 0 To 5  
>   
> ;~ Dim $buff\_table2[11]  
>   
> ;~ Switch $ii  
>   
> ;~ case 0  
> ;~ $buff\_table2 = $Skill1  
> ;~ case 1  
> ;~ $buff\_table2 = $Skill2  
> ;~ case 2  
> ;~ $buff\_table2 = $Skill3  
> ;~ case 3  
> ;~ $buff\_table2 = $Skill4  
> ;~ case 4  
> ;~ $buff\_table2 = $Skill5  
> ;~ case 5  
> ;~ $buff\_table2 = $Skill6  
> ;~ Endswitch  
> ;~ If $buff\_table2[3]=4 and IsBuffActive($\_MyGuid, $buff\_table2[9])=false Then  
> ;~ $cana=false  
> ;~ endif  
> ;~ Next  
> ;~  
> ;~ if \_playerdead() Then  
> ;~ send("{shiftup}")  
> ;~ Switch $buff\_table[6]  
> ;~ Case "right"  
> ;~ mouseup("right")  
> ;~ Case "left"  
> ;~ mouseup("left")  
> ;~ Case Else  
> ;~ Send("{" & $buff\_table[6] & " up}")  
> ;~ endswitch  
> ;~ exitloop  
> ;~ endif  
> ;~ WEnd  
> ;~ send("{shiftup}")  
> ;~ Switch $buff\_table[6]  
> ;~ Case "right"  
> ;~ mouseup("right")  
> ;~ Case "left"  
> ;~ mouseup("left")  
> ;~ Case Else  
> ;~ Send("{" & $buff\_table[6] & " up}")  
> ;~ endswitch  
> ;~  
>   
> ;~ $buff\_table[10] = TimerInit()  
>   
> Endswitch  
>   
> case 2  
> Switch $buff\_table[3]  
> case 0  
> If GetLifep() \<= $buff\_table[7] / 100 Then  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
> EndIf  
> case 22  
> launch\_spell($i)  
> $buff\_table[10] = TimerInit()  
>   
> case 7  
> If Not IsBuffActive($\_MyGuid, $buff\_table[9]) Then  
> $timer\_buff = TimerInit()  
> if IsBuffActive($\_MyGuid,$DemonHunter\_Chakram )=False then  
>   
> If $nameCharacter = "DemonHunter" Then Send("1")  
>   
> endif  
> launch\_spell($i)  
>   
> ;~ Send("{" & $buff\_table[6] & " down}")  
> ;~ While Not IsBuffActive($\_MyGuid, $buff\_table[9])  
> ;~ If TimerDiff($timer\_buff) \> 350 Then ExitLoop  
> ;~ Sleep(50)  
> ;~ WEnd  
> ;~ Send("{" & $buff\_table[6] & " up}")  
> $buff\_table[10] = TimerInit()  
> EndIf  
>   
> EndSwitch  
> endswitch  
>   
>   
> EndIf  
>   
> If $i = 0 Then  
> $Skill1 = $buff\_table  
> ElseIf $i = 1 Then  
> $Skill2 = $buff\_table  
> ElseIf $i = 2 Then  
> $Skill3 = $buff\_table  
> ElseIf $i = 3 Then  
> $Skill4 = $buff\_table  
> ElseIf $i = 4 Then  
> $Skill5 = $buff\_table  
> ElseIf $i = 5 Then  
> $Skill6 = $buff\_table  
> EndIf  
>   
> Next  
>   
> EndFunc ;==\>GestSpellcast  
>   
> Func GestSpellInit()  
>   
> For $i = 0 To 5  
>   
> Dim $buff\_table[11]  
> Dim $buff\_conf\_table[6]  
>   
> If $i = 0 Then  
> $buff\_conf\_table = $Skill\_conf1  
> $buff\_table = $Skill1  
> ElseIf $i = 1 Then  
> $buff\_conf\_table = $Skill\_conf2  
> $buff\_table = $Skill2  
> ElseIf $i = 2 Then  
> $buff\_conf\_table = $Skill\_conf3  
> $buff\_table = $Skill3  
> ElseIf $i = 3 Then  
> $buff\_conf\_table = $Skill\_conf4  
> $buff\_table = $Skill4  
> ElseIf $i = 4 Then  
> $buff\_conf\_table = $Skill\_conf5  
> $buff\_table = $Skill5  
> ElseIf $i = 5 Then  
> $buff\_conf\_table = $Skill\_conf6  
> $buff\_table = $Skill6  
> EndIf  
>   
>   
> If Not $buff\_conf\_table[0] Or $buff\_conf\_table[0] = "false" Then  
> $buff\_table[0] = False  
> Else  
> $buff\_table[0] = True  
> EndIf  
>   
> If $buff\_table[0] Then ;Si skill actived  
>   
> if NOT trim($buff\_conf\_table[1]) = "" Then ;Delay  
> $buff\_table[2] = $buff\_conf\_table[1]  
> EndIf  
>   
> if NOT trim($buff\_conf\_table[2]) = "" Then ;Type  
> $buff\_table[3] = $buff\_conf\_table[2]  
> EndIf  
>   
> if NOT trim($buff\_conf\_table[3]) = "" Then ;EnergyNeeds  
> $buff\_table[4] = $buff\_conf\_table[3]  
> EndIf  
>   
> if NOT trim($buff\_conf\_table[4]) = "" Then ;Trigger Life  
> $buff\_table[7] = $buff\_conf\_table[4]  
> EndIf  
>   
> if NOT trim($buff\_conf\_table[5]) = "" Then ;Trigger Distance  
> $buff\_table[8] = $buff\_conf\_table[5]  
> EndIf  
>   
> EndIF  
>   
> Select  
>   
> case $buff\_table[3] = "life"  
> $type=0  
>   
> case $buff\_table[3] = "attack"  
> $type=1  
>   
>   
> case $buff\_table[3] = "physical"  
> $type=2  
>   
> case $buff\_table[3] = "elite"  
> $type=3  
>   
>   
>   
> case $buff\_table[3] = "buff"  
> $type=4  
>   
>   
> case $buff\_table[3] = "zone"  
> $type=5  
>   
>   
> case StringInStr($buff\_table[3], "zone") And StringInStr($buff\_table[3], "&") And StringInStr($buff\_table[3], "buff")  
> $type=6  
>   
> case $buff\_table[3] = "move"  
> $type=7  
>   
> case StringInStr($buff\_table[3], "life") And StringInStr($buff\_table[3], "&") And StringInStr($buff\_table[3], "attack")  
> $type=8  
>   
> case StringInStr($buff\_table[3], "life") And StringInStr($buff\_table[3], "|") And StringInStr($buff\_table[3], "attack")  
> $type=9  
>   
> case StringInStr($buff\_table[3], "move") And StringInStr($buff\_table[3], "|") And StringInStr($buff\_table[3], "attack")  
> $type=10  
>   
> case StringInStr($buff\_table[3], "life") And StringInStr($buff\_table[3], "|") And StringInStr($buff\_table[3], "buff")  
> $type=11  
>   
> case StringInStr($buff\_table[3], "life") And StringInStr($buff\_table[3], "|") And StringInStr($buff\_table[3], "move")  
> $type=12  
>   
> case StringInStr($buff\_table[3], "life") And StringInStr($buff\_table[3], "&") And StringInStr($buff\_table[3], "buff")  
> $type=13  
>   
> case StringInStr($buff\_table[3], "attack") And StringInStr($buff\_table[3], "|") And StringInStr($buff\_table[3], "buff")  
> $type=14  
>   
> case StringInStr($buff\_table[3], "attack") And StringInStr($buff\_table[3], "&") And StringInStr($buff\_table[3], "buff")  
> $type=15  
>   
> case StringInStr($buff\_table[3], "life") And StringInStr($buff\_table[3], "|") And StringInStr($buff\_table[3], "elite")  
> $type=16  
>   
> case StringInStr($buff\_table[3], "life") And StringInStr($buff\_table[3], "&") And StringInStr($buff\_table[3], "elite")  
> $type=17  
>   
> case StringInStr($buff\_table[3], "attack") And StringInStr($buff\_table[3], "|") And StringInStr($buff\_table[3], "elite")  
> $type=18  
>   
> case StringInStr($buff\_table[3], "attack") And StringInStr($buff\_table[3], "&") And StringInStr($buff\_table[3], "elite")  
> $type=19  
>   
> case StringInStr($buff\_table[3], "elite") And StringInStr($buff\_table[3], "&") And StringInStr($buff\_table[3], "buff")  
> $type=20  
>   
> case StringInStr($buff\_table[3], "elite") And StringInStr($buff\_table[3], "|") And StringInStr($buff\_table[3], "buff")  
> $type=21  
>   
> case $buff\_table[3]="buff\_permanent"  
> $type=22  
>   
> case $buff\_table[3]="canalisation"  
> $type=23  
>   
> Endselect  
>   
> $buff\_table[3]=$type  
>   
> If $i = 0 Then  
> $Skill1 = $buff\_table  
> ElseIf $i = 1 Then  
> $Skill2 = $buff\_table  
> ElseIf $i = 2 Then  
> $Skill3 = $buff\_table  
> ElseIf $i = 3 Then  
> $Skill4 = $buff\_table  
> ElseIf $i = 4 Then  
> $Skill5 = $buff\_table  
> ElseIf $i = 5 Then  
> $Skill6 = $buff\_table  
> EndIf  
> \_log($buff\_table[3])  
> Next  
>   
> EndFunc ;==\>GestSpellInit  
>   
> #cs  
> Func offset\_spell\_search($str)  
> $var = ""  
> If $str = "" Then  
> $var = "false"  
> Else  
>   
> $var = Eval($str)  
> If $var = "" Then  
> $var = "wrong"  
> EndIf  
> EndIf  
> ;\_log("search :" & $var)  
> Return $var  
>   
> EndFunc ;==\>offset\_spell\_search  
> #ce  
>   
> ;;================================================================================  
> ; Function: GetPlayerOffset  
> ; Note(s):  
> ;==================================================================================  
> Func GetPlayerOffset()  
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 0x96c, $d3, "ptr")  
> $index = \_memoryread($ptr2 + 0x0, $d3, "int")  
>   
> $ptr1bis = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2bis = \_memoryread($ptr1 + 0x874, $d3, "ptr")  
> $id = \_memoryread($ptr2bis + 0x60 + $index \* 0x82C8, $d3, "int")  
>   
> Return GetActorFromId($id)  
> EndFunc ;==\>GetPlayerOffset  
>   
>   
> ;;================================================================================  
> ; Function: GetActorFromId  
> ; Note(s):  
> ;==================================================================================  
> Func GetActorFromId($id)  
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 0x900, $d3, "int")  
> $sid = BitAND($id, 0xFFFF)  
>   
> $bitshift = \_memoryread($ptr2 + 0x18C, $d3, "int")  
> $group1 = 4 \* BitShift($sid, $bitshift)  
> $group2 = BitShift(1, -$bitshift) - 1  
> $group3 = \_memoryread(\_memoryread($ptr2 + 0x148, $d3, "int"), $d3, "int")  
> $group4 = 0x42C \* BitAND($sid, $group2)  
> Return $group3 + $group1 + $group4  
> EndFunc ;==\>GetActorFromId  
>   
> Func GoToTown()  
>   
> \_log("start loop \_onloginscreen() = False And \_intown() = False And \_playerdead() = False")  
>   
> Local $nbTriesTownPortal = 0  
> While (\_intown() = False And \_inmenu() = False)  
> $nbTriesTownPortal += 1  
>   
> If $nbTriesTownPortal \< 3 Then  
> if NOT \_TownPortalnew(10) Then  
> $nbTriesTownPortal = 3  
> EndIf  
> Else  
> \_leaveGame()  
> $nbTriesTownPortal = 0  
> Sleep(10000)  
> While \_inmenu() = False  
> Sleep(10)  
> WEnd  
> ExitLoop  
> EndIf  
>   
> If \_checkdisconnect() Then  
> \_log("Disconnected dc1")  
> $disconnectcount += 1  
> Sleep(1000)  
> \_randomclick(398, 349)  
> \_randomclick(398, 349)  
> Sleep(1000)  
> While Not (\_onloginscreen() Or \_inmenu())  
> Sleep(Random(80000, 15000))  
> WEnd  
> ExitLoop  
> EndIf  
> WEnd  
>   
> RandSleep()  
> EndFunc ;==\>GoToTown  
>   
>   
>   
>   
> Func NeedRepair()  
> TpRepairAndBack()  
> EndFunc ;==\>NeedRepair  
>   
> Func TpRepairAndBack()  
>   
> $PortBack = False  
>   
>   
> While Not \_intown()  
> #cs  
> $grabskip = 1  
> Attack()  
> $grabskip = 0  
> Sleep(500)  
> $CurrentLoc = getcurrentpos()  
> MoveToPos($CurrentLoc[0] + 5, $CurrentLoc[1] + 5, $CurrentLoc[2], 0, 6)  
> If \_playerdead() = False Then  
> \_townportal()  
> Else  
> Return False  
> ExitLoop  
> EndIf  
> #ce  
>   
> if Not \_TownPortalnew() Then  
> $GameFailed=1  
> Return False  
> EndIf  
>   
> WEnd  
>   
> $PortBack = true  
>   
>   
> StashAndRepair()  
>   
> If $PortBack Then  
> SafePortBack()  
>   
> While Not offsetlist()  
> Sleep(10)  
> WEnd  
> EndIf  
>   
> $games = 0  
>   
> EndFunc  
>   
> Func StashAndRepair()  
>   
> if trim(StringLower($Unidentified)) = "false" Then  
> Take\_BookOfCain()  
> Else  
> $Uni\_manuel = true  
> EndIF  
>   
> \_log("Func StashAndRepair")  
> $RepairORsell += 1  
> $item\_to\_stash = 0  
>   
> While \_checkInventoryopen() = False  
> Send("i")  
> Sleep(Random(200, 300))  
> WEnd  
>   
> While Not offsetlist()  
> Sleep(10)  
> WEnd  
>   
> Sleep(Random(100, 400))  
>   
> \_log('Filter Backpack')  
> $items = FilterBackpack()  
> $ToStash = \_ArrayFindAll($items, "Stash", 0, 0, 0, 1, 2)  
>   
> Sleep(Random(100, 400))  
>   
> If $ToStash \<\> -1 Then  
> Send("{SPACE}")  
> Sleep(500)  
> InteractByActorName('Player\_Shared\_Stash')  
> Sleep(700)  
> Local $stashtry = 0  
>   
> While \_checkStashopen() = False  
> If $stashtry \<= 4 Then  
> \_log('Fail to open Stash')  
> $stashtry += 1  
> InteractByActorName("Player\_Shared\_Stash")  
> Sleep(Random(100, 200))  
>   
> Else  
> Send("{PRINTSCREEN}")  
> Sleep(200)  
> Log('Failed to open Stash after 4 try')  
> WinSetOnTop("Diablo III", "", 0)  
> MsgBox(0, "Impossible d'ouvrir le stash :", "SVP, veuillez reporter ce problème sur le forum. Erreur : s001 ")  
> Terminate()  
>   
> EndIf  
> WEnd  
> $tabfull = 0  
> CheckWindowD3Size()  
>   
> For $i = 0 To UBound($ToStash) - 1  
> \_log($items[$ToStash[$i]][0] & " stash : " & $items[$ToStash[$i]][1])  
>   
> Sleep(Random(100, 200))  
> InventoryMove($items[$ToStash[$i]][0], $items[$ToStash[$i]][1])  
> Sleep(Random(100, 500))  
>   
> If $items[$ToStash[$i]][3] \>= 6 Then  
> #cs $item\_name = fastCheckuiValue("Root.TopLayer.item 2.stack.top\_wrapper.stack.name", 1, 354)  
> $item\_stats = fastCheckuiValue("Root.TopLayer.item 2.stack.frame body.stack.stats", 1, 827)  
> $item\_to\_stash += 1  
> ;\_log("name file -\> " & $ftpfilename)  
>   
> Xml\_To\_Str(xml\_to\_item($item\_name, $item\_stats), $ftpfilename)  
> #ce  
>   
> EndIf  
>   
> MouseClick('Right')  
> Sleep(Random(50, 200))  
> If Detect\_UI\_error(1) Then  
> \_log('Tab is full : Switching tab')  
> CheckWindowD3Size()  
> $i = $i - 1  
> If $tabfull = 0 Then  
> MouseClick('left', 286, 194, 5)  
> $tabfull = 1  
> ElseIf $tabfull = 1 Then  
> MouseClick('left', 282, 266, 5)  
> $tabfull = 2  
> ElseIf $tabfull = 2 Then  
> \_log('Stash is full : Botting stopped')  
> Terminate()  
> EndIf  
>   
> Sleep(5000)  
>   
> Else  
> $ItemToStash = $ItemToStash + 1  
> EndIf  
> Next  
>   
> ;If $item\_to\_stash \> 0 Then  
> ;Ftp\_Upload\_To\_Xml($ftpfilename)  
> ;EndIf  
>   
> Sleep(Random(50, 100))  
> Send("{SPACE}")  
> Sleep(Random(100, 150))  
>   
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> If NOT Verif\_Attrib\_GlobalStuff() Then  
> \_log("CHANGEMENT DE STUFF ON TOURNE EN ROND (Stash and Repair - Stash)!!!!!")  
> antiidle()  
> EndIf  
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
>   
> EndIf  
>   
> $ToRecycle = \_ArrayFindAll($items, "Recycle", 0, 0, 0, 1, 2)  
>   
> If $ToRecycle \<\> -1 Then  
> Send("{SPACE}")  
> Sleep(Random(100, 200))  
> InteractByActorName('Blacksmith\_RepairShortcut')  
> Sleep(Random(100, 200))  
> Local $stashtry = 0  
>   
> #cs While \_checkStashopen() = False  
> If $stashtry \<= 4 Then  
> \_log('Fail to open Stash')  
> $stashtry += 1  
> InteractByActorName("Blacksmith\_RepairShortcut")  
> Sleep(Random(100, 200))  
>   
> Else  
> Send("{PRINTSCREEN}")  
> Sleep(200)  
> Log('Failed to open Stash after 4 try')  
> WinSetOnTop("Diablo III", "", 0)  
> MsgBox(0, "Impossible d'ouvrir le stash :", "SVP, veuillez reporter ce problème sur le forum. Erreur : s001 ")  
> Terminate()  
>   
> EndIf  
> WEnd  
> #ce  
> $tabfull = 0  
> CheckWindowD3Size()  
> MouseMove(150,150, 2) ; clic sur dez  
> MouseClick('Left')  
>   
> For $i = 0 To UBound($ToRecycle) - 1  
>   
> \_log($items[$ToRecycle[$i]][0] & " stash : " & $items[$ToRecycle[$i]][1])  
> Sleep(Random(100, 200))  
> InventoryMove($items[$ToRecycle[$i]][0], $items[$ToRecycle[$i]][1]);dez l'objet  
> Sleep(Random(100, 200))  
>   
> MouseClick('Left')  
> Sleep(Random(150, 300))  
>   
> if $items[$ToRecycle[$i]][3] \> 5 then ; si jaune ou plus, clique sur OK  
> MouseMove(300,210, 2)  
> Sleep(Random(100, 250))  
> MouseClick('Left')  
> endif  
>   
> Next  
>   
> ;If $item\_to\_stash \> 0 Then  
> ;Ftp\_Upload\_To\_Xml($ftpfilename)  
> ;EndIf  
>   
> Sleep(Random(50, 100))  
> Send("{SPACE}")  
> Sleep(Random(100, 150))  
>   
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> If Not Verif\_Attrib\_GlobalStuff() Then  
> \_log("CHANGEMENT DE STUFF ON TOURNE EN ROND (Stash and Repair - Stash)!!!!!")  
> antiidle()  
> EndIf  
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
>   
> EndIf  
>   
> Sleep(Random(100, 200))  
> Send("{SPACE}")  
> Sleep(Random(100, 200))  
>   
> Repair()  
>   
> Sleep(Random(100, 200))  
> Send("{SPACE}")  
> Sleep(Random(100, 200))  
>   
>   
> ;Trash  
> $ToTrash = \_ArrayFindAll($items, "Trash", 0, 0, 0, 1, 2)  
> If $ToTrash \<\> -1 Then  
> Sleep(Random(100, 200))  
> Send("{SPACE}")  
> Sleep(500)  
> InteractByActorName($RepairVendor)  
> Sleep(700)  
> Local $vendortry = 0  
> While \_checkVendoropen() = False  
> If $vendortry \<= 5 Then  
> \_log('Fail to open vendor')  
> $vendortry = $vendortry + 1  
> InteractByActorName($RepairVendor)  
>   
>   
> Else  
> Send("{PRINTSCREEN}")  
> Sleep(200)  
> \_log('Failed to open Vendor after 5 try')  
> WinSetOnTop("Diablo III", "", 0)  
> MsgBox(0, "Impossible d'ouvrir le vendeur :", "SVP, veuillez reporter ce problème sur le forum. Erreur : v002 ")  
> Terminate()  
> ExitLoop  
> EndIf  
> WEnd  
> CheckWindowD3Size()  
> 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')  
> Sleep(Random(100, 200))  
> Next  
> Sleep(Random(100, 200))  
> Send("{SPACE}")  
> Sleep(Random(100, 200))  
>   
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> If NOT Verif\_Attrib\_GlobalStuff() Then  
> \_log("CHANGEMENT DE STUFF ON TOURNE EN ROND (Stash and Repair - vendeur)!!!!!")  
> antiidle()  
> EndIf  
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
>   
> EndIf  
>   
> Sleep(Random(100, 500))  
> Send("{SPACE}")  
> Sleep(Random(100, 500))  
>   
> \_log('Filter Backpack')  
> $items = FilterBackpack()  
> $ToStash = \_ArrayFindAll($items, "Stash", 0, 0, 0, 1, 2)  
>   
> If $ToStash \<\> -1 Then  
> Sleep(500)  
> InteractByActorName('Player\_Shared\_Stash')  
> Sleep(700)  
> Local $stashtry = 0  
>   
> While \_checkStashopen() = False  
> If $stashtry \<= 4 Then  
> \_log('Fail to open Stash')  
> $stashtry += 1  
> InteractByActorName("Player\_Shared\_Stash")  
> Sleep(Random(100, 200))  
>   
> Else  
> Send("{PRINTSCREEN}")  
> Sleep(200)  
> Log('Failed to open Stash after 4 try')  
> WinSetOnTop("Diablo III", "", 0)  
> MsgBox(0, "Impossible d'ouvrir le stash :", "SVP, veuillez reporter ce problème sur le forum. Erreur : s001 ")  
> Terminate()  
>   
> EndIf  
> WEnd  
> $tabfull = 0  
> CheckWindowD3Size()  
> For $i = 0 To UBound($ToStash) - 1  
> \_log($items[$ToStash[$i]][0] & " stash : " & $items[$ToStash[$i]][1])  
>   
> Sleep(Random(100, 200))  
> InventoryMove($items[$ToStash[$i]][0], $items[$ToStash[$i]][1])  
> Sleep(Random(100, 500))  
>   
> If $items[$ToStash[$i]][3] \>= 6 Then  
> #cs $item\_name = fastCheckuiValue("Root.TopLayer.item 2.stack.top\_wrapper.stack.name", 1, 354)  
> $item\_stats = fastCheckuiValue("Root.TopLayer.item 2.stack.frame body.stack.stats", 1, 827)  
> $item\_to\_stash += 1  
> ;\_log("name file -\> " & $ftpfilename)  
>   
> Xml\_To\_Str(xml\_to\_item($item\_name, $item\_stats), $ftpfilename)  
> #ce  
>   
> EndIf  
>   
> MouseClick('Right')  
> Sleep(Random(50, 200))  
> If Detect\_UI\_error(1) Then  
> \_log('Tab is full : Switching tab')  
> CheckWindowD3Size()  
> $i = $i - 1  
> If $tabfull = 0 Then  
> MouseClick('left', 286, 194, 5)  
> $tabfull = 1  
> ElseIf $tabfull = 1 Then  
> MouseClick('left', 282, 266, 5)  
> $tabfull = 2  
> ElseIf $tabfull = 2 Then  
> \_log('Stash is full : Botting stopped')  
> Terminate()  
> EndIf  
>   
> Sleep(5000)  
>   
> Else  
> $ItemToStash = $ItemToStash + 1  
> EndIf  
> Next  
>   
> ;If $item\_to\_stash \> 0 Then  
> ;Ftp\_Upload\_To\_Xml($ftpfilename)  
> ;EndIf  
>   
> Sleep(Random(50, 100))  
> Send("{SPACE}")  
> Sleep(Random(100, 150))  
>   
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> If NOT Verif\_Attrib\_GlobalStuff() Then  
> \_log("CHANGEMENT DE STUFF ON TOURNE EN ROND (Stash and Repair - Stash)!!!!!")  
> antiidle()  
> EndIf  
> ;\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
>   
> EndIf  
>   
> EndFunc ;==\>StashAndRepair  
>   
>   
>   
>   
>   
>   
>   
>   
> ;;--------------------------------------------------------------------------------  
> ;; Gets levels from Gamebalance file, returns a list with snoid and lvl  
> ;;--------------------------------------------------------------------------------  
> Func GetLevelsAdvanced($offset)  
> If $offset \<\> 0 Then  
> $ofs = $offset + 0x218;  
> $read = \_MemoryRead($ofs, $d3, 'int')  
> While $read = 0  
> $ofs += 0x4  
> $read = \_MemoryRead($ofs, $d3, 'int')  
> WEnd  
> $size = \_MemoryRead($ofs + 0x4, $d3, 'int')  
> $size -= 0x5F8  
> $ofs = $offset + \_MemoryRead($ofs, $d3, 'int')  
> $nr = $size / 0x5F8  
> Local $snoItems[$nr + 1][4]  
> $j = 0  
> For $i = 0 To $size Step 0x5F8  
> $ofs\_address = $ofs + $i  
> $snoItems[$j][0] = \_MemoryRead($ofs\_address, $d3, 'ptr')  
> $snoItems[$j][3] = \_MemoryRead($ofs\_address + 0x4, $d3, 'char[256]')  
> $snoItems[$j][2] = Abs(\_MemoryRead($ofs\_address + 0x108, $d3, 'int')) ;item\_type\_hash  
> $snoItems[$j][1] = \_MemoryRead($ofs\_address + 0x114, $d3, 'int') ;lvl  
> $j += 1  
> Next  
> EndIf  
>   
> Return $snoItems  
>   
> EndFunc ;==\>GetLevelsAdvanced  
>   
>   
>   
> ; #FUNCTION# =====================================================================  
> ; Name...........: \_\_ArrayConcatenate  
> ; Description ...: Concatenate two 1D or 2D arrays  
> ; Syntax.........: \_\_ArrayConcatenate(ByRef $avArrayTarget, Const ByRef $avArraySource)  
> ; Parameters ....: $avArrayTarget - The array to concatenate onto  
> ; $avArraySource - The array to concatenate from - Must be 1D or 2D to match $avArrayTarget,  
> ; and if 2D, then Ubound($avArraySource, 2) \<= Ubound($avArrayTarget, 2).  
> ; Return values .: Success - Index of last added item  
> ; Failure - -1, sets @error to 1 and @extended per failure (see code below)  
> ; Author ........: Ultima  
> ; Modified.......: PsaltyDS - 1D/2D version, changed return value and @error/@extended to be consistent with \_\_ArrayAdd()  
> ; Remarks .......:  
> ; Related .......: \_\_ArrayAdd, \_ArrayPush  
> ; Link ..........;  
> ; Example .......; Yes  
> ; ===============================================================================  
> Func \_\_ArrayConcatenate(ByRef $avArrayTarget, Const ByRef $avArraySource)  
> If Not IsArray($avArrayTarget) Then Return SetError(1, 1, -1); $avArrayTarget is not an array  
> If Not IsArray($avArraySource) Then Return SetError(1, 2, -1); $avArraySource is not an array  
>   
> Local $iUBoundTarget0 = UBound($avArrayTarget, 0), $iUBoundSource0 = UBound($avArraySource, 0)  
> If $iUBoundTarget0 \<\> $iUBoundSource0 Then Return SetError(1, 3, -1); 1D/2D dimensionality did not match  
> If $iUBoundTarget0 \> 2 Then Return SetError(1, 4, -1); At least one array was 3D or more  
>   
> Local $iUBoundTarget1 = UBound($avArrayTarget, 1), $iUBoundSource1 = UBound($avArraySource, 1)  
>   
> Local $iNewSize = $iUBoundTarget1 + $iUBoundSource1  
> If $iUBoundTarget0 = 1 Then  
> ; 1D arrays  
> ReDim $avArrayTarget[$iNewSize]  
> For $i = 0 To $iUBoundSource1 - 1  
> $avArrayTarget[$iUBoundTarget1 + $i] = $avArraySource[$i]  
> Next  
> Else  
> ; 2D arrays  
> Local $iUBoundTarget2 = UBound($avArrayTarget, 2), $iUBoundSource2 = UBound($avArraySource, 2)  
> If $iUBoundSource2 \> $iUBoundTarget2 Then Return SetError(1, 5, -1); 2D boundry of source too large for target  
> ReDim $avArrayTarget[$iNewSize][$iUBoundTarget2]  
> For $r = 0 To $iUBoundSource1 - 1  
> For $c = 0 To $iUBoundSource2 - 1  
> $avArrayTarget[$iUBoundTarget1 + $r][$c] = $avArraySource[$r][$c]  
> Next  
> Next  
> EndIf  
>   
> Return $iNewSize - 1  
> EndFunc ;==\>\_\_ArrayConcatenate  
>   
> ;;--------------------------------------------------------------------------------  
> ;; LoadingSNOExtended  
> ;;--------------------------------------------------------------------------------  
> Func LoadingSNOExtended()  
> \_log("LoadingSNO")  
> $list = IndexSNO($gameBalance)  
>   
>   
>   
> $armorOffs = 0  
> $weaponOffs = 0  
> $otherOffs = 0  
> For $j = 0 To UBound($list) - 1  
> ;19750 = armor, 19754 = weapon, 1953 = other  
> ;170627 = leg armor, 19752 = leg weapon, 1189 = leg other  
> If ($list[$j][1] = 19750) Then  
> $armorOffs = $list[$j][0]  
> EndIf  
> If ($list[$j][1] = 19754) Then  
> $weaponOffs = $list[$j][0]  
> EndIf  
> If ($list[$j][1] = 19753) Then  
> $otherOffs = $list[$j][0]  
> EndIf  
>   
> If ($list[$j][1] = 170627) Then  
> $legarmorOffs = $list[$j][0]  
> EndIf  
> If ($list[$j][1] = 19752) Then  
> $legweaponOffs = $list[$j][0]  
> EndIf  
> If ($list[$j][1] = 1189) Then  
> $legotherOffs = $list[$j][0]  
> EndIf  
>   
> Next  
> Global $armorItems = GetLevelsAdvanced($armorOffs)  
> Global $weaponItems = GetLevelsAdvanced($weaponOffs)  
> Global $otherItems = GetLevelsAdvanced($otherOffs)  
>   
> Global $legarmorItems = GetLevelsAdvanced($legarmorOffs)  
> Global $legweaponItems = GetLevelsAdvanced($legweaponOffs)  
> Global $legotherItems = GetLevelsAdvanced($legotherOffs)  
>   
>   
> Global $allSNOitems = $armorItems  
> \_\_ArrayConcatenate($allSNOitems, $weaponItems)  
> \_\_ArrayConcatenate($allSNOitems, $otherItems)  
> \_\_ArrayConcatenate($allSNOitems, $legarmorItems)  
> \_\_ArrayConcatenate($allSNOitems, $legweaponOffs)  
> \_\_ArrayConcatenate($allSNOitems, $legotherOffs)  
> \_log("GB SNO loaded")  
> Return "true"  
> EndFunc ;==\>LoadingSNOExtended  
>   
>   
> Func Init\_grablistFile()  
> Dim $txttoarray[1]  
> ;local $load\_file = ""  
> Local $compt\_line = 0  
>   
> Local $file = FileOpen($grabListFile, 0)  
> If $file = -1 Then  
> MsgBox(0, "Error", "Unable to open file : " & $grabListFile)  
> Exit  
> EndIf  
>   
> While 1 ;Boucle de traitement de lecture du fichier txt  
> $line = FileReadLine($file)  
> If @error = -1 Then ExitLoop  
>   
> If $line \<\> "" Then  
> $line = StringLower($line)  
> ReDim $txttoarray[$compt\_line + 1]  
> $txttoarray[$compt\_line] = $line  
> $compt\_line += 1  
> EndIf  
> WEnd  
>   
> FileClose($file)  
>   
> Global $tab\_grablist[1][2]  
> Global $grablist = ""  
> Local $compt = 0  
>   
> For $i = 0 To UBound($txttoarray) - 1  
> If StringInStr($txttoarray[$i], "=", 0) Then  
> $var\_temp = StringSplit($txttoarray[$i], "=", 2)  
>   
> $var\_temp[0] = trim($var\_temp[0])  
>   
> ReDim $tab\_grablist[$compt + 1][2]  
>   
> $tab\_grablist[$compt][0] = $var\_temp[0]  
> $tab\_grablist[$compt][1] = $var\_temp[1]  
>   
> Assign($var\_temp[0], $var\_temp[1], 2)  
> $compt += 1  
> Else  
>   
> If $grablist = "" Then  
> $grablist = $txttoarray[$i]  
> Else  
> $grablist = $grablist & "|" & $txttoarray[$i]  
> EndIf  
>   
> EndIf  
> Next  
>   
> EndFunc ;==\>Init\_grablistFile  
>   
> Func Init\_GrabListTab()  
>   
> Dim $tab\_temp = StringSplit($grablist, "|", 2)  
>   
> Local $rules\_ilvl = '(?i)\[ilvl:([0-9]{1,2})\]'  
> Local $rules\_quality = '(?i)\[q:([0-9]{1,2})\]'  
> Local $rules\_filtre = '(?i)\(([[:ascii:]+]+)\)' ;enleve les "(" de premier niveau  
>   
> Local $i = 0, $detect = 0  
> Global $GrabListTab[UBound($tab\_temp)][5]  
> For $y = 0 To UBound($tab\_temp) - 1  
> $tab\_buff = StringLower(trim($tab\_temp[$y]))  
>   
> If StringRegExp($tab\_buff, $rules\_ilvl) = 1 Then ;patern declaration ilvl  
> $tab\_RegExp = StringRegExp($tab\_buff, $rules\_ilvl, 2)  
> $tab\_buff = StringReplace($tab\_buff, $tab\_RegExp[0], "", 0, 2)  
>   
> $curr\_ilvl = $tab\_RegExp[1]  
> Else  
> $curr\_ilvl = 0  
> EndIf  
>   
>   
> If StringRegExp($tab\_buff, $rules\_quality) = 1 Then ;patern declaration quality  
> $tab\_RegExp = StringRegExp($tab\_buff, $rules\_quality, 2)  
> $tab\_buff = StringReplace($tab\_buff, $tab\_RegExp[0], "", 0, 2)  
> $curr\_quality = $tab\_RegExp[1]  
> Else  
> $curr\_quality = 0  
> EndIf  
>   
>   
> If StringRegExp($tab\_buff, $rules\_filtre) = 1 Then ;patern declaration filtre  
> $tab\_RegExp = StringRegExp($tab\_buff, $rules\_filtre, 2)  
> $tab\_buff = StringReplace($tab\_buff, $tab\_RegExp[0], "", 0, 2)  
> $tab\_RegExp[1] = StringReplace($tab\_RegExp[1], "and", " and ", 0, 2)  
> $tab\_RegExp[1] = StringReplace($tab\_RegExp[1], "or", " or ", 0, 2)  
>   
> For $x = 0 To UBound($tab\_grablist) - 1  
> If StringInStr($tab\_RegExp[1], $tab\_grablist[$x][0], 0) Then  
> $tab\_RegExp[1] = StringReplace($tab\_RegExp[1], $tab\_grablist[$x][0], $tab\_grablist[$x][1], 0, 2)  
> EndIf  
> Next  
>   
> $curr\_filtre = $tab\_RegExp[1]  
> $curr\_filtre\_str = give\_str\_from\_filter($tab\_RegExp[1])  
> Else  
> $curr\_filtre = 0  
> $curr\_filtre\_str = ""  
> EndIf  
>   
> For $x = 0 To UBound($tab\_grablist) - 1  
> If StringInStr($tab\_buff, $tab\_grablist[$x][0], 0) Then  
> $tab = StringSplit($tab\_grablist[$x][1], "|", 2)  
> For $Z = 0 To UBound($tab) - 1  
>   
> If $Z \> 0 Then  
> ReDim $GrabListTab[UBound($GrabListTab) + 1][5]  
> EndIf  
>   
> $GrabListTab[$i][0] = $tab[$Z]  
> $GrabListTab[$i][1] = $curr\_ilvl  
> $GrabListTab[$i][2] = $curr\_quality  
> $GrabListTab[$i][3] = $curr\_filtre  
> $GrabListTab[$i][4] = $curr\_filtre\_str  
>   
> $i += 1  
> Next  
> $detect = 1  
> EndIf  
> Next  
>   
> If $detect = 0 Then  
> $GrabListTab[$i][0] = $tab\_buff  
> $GrabListTab[$i][1] = $curr\_ilvl  
> $GrabListTab[$i][2] = $curr\_quality  
> $GrabListTab[$i][3] = $curr\_filtre  
> $GrabListTab[$i][4] = $curr\_filtre\_str  
> $i += 1  
> EndIf  
>   
> $detect = 0  
> Next  
> EndFunc ;==\>Init\_GrabListTab  
>   
> Func give\_str\_from\_filter($str)  
> Local $result = ""  
> $str = StringReplace($str, "and", " ", 0, 2)  
> $str = StringReplace($str, "or", " ", 0, 2)  
>   
> While StringRegExp($str, '(?i)([a-z]+)') = 1  
> $list = StringRegExp($str, '(?i)([a-z]+)', 2)  
> If $result = "" Then  
> $result = $list[1]  
> Else  
> $result = $result & "|" & $list[1]  
> EndIf  
> $str = StringReplace($str, $list[1], " ", 0, 2)  
> ;msgbox(1, "", $str)  
> WEnd  
>   
> Return $result  
> EndFunc ;==\>give\_str\_from\_filter  
>   
> Func SafePortStart()  
> $Curentarea = GetLevelAreaId()  
> ;fix offset list  
> While $Curentarea = -1  
> While Not offsetlist()  
> Sleep(10)  
> WEnd  
> $Curentarea = GetLevelAreaId()  
>   
> WEnd  
> \_log('cur area :' & $Curentarea)  
>   
> $tptry = 0  
> $tpcheck = 0  
>   
> While $tpcheck = 0 And $tptry \<= 1  
> \_log("try n°" & $tptry + 1 & " hearthPortal")  
> InteractByActorName('hearthPortal')  
> $Newarea = GetLevelAreaId()  
>   
> Local $areatry = 0  
>   
> While $Newarea = $Curentarea And $areatry \<= 10  
> $Newarea = GetLevelAreaId()  
> Sleep(500)  
> $areatry = $areatry + 1  
> WEnd  
>   
> If $Newarea \<\> $Curentarea Then  
> $tpcheck = 1  
> Else  
> $tptry += 1  
> EndIf  
>   
> WEnd  
>   
> If $Newarea \<\> $Curentarea Then  
> \_log('succesfully teleported back : ' & $Curentarea & ":" & $Newarea)  
> While Not offsetlist()  
> Sleep(10)  
> WEnd  
> Else  
> $GameFailed = 1  
> EndIf  
>   
> EndFunc ;==\>SafePortStart  
>   
> Func SafePortBack()  
> $Curentarea = GetLevelAreaId()  
> \_log('cur area :' & $Curentarea)  
> ;Go to center according to act  
> Switch $Act  
> Case 1 ; act 1  
> MoveToPos(2922.02783203125, 2791.189453125, 24.0453262329102, 0, 25)  
> MoveToPos(2945.61547851563, 2800.7109375, 24.0453319549561, 0, 25)  
> MoveToPos(2973.68774414063, 2800.90869140625, 24.0453262329102, 0, 25)  
>   
> Case 2 ; act 2  
> ;mtp a definir  
>   
>   
> Case 3 ; act 3  
> MoveToPos(427.152893066406, 345.048858642578, 0.10000141710043, 0, 25)  
> MoveToPos(400.490386962891, 380.362884521484, 0.332595944404602, 0, 25)  
> MoveToPos(390.630401611328, 399.380554199219, 0.55376011133194, 0, 25)  
>   
> Case 4 ; act 4  
> MoveToPos(427.152893066406, 345.048858642578, 0.10000141710043, 0, 25)  
> MoveToPos(400.490386962891, 380.362884521484, 0.332595944404602, 0, 25)  
> MoveToPos(390.630401611328, 399.380554199219, 0.55376011133194, 0, 25)  
>   
> EndSwitch  
>   
> InteractByActorName('hearthPortal')  
> $Newarea = GetLevelAreaId()  
>   
> Local $areatry = 0  
> While $Newarea = $Curentarea And $areatry \<= 10  
> $Newarea = GetLevelAreaId()  
> Sleep(500)  
> $areatry = $areatry + 1  
> WEnd  
>   
> If $Newarea \<\> $Curentarea Then  
> \_log('succesfully teleported back : ' & $Curentarea & ":" & $Newarea)  
> While Not offsetlist()  
> Sleep(10)  
> WEnd  
> Else  
> \_log('We failed to teleport back')  
> EndIf  
> EndFunc ;==\>SafePortBack  
>   
> Func xml\_to\_item($name, $stats)  
> $rules\_name = "(?i){c:[a-z0-9]\*}([a-z0-9éèêëîïìâàäûüùöôòÿ" & @CRLF & " \+ \% \- \’ \']\*){/c}"  
> $rules\_stats = "(?i){c:[a-z0-9]\*}([a-z0-9éèêëîïìâàäûüùöôòÿ" & @CRLF & " \+ \% \- \’ \']\*){/c}"  
> ;$rules\_stat = "(?i){c:[a-z1-9]\*}(.\*){/c}"  
> $str = "\<item\>" & @CRLF  
> If StringRegExp($name, $rules\_name) = 1 Then ;patern declaration ilvl  
> $name\_item = StringRegExp($name, $rules\_name, 2)  
> ;MsgBox(1, "", $name\_item[1])  
> $name = "\<name\>" & $name\_item[1] & "\</name\>" & @CRLF  
> EndIf  
>   
> If StringRegExp($stats, $rules\_stats) = 1 Then  
> $stats\_item = StringRegExp($stats, $rules\_stats, 3)  
> ;\_ArrayDisplay($stats\_item)  
> $temp\_stats = ""  
> For $i = 0 To UBound($stats\_item) - 1  
> $temp\_stats = $temp\_stats & "\<stats\>- " & $stats\_item[$i] & "\</stats\>" & @CRLF  
>   
> Next  
> EndIf  
> $str = $str & $name & $temp\_stats & "\</item\>" & @CRLF & @CRLF  
> Return $str  
> EndFunc ;==\>xml\_to\_item  
>   
> Func Xml\_To\_Str($str, $load\_file)  
> Local $file = FileOpen($load\_file, 1)  
> If $file = -1 Then  
> MsgBox(0, "Error", "Unable to open xml file : " & $load\_file)  
> Exit  
>   
> EndIf  
> FileWrite($file, $str)  
> FileClose($file)  
> EndFunc ;==\>Xml\_To\_Str  
>   
>   
> Func Ftp\_Upload\_To\_Xml($file)  
> If Not $ftpserver = "" And Not $ftpusername = "" And Not $ftppass = "" Then  
> $Open = \_FTPOpen('MyFTP Control')  
> $Conn = \_FTPConnect($Open, $ftpserver, $ftpusername, $ftppass)  
> $Ftpp = \_FtpPutFile($Conn, $file, "statistique\_D3/" & $file)  
> $Ftpc = \_FTPClose($Open)  
> EndIf  
> EndFunc ;==\>Ftp\_Upload\_To\_Xml  
>   
>   
> Func fastcheckuiitemvisiblesize($valuetocheckfor, $visibility, $bucket)  
> Global $itemsize[4]  
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 2420, $d3, "ptr")  
> $ptr3 = \_memoryread($ptr2 + 0, $d3, "ptr")  
> $ofs\_uielements = \_memoryread($ptr3 + 8, $d3, "ptr")  
> $uielementpointer = \_memoryread($ofs\_uielements + 4 \* $bucket, $d3, "ptr")  
> While $uielementpointer \<\> 0  
> $npnt = \_memoryread($uielementpointer + 528, $d3, "ptr")  
> $name = BinaryToString(\_memoryread($npnt + 56, $d3, "byte[256]"), 4)  
> If StringInStr($name, $valuetocheckfor) Then  
> If \_memoryread($npnt + 40, $d3, "int") = $visibility Then  
>   
>   
> $x = \_memoryread($npnt + 0x508, $d3, "float") ;left  
> $y = \_memoryread($npnt + 0x50C, $d3, "float") ;top  
> $r = \_memoryread($npnt + 0x510, $d3, "float") ;right  
> $B = \_memoryread($npnt + 0x514, $d3, "float") ;bot  
> \_log(" x :" & $x & " y :" & $y & " R :" & $r & " B:" & $ ![B)](https://forum.gmstemple.com/uploads/default/original/2X/1/196bd4662947e797ef8567d4c1de4c4d84512d32.gif)  
>   
>   
> Dim $itemsize[4] = [$x, $y, $r, $B]  
>   
>   
>   
> Return $itemsize  
> Else  
> \_log("The UI element we are looking for is invisible")  
> Return False  
> EndIf  
> EndIf  
> $uielementpointer = \_memoryread($uielementpointer, $d3, "ptr")  
> WEnd  
> Return False  
> EndFunc ;==\>fastcheckuiitemvisiblesize  
>   
> Func \_checkbackpacksize()  
> $sizelookfor = "Root.NormalLayer.inventory\_dialog\_mainPage.inventory\_button\_backpack"  
>   
> $count\_fastcheckuiitemvisiblesize = 0  
> $sizecheck = 0  
> While $count\_fastcheckuiitemvisiblesize \<= 100 And $sizecheck = 0  
> fastcheckuiitemvisiblesize($sizelookfor, 1, 1180)  
> $count\_fastcheckuiitemvisiblesize += 1  
> if $itemsize[0] \<\> 0 Then  
> $sizecheck = 1  
> Endif  
> WEnd  
>   
> If $itemsize[0] = 1035 And $itemsize[1] = 652 And $itemsize[2] = 1575 And $itemsize[3] = 972 Then  
> \_log("UI Size check OK : " & $itemsize[0] & ":" & $itemsize[1] & ":" & $itemsize[2] & ":" & $itemsize[3])  
> Return True  
> Else  
>   
> If $itemsize[0] = False Then  
> \_log("UI Size check failed for unknow reason : " & $itemsize[0] & ":" & $itemsize[1] & ":" & $itemsize[2] & ":" & $itemsize[3])  
> else  
> \_log("UI Size check failed cuz windows is wrong size : " & $itemsize[0] & ":" & $itemsize[1] & ":" & $itemsize[2] & ":" & $itemsize[3])  
> Endif  
> antiidle()  
> EndIf  
>   
> EndFunc ;==\>\_checkbackpacksize  
>   
>   
>   
>   
>   
>   
> Func Auto\_spell\_init()  
> If StringLower(Trim($nameCharacter)) = "monk" Then  
> Dim $tab\_skill\_temp = $Monk\_skill\_Table  
> if $Gest\_affixe\_ByClass = "true" Then  
> $Gestion\_affixe\_loot = "false"  
> $Gestion\_affixe = "false"  
> \_log("Monk detected, Gest Affix disabled")  
> EndIf  
> ElseIf StringLower(Trim($nameCharacter)) = "barbarian" Then  
> Dim $tab\_skill\_temp = $Barbarian\_Skill\_Table  
> if $Gest\_affixe\_ByClass = "true" Then  
> $Gestion\_affixe\_loot = "false"  
> $Gestion\_affixe = "false"  
> \_log("Barbarian detected, Gest Affix disabled")  
> EndIf  
> ElseIf StringLower(Trim($nameCharacter)) = "witchdoctor" Then  
> Dim $tab\_skill\_temp = $WitchDoctor\_Skill\_Table  
> if $Gest\_affixe\_ByClass = "true" Then  
> $Gestion\_affixe\_loot = "true"  
> $Gestion\_affixe = "true"  
> \_log("WitchDoctor detected, Gest Affix Enabled")  
> EndIf  
> ElseIf StringLower(Trim($nameCharacter)) = "demonhunter" Then  
> Dim $tab\_skill\_temp = $DemonHunter\_skill\_Table  
> if $Gest\_affixe\_ByClass = "true" Then  
> $Gestion\_affixe\_loot = "true"  
> $Gestion\_affixe = "true"  
> \_log("DemonHunter detected, Gest Affix Enabled")  
> EndIf  
> Else  
> Dim $tab\_skill\_temp = $Wizard\_skill\_Table  
> if $Gest\_affixe\_ByClass = "true" Then  
> $Gestion\_affixe\_loot = "true"  
> $Gestion\_affixe = "true"  
> \_log("Wizard detected, Gest Affix Enabled")  
> EndIf  
> EndIf  
>   
>   
> for $i=-1 to 4  
> For $y=0 to Ubound($tab\_skill\_temp) - 1  
>   
> if GetActivePlayerSkill($i) = $tab\_skill\_temp[$y][0] Then  
> If $i= -1 Then  
> $Skill1 = assoc\_skill($y, "left", $tab\_skill\_temp)  
> Elseif $i=0 Then  
> $skill2 = assoc\_skill($y, "right", $tab\_skill\_temp)  
> ElseIf $i=1 Then  
> $skill3 = assoc\_skill($y, $Key1, $tab\_skill\_temp)  
> ElseIf $i=2 Then  
> $skill4 = assoc\_skill($y, $Key2, $tab\_skill\_temp)  
> ElseIf $i=3 Then  
> $skill5 = assoc\_skill($y, $Key3, $tab\_skill\_temp)  
> ElseIf $i=4 Then  
> $skill6 = assoc\_skill($y, $Key4, $tab\_skill\_temp)  
> EndIf  
> Exitloop  
> EndIF  
>   
> Next  
> Next  
> EndFunc  
>   
> Func assoc\_skill($y, $key, $tab\_skill\_temp)  
> Dim $tab[11]  
> $tab[0] = True  
> $tab[1] = $tab\_skill\_temp[$y][1]  
> $tab[2] = $tab\_skill\_temp[$y][2]  
> $tab[3] = $tab\_skill\_temp[$y][3]  
> $tab[4] = $tab\_skill\_temp[$y][4]  
> $tab[5] = $tab\_skill\_temp[$y][5]  
> $tab[6] = $key  
> $tab[7] = $tab\_skill\_temp[$y][6]  
> $tab[8] = $tab\_skill\_temp[$y][7]  
> $tab[9] = $tab\_skill\_temp[$y][0]  
> $tab[10] = ""  
> return $tab  
> EndFunc  
>   
> Func Detect\_UI\_error($mode=0)  
>   
> ;$mode=0 -\> Detection inventory full  
> ;$mode=1 -\> Detection Stash full  
> ;$mode=2 -\> Detection Deny Boss tp  
> ;$mode=3 -\> Detection No item IDentify  
>   
> $bucket\_inventory\_full = 1185  
> $valuetocheckfor = "Root.TopLayer.error\_notify.error\_text"  
> $Visibility = 1  
>   
> $ptr1 = \_memoryread($ofs\_objectmanager, $d3, "ptr")  
> $ptr2 = \_memoryread($ptr1 + 2420, $d3, "ptr")  
> $ptr3 = \_memoryread($ptr2 + 0, $d3, "ptr")  
> $ofs\_uielements = \_memoryread($ptr3 + 8, $d3, "ptr")  
> $uielementpointer = \_memoryread($ofs\_uielements + 4 \* $bucket\_inventory\_full, $d3, "ptr")  
>   
> While $uielementpointer \<\> 0  
> $npnt = \_memoryread($uielementpointer + 528, $d3, "ptr")  
> $name = BinaryToString(\_memoryread($npnt + 56, $d3, "byte[256]"), 4)  
> $uitextptr = \_memoryread($npnt + 0xAE0, $d3, "ptr")  
>   
> If StringInStr($name, $valuetocheckfor) Then  
> If \_memoryread($npnt + 40, $d3, "int") = $visibility Then  
>   
> ;\_log("Ui Error Visible")  
>   
> If $mode = 0 Then ;Detect inventory full  
> $uitext\_InventaireFull = \_memoryread($uitextptr, $d3, "byte["&$Byte\_full\_inventory[1]&"]")  
> If $Byte\_full\_inventory[0] = $uitext\_InventaireFull Then  
> \_log("Detection Inventaire Full !")  
> return true  
> EndIf  
> ElseIf $mode = 1 Then ;Detect Stash full  
> $uitext\_StashFull = \_memoryread($uitextptr, $d3, "byte["&$Byte\_Full\_Stash[1]&"]")  
> If $Byte\_Full\_Stash[0] = $uitext\_StashFull Then  
> \_log("Detection Stash Full !")  
> return true  
> EndIf  
> ElseIf $mode = 2 Then ;Detect Deny Tp  
> $uitext\_BossTpDeny = \_memoryread($uitextptr, $d3, "byte["&$Byte\_Boss\_TpDeny[1]&"]")  
> If $Byte\_Boss\_TpDeny[0] = $uitext\_BossTpDeny Then  
> \_log("Detection Deny Tp, Boss room !")  
> return true  
> EndIf  
> ElseIf $mode = 3 Then ;Detect No Item identify  
> $uitext\_NoItemIdentify = \_memoryread($uitextptr, $d3, "byte["&$Byte\_NoItem\_Identify[1]&"]")  
> If $Byte\_NoItem\_Identify[0] = $uitext\_NoItemIdentify Then  
> \_log("Detection No Item IDentify !")  
> return true  
> EndIf  
> ElseIf $mode \> 3 Then ;Test Mode  
>   
> $uitext\_InventaireFull = \_memoryread($uitextptr, $d3, "byte["&$Byte\_full\_inventory[1]&"]")  
> $uitext\_StashFull = \_memoryread($uitextptr, $d3, "byte["&$Byte\_Full\_Stash[1]&"]")  
> $uitext\_BossTpDeny = \_memoryread($uitextptr, $d3, "byte["&$Byte\_Boss\_TpDeny[1]&"]")  
> $uitext\_NoItemIdentify = \_memoryread($uitextptr, $d3, "byte["&$Byte\_NoItem\_Identify[1]&"]")  
>   
> If $Byte\_full\_inventory[0] = $uitext\_InventaireFull Then  
> \_log("Detection Inventaire Full !")  
> return true  
> ElseIf $Byte\_Full\_Stash[0] = $uitext\_StashFull Then  
> \_log("Detection Stash Full !")  
> return true  
> ElseIf $Byte\_Boss\_TpDeny[0] = $uitext\_BossTpDeny Then  
> \_log("Detection Deny Tp, Boss room !")  
> return true  
> ElseIf $Byte\_NoItem\_Identify[0] = $uitext\_NoItemIdentify Then  
> \_log("Detection No Item IDentify !")  
> return true  
> EndIf  
>   
> EndIf  
>   
> Else  
> \_log("No detection")  
> Return False  
> EndIf  
>   
> EndIf  
>   
> $uielementpointer = \_memoryread($uielementpointer, $d3, "ptr")  
> WEnd  
> Return False  
> EndFunc  
>   
>   
> Func Detect\_Str\_full\_inventory()  
>   
> Global $Byte\_Full\_Inventory[2]  
> Global $Byte\_Full\_Stash[2]  
> Global $Byte\_Boss\_TpDeny[2]  
> Global $Byte\_NoItem\_Identify[2]  
>   
> Dim $list = IndexSNO($ofs\_StringListDef,0)  
> ;\_arraydisplay($list)  
>   
> For $y=1 to Ubound($List) - 1  
>   
> If $list[$y][1] = 0xCB21 Then  
> $count = \_MemoryRead($list[$y][0] + 0x1c, $d3, "int")  
> $count = $count / 0x50  
>   
> $offset = $list[$y][0] + 0x28  
>   
> For $i=0 to $count - 1  
>   
>   
> $structtest = DllStructCreate("ptr;byte[8];int;ptr;byte[8];int;ptr;byte[8];int;ptr;byte[8];int;byte[16]")  
> ;$structtest = DllStructCreate("ptr;byte[4];ptr;int;byte[8];ptr;int;byte[8]ptr;int;byte[8];ptr;int;byte[16]")  
> DllCall($d3[0], 'int', 'ReadProcessMemory', 'int', $d3[1], 'int', $offset, 'ptr', DllStructGetPtr($structtest), 'int', DllStructGetSize($structtest), 'int', '')  
>   
> $str1 = DllStructGetData($structtest, 1)  
> $size1 = DllStructGetData($structtest, 3)  
>   
> $str2 = DllStructGetData($structtest, 4)  
> $size2 = DllStructGetData($structtest, 6)  
>   
>   
> $str\_to\_check = BinaryToString( \_MemoryRead($str1, $d3, "char[" & $size1 & "]"), 4)  
>   
> If StringInStr($str\_to\_check, "Pickup\_NoSuitableSlot") Then  
> \_log("1) Pickup\_NoSuitableSlot found")  
> $Byte\_Full\_Inventory[0] = \_MemoryRead($str2, $d3, "byte[" & $size2 & "]")  
> $Byte\_Full\_Inventory[1] = $size2  
> ElseIf StringInStr($str\_to\_check, "IAR\_NotEnoughRoom") Then  
> \_log("2) IAR\_NotEnoughRoom found")  
> $Byte\_Full\_Stash[0] = \_MemoryRead($str2, $d3, "byte[" & $size2 & "]")  
> $Byte\_Full\_Stash[1] = $size2  
> ElseIf StringInStr($str\_to\_check, "PowerUnusableDuringBossEncounter") Then  
> \_log("3) PowerUnusableDuringBossEncounter found")  
> $Byte\_boss\_TpDeny[0] = \_MemoryRead($str2, $d3, "byte[" & $size2 & "]")  
> $Byte\_boss\_TpDeny[1] = $size2  
> ElseIf StringInStr($str\_to\_check, "IdentifyAllNoItems") Then  
> \_log("4) IdentifyAllNoItems found")  
> $Byte\_NoItem\_Identify[0] = \_MemoryRead($str2, $d3, "byte[" & $size2 & "]")  
> $Byte\_NoItem\_Identify[1] = $size2  
> EndIf  
>   
>   
> $offset += 0x50  
> $structtest = ""  
> Next  
> EndIf  
> Next  
>   
> EndFunc  
>   
> Func GetLocalPlayer()  
> Global $ObjManStorage = 0x7CC ;0x794  
> $v0 = \_MemoryRead(\_MemoryRead($ofs\_objectmanager, $d3, 'int') + 0x984, $d3, 'int') ;0x94C/934  
> $v1 = \_MemoryRead(\_MemoryRead($ofs\_objectmanager, $d3, 'int') + $ObjManStorage + 0xA8, $d3, 'int')  
>   
> if $v0 \<\> 0 AND \_MemoryRead($v0, $d3, 'int') \<\> -1 AND $v1 \<\> 0 Then  
> return 0x8008 \* \_MemoryRead($v0, $d3, 'int') + $v1 + 0x58  
> Else  
> return 0  
> EndIf  
> EndFunc  
>   
> Func GetActivePlayerSkill($index)  
> $Local\_player = GetLocalPlayer()  
> If $local\_player \<\> 0 Then  
> return \_MemoryRead($local\_player + 4 \* (3 \* $index + 0x30), $d3, 'int')  
> Else  
> return 0  
> EndIf  
> EndFunc  
>   
> Func GoToTown\_Portal()  
>   
>   
> EndFunc  
>   
>   
> Func \_TownPortalnew($mode=0)  
>   
> $compt=0  
>   
> While Not \_intown()  
>   
> \_log("tour de boucle \_intown")  
>   
> $compt += 1  
> $compt\_while = 0  
> $timer = 0  
> $try = 0  
>   
> if $mode\<\>0 AND $compt \> $mode Then  
> \_log("Too Much TP try !!!")  
> ExitLoop  
> EndIF  
>   
> \_log("enclenche attack")  
> $grabskip = 1  
> Attack()  
> $grabskip = 0  
>   
> Sleep(100)  
>   
> $CurrentLoc = getcurrentpos()  
> MoveToPos($CurrentLoc[0] + 5, $CurrentLoc[1] + 5, $CurrentLoc[2], 0, 6)  
>   
>   
> If \_playerdead() = False Then  
>   
> sleep(250)  
> send("t")  
> sleep(250)  
>   
> If Detect\_UI\_error(2) AND NOT \_intown() Then  
> \_log('Detection Asmo room')  
> Return False  
> EndIf  
>   
> $Current\_area = GetLevelAreaId()  
>   
> \_log("enclenchement fastCheckui de la barre de loading")  
>   
> while fastcheckuiitemvisible("Root.NormalLayer.game\_dialog\_backgroundScreen.loopinganimmeter.progressBar", 1, 996)  
> if $compt\_while = 0 Then  
> \_log("enclenchement du timer")  
> $timer = timerinit()  
> EndIF  
>   
> sleep(100)  
> $compt\_while += 1  
> WEnd  
>   
> \_log("compare time to tp -\> " & TimerDiff($timer) & "\> 3700")  
> if TimerDiff($timer) \> 3700 Then  
> while NOT \_intown() AND $try \< 6  
> \_log("on a peut etre reussi a tp, on reste inerte pendant 6sec voir si on arrive en ville, tentative -\> " & $try)  
> $try += 1  
> sleep(1000)  
> WEnd  
> EndIf  
>   
> Sleep(500)  
>   
>   
> if $Current\_area \<\> GetLevelAreaId() Then  
> \_log("Changement d'arreat, on quite la boucle")  
> ExitLoop  
> EndIf  
>   
> Else  
> \_log("Vous etes morts lors d'une tentative de teleporte !!!")  
> Return False  
> EndIf  
>   
> sleep(100)  
> $PortBack = True  
> WEnd  
>   
> \_log("on a renvoyer true, quite bien la fonction")  
> While Not offsetlist()  
> Sleep(10)  
> WEnd  
>   
> return true  
> EndFunc  
>   
>   
> Func GetMaxResource($idAttrib, $classe)  
>   
> Switch $classe  
> Case "monk"  
> $source = 0x3000  
> $MaximumSpirit=\_memoryread(GetAttributeOfs($idAttrib, BitOR($Atrib\_Resource\_Max\_Total[0], $source)), $d3, "float")  
> \_log("Ressource Maximum : " & $MaximumSpirit)  
> Case "barbarian"  
> $source = 0x2000  
> $MaximumFury=\_memoryread(GetAttributeOfs($idAttrib, BitOR($Atrib\_Resource\_Max\_Total[0], $source)), $d3, "float")  
> \_log("Ressource Maximum : " & $MaximumFury)  
> Case "wizard"  
> $source = 0x1000  
> $MaximumArcane=\_memoryread(GetAttributeOfs($idAttrib, BitOR($Atrib\_Resource\_Max\_Total[0], $source)), $d3, "float")  
> \_log("Ressource Maximum : " & $MaximumArcane)  
> Case "witchdoctor"  
> $source = 0  
> $MaximumMana=\_memoryread(GetAttributeOfs($idAttrib, BitOR($Atrib\_Resource\_Max\_Total[0], $source)), $d3, "float")  
> \_log("Ressource Maximum : " & $MaximumMana)  
> Case "demonhunter"  
> $source = 0x5000  
> $MaximumHatred=\_memoryread(GetAttributeOfs($idAttrib, BitOR($Atrib\_Resource\_Max\_Total[0], $source)), $d3, "float")  
> $source = 0x6000  
> $MaximumDiscipline=\_memoryread(GetAttributeOfs($idAttrib, BitOR($Atrib\_Resource\_Max\_Total[0], $source)), $d3, "float")  
> \_log("Ressource Maximum : " & $MaximumHatred)  
> \_log("Ressource Maximum : " & $MaximumDiscipline)  
>   
> EndSwitch  
>   
> EndFunc ;==\>GetMaxResource  
>   
>   
>   
> func reset\_timer\_ignore()  
> if timerdiff($timer\_ignore\_reset)\>120000 Then  
>   
> redim $ignore\_affix[1][2]  
> $timer\_ignore\_reset=timerinit()  
> EndIf  
> endfunc  
>   
> func check\_ignore\_affix($\_x\_verif,$\_y\_verif)  
> for $a=0 to ubound($ignore\_affix)-1  
> if $\_x\_verif=$ignore\_affix[$a][0] and $\_y\_verif=$ignore\_affix[$a][1] Then  
> return False  
> $a=ubound($ignore\_affix)-1  
> Else  
> return True  
> EndIf  
> Next  
>   
> EndFunc  
>   
>   
>   
> func is\_zone\_safe($x\_perso,$y\_perso,$z\_test,$item\_safe)  
> $condition\_affixe=0  
> for $aa=0 to ubound($item\_safe)-1  
>   
> $distance\_centre\_affixe=sqrt(($item\_safe[$aa][2]-$x\_perso)^2 + ($item\_safe[$aa][3]-$y\_perso)^2)  
> if $distance\_centre\_affixe\<$item\_safe[$aa][10] then  
> $condition\_affixe=$condition\_affixe+1  
> ;~ $aa=ubound($item\_safe)-1  
> EndIf  
>   
> next  
>   
> if $condition\_affixe=0 Then  
>   
> return true  
> Else  
> return false  
> EndIf  
>   
> EndFunc  
>   
> func zone\_safe($x\_perso,$y\_perso,$item\_verif,$z\_test,$x\_mob,$y\_mob)  
> dim $safe\_array[1][3]  
> $bb=-1  
> if $x\_mob-$x\_perso\>0 then  
> $ord=1  
> else  
> $ord=-1  
> EndIf  
>   
> if $y\_mob-$y\_perso\>0 then  
> $abs=1  
> else  
> $abs=-1  
> EndIf  
>   
> for $b=0 to ubound($tab\_aff2)-1  
> $x\_test=$x\_perso+$ord\*$tab\_aff2[$b][0]  
> $y\_test=$y\_perso+$abs\*$tab\_aff2[$b][1]  
> if is\_zone\_safe($x\_test,$y\_test,$z\_test,$item\_verif) and check\_ignore\_affix($x\_test,$y\_test) Then  
> ReDim $safe\_array[$bb+2][3]  
> $bb=$bb+1  
> $distance\_safe=getdistance($x\_test,$y\_test,0)  
> $safe\_array[$bb][1]=$x\_test  
> $safe\_array[$bb][2]=$y\_test  
> $safe\_array[$bb][0]=$distance\_safe  
> ;~ $safe\_array[$bb+1][1]=$x\_test  
> ;~ $safe\_array[$bb+1][2]=$y\_test  
> ;~ $safe\_array[$bb+1][0]=$distance\_safe  
> ;~ $b= ubound($tab\_aff2)-1  
> EndIf  
>   
> $x\_test=$x\_perso-$ord\*$tab\_aff2[$b][0]  
> $y\_test=$y\_perso-$abs\*$tab\_aff2[$b][1]  
> if is\_zone\_safe($x\_test,$y\_test,$z\_test,$item\_verif) and check\_ignore\_affix($x\_test,$y\_test) Then  
> ReDim $safe\_array[$bb+2][3]  
> $bb=$bb+1  
> $distance\_safe=getdistance($x\_test,$y\_test,0)  
> $safe\_array[$bb][1]=$x\_test  
> $safe\_array[$bb][2]=$y\_test  
> $safe\_array[$bb][0]=$distance\_safe  
> ;~ $safe\_array[$bb+1][1]=$x\_test  
> ;~ $safe\_array[$bb+1][2]=$y\_test  
> ;~ $safe\_array[$bb+1][0]=$distance\_safe  
> ;~ $b= ubound($tab\_aff2)-1  
> EndIf  
>   
> $x\_test=$x\_perso+$ord\*$tab\_aff2[$b][0]  
> $y\_test=$y\_perso-$abs\*$tab\_aff2[$b][1]  
> if is\_zone\_safe($x\_test,$y\_test,$z\_test,$item\_verif) and check\_ignore\_affix($x\_test,$y\_test) Then  
> ReDim $safe\_array[$bb+2][3]  
> $bb=$bb+1  
> $distance\_safe=getdistance($x\_test,$y\_test,0)  
> $safe\_array[$bb][1]=$x\_test  
> $safe\_array[$bb][2]=$y\_test  
> $safe\_array[$bb][0]=$distance\_safe  
> ;~ $safe\_array[$bb+1][1]=$x\_test  
> ;~ $safe\_array[$bb+1][2]=$y\_test  
> ;~ $safe\_array[$bb+1][0]=$distance\_safe  
> ;~ $b= ubound($tab\_aff2)-1  
> EndIf  
>   
> $x\_test=$x\_perso-$ord\*$tab\_aff2[$b][0]  
> $y\_test=$y\_perso+$abs\*$tab\_aff2[$b][1]  
> if is\_zone\_safe($x\_test,$y\_test,$z\_test,$item\_verif) and check\_ignore\_affix($x\_test,$y\_test) Then  
> ReDim $safe\_array[$bb+2][3]  
> $bb=$bb+1  
> $distance\_safe=getdistance($x\_test,$y\_test,0)  
> $safe\_array[$bb][1]=$x\_test  
> $safe\_array[$bb][2]=$y\_test  
> $safe\_array[$bb][0]=$distance\_safe  
> ;~ $safe\_array[$bb+1][1]=$x\_test  
> ;~ $safe\_array[$bb+1][2]=$y\_test  
> ;~ $safe\_array[$bb+1][0]=$distance\_safe  
> ;~ $b= ubound($tab\_aff2)-1  
> EndIf  
> Next  
> if $safe\_array[0][0]\<\>0 then  
> \_ArraySort($safe\_array)  
> dim $move\_aff[2]  
> $move\_aff[0]=$safe\_array[0][1]  
> $move\_aff[1]=$safe\_array[0][2]  
>   
> Else  
> $move\_aff[0]=$x\_test  
> $move\_aff[1]=$y\_test  
>   
> EndIf  
> return $move\_aff  
>   
> EndFunc  
>   
> Func maffmove($\_x\_aff,$\_y\_aff,$\_z\_aff,$x\_mob,$y\_mob)  
> reset\_timer\_ignore()  
> if timerdiff($maff\_timer)\>500 then  
> Dim $item\_maff\_move = IterateFilterAffix()  
> If IsArray($item\_maff\_move) Then  
> $a=0  
> while $a\<=ubound($item\_maff\_move)-1  
> checkforpotion()  
> mouseup('left')  
> ;~ $dist\_aff=sqrt(($\_x\_aff-$item\_maff\_move[$a][2])\*($\_x\_aff-$item\_maff\_move[$a][2]) + ($\_y\_aff-$item\_maff\_move[$a][3])\*($\_y\_aff-$item\_maff\_move[$a][3]) + ($\_z\_aff-$item\_maff\_move[$a][4])\*($\_z\_aff-$item\_maff\_move[$a][4]))  
> if $item\_maff\_move[$a][9]\<$item\_maff\_move[$a][10] and \_playerdead()=false then  
> dim $move\_coords[2]  
> $move\_coords=zone\_safe($\_x\_aff,$\_y\_aff,$item\_maff\_move,$\_z\_aff,$x\_mob,$y\_mob)  
> $Coords\_affixe = FromD3toScreenCoords($move\_coords[0],$move\_coords[1],$\_z\_aff)  
> Mousemove($Coords\_affixe[0], $Coords\_affixe[1], 3)  
> GestSpellcast(0, 0, 0)  
> MouseClick("middle")  
> $ignore\_timer=timerinit()  
> while \_MemoryRead($ClickToMoveToggle,$d3,"float")\<\>0  
> ;~ GestSpellcast(0, 2, 0)  
> if timerdiff($ignore\_timer)\>10000 then exitloop  
> sleep(10)  
>   
> wend  
> if timerdiff($ignore\_timer)\<30 Then  
> $nbr\_ignore=ubound($ignore\_affix)  
> redim $ignore\_affix[$nbr\_ignore+1][2]  
> $ignore\_affix[$nbr\_ignore][0]=$move\_coords[0]  
> $ignore\_affix[$nbr\_ignore][1]=$move\_coords[1]  
> endif  
>   
> $maff\_timer=timerinit()  
> exitloop  
>   
> endif  
> $a +=1  
> wend  
> endif  
>   
> endif  
> EndFunc ;maffmove  
>   
> Func IterateFilterAffix()  
> Local $index, $offset, $count, $item[10]  
> startIterateObjectsList($index, $offset, $count)  
> Dim $item\_affix\_2D[1][11]  
> Local $i = 0  
> $pv\_affix=getlifep()  
> $compt = 0  
> ;~ $ii=0  
> While iterateObjectsList($index, $offset, $count, $item)  
> $compt += 1  
> If Is\_Affix($item,$pv\_affix) Then  
> ReDim $item\_affix\_2D[$i + 1][11]  
> For $x = 0 To 9  
> $item\_affix\_2D[$i][$x] = $item[$x]  
> Next  
>   
> if (StringInStr($item[1],"woodWraith\_explosion") or StringInStr($item[1],"WoodWraith\_sporeCloud\_emitter") ) then $item\_affix\_2D[$i][10] = $range\_ice  
> if StringInStr($item[1],"molten\_trail") then $item\_affix\_2D[$i][10] = $range\_lave  
> if StringInStr($item[1],"Desecrator") then $item\_affix\_2D[$i][10] = $range\_profa  
> if (StringInStr($item[1],"bomb\_buildup") or StringInStr($item[1],"Icecluster") or stringinstr($item[1],"Molten\_deathExplosion") or stringinstr($item[1],"Molten\_deathStart")) then $item\_affix\_2D[$i][10] = $range\_ice  
> if (StringInStr($item[1],"demonmine\_C") or StringInStr($item[1],"Crater\_DemonClawBomb")) then $item\_affix\_2D[$i][10] = $range\_mine  
> if StringInStr($item[1],"creepMobArm") then $item\_affix\_2D[$i][10] = $range\_arm  
> if (StringInStr($item[1],"spore") or StringInStr($item[1],"Plagued\_endCloud") or StringInStr($item[1],"Poison")) then $item\_affix\_2D[$i][10] = $range\_peste  
> if StringInStr($item[1],"ArcaneEnchanted\_petsweep") then $item\_affix\_2D[$i][10] = $range\_arcane  
>   
> ;~ if $item\_affix\_2D[$i][10]-$item\_affix\_2D[$i][9]\>0 then $ii=$ii+1  
>   
> $i += 1  
> EndIf  
> WEnd  
> ;~ or $ii=0  
> If $i = 0 Then  
> Return False  
> Else  
>   
> \_ArraySort($item\_affix\_2D, 0, 0, 0, 9)  
>   
> Return $item\_affix\_2D  
> EndIf  
> EndFunc ;==\>IterateFilterAffix  
>   
> $BanAffixList="poison\_humanoid|"&$BanAffixList  
>   
> Func Is\_Affix($item,$pv=0)  
> if $item[9]\<50 then  
> if ((StringInStr($item[1],"bomb\_buildup") and $pv\<=$Life\_explo/100 ) or \_  
> (StringInStr($item[1],"demonmine\_C") and $pv\<=$Life\_mine/100) or \_  
> (StringInStr($item[1],"creepMobArm") and $pv\<=$Life\_arm/100 ) or \_  
> (StringInStr($item[1],"woodWraith\_explosion") and $pv\<=$Life\_spore/100) or \_  
> (StringInStr($item[1],"WoodWraith\_sporeCloud\_emitter") and $pv\<=$Life\_spore/100 ) or \_  
> (StringInStr($item[1],"Crater\_DemonClawBomb") and $pv\<=$Life\_mine/100 ) or \_  
> (stringinstr($item[1],"Molten\_deathExplosion") and $pv\<=$Life\_explo/100 ) or \_  
> (stringinstr($item[1],"Molten\_deathStart") and $pv\<=$Life\_explo/100 ) or \_  
> (StringInStr($item[1],"icecluster") and $pv\<=$Life\_ice/100 ) or \_  
> (StringInStr($item[1],"spore") and $pv\<=$Life\_spore/100 ) or \_  
> (StringInStr($item[1],"ArcaneEnchanted\_petsweep") and $pv\<=$Life\_arcane/100 ) or \_  
> (StringInStr($item[1],"desecrator") and $pv\<=$Life\_profa/100 ) or \_  
> (StringInStr($item[1],"Plagued\_endCloud") and $pv\<=$Life\_peste/100 ) or \_  
> (StringInStr($item[1],"poison") and $pv\<=$Life\_poison/100 ) or \_  
> (StringInStr($item[1],"molten\_trail") and $pv\<=$Life\_lave/100 )) \_  
> and checkfromlist($BanAffixList, $item[1]) = 0 then  
> Return True  
> Else  
> Return False  
> EndIf  
> EndIf  
>   
> EndFunc ;==\>Is\_Affix  
>   
>   
> Func Take\_BookOfCain()  
>   
> If \_checkInventoryopen() = true Then  
> Send("i")  
> Sleep(150)  
> Endif  
>   
> Switch $Act  
> Case 1  
> MoveToPos(2971.64501953125, 2804.37109375, 24.0453300476074,1,25)  
> MoveToPos(2954.90478515625, 2794.11181640625, 24.0453319549561,1,25)  
> Case 2  
> ;do nothing act 2  
> Case 3 To 4  
> MoveToPos(395.930847167969, 390.577362060547, 0.408410131931305,0,20)  
> EndSwitch  
>   
> InteractByActorName("All\_Book\_Of\_Cain")  
> While NOT fastcheckuiitemvisible("Root.NormalLayer.game\_dialog\_backgroundScreen.loopinganimmeter", 1, 1512) AND NOT Detect\_UI\_error(3)  
> ;\_log("Ui : " & fastcheckuiitemvisible("Root.NormalLayer.game\_dialog\_backgroundScreen.loopinganimmeter", 1, 1512) & " Error : " & fastcheckuiitemvisible("Root.TopLayer.error\_notify.error\_text", 1, 1185))  
> \_log("tour boucle")  
> if NOT fastcheckuiitemvisible("Root.NormalLayer.game\_dialog\_backgroundScreen.loopinganimmeter", 1, 1512) Then  
> InteractByActorName("All\_Book\_Of\_Cain")  
> EndIf  
> WEnd  
> While fastcheckuiitemvisible("Root.NormalLayer.game\_dialog\_backgroundScreen.loopinganimmeter", 1, 1512)  
> sleep(50)  
> Wend  
> EndFunc

  
  
Merci d'avance

---

<div class="post-metadata">

**Author:** ![max68](https://forum.gmstemple.com/user_avatar/forum.gmstemple.com/max68/32/4312_2.png) [@max68](https://forum.gmstemple.com/u/max68)\
**Post date:** [Juin 6, 2013, 5:06 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/9 "2013-06-06T17:06:55Z")

</div>

Merci pour les balises ![:)](https://forum.gmstemple.com/uploads/default/original/2X/f/f31646767a12ff3f4d6b8c4766d2ea41b23d4ab9.gif)

---

<div class="post-metadata">

**Author:** ![fidjo](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/f/41988e/32.png) [@fidjo](https://forum.gmstemple.com/u/fidjo)\
**Post date:** [Juin 6, 2013, 5:09 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/10 "2013-06-06T17:09:12Z")

</div>

désolé moi et le bbecode ... ![:D](https://forum.gmstemple.com/uploads/default/original/2X/4/4e279733a789da83bda5b44aedcf6a0d5178edcb.gif)

---

<div class="post-metadata">

**Author:** ![fidjo](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/f/41988e/32.png) [@fidjo](https://forum.gmstemple.com/u/fidjo)\
**Post date:** [Juin 6, 2013, 6:13 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/11 "2013-06-06T18:13:47Z")

</div>

une idée sinon ?

---

<div class="post-metadata">

**Author:** ![fidjo](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/f/41988e/32.png) [@fidjo](https://forum.gmstemple.com/u/fidjo)\
**Post date:** [Juin 7, 2013, 11:14 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/12 "2013-06-07T23:14:10Z")

</div>

un petit up ! merci d'avance !

---

<div class="post-metadata">

**Author:** ![Peage](https://forum.gmstemple.com/user_avatar/forum.gmstemple.com/peage/32/4755_2.png) [@Peage](https://forum.gmstemple.com/u/Peage)\
**Post date:** [Juin 7, 2013, 11:38 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/13 "2013-06-07T23:38:44Z")

</div>

> un petit up ! merci d'avance !

  
  
j'ai une idee , tu re dl proprement le bot v8.1 , et tu refais les modification expliqué dans le thread car tout marche impecable ^^

---

<div class="post-metadata">

**Author:** ![fidjo](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/f/41988e/32.png) [@fidjo](https://forum.gmstemple.com/u/fidjo)\
**Post date:** [Juin 8, 2013, 1:23 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/14 "2013-06-08T01:23:01Z")

</div>

Oui j'ai déjà fais ça au moins 5 fois !! mais toujours le même problème ...   
  
une autre option ? personne ne peut se pencher sur mon code écris plus haut ?  
  
Merci d'avance ...

---

<div class="post-metadata">

**Author:** ![lokiro123](https://forum.gmstemple.com/user_avatar/forum.gmstemple.com/lokiro123/32/4577_2.png) [@lokiro123](https://forum.gmstemple.com/u/lokiro123)\
**Post date:** [Juin 8, 2013, 1:46 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/15 "2013-06-08T01:46:36Z")

</div>

je conseil cette fonction [https://forum.gmstemple.com/index.php?showtopic=13780](https://forum.gmstemple.com/t/11846)  
  
au lieu de celle poster sur se topic, qui n'a pas été réellement tester et "approuver" fonctionnel

---

<div class="post-metadata">

**Author:** ![spctoma](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/s/a9a28c/32.png) [@spctoma](https://forum.gmstemple.com/u/spctoma)\
**Post date:** [Juin 8, 2013, 9:38 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/16 "2013-06-08T09:38:42Z")

</div>

> Bonjour, j'ai effectué toutes les modifications mais j'ai un souci... le Bot lorsqu'il veut recycler il clique sur forger une amure du coup bah ça ne recycle rien du tout  
>   
> avez vous une solution ? je vous poste en spoil mon Toolkit et mon settings

  
J'avais le même problème, le bot cliquait sur l'onglet Armor tout le temps au lieu de dez. Cela arrive si vous avez coché l'option : "ne pas confirmer le dez des objets jaunes".  
Le bot cherche en fait à valider le dez d'un objet jaune en cliquant sur OK ce qui a pour effet de vous amener dans l'onglet Armure.  
  
Si vous avez coché cette option, commentez les lignes suivantes :  
  

```
;if $items[$ToRecycle[$i]][3] > 5 then ; si jaune ou plus, clique sur OK
;MouseMove(300,210, 2)
;Sleep(Random(100, 500))
;MouseClick('Left')
;endif
```

  
Dans la fonction StashAndRepair()  
  

> je conseil cette fonction [https://forum.gmstemple.com/index.php?showtopic=13780](https://forum.gmstemple.com/t/11846)  
>   
> au lieu de celle poster sur se topic, qui n'a pas été réellement tester et "approuver" fonctionnel

  
Je confirme, cela marche très bien en faisant les modifs de ce poste : [https://forum.gmstemple.com/index.php?showtopic=13780](https://forum.gmstemple.com/t/11846)  
(en rajoutant uniquement ce qui est en gras dans mes fonctions).

---

<div class="post-metadata">

**Author:** ![fidjo](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/f/41988e/32.png) [@fidjo](https://forum.gmstemple.com/u/fidjo)\
**Post date:** [Juin 8, 2013, 12:12 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/17 "2013-06-08T12:12:52Z")

</div>

Merci beaucoup je test tout ça et je vous tiens au courant ! @ bientôt   
  
  
Edit : ça Fonctionne !!! Merci (j'ai désactiver la fonction ne pas confirmer le dez)  
reste plus que les petits réglages sur le problème du coffre (blocage) et le fait que le bot soit stressé du cul ou il termine pas ses mobs (en général les champions)   
  
Pourtant j'ai bien augmenté la durée de l'attaque ![:)](https://forum.gmstemple.com/uploads/default/original/2X/f/f31646767a12ff3f4d6b8c4766d2ea41b23d4ab9.gif)  
  
D'après vous , problème sur l'attaque range ou attacktimeout ?  
  
voici quelques infos :   
  

> **Spoiler**
>
> Unidentified=false  
>   
> TakeShrines=true  
>   
> repairafterxxgames=2  
> maxgamelength=3000000  
> attackRange=50  
> grabRange=230  
>   
> MonsterTri=True  
> MonsterRefresh=True  
> ItemRefresh=True  
> MonsterPriority=False  
> InventoryCheck=True  
>   
> Gest\_affixe\_ByClass=true  
> Gestion\_affixe=true  
> Gestion\_affixe\_loot=true  
> BanAffixList=poison|spore  
>   
> attacktimeout=14000  
> grabtimeout=10000  
>   
>   
> UsePath=true  
> ResActivated=true  
> ResLife=4

  
  
Fidjo  
  
PS: Bon Botting

---

<div class="post-metadata">

**Author:** ![sapman78](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@sapman78](https://forum.gmstemple.com/u/sapman78)\
**Post date:** [Juin 9, 2013, 3:40 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/18 "2013-06-09T15:40:05Z")

</div>

Bonjour,  
  
Pour moi cela ne fonctionne pas malheureusement. Je suis en version 8.1 et j'ai modifié les fichiers tel qu'expliqué dans le 1er post.  
  
[https://forum.gmstemple.com/index.php?showtopic=13780&st=0](https://forum.gmstemple.com/t/11846)  
  
J'ai appliqué les modifications mais mon bot ne s'arrête pas au forgeron, il va au vendeur pour réparer et vends mes objets jaunes et bleus.  
  
J'ai essayé de rajouter une variable dans le setting.ini , Recycle=True, cela ne change rien.  
  
Dommage.

---

<div class="post-metadata">

**Author:** ![marcounet75](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/m/bbce88/32.png) [@marcounet75](https://forum.gmstemple.com/u/marcounet75)\
**Post date:** [Juin 9, 2013, 4:45 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/19 "2013-06-09T16:45:05Z")

</div>

> Bonjour,  
>   
> Pour moi cela ne fonctionne pas malheureusement. Je suis en version 8.1 et j'ai modifié les fichiers tel qu'expliqué dans le 1er post.  
>   
> [https://forum.gmstemple.com/index.php?showtopic=13780&st=0](https://forum.gmstemple.com/t/11846)  
>   
> J'ai appliqué les modifications mais mon bot ne s'arrête pas au forgeron, il va au vendeur pour réparer et vends mes objets jaunes et bleus.  
>   
> J'ai essayé de rajouter une variable dans le setting.ini , Recycle=True, cela ne change rien.  
>   
> Dommage.

  
Tu as pensé à compilé l' .exe après avoir fait les modif?

---

<div class="post-metadata">

**Author:** ![sapman78](https://forum.gmstemple.com/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@sapman78](https://forum.gmstemple.com/u/sapman78)\
**Post date:** [Juin 9, 2013, 7:26 UTC](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993/20 "2013-06-09T19:26:15Z")

</div>

J'ai honte.  
  
Tu as mis dans le mille. :-)  
  
Cela fonctionne. Je sais pas pourquoi je me disais que vu que je n'ai pas touché le main.au3 j'avais pas besoin de recompiler...  
  
Merci beaucoup d'avoir pris le temps de me répondre.  
  
Dire que j'ai essayé tous l'après midi.

[Page suivante](https://forum.gmstemple.com/t/fonction-recycler-les-items-bot-8-1/11993.md?page=2)
