Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.68 KB | None | 0 0
  1. ;=============================================================
  2. ; Script Name: BadManiac's Automagic Looting 2
  3. ; Author: BadManiac
  4. ; Version: 2.62
  5. ; Client Tested with: 5.0.1c
  6. ; EUO version tested with: 1.5 Test Version 62
  7. ; Shard OSI / FS: OSI / works on FS with correct item types
  8. ; Revision Date: 22/11/2005
  9. ; Public Release: 05/12/2004
  10. ; Global Variables Used:
  11. ; *bml_busy Denotes Script is busy looting
  12. ; *bml_minvalue Contains the last min value for equipment
  13. ; *bml_settings Contains the last used settings for the script
  14. ; *bml_hotkey Stores the current looting hotkey
  15. ; Purpose:
  16. ; Powerful fast Automagic Looting with item evaluation, corpse cutting,
  17. ; resource gathering and cutting, and looting equipment over a certain value
  18. ;=============================================================
  19. SET #LPC 50
  20. ;=============================================================
  21. ;############### USER SETTINGS BELOW ONLY! #################
  22. ;=============================================================
  23. ; One delay timing, this timer is the only thing you need to
  24. ; edit if the script has problems.
  25. ; Should be around 5, but lowering it to 2-3 works fine for
  26. ; low ping high speed conn's. FS'ers should leave it at 4-5
  27. ; Dialup and high ping users might have to set it as high as
  28. ; 6 or 7.
  29. ;=============================================================
  30. SET %bml_waittime 4
  31. ;=============================================================
  32. ; Time to wait between actions to prevent errors.
  33. ; Minimum on EA is 10, and for freeshards 5, for fast conn's.
  34. ; Recommended 13 as this is UO's default action delay.
  35. ;=============================================================
  36. SET %bml_action_wait 10
  37. ;=============================================================
  38. ; user1 and user2 are for the users personal lists. They are selectable
  39. ; in the menu and you can add your own loot types to them.
  40. ; The lists below are examples of what you may want to include
  41. ;=============================================================
  42. ;Plate of Cookies, Fertile Dirt, Tribal Mask,Mask of Orcish Kin, Evil Orc Helm, Fire Horn
  43. SET %user1 SLI_NZF_PZH_VSH_NWL_IWL_ZWF_
  44. ;Bandage, Raw Ribs
  45. SET %user2 ZLF_VRD_
  46. ;=============================================================
  47. ;############# EDIT NOTHING BELOW THIS LINE ################
  48. ;=============================================================
  49. ; The lootlists are set here, other is a list of various
  50. ; other loot that doesn't fit anywhere else.
  51. ;=============================================================
  52. SET %gold POF_
  53. SET %jewels HVF_UVF_FVF_EVF_OVF_VUF_GVF_RVF_BVF_VVF_NVF_ZVF_MWF_
  54. SET %reagents KUF_JUF_KZF_JZF_MZF_WZF_RZF_SZF_DUF_TZF_UZF_YZF_IUF_DAG_EUF_HUF_PZF_LZF_QZF_VZF_GUF_OZF_EAG_NZF_FUF_XZF_
  55. SET %scrolls AUL_BUL_CUL_DUL_EUL_FUL_GUL_HUL_IUL_JUL_KUL_LUL_MUL_NUL_OUL_PUL_QUL_RUL_SUL_TUL_UUL_VUL_WUL_XUL_YUL_ZUL_AVL_GVL_FVL_IVL_HVL_CVL_NTL_OTL_PTL_QTL_RTL_STL_TTL_UTL_VTL_WTL_XTL_YTL_ZTL_QXL_PXL_ZXL_NXL_WXL_VXL_YXL_XXL_ZFJ_BYL_CYL_DYL_EYL_FYL_GYL_HYL_IYL_JYL_KYL_KYM_PYM_SYM_TYM_WYM_UYM_GCR_ZBR_NCR_ACR_HCR_LCR_ICR_CCR_UCR_OCR_KCR_DCR_JCR_FCR_
  56. SET %arrowsbolts RWF_LNK_FKF_
  57. SET %solenloot GMF_OKF_TTO_IJG_
  58. SET %jukaloot JSL_USL_WOH_YWL_
  59. SET %paragonloot IIF_IKF_BUD_HIF_
  60. set %questloot YJM_MSG_GHH_UVH_RY_QY_SY_PY_
  61. ;Resource loot lists
  62. SET %feather VLK_
  63. SET %wool HFG_
  64. SET %scale STO_
  65. SET %bones OJK_XIK_SJK_IJK_TJK_BJK_UJK_DJK_MJK_AJK_LJK_FJK_RJK_EJK_ZIK_YIK_JJK_GJK_KJK_HJK_
  66. SET %leather EEG_GED_DEG_
  67. ;Itemtypes for bones and leather after cutting with scissor
  68. SET %cutresources JJG_GUF_
  69. ;Seeds, TMap, Gargoyle Pickaxe, Demon Bones, Tribal Berry, Origami Paper, Healthy Gland
  70. SET %other PDF_XVH_QPF_OZF_QQD_QIP_NWK_
  71. ;=============================================================
  72. ;This is a list of the different bags types that will be opened and looted,
  73. ;as well as types for knives and scissors for cutting corpses and leather.
  74. ;DON'T EDIT.
  75. ;=============================================================
  76. SET %bags ZJF_LKF_CKF_YKK
  77. SET %knives TSF_GMH_BNF_CNF_FMH_WSF
  78. SET %scissors KAG_JAG
  79. ;=====================================
  80. ;Set lootlists for equippment
  81. ;=====================================
  82. GOSUB SetEquipLootlists
  83. ;=====================================
  84. ; Script INIT
  85. ;=====================================
  86. GOSUB BMEuoVer
  87. IF #RESULT < 15000
  88. {
  89. DISPLAY OK This script does not support your version of EasyUO. , $ , You must use Version 1.5 , $ , HALTED!
  90. HALT
  91. }
  92. GOSUB CheckFreeShard bml_freeshard
  93. GOSUB ShowLootMenu
  94. GOSUB LootInit
  95. ;=====================================
  96. ; Script MAIN LOOP
  97. ;=====================================
  98. WHILE #TRUE
  99. {
  100. ;Make script less intrusive by checking for lifted objects, target cursor, charcter status or char movement.
  101. REPEAT
  102. {
  103. GOSUB CheckStatus
  104. WAIT 1
  105. }
  106. UNTIL #RESULT
  107. GOSUB CheckWeight
  108. ;If hotkey is set, wait until the specified key is pressed before starting to loot.
  109. IF %bml_hotkey
  110. {
  111. WHILE #TRUE
  112. {
  113. ONHOTKEY *bml_hotkey
  114. BREAK
  115. WAIT 0
  116. }
  117. }
  118. ;All is well, go ahead and look for corpses in range to loot.
  119. GOSUB LookForCorpse
  120. IF #RESULT <> #FALSE
  121. {
  122. ;Set global to denote that we are busy looting
  123. SET *bml_busy #TRUE
  124. GOSUB LootPack %bml_corpseid %bml_corpsetype
  125. IF #RESULT = #TRUE
  126. {
  127. FINDITEM %bml_corpseid
  128. IF #FINDCNT > 0
  129. IGNOREITEM %bml_corpseid BmLooter
  130. }
  131. IF #RESULT = lootright || #RESULT = instanced
  132. GOSUB IgnoreList %bml_corpseid
  133. }
  134. ;Set global to denote that we are done looting
  135. SET *bml_busy #FALSE
  136. GOSUB IgnoreList
  137. WAIT %bml_waittime
  138. }
  139. ;================================================================
  140. ;SUBROUTINES START HERE.
  141. ;================================================================
  142. ;LootInit=====================
  143. SUB LootInit
  144. {
  145. IF %bml_cutcorpse
  146. {
  147. FINDITEM %scissors C_ , #BACKPACKID
  148. IF #FINDKIND = -1
  149. {
  150. DISPLAY OK You need scissors to cut looted resources. $ HALTED!
  151. HALT
  152. }
  153. FINDITEM %knives C_ , #BACKPACKID
  154. IF #FINDKIND = -1
  155. {
  156. DISPLAY OK You need a knife to cut corpses to loot resources. $ HALTED!
  157. HALT
  158. }
  159. }
  160. IF %bml_lootequipment
  161. {
  162. SET #RESULT #FALSE
  163. CALL BMItemEval.euo INIT
  164. IF #RESULT <> BMItemEval_OK
  165. {
  166. DISPLAY YESNO You selected equipment loot options , $ , But you don't have the BMItemEval.euo script file in the same folder as this file. , $ , Would you like to simply loot all equipment items regardless of item value?
  167. IF #DISPRES = NO
  168. {
  169. DISPLAY OK Please read the setup instructions in the EasyUO PSL thread for this script. , $ , HALTED!
  170. HALT
  171. }
  172. SET *bml_minvalue 0
  173. }
  174. }
  175. IF %lootbag = #TRUE
  176. {
  177. SET #LTARGETID N/A
  178. DISPLAY OK Please target your LOOTBAG and click it. $
  179. SET #TARGCURS 1
  180. WHILE #TARGCURS = 1
  181. WAIT 0
  182. SET %lootbagid #LTARGETID
  183. SET %regbagid %lootbagid
  184. }
  185. IF %regbag = #TRUE
  186. {
  187. DISPLAY OK Please target our REGBAG and click it.$
  188. SET #LTARGETID N/A
  189. SET #TARGCURS 1
  190. WHILE #TARGCURS = 1
  191. WAIT 0
  192. SET %regbagid #LTARGETID
  193. }
  194. IGNOREITEM RESET BmLooter
  195. EXEVENT DROPC #BACKPACKID
  196. GOSUB BMWaitAction
  197. SET %idx 0
  198. ;Reset globals for Seg'sBandage healer and CEOMedic
  199. SET *510 ok
  200. SET *BUSY 0
  201. RETURN
  202. }
  203. ;LookForCorpse================
  204. SUB LookForCorpse
  205. {
  206. FINDITEM YFM G_2
  207. ;If the corpse is too far away. Don't loot it.
  208. IF #FINDCNT < 1 || #FINDDIST > 2 || #FINDTYPE <> YFM
  209. RETURN #FALSE
  210. ;If everything is fine, the found object is a corpse, and it is within range.
  211. ;Confirm the loot- and reg bags
  212. SET %bml_corpseid #FINDID
  213. SET %bml_corpsetype #FINDTYPE
  214. FINDITEM %lootbagid C
  215. IF #FINDKIND = -1
  216. {
  217. EVENT EXMSG #CHARID 3 33 Can't find lootbag, paused.
  218. PAUSE
  219. RETURN #FALSE
  220. }
  221. IF %regbag = #TRUE
  222. {
  223. FINDITEM %regbagid C
  224. IF #FINDKIND = -1
  225. {
  226. EVENT EXMSG #CHARID 3 33 Can't find regbag, paused.
  227. PAUSE
  228. RETURN #FALSE
  229. }
  230. }
  231. RETURN %bml_corpseid
  232. }
  233. ;LootPack=====================
  234. ; %1 is the source cont ID
  235. ; %2 is the source cont type
  236. ;=============================
  237. SUB LootPack
  238. {
  239. IF %1 = %lootbagid || %1 = %regbagid || %1 = #BACKPACKID || %1 = #CHARID || %0 <> 2
  240. RETURN #FALSE
  241. SET %idx %idx + 1
  242. NAMESPACE PUSH
  243. NAMESPACE LOCAL BMLootPack . %idx
  244. SET !fcontid . %idx %1
  245. SET !conttype . %idx %2
  246. SET !success #TRUE
  247. ;Make script less intrusive by checking for lifted objects, target cursor, or char movement.
  248. REPEAT
  249. {
  250. GOSUB CheckStatus
  251. WAIT 1
  252. }
  253. UNTIL #RESULT
  254. ;Cut corpse if specified
  255. IF %bml_cutcorpse && %idx = 1
  256. {
  257. GOSUB CutCorpse !fcontid . %idx
  258. IF #RESULT <> #TRUE
  259. {
  260. NAMESPACE CLEAR
  261. NAMESPACE POP
  262. SET %idx %idx - 1
  263. RETURN #RESULT
  264. }
  265. }
  266. REPEAT
  267. {
  268. GOSUB CheckStatus
  269. WAIT 1
  270. }
  271. UNTIL #RESULT
  272. ;Open corpses and containers near the lower right corner of the game area for 800x600 res.
  273. IF %idx = 1 || !conttype . %idx = YFM
  274. GOSUB OpenCorpse !fcontid . %idx
  275. IF %idx > 1 || !conttype . %idx <> YFM
  276. GOSUB OpenContainer !fcontid . %idx !conttype . %idx
  277. IF #RESULT <> #TRUE
  278. {
  279. NAMESPACE CLEAR
  280. NAMESPACE POP
  281. SET %idx %idx - 1
  282. RETURN #RESULT
  283. }
  284. SET !contid . %idx #CONTID
  285. IF !contid . %idx <> !fcontid . %idx
  286. {
  287. FINDITEM YFM CA_ , !fcontid . %idx
  288. IF #FINDCNT > 1
  289. SET !success instanced
  290. }
  291. IF ! %bml_freeshard
  292. {
  293. WAIT %bml_waittime
  294. GOSUB BMWaitAction
  295. }
  296. ;=====================
  297. ; Looting starts here
  298. ;=====================
  299. GOSUB LootItems !contid . %idx
  300. IF %bml_lootequipment
  301. GOSUB LootEquipment !contid . %idx
  302. WHILE %bml_openbags
  303. {
  304. FINDITEM %bags C_ , !contid . %idx
  305. IF #FINDCNT < 1 || #FINDBAGID <> !contid . %idx
  306. BREAK
  307. SET !bml_currentbag #FINDID
  308. GOSUB LootPack !bml_currentbag #FINDTYPE
  309. IF #RESULT <> #TRUE
  310. IGNOREITEM !bml_currentbag BmLooter_temp
  311. }
  312. ; Loot end-----
  313. ;=====================
  314. ; Close Container
  315. ;=====================
  316. IF %bml_closecorpse || %idx > 1
  317. {
  318. SET !closetimeout #SCNT2 + 20
  319. WHILE #SCNT2 < !closetimeout
  320. {
  321. IF #CONTID <> !contid . %idx
  322. {
  323. CLICK 730 440 F DMC
  324. WAIT %bml_waittime
  325. }
  326. IF #CONTID = !contid . %idx
  327. CLICK 730 440 F R DMC
  328. GOSUB WaitForVar CONTID <> !contid . %idx 10
  329. IF #RESULT
  330. BREAK
  331. }
  332. }
  333. FINDITEM %bml_corpseid G
  334. IF #FINDDIST > 2
  335. SET !success range
  336. FINDITEM !contid . %idx
  337. IF #FINDCNT > 0 && %idx > 1
  338. IGNOREITEM !contid . %idx BmLooter
  339. SET %idx %idx - 1
  340. SET #RESULT !success
  341. NAMESPACE CLEAR
  342. NAMESPACE POP
  343. RETURN #RESULT
  344. }
  345. ;LootItems====================
  346. ; %1 is the source cont ID
  347. ;=============================
  348. SUB LootItems
  349. {
  350. SET !contid %1
  351. SET !done #FALSE
  352. WHILE #TRUE
  353. {
  354. FINDITEM %bml_corpseid G
  355. IF #FINDCNT < 1 || #FINDDIST > 2
  356. BREAK
  357. ;Make script less intrusive by checking for target cursor, or char movement and waiting.
  358. REPEAT
  359. {
  360. GOSUB CheckStatus
  361. WAIT 1
  362. }
  363. UNTIL #RESULT
  364. ;Check weight before each drag operation to make sure we're not overweight.
  365. GOSUB CheckWeight
  366. FINDITEM %bml_lootlist C_ , !contid
  367. IF #FINDCNT < 1 && !done
  368. BREAK
  369. IF #FINDCNT < 1 && ! !done
  370. {
  371. IGNOREITEM RESET BmLooter_once
  372. SET !done #TRUE
  373. CONTINUE
  374. }
  375. IF #FINDBAGID <> !contid
  376. {
  377. IGNOREITEM #FINDID BmLooter_temp
  378. CONTINUE
  379. }
  380. SET #RESULT #TRUE
  381. SET !lastitem #FINDID
  382. IF #findtype IN %reagents , %necroregs
  383. {
  384. GOSUB MoveItem !lastitem #FINDBAGID %regbagid
  385. GOTO li_finishcurrent
  386. }
  387. IF #FINDTYPE IN %leather , %bones
  388. {
  389. GOSUB MoveAndCut !lastitem %lootbagid
  390. GOTO li_finishcurrent
  391. }
  392. IF #FINDTYPE IN IJG_QPF
  393. {
  394. GOSUB BMGetProperty !lastitem
  395. IF binding NOTIN #PROPERTY && gargoyle NOTIN #PROPERTY
  396. {
  397. IGNOREITEM !lastitem BmLooter_temp
  398. GOTO li_finishcurrent
  399. }
  400. }
  401. GOSUB MoveItem !lastitem #FINDBAGID %lootbagid
  402. li_finishcurrent:
  403. ;Last drag failed, temporarily ignore the item before proceeding.
  404. IF #RESULT = #FALSE
  405. IGNOREITEM !lastitem BmLooter_once
  406. ELSE
  407. IGNOREITEM RESET BmLooter_once
  408. }
  409. IGNOREITEM RESET BmLooter_temp
  410. RETURN
  411. }
  412. ;LootEquipment================
  413. ; %1 is the source cont ID
  414. ;=============================
  415. SUB LootEquipment
  416. {
  417. SET !contid %1
  418. SET !done #FALSE
  419. WHILE #TRUE
  420. {
  421. FINDITEM %bml_corpseid G
  422. IF #FINDCNT < 1 || #FINDDIST > 2
  423. BREAK
  424. REPEAT
  425. {
  426. GOSUB CheckStatus
  427. WAIT 1
  428. }
  429. UNTIL #RESULT
  430. ;Check weight before each drag operation to make sure we're not overweight.
  431. GOSUB CheckWeight
  432. SET #RESULT 0
  433. FINDITEM %bml_equiplootlist C_ , !contid
  434. IF #FINDCNT < 1 && !done
  435. BREAK
  436. IF #FINDCNT < 1 && ! !done
  437. {
  438. IGNOREITEM RESET BmLooter_once
  439. SET !done #TRUE
  440. CONTINUE
  441. }
  442. IF #FINDBAGID <> !contid
  443. {
  444. IGNOREITEM #FINDID BmLooter_temp
  445. CONTINUE
  446. }
  447. SET !lastitem #FINDID
  448. CALL BMItemEval.euo !lastitem
  449. IF %bml_lootsets
  450. {
  451. IF Only , #SPC , When , #SPC , Full , #SPC , Set , #SPC , Is , #SPC , Present: IN #PROPERTY
  452. SET #RESULT *bml_minvalue
  453. }
  454. IF #RESULT < *bml_minvalue
  455. IGNOREITEM !lastitem BmLooter
  456. ELSE
  457. GOSUB MoveItem !lastitem #FINDBAGID %lootbagid
  458. ;Last drag failed, temporarily ignore the item before proceeding.
  459. IF #RESULT = #FALSE
  460. IGNOREITEM %lootitem BmLooter_once
  461. ELSE
  462. IGNOREITEM RESET BmLooter_once
  463. }
  464. IGNOREITEM RESET BmLooter_temp
  465. RETURN
  466. }
  467. ;OpenCorpse================
  468. ; %1 is the ID of the corpse to open
  469. ;=============================
  470. SUB OpenCorpse
  471. {
  472. IF %1 = %lootbagid || %1 = %regbagid || %1 = #BACKPACKID || %1 = #CHARID
  473. RETURN #FALSE
  474. NAMESPACE PUSH
  475. NAMESPACE LOCAL opencorpse
  476. SET !corpseid %1
  477. oc_opencorpse:
  478. SET #LOBJECTID !corpseid
  479. SET !timeout #SCNT2 + 50
  480. SET !jstart #JINDEX + 1
  481. GOSUB BMWaitAction %bml_action_wait
  482. SET #nextCPosX 656
  483. SET #nextCPosY 388
  484. EVENT MACRO 17 0
  485. GOSUB BMWaitAction
  486. WAIT %bml_waittime
  487. SET !success #TRUE
  488. WHILE YFM NOTIN #CONTTYPE && !success = #TRUE
  489. {
  490. IF #SCNT2 > !timeout
  491. RETURN #FALSE
  492. FOR !i !jstart #JINDEX
  493. {
  494. SCANJOURNAL !i
  495. IF You_must_wait IN #JOURNAL
  496. GOTO oc_opencorpse
  497. IF may_not_loot IN #JOURNAL || criminal_action IN #JOURNAL || did_not_earn_the_right IN #JOURNAL || did_not_slay_this_creature IN #JOURNAL
  498. SET !success lootright
  499. IF I_can't_reach_that. IN #JOURNAL || Out_of_sight || #JOURNAL
  500. SET !success range
  501. }
  502. WAIT %bml_waittime
  503. }
  504. IF !success && ( #CONTPOSX <> 656 || #CONTPOSY <> 388 )
  505. CONTPOS 656 388
  506. SET #RESULT !success
  507. NAMESPACE CLEAR
  508. NAMESPACE POP
  509. RETURN #RESULT
  510. }
  511. ;OpenContainer================
  512. ; %1 is the ID of the container to open
  513. ; %2 is the TYPE of the container
  514. ;=============================
  515. SUB OpenContainer
  516. {
  517. IF %1 = %lootbagid || %1 = %regbagid || %1 = #BACKPACKID || %1 = #CHARID
  518. RETURN #FALSE
  519. NAMESPACE PUSH
  520. NAMESPACE LOCAL opencont
  521. SET !contid %1
  522. SET !conttype %2
  523. oc_opencont:
  524. SET !timeout #SCNT2 + 50
  525. SET !success #TRUE
  526. SET #LOBJECTID !contid
  527. GOSUB BMWaitAction %bml_action_wait
  528. SET !jstart #JINDEX + 1
  529. SET !oldcontid #CONTID
  530. SET #nextCPosX 660
  531. SET #nextCPosY 390
  532. EVENT MACRO 17 0
  533. GOSUB BMWaitAction
  534. WAIT %bml_waittime
  535. WHILE #CONTID = !oldcontid && #CONTID <> !contid && #CONTTYPE <> !conttype
  536. {
  537. IF #SCNT2 > !timeout
  538. {
  539. SET !success #FALSE
  540. BREAK
  541. }
  542. FOR !j !jstart #JINDEX
  543. {
  544. SCANJOURNAL !j
  545. IF You_must_wait IN #JOURNAL
  546. GOTO oc_opencont
  547. IF I_can't_reach_that. IN #JOURNAL || Out_of_sight || #JOURNAL
  548. {
  549. SET !success range
  550. BREAK
  551. }
  552. }
  553. IF !success <> #TRUE
  554. BREAK
  555. WAIT 0
  556. }
  557. SET #RESULT !success
  558. NAMESPACE CLEAR
  559. NAMESPACE POP
  560. RETURN #RESULT
  561. }
  562. ;############################################################
  563. ;==================================
  564. ;* @packageversion 1.10
  565. ;* @purpose move an item from one location to another
  566. ;* @author Tecmo, Bad_Maniac
  567. ;* @param
  568. ; %1 req Item to move
  569. ; %2 req Move from location
  570. ; %3 req Move to location
  571. ; %4 opt Quantity
  572. ;* @return Returns the value True or False
  573. ;* @Calling Example
  574. ; Inside script = gosub moveItem [Item to Move] [From location] [To location] [Quantity] (nothing in qty uses #findstack)
  575. ; Outside calling = call subMoveItem.txt [Item to Move] [From location] [To location] [Quantity] (nothing in qty uses #findstack)
  576. ;==================================
  577. SUB MoveItem
  578. {
  579. IF %0 < 3 || %0 > 4
  580. RETURN #FALSE
  581. SET !_itemId %1
  582. IF G_ notin %2 && %2 <> C
  583. SET !_itemLocation C_ , %2
  584. ELSE
  585. SET !_itemLocation %2
  586. SET !_newItemLocation %3
  587. IF %0 = 4
  588. SET !_qty %4
  589. ELSE
  590. SET !_qty 0
  591. IF %bml_freeshard
  592. {
  593. SET !actionwait 5
  594. SET !dragdropwait 5 ; Increase this number if you recieve 'You must wait' messages
  595. SET !dropg dropg , #SPC , #CHARPOSX , #SPC , #CHARPOSY
  596. }
  597. ELSE
  598. {
  599. SET !actionwait %bml_action_wait
  600. SET !dragdropwait %bml_waittime
  601. SET !_XdropOffset #CHARPOSX - 1
  602. SET !dropg dropg , #SPC , #CHARPOSX , #SPC , !_XdropOffset
  603. }
  604. moveLoop:
  605. FINDITEM !_itemId !_itemLocation
  606. IF #FINDKIND <> -1
  607. {
  608. SET !_litemID #FINDID
  609. GOSUB BMWaitAction !actionwait
  610. IF !_qty = 0
  611. SET !qty #FINDSTACK
  612. ELSE
  613. SET !qty !_qty
  614. EXEVENT drag #FINDID !qty
  615. WAIT !dragdropwait
  616. SET !droptimeout #SYSTIME + 2000
  617. REPEAT
  618. {
  619. IF !_newItemLocation = ground
  620. EXEVENT !dropg
  621. ELSE
  622. EXEVENT dropc !_newItemLocation
  623. FINDITEM !_litemID !_itemLocation
  624. }
  625. UNTIL #FINDKIND = -1 || #FINDCNT = 0 || #SYSTIME < !droptimeout
  626. GOSUB BMWaitAction
  627. }
  628. RETURN
  629. }
  630. ;############################################################
  631. ; MoveAndCut====================
  632. ; %1 is the item ID to drag
  633. ; %2 ID of the dest container
  634. ;===============================
  635. SUB MoveAndCut
  636. SET %mi_itemid %1
  637. SET %mi_destcont %2
  638. IF %mi_itemid <> #FINDID
  639. FINDITEM %mi_itemid
  640. IF #FINDCNT < 1
  641. RETURN #FALSE
  642. SET %mac_cont #FINDBAGID
  643. IF %bml_freeshard
  644. {
  645. ;Cut the resource on the corpse
  646. GOSUB Cut %mi_itemid
  647. FINDITEM %cutresources C_ , %mac_cont
  648. IF #RESULT = #FALSE || #FINDCNT < 1
  649. RETURN #FALSE
  650. SET %mi_itemid #FINDID
  651. }
  652. SET %mac_dragtimer #SCNT2 + 25
  653. IF %bml_freeshard
  654. GOSUB MoveItem %mi_itemid %mac_cont %mi_destcont
  655. ELSE
  656. GOSUB MoveItem %mi_itemid %mac_cont #BACKPACKID
  657. REPEAT
  658. {
  659. FINDITEM %mi_itemid C_ , %mac_cont
  660. }
  661. UNTIL #FINDCNT = 0 || #SCNT2 > %mac_dragtimer
  662. IF ! %bml_freeshard
  663. {
  664. GOSUB Cut %mi_itemid
  665. IF %bml_dragcut
  666. {
  667. WHILE #TRUE
  668. {
  669. FINDITEM %cutresources C_ , #BACKPACKID
  670. IF #FINDCNT < 1
  671. BREAK
  672. IF #FINDBAGID <> %mi_destcont
  673. GOSUB MoveItem #FINDID #FINDBAGID %mi_destcont
  674. }
  675. }
  676. }
  677. RETURN #TRUE
  678. ; Cut===========================
  679. ; %1 ID of the item to cut
  680. ;===============================
  681. SUB Cut
  682. {
  683. SET %cut_itemid %1
  684. SET #LTARGETKIND 1
  685. SET #LTARGETID %cut_itemid
  686. FINDITEM %scissors C_ , #BACKPACKID
  687. SET #LOBJECTID #FINDID
  688. SET %bml_cut_timeout #SCNT2 + 50
  689. SET %bml_jindex #JINDEX
  690. cut_start:
  691. GOSUB BMWaitAction %bml_action_wait
  692. EVENT MACRO 17 0
  693. TARGET 5s
  694. WAIT %bml_waittime
  695. IF You_must_wait_to_perform_another_action IN #SYSMSG
  696. {
  697. GOSUB BMWaitAction
  698. GOTO cut_start
  699. }
  700. EVENT MACRO 22 0
  701. GOSUB BMWaitAction
  702. WAIT %bml_waittime
  703. REPEAT
  704. {
  705. FINDITEM %cut_itemid
  706. FOR %i %bml_jindex #JINDEX
  707. {
  708. SCANJOURNAL %i
  709. IF That_is_too_far_away IN #JOURNAL
  710. RETURN #FALSE
  711. }
  712. }
  713. UNTIL #FINDCNT < 1 || #SCNT2 > %bml_cut_timeout
  714. }
  715. RETURN #TRUE
  716. }
  717. ; CutCorpse=====================
  718. ; %1 ID of the corpse to cut
  719. ;===============================
  720. SUB CutCorpse
  721. {
  722. FINDITEM !fcontid . 1 G
  723. IF #FINDCNT < 1 || #FINDDIST > 2
  724. RETURN #FALSE
  725. cut_corpse:
  726. FINDITEM %knives C
  727. SET #LOBJECTID #FINDID
  728. SET #LTARGETID %1
  729. SET #LTARGETKIND 1
  730. GOSUB BMWaitAction %bml_action_wait
  731. SET !bml_jstart #JINDEX + 1
  732. EVENT MACRO 17 0
  733. TARGET 5s
  734. EVENT MACRO 22 0
  735. GOSUB BMWaitAction
  736. WAIT %bml_waittime
  737. SET !cut_corpse_timeout #SCNT2 + 25
  738. SET !bml_jend #JINDEX + 1
  739. WHILE #SCNT2 < !cut_corpse_timeout
  740. {
  741. FOR !ji !bml_jstart !bml_jend
  742. {
  743. SCANJOURNAL !ji
  744. IF You_see_nothing_useful_to_carve IN #JOURNAL || You_carve_some IN #JOURNAL || You_skin_it IN #JOURNAL || You_pluck_the_bird IN #JOURNAL || You_may_not_dismember_that IN #JOURNAL
  745. RETURN #TRUE
  746. IF I_can't_reach_that. IN #JOURNAL || too_far IN #JOURNAL
  747. RETURN range
  748. IF may_not_loot IN #JOURNAL || criminal_action IN #JOURNAL || You_did_not_earn_the_right_to_loot IN #JOURNAL || did_not_slay_this_creature IN #JOURNAL
  749. RETURN lootright
  750. IF You_must_wait_to_perform_another_action. IN #JOURNAL
  751. GOTO cut_corpse
  752. }
  753. }
  754. RETURN #FALSE
  755. }
  756. ; CheckStatus===================
  757. SUB CheckStatus
  758. {
  759. IF %cs_statustimer = N/A
  760. SET %cs_statustimer #SYSTIME + 600
  761. IF %cs_charpos = N/A
  762. SET %cs_charpos #CHARPOSX , #CHARPOSY
  763. IF %cs_charpos <> #CHARPOSX , #CHARPOSY
  764. {
  765. IF #SYSTIME > %cs_statustimer
  766. {
  767. SET %cs_charpos #CHARPOSX , #CHARPOSY
  768. SET %cs_statustimer #SYSTIME + 600
  769. }
  770. RETURN #FALSE
  771. }
  772. IF #LLIFTEDKIND = 1 || #CONTNAME = drag_gump || #CONTNAME = stack_gump || #TARGCURS = 1
  773. RETURN #FALSE
  774. IF #CLILOGGED = 0 || #CHARGHOST = YES || H IN #CHARSTATUS
  775. RETURN #FALSE
  776. ;Check if other scripts are busy.
  777. ;Currently supports CEOMedic and Seg's stable bandage healer 11.0
  778. IF ( N/A NOTIN *BUSY && *BUSY <> 0 ) || ok NOTIN *510 && paused NOTIN *510
  779. GOSUB BMWaitAction
  780. RETURN #TRUE
  781. }
  782. ; CheckWeight==================
  783. SUB CheckWeight
  784. {
  785. IF %bml_maxweight = N/A
  786. {
  787. SET %bml_maxweight #MAXWEIGHT - 30
  788. IF ! %bml_freeshard
  789. {
  790. FINDITEM #CHARID
  791. IF #FINDTYPE IN HS_IS
  792. SET %bml_maxweight %bml_maxweight + 60
  793. }
  794. }
  795. IF #WEIGHT >= %bml_maxweight
  796. {
  797. EVENT EXMSG #CHARID 3 33 Nearly overweight, please unload some loot.
  798. WHILE #WEIGHT >= %bml_maxweight
  799. WAIT 20
  800. }
  801. RETURN
  802. }
  803. ; BMWaitAction==================
  804. ; %1 time to wait in 10th of a second
  805. ; If no arguments are passed, it sets
  806. ; the timer to the current time
  807. ;===============================
  808. SUB BMWaitAction
  809. {
  810. IF %0 < 1 || %1 = N/A || %bmwatimer = N/A
  811. {
  812. SET %bmwatimer #SCNT2
  813. SET %1 0
  814. }
  815. WHILE ( %bmwatimer + %1 ) > #SCNT2
  816. WAIT 0
  817. RETURN
  818. }
  819. ; WaitForVar====================
  820. ; %1 sysvar to wait for without #
  821. ; %2 comparison operator = <> ...
  822. ; %3 value to compare with
  823. ; %4 optional timeout, default 5 seconds
  824. ;===============================
  825. SUB WaitForVar
  826. {
  827. SET %wfv_timeout #SCNT2 + 50
  828. IF %0 = 4
  829. SET %wfv_timeout #SCNT2 + %4
  830. wfv_waitloop:
  831. IF #SCNT2 > %wfv_timeout
  832. RETURN #FALSE
  833. IF ! ( # . %1 %2 %3 )
  834. GOTO wfv_waitloop
  835. RETURN #TRUE
  836. }
  837. ; IgnoreList====================
  838. ; %1 Item to ignore for 3 minutes
  839. ;===============================
  840. SUB IgnoreList
  841. {
  842. NAMESPACE PUSH
  843. NAMESPACE LOCAL IgnoreList
  844. SET !item #FALSE
  845. IF %0 > 0
  846. SET !item %1
  847. IF !timer < #SCNT || !timer = N/A
  848. {
  849. IF !timer <> N/A
  850. SET !resetcnt ( #SCNT - !timer ) / 10 + 1
  851. ELSE
  852. SET !resetcnt 1
  853. SET !timer #SCNT - ( #SCNT % 10 ) + 10
  854. FOR !i 1 !resetcnt
  855. {
  856. SET !resetlist !timer - ( 190 + ( !i * 10 ) )
  857. IGNOREITEM RESET !resetlist
  858. }
  859. }
  860. IF !item <> #FALSE
  861. IGNOREITEM !item !timer
  862. NAMESPACE POP
  863. RETURN
  864. }
  865. ;SetEquipLootlists===============
  866. SUB SetEquipLootlists
  867. {
  868. ;WEAPON TYPES=============================================================
  869. SET %sword YPO_BNF_CPH_INF_FSF_OSF_ASF_HNF_FMH_CNF_LSF_NSF_ISF_SMH_RMH_CSF_ZRF_MPH_LPH_MSF_BSF_KPO_GUO_KTF_JTF_BPH_EPH_ZSF_ATF_JPH_SOH_POH_NMH_OMH_LPO_ZTO_XTH_YTH_HSF_KSF_NPO_XPO_FUO_JPO_QPF_NPF_KPH_FYG_RHM_SFR_
  870. SET %fencing SRH_AQF_PPF_TSF_WSF_BUO_VPO_WPO_WRH_VRH_XRH_YRH_LTF_MTF_OPO_RRH_CUO_
  871. SET %mace OLH_JOH_URH_EMH_WTH_DMH_QMH_CFF_BFF_PMH_GMH_ZPF_CQF_FFF_RPF_TRH_YSF_XSF_FBG_VTH_AUH_ZTH_UOH_VOH_AUO_MPO_BUH_CUH_DMH_GFF_QOH_HFF_TLH_GBG_
  872. SET %bow WOH_TOH_QPO_SPO_WOH_TOH_JSF_USF_LMH_MMH_QPO_SPO_PPO_RPO_JSF_USF_LMH_MMH_PPO_RPO_JSF_
  873. ;Samurai Empire Weapons---
  874. SET %se_sword CSF_ZRF_MPH_LPH_MSF_BSF_KPO_GUO_KTF_JTF_BPH_EPH_ZSF_ATF_JPH_SOH_POH_NMH_OMH_LPO_ZTO_XTH_YTH_HSF_KSF_NPO_XPO_FUO_JPO_QPF_NPF_KPH_FYG_RHM_JDP_EDP_YCP_KDP_
  875. SET %se_fencing LDP_HDP_ZCP_FDP_
  876. SET %se_mace DDP_ADP_IDP_
  877. SET %se_bow XCP_
  878. ;Mondain's Legacy Weapons---
  879. SET %ml_sword RFR_NFR_SFR_OFR_EFR_YFR_XFR_DFR_
  880. SET %ml_fencing KFR_GFR_LFR_HFR_IFR_MFR_FFR_JFR_
  881. SET %ml_mace VFR_BFR_WFR_CFR_
  882. SET %ml_bow VER_PFR_wer_QFR_
  883. ;ARMOR TYPES================================================================
  884. ;Medable first----
  885. SET %leatherarmor VKH_NJL_QJL_JKH_QKH_DLH_HKH_PKH_SKH_KKH_ELH_PSF_QSK_ATK_ZSK_OSK_YSK_NSK_
  886. SET %medhelmet NJL_QJL_NZH_TDI_VVI_KZH_PZH_DZH_
  887. SET %medgorget JKH_RJG_SJG_FJG_MWL_
  888. SET %medarm HKH_PKH_
  889. SET %medtunic QKH_DLH_
  890. SET %femalemedtunic ATK_ZSK_OSK_NSK_
  891. SET %medglove KKH_SKH_WTO_
  892. SET %medlegging VKH_ELH_
  893. SET %femalemedlegging QSK_YSK_PSK_
  894. ;Hats---
  895. SET %hats CZH_HZH_GZH_BWI_WVI_XVI_YVI_IWI_HWI_KWI_JWI_EWI_JJN_OZH_DZH_BZH_EZH_VSH_QSH_VSH_NWL_
  896. ;Samurai Empire Medable Armor---
  897. SET %se_leatherarmor RWO_GCP_UBP_OWO_LCP_SWO_GWO_CCP_NCP_OCP_
  898. SET %se_medhelmet GWO_CCP_
  899. SET %se_medgorget SWO_
  900. SET %se_medarm OWO_
  901. SET %se_medtunic RWO_NCP_
  902. SET %se_medglove OCP_
  903. SET %se_medleggins GCP_UBP_LCP_ECP_
  904. SET %se_medarmor %se_leatherarmor , %se_medhelmet , %se_medgorget , %se_medarm , %se_medtunic , %se_medglove , %se_medleggins
  905. ;Mondain's Legacy Medable Armor---
  906. SET %ml_medhelmet IJQ_
  907. SET %ml_medgorget BAS_
  908. SET %ml_medarm MAS_
  909. SET %ml_medtunic ZZR_
  910. SET %ml_medglove CAS_
  911. SET %ml_medleggings OAS_LAS_
  912. SET %ml_medarmor %ml_medhelmet , %ml_medgorget , %ml_medarm , %ml_medtunic , %ml_medglove , %ml_medleggings
  913. ;---
  914. SET %medarmor %leatherarmor , %medHelmet , %hats , %medGorget , %medArm , %medTunic , %femaleMedTunic , %medGlove , %medLegging , %femaleMedLegging , %se_medarmor , %ml_medarmor
  915. ;Non medable---
  916. SET %studdedarmor ALH_ULH_LLH_YKH_GLH_XKH_FLH_RLH_MLH_SSK_RSK_
  917. SET %bonearmor ZPH_YPH_WPH_PPH_BQH_QPH_VPH_XPH_CQH_AQH_
  918. SET %nonmedhelmet DSH_ASH_TSH_ESH_YPH_GSH_OSH_ZPH_ZRH_IWL_CSH_CSH_BSH_FSH_DPH_LKO_NWL_MKH_
  919. SET %nonmedgorget NSH_ALH_
  920. SET %nonmedarm BQH_JSH_XLH_GLH_MSH_YLH_QPH_YKH_DLO_
  921. SET %nonmedtunic HSH_ULH_LLH_ZOH_IKH_VLH_KSH_WLH_WPH_PKO_PPH_RSK_
  922. SET %femalenonmedtunic USK_SSK_MSK_TSK_LSK_USK_
  923. SET %nonmedglove VPH_ISH_AQH_BMH_USH_XKH_FLH_KMH_RKO_
  924. SET %nonmedlegging HMH_LSH_IMH_CQH_WSH_APH_MLH_RLH_NKH_XPH_NKO_
  925. ;Samurai Empire Non Medable Armor---
  926. SET %se_studdedarmor MWO_NWO_FCP_PCP_TBP_
  927. SET %se_nonmedhelmet RBP_DCP_QWO_DWO_SBP_VBP_FWO_
  928. SET %se_nonmedgorget PCP_
  929. SET %se_nonmedarm NWO_WBP_
  930. SET %se_nonmedtunic MWO_LWO
  931. SET %se_nonmedleggins FCP_TBP_ZBP_
  932. SET %se_nonmedarmor %se_studdedarmor , %se_nonmedhelmet , %se_nonmedgorget , %se_nonmedarm , %se_nonmedtunic , %se_nonmedleggins
  933. ;Mondain's Legacy Non Medable Armor---
  934. SET %ml_nonmedhelmet RJQ_UJQ_TJQ_
  935. SET %ml_nonmedgorget QJQ_JJQ_
  936. SET %ml_nonmedarm PJQ_GJQ_
  937. SET %ml_nonmedtunic OJQ_ZIQ_
  938. SET %ml_nonmedgloves NJQ_MJQ_
  939. SET %ml_nonmedleggings AKQ_LJQ_
  940. SET %ml_nonmedarmor %ml_nonmedhelmet , %ml_nonmedgorget , %ml_nonmedarm , %ml_nonmedtunic , %ml_nonmedgloves , %ml_nonmedleggings
  941. ;---
  942. SET %nonmedarmor %studdedarmor , %bonearmor , %nonmedHelmet , %nonmedGorget , %nonmedArm , %nonmedTunic , %femaleNonMedTunic , %nonmedGlove , %nonmedLegging , %se_nonmedarmor , %ml_nonmedarmor
  943. ;INIT LISTS====================================================================
  944. SET %bml_swordlist %sword , %se_sword , %ml_sword
  945. SET %bml_fencinglist %fencing , %se_fencing , %ml_fencing
  946. SET %bml_macelist %mace , %se_mace , %ml_mace
  947. SET %bml_bowlist %bow , %se_bow , %ml_bow
  948. SET %bml_armorlist %medarmor , %nonmedarmor
  949. SET %bml_shieldlist LIK_MIK_CLK_AIK_CIK_LYD_GIK_NIK_ZHK_HLK_BLK_FIK_BIK_OIK_
  950. SET %bml_jewelerylist CWL_LWL_UJG_IJG
  951. SET %bml_instrumentlist OQF_LQF_PRF_KRF_MQF_QRF_RGP_ ;RGP is the Samurai Empire Instrument
  952. RETURN
  953. }
  954. ;--------- EasyUO Menu Designer Code Begin ---------
  955. sub showLootMenu
  956. {
  957. menu Clear
  958. menu Window Title Automagic Looting
  959. menu Window Color BtnFace
  960. menu Window Size 222 330
  961. menu Font Transparent #true
  962. menu Font Align Right
  963. menu Shape EUOShape1 0 216 221 2 3 7 1 Black 7 Black
  964. menu Shape EUOShape2 0 124 225 2 3 7 1 Black 7 Black
  965. menu Shape EUOShape3 52 268 109 29 3 7 2 Black 7 BtnFace
  966. menu Shape EUOShape4 0 100 225 2 3 7 1 Black 7 Black
  967. menu Shape EUOShape5 0 268 221 2 3 7 1 Black 7 Black
  968. menu Font Name MS Sans Serif
  969. menu Font Size 8
  970. menu Font Style
  971. menu Font Color WindowText
  972. menu Font Transparent #false
  973. menu Font Align Left
  974. ;---
  975. menu Text EUOLabel1 28 196 Minimum Loot Score:
  976. menu Text EUOLabel2 156 196 (1-40)
  977. menu Font BGColor Window
  978. menu Edit value 128 192 25 10
  979. menu Edit hotkey 144 272 13 A
  980. menu Font BGColor BtnFace
  981. ;---
  982. menu Check goldchk 0 0 109 17 #false Gold
  983. menu Check gemchk 0 16 109 17 #false Gems
  984. menu Check regchk 0 32 109 17 #false Reagents
  985. menu Check ammochk 0 48 109 17 #false Ammo
  986. menu Check scrollchk 0 64 109 17 #false Scrolls
  987. menu Check instrumentchk 0 80 109 17 #false Instruments
  988. menu Check solenchk 112 0 109 17 #false Solen Loot
  989. menu Check jukachk 112 16 109 17 #false Juka Loot
  990. menu Check paragonchk 112 32 109 17 #false Paragon Loot
  991. menu Check questchk 112 48 109 17 #false Quest Loot
  992. menu Check resourcechk 112 64 109 17 #false Resources
  993. menu Check otherchk 112 80 109 17 #false Other
  994. ;---
  995. menu Check user1chk 0 104 109 17 #false User1
  996. menu Check user2chk 112 104 109 17 #false User2
  997. ;---
  998. menu Check swordchk 0 128 109 17 #false Swords
  999. menu Check fencechk 112 128 109 17 #false Fencing
  1000. menu Check macechk 0 144 109 17 #false Maces
  1001. menu Check bowchk 112 144 109 17 #false Bows
  1002. menu Check armorchk 0 160 109 17 #false Armor
  1003. menu Check shieldchk 112 160 109 17 #false Shields
  1004. menu Check jewelchk 0 176 109 17 #false Jewellery
  1005. menu Check setchk 112 176 109 17 #false Equipment Sets
  1006. ;---
  1007. menu Check allchk 0 220 109 13 #false Everything
  1008. menu Check closechk 112 220 109 13 #true Close Corpse
  1009. menu Check regbagchk 0 236 109 13 #false Use Regbag
  1010. menu Check cutchk 112 236 109 13 #false Cut Corpses
  1011. menu Check dragcutchk 0 252 109 13 #false Drag After Cut
  1012. menu Check bagchk 112 252 109 13 #false Open Sub Bags
  1013. menu Check hotkeychk 56 276 85 13 #false Use HotKey
  1014. ;---
  1015. menu Button startbutton 52 298 109 29 [ START ]
  1016. ;---
  1017. SET %null
  1018. IF *bml_minvalue <> %null && *bml_minvalue <> N/A
  1019. MENU SET value *bml_minvalue
  1020. IF *bml_hotkey <> %null && *bml_hotkey <> N/A
  1021. MENU SET hotkey *bml_hotkey
  1022. IF *bml_settings <> %null && *bml_settings <> N/A
  1023. {
  1024. IF gold IN *bml_settings
  1025. menu SET goldchk #TRUE
  1026. IF gem IN *bml_settings
  1027. menu SET gemchk #TRUE
  1028. IF reg IN *bml_settings
  1029. menu SET regchk #TRUE
  1030. IF ammo IN *bml_settings
  1031. menu SET ammochk #TRUE
  1032. IF scroll IN *bml_settings
  1033. menu SET scrollchk #TRUE
  1034. IF instrument IN *bml_settings
  1035. menu SET instrumentchk #TRUE
  1036. IF solen IN *bml_settings
  1037. menu SET solenchk #TRUE
  1038. IF juka IN *bml_settings
  1039. menu SET jukachk #TRUE
  1040. IF paragon IN *bml_settings
  1041. menu SET paragonchk #TRUE
  1042. IF quest IN *bml_settings
  1043. menu SET questchk #TRUE
  1044. IF resource IN *bml_settings
  1045. menu SET resourcechk #TRUE
  1046. IF sword IN *bml_settings
  1047. menu SET swordchk #TRUE
  1048. IF fence IN *bml_settings
  1049. menu SET fencechk #TRUE
  1050. IF mace IN *bml_settings
  1051. menu SET macechk #TRUE
  1052. IF bow IN *bml_settings
  1053. menu SET bowchk #TRUE
  1054. IF armor IN *bml_settings
  1055. menu SET armorchk #TRUE
  1056. IF shield IN *bml_settings
  1057. menu SET shieldchk #TRUE
  1058. IF jewel IN *bml_settings
  1059. menu SET jewelchk #TRUE
  1060. IF sets IN *bml_settings
  1061. menu SET setchk #TRUE
  1062. IF other IN *bml_settings
  1063. menu SET otherchk #TRUE
  1064. IF user1 IN *bml_settings
  1065. menu SET user1chk #TRUE
  1066. IF user2 IN *bml_settings
  1067. menu SET user2chk #TRUE
  1068. IF all IN *bml_settings
  1069. menu SET allchk #TRUE
  1070. IF close NOTIN *bml_settings
  1071. menu SET closechk #FALSE
  1072. IF regbag IN *bml_settings
  1073. menu SET regbagchk #TRUE
  1074. IF cut IN *bml_settings
  1075. menu SET cutchk #TRUE
  1076. IF dragcut IN *bml_settings
  1077. menu SET dragcutchk #TRUE
  1078. IF openbags IN *bml_settings
  1079. menu SET bagchk #TRUE
  1080. IF hotkey IN *bml_settings
  1081. menu SET hotkeychk #TRUE
  1082. }
  1083. menu Show
  1084. SET #MENUBUTTON N/A
  1085. WHILE #TRUE
  1086. {
  1087. IF #MENUBUTTON = startbutton
  1088. BREAK
  1089. IF #MENUBUTTON = closed
  1090. HALT
  1091. }
  1092. Menu HIDE
  1093. ;=========================================================================================================
  1094. ;Below the lootlist is set according to the users menu choices, everything specified will be looted automagically.
  1095. ;=========================================================================================================
  1096. GOSUB ClearGlobal bml_settings
  1097. GOSUB ClearGlobal bml_minvalue
  1098. SET %bml_lootlist
  1099. SET %lootbag #TRUE
  1100. SET %bml_closecorpse #FALSE
  1101. SET %bml_openbags #FALSE
  1102. SET %bml_hotkey #FALSE
  1103. MENU GET goldchk
  1104. IF #MENURES
  1105. {
  1106. SET %bml_lootlist %bml_lootlist , %gold
  1107. GOSUB WriteToGlobal bml_settings gold
  1108. }
  1109. MENU GET gemchk
  1110. IF #MENURES
  1111. {
  1112. SET %bml_lootlist %bml_lootlist , %jewels
  1113. GOSUB WriteToGlobal bml_settings gem
  1114. }
  1115. MENU GET regchk
  1116. IF #MENURES
  1117. {
  1118. SET %bml_lootlist %bml_lootlist , %reagents
  1119. GOSUB WriteToGlobal bml_settings reg
  1120. MENU GET regbagchk
  1121. SET %regbag #MENURES
  1122. IF #MENURES
  1123. GOSUB WriteToGlobal bml_settings regbag
  1124. }
  1125. MENU GET ammochk
  1126. IF #MENURES
  1127. {
  1128. SET %bml_lootlist %bml_lootlist , %arrowsbolts
  1129. GOSUB WriteToGlobal bml_settings ammo
  1130. }
  1131. MENU GET solenchk
  1132. IF #MENURES
  1133. {
  1134. SET %bml_lootlist %bml_lootlist , %solenloot
  1135. GOSUB WriteToGlobal bml_settings solen
  1136. }
  1137. MENU GET jukachk
  1138. IF #MENURES
  1139. {
  1140. SET %bml_lootlist %bml_lootlist , %jukaloot
  1141. GOSUB WriteToGlobal bml_settings juka
  1142. }
  1143. MENU GET paragonchk
  1144. IF #MENURES
  1145. {
  1146. SET %bml_lootlist %bml_lootlist , %paragonloot
  1147. GOSUB WriteToGlobal bml_settings paragon
  1148. }
  1149. MENU GET questchk
  1150. IF #MENURES
  1151. {
  1152. SET %bml_lootlist %bml_lootlist , %questloot
  1153. GOSUB WriteToGlobal bml_settings quest
  1154. }
  1155. MENU GET resourcechk
  1156. IF #MENURES
  1157. {
  1158. SET %bml_lootlist %bml_lootlist , %leather
  1159. SET %bml_lootlist %bml_lootlist , %feather
  1160. SET %bml_lootlist %bml_lootlist , %bones
  1161. SET %bml_lootlist %bml_lootlist , %wool
  1162. SET %bml_lootlist %bml_lootlist , %scale
  1163. GOSUB WriteToGlobal bml_settings resource
  1164. }
  1165. MENU GET instrumentchk
  1166. IF #MENURES
  1167. {
  1168. SET %bml_lootlist %bml_lootlist , %bml_instrumentlist
  1169. GOSUB WriteToGlobal bml_settings instrument
  1170. }
  1171. MENU GET otherchk
  1172. IF #MENURES
  1173. {
  1174. SET %bml_lootlist %bml_lootlist , %other
  1175. GOSUB WriteToGlobal bml_settings other
  1176. }
  1177. MENU GET scrollchk
  1178. IF #MENURES
  1179. {
  1180. SET %bml_lootlist %bml_lootlist , %scrolls
  1181. GOSUB WriteToGlobal bml_settings scroll
  1182. }
  1183. MENU GET user1chk
  1184. IF #MENURES
  1185. {
  1186. SET %bml_lootlist %bml_lootlist , %user1
  1187. GOSUB WriteToGlobal bml_settings user1
  1188. }
  1189. MENU GET user2chk
  1190. IF #MENURES
  1191. {
  1192. SET %bml_lootlist %bml_lootlist , %user2
  1193. GOSUB WriteToGlobal bml_settings user2
  1194. }
  1195. MENU GET cutchk
  1196. SET %bml_cutcorpse #MENURES
  1197. IF #MENURES
  1198. GOSUB WriteToGlobal bml_settings cut
  1199. ;=======================================
  1200. ;Set the Equipment lootlist from the user selection
  1201. ;=======================================
  1202. SET %bml_equiplootlist
  1203. SET %bml_lootequipment #FALSE
  1204. SET %bml_lootsets #FALSE
  1205. MENU GET value
  1206. SET *bml_minvalue #MENURES
  1207. MENU GET swordchk
  1208. IF #MENURES
  1209. {
  1210. SET %bml_equiplootlist %bml_equiplootlist , %bml_swordlist
  1211. GOSUB WriteToGlobal bml_settings sword
  1212. }
  1213. MENU GET fencechk
  1214. IF #MENURES
  1215. {
  1216. SET %bml_equiplootlist %bml_equiplootlist , %bml_fencinglist
  1217. GOSUB WriteToGlobal bml_settings fence
  1218. }
  1219. MENU GET macechk
  1220. IF #MENURES
  1221. {
  1222. SET %bml_equiplootlist %bml_equiplootlist , %bml_macelist
  1223. GOSUB WriteToGlobal bml_settings mace
  1224. }
  1225. MENU GET bowchk
  1226. IF #MENURES
  1227. {
  1228. SET %bml_equiplootlist %bml_equiplootlist , %bml_bowlist
  1229. GOSUB WriteToGlobal bml_settings bow
  1230. }
  1231. MENU GET armorchk
  1232. IF #MENURES
  1233. {
  1234. SET %bml_equiplootlist %bml_equiplootlist , %bml_armorlist
  1235. GOSUB WriteToGlobal bml_settings armor
  1236. }
  1237. MENU GET shieldchk
  1238. IF #MENURES
  1239. {
  1240. SET %bml_equiplootlist %bml_equiplootlist , %bml_shieldlist
  1241. GOSUB WriteToGlobal bml_settings shield
  1242. }
  1243. MENU GET jewelchk
  1244. IF #MENURES
  1245. {
  1246. SET %bml_equiplootlist %bml_equiplootlist , %bml_jewelerylist
  1247. GOSUB WriteToGlobal bml_settings jewel
  1248. }
  1249. MENU GET setchk
  1250. IF #MENURES
  1251. {
  1252. SET %bml_lootsets #TRUE
  1253. GOSUB WriteToGlobal bml_settings sets
  1254. }
  1255. ;=====================
  1256. ; Other check boxes
  1257. ;=====================
  1258. MENU GET closechk
  1259. IF #MENURES
  1260. {
  1261. GOSUB WriteToGlobal bml_settings close
  1262. SET %bml_closecorpse #TRUE
  1263. }
  1264. MENU GET hotkeychk
  1265. IF #MENURES
  1266. {
  1267. GOSUB WriteToGlobal bml_settings hotkey
  1268. MENU GET hotkey
  1269. SET *bml_hotkey #MENURES
  1270. SET %bml_hotkey #TRUE
  1271. }
  1272. IF %bml_equiplootlist <> %null
  1273. SET %bml_lootequipment #TRUE
  1274. MENU GET bagchk
  1275. IF ! #MENURES
  1276. SET %bml_lootlist %bml_lootlist , %bags
  1277. IF #MENURES
  1278. {
  1279. GOSUB WriteToGlobal bml_settings openbags
  1280. SET %bml_openbags #TRUE
  1281. }
  1282. MENU GET dragcutchk
  1283. IF #MENURES
  1284. {
  1285. GOSUB WriteToGlobal bml_settings dragcut
  1286. SET %bml_dragcut #TRUE
  1287. }
  1288. MENU GET allchk
  1289. IF #MENURES
  1290. {
  1291. GOSUB WriteToGlobal bml_settings all
  1292. SET %bml_lootlist *
  1293. RETURN
  1294. }
  1295. ;=======================================
  1296. IF %bml_lootlist = %reagents
  1297. {
  1298. SET %lootbag #FALSE
  1299. SET %regbag #TRUE
  1300. }
  1301. IF %bml_lootlist = %null && %bml_equiplootlist = %null
  1302. {
  1303. DISPLAY OK No loot selected!$Halting script.
  1304. HALT
  1305. }
  1306. RETURN
  1307. ;------------------------------
  1308. ;* @name CheckFreeShard
  1309. ;* @ver 1.0 2Feb05
  1310. ;* @author Roadkill
  1311. ;* @purpose checks if you're on a known OSI shard or not
  1312. ;* @params %1 optional, variablename to return #true/#false in, #true if on a freeshard
  1313. ;* @returns #result and @%1 #true if on a freeshard, #false if on a known OSI shard.
  1314. ;* @example call rksubs.txt CheckFreeShard <@%1 varname, opt><@#result #true if #shard notin osi list
  1315. ;------------------------------
  1316. sub CheckFreeShard
  1317. set !OSIshards pacific_sonoma_baja_legends_atlantic_chesapeake_catskills_lake , #spc , austin
  1318. +_napa , #spc , valley_lake , #spc , superior_great , #spc , lakes_siege , #spc , perilous_europa
  1319. +_drachenfels_oceania_origin_wakoku_formosa_arirang_balhae_asuka_yamato_mugen_hokuto_misuho_izumo_sakura_
  1320. set !result #shard notin !OSIshards
  1321. if %0 >= 1 && %1 <> n/a
  1322. set % . %1 !result
  1323. return !result
  1324. ;BMEuoVer========================
  1325. ; Returns the numerical EUO version
  1326. ;================================
  1327. SUB BMEuoVer
  1328. {
  1329. SET %euover #EUOVER
  1330. REPEAT
  1331. {
  1332. STR POS %euover _
  1333. IF #STRRES > 0
  1334. {
  1335. STR DEL %euover #STRRES 1
  1336. SET %euover #STRRES
  1337. }
  1338. }
  1339. UNTIL #STRRES = 0
  1340. }
  1341. RETURN %euover
  1342. ;BMGetProperty======================
  1343. ;%1 is the itemID to get the property of
  1344. ;================================
  1345. SUB BMGetProperty
  1346. {
  1347. SET %prop_timeout #SYSTIME + 1500
  1348. EVENT PROPERTY %1
  1349. WHILE #PROPERTY = $ || No , #SPC , Data IN #PROPERTY
  1350. {
  1351. IF No , #SPC , Data IN #PROPERTY
  1352. EVENT PROPERTY %1
  1353. IF #SYSTIME > %prop_timeout
  1354. RETURN #FALSE
  1355. }
  1356. RETURN #TRUE
  1357. }
  1358. ;WriteToGlobal======================
  1359. ;%1 is the global to write to (no *)
  1360. ;%2 to %N are the words or values to write
  1361. ;================================
  1362. SUB WriteToGlobal
  1363. {
  1364. FOR %i 2 %0
  1365. {
  1366. IF % . %i NOTIN * . %1
  1367. SET * . %1 * . %1 , % . %i , _
  1368. }
  1369. RETURN
  1370. }
  1371. ;ClearGlobal=======================
  1372. ;%1 is the global to clear (no *)
  1373. ;================================
  1374. SUB ClearGlobal
  1375. {
  1376. SET * . %1
  1377. RETURN
  1378. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement