Advertisement
sorvani

ninjadvloot.inc

Feb 27th, 2014
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.01 KB | None | 0 0
  1. | Ninjadvloot.inc v3.1 05/11/2013 Redguides.com
  2. | Author A_Druid_00 12/19/2005
  3. | Based on original looting code of toomanynames
  4. | The following updates were all individually posted and consolidated by Maskoi into the current version.
  5. | Updated: Moeymoejoe added strip out comma in item names when accessing ini file 08/02/2006
  6. | Updated: mystikule added sell option to ini file 01/07/2008
  7. | Updated: drkrain for House of Thule 10/23/2010
  8. | Updated: Maskoi with Sell Routines 11/27/2010
  9. | Updated: Maskoi with /item keep/sell/destroy ini commands 07/21/2011
  10. | Updated: Maskoi with Foraged item handling 08/31/2011
  11. | Updated: Maskoi with Buying item handling 07/31/2012
  12. | Updated: Maskoi with Assign different ini file for item handling 01/01/2013
  13. |
  14. | Selling Contributions by
  15. | drkrain - TLInv item check
  16. | dewey2461 - Add sold items to ini file Event
  17. |
  18. | Requirements: MQ2Moveutils
  19. | Usage: add the following to your macro for looting
  20. | #include Ninjadvloot.inc
  21. | /call SetupAdvLootVars
  22. | /call LootMobs
  23. |
  24. | Assign differnent ini files. Default is Loot.ini
  25. | /call SetupAdvLootVars "MyToonLoot.ini"
  26. | /call SetupAdvLootVars "LootMesa.ini"
  27. |
  28. | Commands
  29. | Usage. Grab the item and put it on your cursor then use one of the following commands
  30. | /lootdestroy - Mark item on cursor to Destroy in Loot.ini file
  31. | /lootignore - Mark item on cursor to Ignore in Loot.ini file
  32. | /lootkeep - Mark item on cursor to Keep in Loot.ini file
  33. | /lootsell - Mark item on cursor to Sell in Loot.ini file
  34. | /sellstuff - Target a vendor and this command will sell any item in your inventory marked sell.
  35. | /depositstuff - Target your guildbanker and this command will deposit any item in your inventory marked keep into the guild bank.
  36.  
  37. #Event CantLoot "#*#may not loot this corpse#*#"
  38. #Event Sell "#*#You receive#*# for the #1#(s)#*#"
  39. #Event EditIniItem "[MQ2] LootIniItem #1# #2#"
  40. #Event SellStuff "[MQ2] NinjadvLoot selling items to vendor"
  41. #Event Broke "#*#you cannot afford#*#"
  42. #Event Broke "#*#you can't afford#*#"
  43. #Event Forage "Your forage mastery has enabled you to find something else!"
  44. #Event Forage "You have scrounged up #*#"
  45. #Event InventoryFull "#*#Your inventory appears full!#*#"
  46.  
  47. Sub SetupAdvLootVars(string ChangeIniFile)
  48.  
  49. /declare CantLootID int outer
  50. /declare CorpseRotTimer timer outer
  51. /declare AletClearTimer timer outer
  52. /declare NinjadVersion string outer 3.0
  53. /declare InventoryFull int outer 0
  54. /declare NinjaIniFile string outer Loot.ini
  55. /if (${ChangeIniFile.Length}) {
  56. /varset NinjaIniFile ${ChangeIniFile}
  57. /echo Ninja Advance Loot in now writing all info to the ${ChangeIniFile} file.
  58. }
  59. /declare NALVersion string outer ${Ini[${NinjaIniFile},Settings,Version]}
  60. /if (!${Ini[${NinjaIniFile},Settings,Version].Length}) {
  61. /call CreateIni
  62. /ini "${NinjaIniFile}" "Settings" "Version" "0.0"
  63. }
  64. /if (${NALVersion.NotEqual[${NinjadVersion}]}) {
  65. /echo NinjAdvLoot version mismatch detected writing aliases.
  66. /noparse /squelch /alias /lootignore /echo LootIniItem Ignore ${Cursor.Name}
  67. /noparse /squelch /alias /lootsell /echo LootIniItem Sell ${Cursor.Name}
  68. /noparse /squelch /alias /lootkeep /echo LootIniItem Keep ${Cursor.Name}
  69. /noparse /squelch /alias /lootdestroy /echo LootIniItem Destroy ${Cursor.Name}
  70. /squelch /alias /sellstuff /echo NinjadvLoot selling items to vendor
  71. /squelch /alias /depositstuff /echo NinjadvLoot depositing items to guildbank
  72. /ini "${NinjaIniFile}" "Settings" "Version" "${NinjadVersion}"
  73. }
  74.  
  75. | Loot ini settings
  76. /call ALLoadVar Settings OpenAllBags 1 int
  77. /call ALLoadVar Settings AddNewSales 1 int
  78. /call ALLoadVar Settings LootForage 1 int
  79. /call ALLoadVar Settings LootMobs TRUE bool
  80. /call ALLoadVar Settings CorpseRadius 100 int
  81. /call ALLoadVar Settings MobsTooClose 100 int
  82. /call ALLoadVar Settings CorpseRotTime 440s string
  83. /call ALLoadVar Settings ReportLoot FALSE bool
  84. /call ALLoadVar Settings LootChannel g string
  85. /call ALLoadVar Settings LootForageSpam 1 int
  86. | Alert list 9 used to define an ignore list like campfires untargetable etc.
  87. /if (!${Defined[${AlertList}]}) /declare AlertList int outer 9
  88.  
  89. /return
  90.  
  91. Sub ALLoadVar(IniSection,IniVar,IniValue,VarType)
  92. /if (!${Defined[${IniVar}]} && ${Defined[VarType]}) /declare ${IniVar} ${VarType} outer
  93. /declare IniString string local ${Ini[${NinjaIniFile},${IniSection},${IniVar},NOTFOUND]}
  94. /varset ${IniVar} ${IniString}
  95. /if (${IniString.Equal["NOTFOUND"]}) {
  96. /if (${IniString.Equal["NOTFOUND"]}) /varset ${IniVar} ${IniValue}
  97. /ini "${NinjaIniFile}" "${IniSection}" "${IniVar}" "${${IniVar}}"
  98. }
  99. /return
  100.  
  101. | **************** Loot Mobs Section ******************** |
  102.  
  103. Sub Event_CantLoot
  104. /varset CantLootID ${Target.ID}
  105. /return
  106.  
  107. Sub LootMobs
  108. /if (!${AletClearTimer}) {
  109. /call AlertClear
  110. /varset AletClearTimer 5m
  111. /squelch /alert add ${AlertList} untargetable
  112. /squelch /alert add ${AlertList} FSP
  113. }
  114. /declare DeadCount int local ${SpawnCount[corpse radius ${CorpseRadius} zradius 50 noalert 25]}
  115. /if (!${LootMobs} || ${SpawnCount[npc radius ${MobsTooClose} zradius 50 noalert ${AlertList}]} || !${DeadCount} || ${Me.Combat} || !${Me.FreeInventory}) /return
  116. /if (!${CorpseRotTimer}) /squelch /alert clear 25
  117. /declare i int local
  118. /declare CorpseList string local
  119. /declare CorpseToLoot int local
  120. /declare ZDist float local ${Math.Distance[${Target.Z}:${Me.Z}]}
  121. /for i 1 to ${DeadCount}
  122. /varset CorpseList ${CorpseList}${NearestSpawn[${i},corpse radius ${CorpseRadius} zradius 50 noalert 25].ID}|
  123. /next i
  124. /for i 1 to ${DeadCount}
  125. /varset CorpseToLoot ${Spawn[${CorpseList.Arg[${i},|]}].ID}
  126. /if (${Spawn[${CorpseToLoot}].Deity.ID} || !${Spawn[${CorpseToLoot}].ID} || !${Spawn[${CorpseToLoot}].LineOfSight}) /goto :SkipCorpse
  127. /if (${Target.ID}!=${CorpseToLoot}) /target id ${CorpseToLoot}
  128. /if (!${Me.Standing}) /stand
  129. /delay 2s ${Target.ID}==${CorpseToLoot} && ${Me.Standing}
  130. /if (${Target.Distance}>5) {
  131. /moveto mdist 10
  132. /moveto loc ${Target.Y} ${Target.X}
  133. /delay 250 ${MoveTo.Stopped}
  134. /call ZCheck ${ZDist} 8
  135. /face fast
  136. }
  137. /if (${Target.Distance}<10) /call LootCorpse
  138. :SkipCorpse
  139. /next i
  140. /return
  141.  
  142. Sub LootCorpse
  143. /declare i int local
  144. /declare LootList string local
  145. /declare FirstLetter string local
  146. /call CheckCursor
  147. /loot
  148. /delay 3s ${Corpse.Open}
  149. /doevents CantLoot
  150. /if (${Target.ID}==${CantLootID} && ${Spawn[${CantLootID}].ID}) /squelch /alert add 25 id ${CantLootID}
  151. /delay 3s ${Corpse.Items} || ${Target.ID}==${CantLootID}
  152. /if (${Corpse.Open} && ${Corpse.Items}) {
  153. /declare loottotal int local
  154. :LootLag
  155. /varset loottotal ${Corpse.Items}
  156. /delay 1s ${loottotal}!=${Corpse.Items}
  157. /if (${loottotal}!=${Corpse.Items}) /goto :LootLag
  158. /for i 1 to ${loottotal}
  159. /varset FirstLetter ${Corpse.Item[${i}].Name.Left[1]}
  160. /if (${Corpse.Item[${i}].ID} && !${Select[${Ini[${NinjaIniFile},"${FirstLetter}","${Corpse.Item[${i}]}"]},Ignore,Keep,Destroy,Sell]}) {
  161. /if (${Corpse.Item[${i}].NoDrop}) /ini "${NinjaIniFile}" "${FirstLetter}" "${Corpse.Item[${i}]}" Ignore
  162. /if (!${Corpse.Item[${i}].NoDrop}) /ini "${NinjaIniFile}" "${FirstLetter}" "${Corpse.Item[${i}]}" Keep
  163. }
  164. /if (${Ini[${NinjaIniFile},"${FirstLetter}","${Corpse.Item[${i}]}"].NotEqual[Destroy]} && !${Me.FreeInventory} && (!${FindItemCount[=${Corpse.Item[${i}].Name}]} || (${FindItemCount[=${Corpse.Item[${i}].Name}]} && ${Corpse.Item[${i}].Stackable} && !${Corpse.Item[${i}].FreeStack})) || (${Corpse.Item[${i}].Lore} && ${FindItem[${Corpse.Item[${i}]}].ID}) || ${Ini[${NinjaIniFile},"${FirstLetter}","${Corpse.Item[${i}]}"].Equal[Ignore]}) /varset LootList ${LootList}${Corpse.Item[${i}]},
  165. /if ((${Ini[${NinjaIniFile},"${FirstLetter}","${Corpse.Item[${i}]}"].Equal[Keep]} || ${Ini[${NinjaIniFile},"${FirstLetter}","${Corpse.Item[${i}]}"].Equal[Sell]}) && (!${Corpse.Item[${i}].Lore} || !${FindItem[${Corpse.Item[${i}]}].ID}) && (${Me.FreeInventory} || (${FindItemCount[=${Corpse.Item[${i}].Name}]} && ${Corpse.Item[${i}].Stackable} && ${Corpse.Item[${i}].FreeStack}))) /call LootItem ${i} Keep Right
  166. /if (${Ini[${NinjaIniFile},"${FirstLetter}","${Corpse.Item[${i}]}"].Equal[Destroy]}) /call LootItem ${i} Destroy left
  167. /next i
  168. /if (${Corpse.Items}) {
  169. /if (${ReportLoot} && ${LootList.Length}) {
  170. /keypress Enter
  171. /keypress / chat
  172. /call Type "${LootChannel}"
  173. /keypress Space chat
  174. /notify LootWND LW_BroadcastButton leftmouseup
  175. /delay 5
  176. /call Type " left on corpse."
  177. /keypress /
  178. /keypress Enter chat
  179. }
  180. /if (${Target.ID}) /squelch /alert add 25 id ${Target.ID}
  181. /varset CorpseRotTimer ${CorpseRotTime}
  182. }
  183. }
  184. :clickdoneffs
  185. /nomodkey /notify LootWnd LW_DoneButton leftmouseup
  186. /delay 5s !${Window[LootWnd].Open}
  187. /if (${Window[LootWnd].Open}) /goto :clickdoneffs
  188. /return
  189.  
  190. Sub LootItem(int i,DoWhat,WhichButton)
  191. /declare CorpseItemID int local ${Corpse.Item[${i}].ID}
  192. /nomodkey /shift /itemnotify ${Corpse.Item[${i}].InvSlot} ${WhichButton}mouseup
  193. /delay 5s ${Window[ConfirmationDialogBox].Open} || !${Corpse.Item[${i}].NoDrop}
  194. /if (${Window[ConfirmationDialogBox].Open}) /nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup
  195. /delay 5s ${Cursor.ID} || ${WhichButton.NotEqual[left]}
  196. /if (${DoWhat.Equal[Destroy]} && ${Cursor.ID}==${CorpseItemID}) /destroy
  197. /delay 3s !${Corpse.Item[${i}].ID}
  198. /if (${Cursor.ID}) /call CheckCursor
  199. /return
  200.  
  201. Sub CheckCursor
  202. :ALauto_inv
  203. /if (${Cursor.ID}) {
  204. /if (${Cursor.NoDrop} && !${Me.FreeInventory}) /return
  205. /timed 5 /autoinventory
  206. /delay 2s !${Cursor.ID}
  207. /goto :ALauto_inv
  208. }
  209. /return
  210.  
  211. | **************** Foraged Items Section ******************** |
  212. Sub Event_Forage
  213. /if (!${LootForage}) /return
  214. /declare ForagedItem string local
  215. :MoreToAutoInventory
  216. /if (${Cursor.ID}) {
  217. /varset ForagedItem ${Cursor.Name}
  218. /if (!${Select[${Ini[${NinjaIniFile},"${Cursor.Name.Left[1]}","${Cursor.Name}"]},Ignore,Keep,Destroy,Sell]}) {
  219. /if (${Cursor.ID}) /ini "${NinjaIniFile}" "${Cursor.Name.Left[1]}" "${Cursor.Name}" Keep
  220. /if (${LootForageSpam}) /echo New foraged item >> ${Cursor.Name} << added to ini file.
  221. }
  222. /if (${Ini[${NinjaIniFile},"${Cursor.Name.Left[1]}","${Cursor.Name}"].Equal[Destroy]} || ${Ini[${NinjaIniFile},"${Cursor.Name.Left[1]}","${Cursor.Name}"].Equal[Ignore]}) {
  223. /if (${Cursor.Name.Equal[${ForagedItem}]}) /destroy
  224. /delay 5
  225. /if (${LootForageSpam}) /echo NINJADVLOOT -- Destroyed foraged ${ForagedItem}.
  226. } else /if ((${Ini[${NinjaIniFile},"${Cursor.Name.Left[1]}","${Cursor.Name}"].Equal[Keep]} || ${Ini[${NinjaIniFile},"${Cursor.Name.Left[1]}","${Cursor.Name}"].Equal[Sell]}) && (!${Cursor.Lore} || !${FindItem[${Cursor.Name}].ID}) && (${Me.FreeInventory} || (${FindItemCount[=${Cursor.Name}]} && ${Cursor.Stackable} && ${Cursor.FreeStack}))) {
  227. /if (${LootForageSpam}) /echo NINJADVLOOT ++ Kept foraged ${ForagedItem}.
  228. /autoinventory
  229. /delay 5
  230. }
  231. }
  232. /if (${Cursor.ID}) /goto :MoreToAutoInventory
  233. /return
  234.  
  235. | **************** Search Loot Section ******************** |
  236. Sub DoLootStuff(LootAction)
  237. /declare i int local
  238. /declare j int local
  239. /declare k int local
  240. /declare LootItem string
  241. /if (${OpenAllBags}) {
  242. /echo Opening all bags
  243. /keypress OPEN_INV_BAGS
  244. }
  245. /call NPC "${Target.CleanName}"
  246. | Top level inv has its own loop since ${FindItem[=${ItemToSell}].InvSlot} looks at top lev inv slots first in Sub SellToVendor for the item to sell.
  247. | Loop through top level inventory slots for sellable items
  248. /for k 1 to 10
  249. | Check if top level inv slot is not a container/bag
  250. /if (${InvSlot[pack${k}].Item.Container}==0) {
  251. | If top level inv slot is empty check for an item marked sell
  252. /if (${InvSlot[pack${k}].Item.ID}) {
  253. /varset LootItem ${InvSlot[pack${k}].Item}
  254. /if (${LootAction.Equal[sell]}) {
  255. /if (${Ini[${NinjaIniFile},"${LootItem.Left[1]}","${LootItem}"].Equal[Sell]}) /call SellToVendor "${LootItem}"
  256. }
  257. /if (${LootAction.Equal[deposit]}) {
  258. /if (${Ini[${NinjaIniFile},"${LootItem.Left[1]}","${LootItem}"].Equal[Keep]}) /call DepositToGuildBank "${LootItem}"
  259. }
  260. }
  261. }
  262. /next k
  263. | Loop through top level inventory slots for containers
  264. /for i 1 to 10
  265. | Check if top level inv slot has a bag
  266. /if (${InvSlot[pack${i}].Item.Container}==0) /next i
  267. | Set j 1 to number of bag slots and loop through slots looking for items marked sell
  268. /for j 1 to ${InvSlot[pack${i}].Item.Container}
  269. /if (${InvSlot[pack${i}].Item.Item[${j}].ID}) {
  270. /varset LootItem ${InvSlot[pack${i}].Item.Item[${j}].Name}
  271. /if (${LootAction.Equal[sell]}) {
  272. /if (${Ini[${NinjaIniFile},"${LootItem.Left[1]}","${LootItem}"].Equal[Sell]}) /call SellToVendor "${LootItem}"
  273. }
  274. /if (${LootAction.Equal[deposit]}) {
  275. /if (${Ini[${NinjaIniFile},"${LootItem.Left[1]}","${LootItem}"].Equal[Keep]}) /call DepositToGuildBank "${LootItem}"
  276. }
  277. }
  278. /next j
  279. /next i
  280.  
  281. /if (${OpenAllBags}) {
  282. /echo Closing all bags
  283. /keypress CLOSE_INV_BAGS
  284. }
  285. | Prevent spam from Sell event after selling items in Sub SellStuff
  286. /doevents flush Sell
  287. /if (${Window[MerchantWnd].Open}) {
  288. /echo Closing merchant window
  289. /nomodkey /notify MerchantWnd MW_Done_Button LeftMouseUp
  290. }
  291. /if (${Window[GuildBankWnd].Open}) {
  292. /echo Closing guildbank window
  293. /keypress esc
  294. }
  295. /return
  296.  
  297. Sub NPC(NPCName)
  298. /target npc ${NPCName}
  299. /delay 1s
  300. /if (!${Select[${Target.Type},npc,pet]} || !${Target.ID} || ${Target.Type.Equal[pet]} && !${Target.CleanName.Find[familiar]}) {
  301. /echo Please target a vendor or guildbanker
  302. /return
  303. }
  304. /echo Doing business with ${NPCName}
  305. /target id ${Spawn[${NPCName}].ID}
  306. /delay 3s ${Target.ID}==${Spawn[${NPCName}].ID}
  307. /if (${Target.Distance}>15) {
  308. /moveto id ${Spawn[${NPCName}].ID}
  309. /delay 250 ${MoveTo.Stopped}
  310. }
  311. /face nolook
  312. /delay 1s
  313. /echo Opening merchant/guildbank window
  314. /nomodkey /click right target
  315. /echo Waiting 5s for merchant/guildbank window to populate
  316. /delay 5s
  317. /return
  318.  
  319. | **************** Sell Loot Section ******************** |
  320. Sub Event_Sell(string soldstr, string ItemName)
  321. /if ( ${AddNewSales} ) {
  322. /echo Setting ${ItemName} to sell
  323. /ini "${NinjaIniFile}" "${ItemName.Left[1]}" "${ItemName}" Sell
  324. }
  325. /return
  326.  
  327. Sub SellToVendor(ItemToSell)
  328. /if (${Window[MerchantWnd].Open}) {
  329. :sell
  330. /echo Selling ${ItemToSell}
  331. /nomodkey /itemnotify ${FindItem[=${ItemToSell}].InvSlot} leftmouseup
  332. /delay 5
  333. /nomodkey /shiftkey /notify merchantwnd MW_Sell_Button leftmouseup
  334. /delay 2s
  335. /if (${FindItem[${itemToSell}].InvSlot}) /goto :sell
  336. }
  337. /return
  338.  
  339. | **************** Deposit Loot Section ********************
  340. Sub DepositToGuildBank(ItemToDeposit)
  341. /if (${Window[GuildBankWnd].Open}) {
  342. :deposit
  343. /if (${Window[GuildBankWnd].Child[GBANK_DepositCountLabel].Text.Arg[2,:]}==0) {
  344. /echo Guildbank Deposited Items is full.
  345. /return
  346. }
  347. /if (${FindItem[=${ItemToDeposit}].InvSlot}<=22) /return
  348. /echo Depositing ${ItemToDeposit}
  349. /nomodkey /shiftkey /itemnotify ${FindItem[=${ItemToDeposit}].InvSlot} leftmouseup
  350. /delay 5
  351. /nomodkey /notify GuildBankWnd GBANK_DepositButton leftmouseup
  352. /delay 2s
  353. /if (${FindItem[${itemToSell}].InvSlot}) /goto :deposit
  354. }
  355. /return
  356.  
  357. | **************** Item set ini file event ********************
  358. Sub Event_EditIniItem(ItemString,ItemAction,ItemName)
  359. /if (${Cursor.ID}) {
  360. /echo -- Setting ${ItemName} to ${ItemAction}
  361. /ini "${NinjaIniFile}" ${ItemName.Left[1]} "${ItemName}" ${ItemAction}
  362. } else {
  363. /echo No item on cursor.
  364. }
  365. /return
  366.  
  367. | **************** Sell Stuff Event ********************
  368. Sub Event_SellStuff
  369. /call DoLootStuff sell
  370. /return
  371.  
  372. | **************** Deposit Stuff Event *******************
  373. Sub Event_DepositStuff
  374. /call DoLootStuff deposit
  375. /return
  376.  
  377. | **************** Broke Event ********************
  378. Sub Event_Broke
  379. /echo You are out of money!
  380. /endmacro
  381. /return
  382.  
  383. | **************** Type Stuff ********************
  384. | Lifted from commonsubs.inc by Armysoldier
  385. Sub Type(InStr)
  386. /declare char string local
  387. /declare loopctr int local
  388. /for loopctr 1 to ${InStr.Length}
  389. /varset char ${InStr.Mid[${loopctr},1]}
  390. /if (!${char.Length}) {
  391. /nomodkey /keypress space chat
  392. } else {
  393. /nomodkey /keypress ${char} chat
  394. }
  395. /next loopctr
  396. /return
  397.  
  398. | **************** Buy Stuff ********************
  399. Sub Buy(string ItemToBuy, int amount)
  400. /declare i int local
  401. | /echo Buying ${ItemToBuy}!
  402. /declare QTY int local
  403. /declare ListItem int local
  404. /varcalc QTY ${amount}-${FindItemCount[${ItemToBuy}]}
  405. /delay 1s
  406. /if (${FindItemCount[${ItemToBuy}]}>= ${amount}) {
  407. /echo I have enough ${ItemToBuy}.
  408. /return
  409. }
  410. /varset ListItem ${Window[MerchantWnd].Child[ItemList].List[=${ItemToBuy},2]}
  411. /if (!${ListItem}) {
  412. /echo couldn't find ${ItemToBuy}
  413. /return
  414. } else {
  415. /notify MerchantWnd ItemList listselect ${ListItem}
  416. /delay 1s
  417. }
  418. /echo Buying ${ItemToBuy} Till I get ${amount}
  419. :Loop
  420. /doevents
  421. /if (${InventoryFull}) /return
  422. /if (${QTY}>1) {
  423. /if (${QTY}>19) {
  424. /Shiftkey /notify merchantwnd MW_Buy_Button leftmouseup
  425. /delay 2s ${FindItemCount[${ItemToBuy}]}>=${QTY}
  426. /echo ${FindItemCount[${ItemToBuy}]} ${ItemToBuy} in inventory
  427. /varcalc QTY ${amount}-${FindItemCount[${ItemToBuy}]}
  428. /delay 3
  429. /if (${QTY}<=0) /return
  430. /goto :Loop
  431. }
  432. /if (${QTY}>0 && ${QTY}<20) {
  433. /for i 1 to ${QTY}
  434. /ctrlkey /notify merchantwnd MW_Buy_Button leftmouseup
  435. /delay 2s ${FindItemCount[${ItemToBuy}]}>=${Math.Calc[${FindItemCount[${ItemToBuy}]}+${i}]}
  436. /echo Buying ${ItemToBuy} ${i} of ${QTY}
  437. /if (${i}>=${QTY}) {
  438. /echo ${FindItemCount[${ItemToBuy}]} ${ItemToBuy} in inventory
  439. /return
  440. }
  441. /next i
  442. /varcalc QTY ${amount}-${FindItemCount[${ItemToBuy}]}
  443.  
  444. }
  445. }
  446. /return
  447.  
  448. Sub ZCheck(float Zcur, float Zdiff)
  449. | Move down if Z distance more than Zcheck due to levitation
  450. /if (${Zcur}>=${Zdiff}) {
  451. /keypress end hold
  452. /delay 10
  453. /keypress end
  454. }
  455. /return
  456.  
  457. Sub Event_InventoryFull
  458. /echo Your Inventory is full. Turning off looting functions.
  459. /varset LootMobs FALSE
  460. /varset InventoryFull 1
  461. /return
  462.  
  463. Sub CreateIni
  464. /if (${Ini[${NinjaIniFile}].Length}) /return
  465. /declare a local Settings|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z
  466. /echo Creating ini file ${NinjaIniFile}
  467. /declare i int local 1
  468. /for i 1 to 27
  469. /ini ${NinjaIniFile} "${a.Arg[${i},|]}" "|===================================" "==================================|"
  470. /next i
  471. /return
  472.  
  473. Sub AlertClear
  474. /squelch /alert clear 25
  475. /squelch /alert clear ${AlertList}
  476. /return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement