Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.50 KB | None | 0 0
  1. ;==================================
  2. ; Script Name: Autoloot with specific item looting capabilities
  3. ; Author: Patriot, Orngrimm
  4. ; Version: 1.0
  5. ; Client Tested with: 6.0.14.2
  6. ; EUO version tested with: 1.5 B 158
  7. ; Shard OSI / FS: both
  8. ; Revision Date: 15.6.2010
  9. ; Public Release: 9.6.2010
  10. ; Global Variables Used: none
  11. ; Purpose: opens and loots defined itemtypes.
  12. ; Some types (Armor, Weaps, Jewelry) is only looted it they match one property-string of a defined selection.
  13. ;==================================
  14.  
  15.  
  16. ;=========== SETUP ================
  17. set %property_looting_first #true
  18.  
  19. set %lootprop1 Wizards , #SPC , Strong , #SPC , Arm
  20. set %lootprop2 spell , #SPC , channeling , #SPC , deed
  21. set %lootprop3 Black , #SPC , Lotus , #SPC , Hood
  22. set %lootprop4 A , #SPC , Runic , #SPC , Hammer
  23. set %lootprop5 Rough , #SPC , Stone
  24. set %lootprop6 stormgrips
  25. set %number_of_markers 6
  26.  
  27. set %jewel _OWI
  28. set %gold _POF_OWI_IIE_NVI_WRO_MPF_XDI_LYD_MDP_AZF_SDJ_BFF_CFF_IFF_HFF_KEJ
  29. set %weapon _fuo_atf_npo_jph_tsf_nmh_vrh_jtf_soh_bph
  30. +_lsf_bsf_nsf_zrf_rmh_lph_uoh_hsf_zto_buo_xth_opo_cuo
  31. +_xrh_guo_mtf_rrh_vth_ysf_buh_auo_trh_zth_woh_usf_lmh
  32. +_qpo_ppo ; Added POF for normal gp's
  33. set %armor _gsh_osh_fik_gik_cik_nik_aik_mik_hlk_clk
  34. +_czh_jwi_gzh_ewi_bwi_jjn_vvi_wvi_xvi_yvi_iwi_hwi_kwi
  35. +_xvl_vjn_fci_jkh_njl_kkh_hkh_vkh_qkh_alh_xkh_ykh_mlh
  36. +_llh_qsk_ysk_atk_usk_osk_ssk_yph_vph_bqh_cqh_pph
  37. set %bag _ckf_lkf_zjf
  38. set %gems _uvf_vuf_gvf_evf_hvf_ovf_fvf_bvf_rvf_ZVF_NVF ; Added ZVF for turmaline, NVF for saphire
  39. set %regs _KUF_JUF_KZF_JZF_MZF_WZF_RZF_SZF_IUF_DUF_TZF_UZF_YZF
  40. ;=========== END SETUP ============
  41.  
  42. ;=========== CONSTANTS ============
  43. ;=========== END CONSTANTS ========
  44.  
  45. ;=========== Preparation =============
  46. if sys notin #opts
  47. {
  48. display ok enable system messages and hit play
  49. halt
  50. }
  51. if dmc notin #opts
  52. {
  53. display ok enable don't move cursor and hit play
  54. halt
  55. }
  56. menu Clear
  57. menu Window Title Corpse looter
  58. menu Window Color maroon
  59. menu Window Size 193 189
  60. menu Font Transparent #true
  61. menu Font Align Right
  62. menu Shape EUOShape1 -4 4 93 183 3 2 1 Yellow 2 White
  63. menu Font Name MS Sans Serif
  64. menu Font Size 10
  65. menu Font Style
  66. menu Font Color Yellow
  67. menu Font Transparent #false
  68. menu Font Align Left
  69. menu Font BGColor Maroon
  70. menu Text EUOLabel1 4 8 What to Loot:
  71. menu Font Size 8
  72. menu Font Color Green
  73. menu Text EUOLabel2 92 104 Current Weight
  74. menu Font Color Background
  75. menu Text EUOLabel3 92 132 % of Max Weight
  76. menu Font Color WindowText
  77. menu Text weight 104 120 EUOLabel4
  78. menu Text per 104 144 EUOLabel5
  79. menu Check gold 4 28 77 25 #false Gold
  80. menu Check weapons 4 52 77 25 #false Weapons
  81. menu Check armor 4 72 77 25 #false Armor
  82. menu Check jewelery 4 100 77 25 #false Jewelery
  83. menu Check bags 4 122 77 25 #false Bags
  84. menu Check gems 4 142 77 25 #false Gems
  85. menu Check regs 4 161 77 25 #false Regs
  86. menu Font BGColor Red
  87. menu Button cursor 92 0 103 25 Set Loot Location
  88. menu Button min 92 24 103 25 Min. Update Range
  89. menu Button norm 92 48 103 25 norm Update Range
  90. menu Button pause 92 72 103 25 Pause
  91. menu Show 421 270 halt
  92. set #menubutton closed
  93. ignoreitem reset
  94. ;=========== End Preparation =========
  95.  
  96. ;=========== World-setup =============
  97. gosub cursor
  98. set %lootbagID #result
  99. ;=========== End World-setup =========
  100.  
  101.  
  102. ;=========== Maincode =============
  103. while #true
  104. {
  105. set %loot_all
  106. set %loot_always
  107. set %loot_prop
  108.  
  109. menu get regs
  110. if #menures = -1
  111. set %loot_always %loot_always , %regs
  112. menu get gems
  113. if #menures = -1
  114. set %loot_always %loot_always , %gems
  115. menu get gold
  116. if #menures = -1
  117. set %loot_always %loot_always , %gold
  118. menu get weapons
  119. if #menures = -1
  120. set %loot_prop %loot_prop , %weapon
  121. menu get armor
  122. if #menures = -1
  123. set %loot_prop %loot_prop , %armor
  124. menu get jewelery
  125. if #menures = -1
  126. set %loot_prop %loot_prop , %jewel
  127. menu get bags
  128. if #menures = -1
  129. set %loot_always %loot_always , %bag
  130. if #menubutton = min
  131. {
  132. event macro 42 0
  133. set #menubutton closed
  134. }
  135. if #menubutton = norm
  136. {
  137. event macro 43 0
  138. set #menubutton closed
  139. }
  140. if #menubutton = pause
  141. {
  142. set #menubutton closed
  143. gosub pause
  144. }
  145. if #charghost = yes
  146. gosub pause
  147. if #menubutton = cursor
  148. gosub cursor
  149. if #weight <> %weight
  150. {
  151. set %weight #weight
  152. menu delete weight
  153. menu Text weight 104 120 #weight
  154. set %perc #weight * 100 / #maxweight
  155. menu delete per
  156. menu Text per 104 144 %perc
  157. }
  158. set %loot_all %loot_always , %loot_prop
  159. finditem YFM G_1
  160. if #findkind = -1
  161. continue ; Start over with a new iteration of the mainloop
  162.  
  163.  
  164. set %body #findid
  165. set #lobjectid #findid
  166. nextCPos 10 10
  167.  
  168. ; Implemented a better setting of %bod
  169.  
  170. event macro 17 0
  171. repeat
  172. {
  173. wait 1
  174. }
  175. until #CONTNAME = container_gump && #CONTSIZE = 144_212
  176. set %bod #ContID
  177.  
  178. while #true ; loot-loop
  179. {
  180. finditem %loot_all C_ , %bod
  181. if #findCNT = 0
  182. {
  183. event SysMessage finished Corpse.
  184. ignoreitem %body
  185. wait 15
  186. }
  187.  
  188. if %property_looting_first
  189. {
  190. gosub loot_prop %loot_prop %bod %number_of_markers %lootbagid
  191. gosub loot_always %loot_always %bod %lootbagid
  192. Break ; Looting finished. Break the loot-loop
  193. }
  194. else
  195. {
  196. gosub loot_always %loot_always %bod %lootbagid
  197. gosub loot_prop %loot_prop %bod %number_of_markers %lootbagid
  198. Break ; Looting finished. Break the loot-loop
  199. }
  200. } ; end loot-loop
  201. } ; end mainloop
  202. ;=========== End Maincode =========
  203.  
  204.  
  205. ;=========== SUBs =================
  206. ; -------------------------
  207. ; Sub name: cursor
  208. ; Autor: Patriot, Orngrimm
  209. ; Version: 1.0
  210. ; Purpose: Lets the User target a item and returns this ID.
  211. ; Params: none
  212. ; Outputs: #result ID of targetet item
  213. ; -------------------------
  214. sub cursor
  215. set #menubutton closed
  216. set #LTargetID NULL
  217. set #TargCurs 1
  218. event SysMessage Please click the lootbag.
  219. menu Window Color blue
  220. repeat
  221. {
  222. wait 1
  223. }
  224. until #LTargetID <> NULL
  225. menu Window Color Maroon
  226. return #LtargetID
  227.  
  228.  
  229.  
  230. ; -------------------------
  231. ; Sub name: pause
  232. ; Autor: Patriot
  233. ; Version: 1.0
  234. ; Purpose: Pauses the script until the unpause-button is pressed.
  235. ; Params: none
  236. ; Outputs: none
  237. ; -------------------------
  238. sub pause
  239. menu Button pause 92 72 103 25 Resume
  240. while #menubutton <> pause
  241. {
  242. wait 1
  243. }
  244. menu Button pause 92 72 103 25 Pause
  245. set #menubutton closed
  246. return
  247.  
  248.  
  249. ; -------------------------
  250. ; Sub name: loot_prop
  251. ; Autor: Orngrimm
  252. ; Version: 1.0
  253. ; Purpose: Loots items with a specific type. But it loots them only if they meet a property-string-requirement
  254. ; Params: 1 req Lootlist
  255. ; 2 req Container-ID to loot from
  256. ; 3 req Ammount of markers %lootprop[#]
  257. ; 4 req Container-ID to store the loot
  258. ; Outputs: none
  259. ; -------------------------
  260. sub loot_prop
  261. if %0 < 4
  262. {
  263. display OK Incorrect ammount of atributes passed to the sub. Script pauses for debug.
  264. pause
  265. return
  266. }
  267.  
  268. ; Create a new namesapce to have vars at our disposal which
  269. ; doesnt clutter the variable-space.
  270. nameSpace Push
  271. nameSpace Local #sysTime , #random
  272. ; Here we check for props and loot only those who meet the props
  273. Finditem %1 C_ , %2
  274. if #FindCNT > 0 ; Check only if we found anything
  275. {
  276. for #FindIndex #FindCNT 1 ; check all found items
  277. {
  278. event property #findID
  279. set !looted #false
  280. for !cnt_o 1 %3 ; check all markers
  281. {
  282. set !temp_o lootprop , !cnt_o
  283. set !temp_o % . !temp_o
  284. if !temp_o in #Property ; Here was a_o missing
  285. {
  286. exevent drag #FindID #Findstack
  287. exevent dropc %4
  288. wait 15
  289. set !looted #true
  290. break ; If we looted it, there is no need to check for the other props.
  291. }
  292. }
  293. ; Here we checked one item for all propertys. Ignore it if not interesting for looting
  294. if !looted = #false
  295. ignoreitem #FindID nonloot
  296. }
  297. }
  298. nameSpace Clear
  299. nameSpace Pop
  300. return
  301.  
  302.  
  303. ; -------------------------
  304. ; Sub name: loot_always
  305. ; Autor: Orngrimm
  306. ; Version: 1.0
  307. ; Purpose: It loots all defined from the defined container to the defined target
  308. ; Params: 1 req Lootlist
  309. ; 2 req Container-ID to loot from
  310. ; 3 req Container-ID to store the loot
  311. ; Outputs: none
  312. ; -------------------------
  313. sub loot_always
  314. if %0 < 3
  315. {
  316. display OK Incorrect ammount of atributes passed to the sub. Script pauses for debug.
  317. pause
  318. return
  319. }
  320. ; Here we check for props and loot only those who meet the props
  321. Finditem %1 C_ , %2
  322. if #FindCNT = 0
  323. return
  324. for #Findindex #FindCNT 1
  325. {
  326. exevent drag #FindID #Findstack
  327. exevent dropc %3
  328. wait 15
  329. }
  330. return
  331. ;=========== End SUBs =============
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement