Advertisement
Guest User

savsuds

a guest
Mar 24th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.13 KB | None | 0 0
  1. #Region Salvage
  2. Func FindCheapSalvageKit()
  3. Local $lItem
  4. Local $lKit = 0
  5. Local $lUses = 101
  6. For $i = 1 To 4
  7. For $j = 1 To DllStructGetData(GetBag($i), 'Slots')
  8. $lItem = GetItemBySlot($i, $j)
  9. Switch DllStructGetData($lItem, 'ModelID')
  10. Case 2992
  11. If DllStructGetData($lItem, 'Value') / 2 < $lUses Then
  12. $lKit = DllStructGetData($lItem, 'ID')
  13. $lUses = DllStructGetData($lItem, 'Value') / 8
  14. EndIf
  15. Case Else
  16. ContinueLoop
  17. EndSwitch
  18. Next
  19. Next
  20. Return $lKit
  21. EndFunc ;==>FindSalvageKit
  22.  
  23. Func Salvage()
  24. Local $aitem
  25. Local $q = DllStructGetData($aitem, 'quantity')
  26. For $I = 1 To 4
  27. For $j = 1 To DllStructGetData(GetBag($I), 'Slots')
  28. $aitem = GetItemBySlot($I, $j)
  29. If CanSalvage($aitem) Then
  30. For $x = 1 To $q
  31. $salvagekit = FindCheapSalvageKit()
  32. If $salvagekit = 0 Then
  33. Out("No Salvage Kits")
  34. Main()
  35. EndIf
  36. $oldvalue = DllStructGetData(GetItemByItemID($salvagekit), 'Value')
  37. StartSalvage1($aitem, True)
  38. Do
  39. Sleep(200)
  40. Until FindCheapSalvageKit() <> $salvagekit Or DllStructGetData(GetItemByItemID($salvagekit), 'Value') <> $oldvalue
  41. $aitem = GetItemBySlot($I, $j)
  42. PingSleep(500)
  43. Next
  44. EndIf
  45. Next
  46. Next
  47. EndFunc
  48.  
  49. Func SalvageExplorable()
  50. Local $lItem
  51. Local $quantity
  52. For $I = 1 To 4
  53. For $j = 1 To DllStructGetData(GetBag($I), 'Slots')
  54. $lItem = GetItemBySlot($I, $j)
  55. If CanDropItem($lItem) Then
  56. $quantity = DllStructGetData($lItem, 'quantity')
  57. For $x = 1 To $quantity
  58. $salvagekit = FindCheapSalvageKit()
  59. If $salvagekit = 0 Then
  60. Out("No ID kit")
  61. Main()
  62. EndIf
  63. $oldvalue = DllStructGetData(GetItemByItemID($salvagekit), 'Value')
  64. StartSalvage1($lItem, True)
  65. Do
  66. Sleep(200)
  67. Until FindCheapSalvageKit() <> $salvagekit Or DllStructGetData(GetItemByItemID($salvagekit), 'Value') <> $oldvalue
  68. $lItem = GetItemBySlot($I, $j)
  69. PingSleep(500)
  70. Next
  71. EndIf
  72. Next
  73. Next
  74. EndFunc
  75.  
  76. Func StartSalvage1($aItem, $aCheap = false)
  77. Local $lOffset[4] = [0, 0x18, 0x2C, 0x62C]
  78. Local $lSalvageSessionID = MemoryReadPtr($mBasePointer, $lOffset)
  79. If IsDllStruct($aItem) = 0 Then
  80. Local $lItemID = $aItem
  81. Else
  82. Local $lItemID = DllStructGetData($aItem, 'ID')
  83. EndIf
  84. If $aCheap Then
  85. Local $lSalvageKit = FindCheapSalvageKit()
  86. Else
  87. Local $lSalvageKit = FindSalvageKit()
  88. EndIf
  89. If $lSalvageKit = 0 Then Return
  90. DllStructSetData($mSalvage, 2, $lItemID)
  91. DllStructSetData($mSalvage, 3, $lSalvageKit)
  92. DllStructSetData($mSalvage, 4, $lSalvageSessionID[1])
  93. Enqueue($mSalvagePtr, 16)
  94. EndFunc ;==>StartSalvage
  95.  
  96. Func SalvagesUses()
  97. Local $aitem, $lBag
  98. Local $lUses = 0
  99. For $i = 1 To 4
  100. $lBag = GetBag($i)
  101. For $j = 1 To DllStructGetData($lBag, 'Slots')
  102. $aitem = GetItemBySlot($lBag, $j)
  103. Switch DllStructGetData($aitem, 'ModelID')
  104. Case 2992
  105. $lUses += DllStructGetData($aitem, 'Value') / 2
  106. Case 2991
  107. $lUses += DllStructGetData($aitem, 'Value') / 8
  108. Case 5900
  109. $lUses += DllStructGetData($aitem, 'Value') / 10
  110. Case Else
  111. ContinueLoop
  112. EndSwitch
  113. Next
  114. Next
  115. Return $lUses
  116. EndFunc ;==>IdentificationUses
  117.  
  118. Func CanSalvage($aitem)
  119. Local $m = DllStructGetData($aitem, "ModelID")
  120. Local $t = DllStructGetData($aitem, "Type")
  121. Local $r = GetRarity($aitem)
  122. Local $ModStruct = GetModStruct($aitem)
  123. Switch $r
  124. Case $Rarity_Gold, $Rarity_Purple, $Rarity_Blue
  125. Return True
  126. Case $Rarity_White
  127. If $m = 146 Or $m = 21797 Then ; Dyes and Mesmer Tomes
  128. Return False
  129. ; All weapon mods
  130. ElseIf CheckArrayWeaponMods($m) Then
  131. Return True
  132. ; ==== General ====
  133. ElseIf CheckArrayGeneralItems($m) Then ; Lockpicks, Kits, Glacial Stones
  134. Return False
  135. ElseIf CheckArrayAllDrops($m) Then ; Event Items, materials
  136. Return False
  137. ; ==== Stupid Drops =
  138. ElseIf CheckArrayMapPieces($m) Then
  139. Return False
  140. Else
  141. Return True
  142. EndIf
  143. EndSwitch
  144. EndFunc
  145. #EndRegion Salvage
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152. ;;;;;;;;;;;;;inventory()func
  153.  
  154. Func Inventory()
  155. Out("Travel to Guild Hall")
  156. TravelGH()
  157. WaitMapLoading()
  158.  
  159.  
  160. Out("Checking Guild Hall")
  161. CheckGuildHall()
  162.  
  163. Chest()
  164.  
  165. ;Select_The_NPC(6, GH_Control())
  166. ;Select_The_NPC(5, GH_Control())
  167.  
  168. If GetGoldCharacter() > 90000 Then
  169. Out("Depositing Gold")
  170. DepositGold()
  171. EndIf
  172.  
  173. Out("Storing Stuff")
  174. StoreItems()
  175.  
  176. StoreMods()
  177.  
  178. Merchant()
  179.  
  180. Out("Identifying")
  181. Ident()
  182. $i = 0;;;;;;;;;;this for salvagingg
  183. Do
  184. If FindCheapSalvageKit() = 0 Then
  185. If GetGoldCharacter() < 100 And GetGoldStorage() > 99 Then
  186. WithdrawGold(100)
  187. Sleep(GetPIng()+250)
  188. EndIf
  189. BuyItem(2, 1, 100)
  190. Do
  191. Sleep(200)
  192. Until FindCheapSalvageKit() <> 0
  193. EndIf
  194. Salvage()
  195. Sleep(GetPing())
  196. $i += 1
  197. Until FindCheapSalvageKit() <> 0 Or $i > 100
  198.  
  199. Out("Storing Special Items")
  200. StoreSpecialItems()
  201.  
  202. Out("Salvaging for Mats")
  203. Salvage()
  204.  
  205. Out("Selling")
  206. Sell()
  207.  
  208.  
  209.  
  210. ;Out("Buying ID Kits")
  211. ;BuyKitsfortheRoad()
  212.  
  213. If GetGoldCharacter() > 90000 Then
  214. Out("Depositing Gold")
  215. DepositGold()
  216. EndIf
  217.  
  218. Sleep(GetPing()+1000)
  219.  
  220. LeaveGH()
  221. WaitMapLoading()
  222. SetUpFastWay()
  223. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement