Voila quelques modifs pour recycler les items destinés à être vendus:
dans le toolkit.au3,
Remplacer la fonction FilterBackpack () par celle ci:
Spoiler
Func FilterBackpack()
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 $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
$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
;a rajouter
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
;a rajouter
Send("{SPACE}") ; make sure we close everything
Return $return
EndIf
Return False
EndFunc ;==>FilterBackpack
Func FilterBackpack()
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 $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
$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
;a rajouter
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
;a rajouter
Send("{SPACE}") ; make sure we close everything
Return $return
EndIf
Return False
EndFunc ;==>FilterBackpack
Remplacer la fonction StashAndRepair() par celle ci:
Spoiler
Func StashAndRepair()
_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(500, 1000))
_log('Filter Backpack')
$items = FilterBackpack()
$ToStash = _ArrayFindAll($items, "Stash", 0, 0, 0, 1, 2)
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
;a rajouter
$ToRecycle = _ArrayFindAll($items, "Recycle", 0, 0, 0, 1, 2)
If $ToRecycle <> -1 Then
Send("{SPACE}")
Sleep(500)
InteractByActorName('Blacksmith_RepairShortcut')
Sleep(700)
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, 500))
MouseClick('Left')
Sleep(Random(40, 250))
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
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))
Sleep(Random(500, 1000))
Repair()
Sleep(Random(100, 200))
Send("{SPACE}")
Sleep(Random(100, 200))
;a rajouter
;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
EndFunc ;==>StashAndRepair
Func StashAndRepair()
_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(500, 1000))
_log('Filter Backpack')
$items = FilterBackpack()
$ToStash = _ArrayFindAll($items, "Stash", 0, 0, 0, 1, 2)
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
;a rajouter
$ToRecycle = _ArrayFindAll($items, "Recycle", 0, 0, 0, 1, 2)
If $ToRecycle <> -1 Then
Send("{SPACE}")
Sleep(500)
InteractByActorName('Blacksmith_RepairShortcut')
Sleep(700)
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, 500))
MouseClick('Left')
Sleep(Random(40, 250))
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
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))
Sleep(Random(500, 1000))
Repair()
Sleep(Random(100, 200))
Send("{SPACE}")
Sleep(Random(100, 200))
;a rajouter
;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
EndFunc ;==>StashAndRepair
Enfin, rajouter dans la grablist, pour garder les matériaux obtenus.
Spoiler
|Crafting_Tier
|Crafting_Tier
Deux pistes d'amélioration:
- Nous ne vérifions pas que la fenêtre du forgeron est bien ouverte
- Les matériaux recyclés ne sont placés dans le coffre que lors du check suivant.
Bon botting!


Ce sujet est fermé


