Advertisement
Guest User

pquaff fixed

a guest
Aug 30th, 2015
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.05 KB | None | 0 0
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <!DOCTYPE muclient>
  3. <!-- $Id$ -->
  4. <!-- Saved on Monday, August 07, 2006, 1:30 PM -->
  5. <!-- MuClient version 3.74 -->
  6.  
  7. <!-- Plugin "PotionQuaffer v2" generated by Plugin Wizard -->
  8.  
  9. <muclient>
  10. <plugin
  11. name="PotionQuafferv2"
  12. author="Onoitsu2/Bottomfeeder"
  13. id="59358039c72bc395fb31922e"
  14. language="Lua"
  15. purpose="Ease Potion Quaffing and Total Remaining and Reporting To Group"
  16. save_state="y"
  17. date_written="2006-08-07 12:30:21"
  18. requires="3.74"
  19. version="1.3"
  20. >
  21. <description trim="n">
  22. <![CDATA[
  23. PotionQuafferv2 Helpfile
  24. EQUAL SIGNS are OPTIONAL, and SPACES between command, equals, and value are also OPTIONAL!!
  25. All Commands Are CaSe Insensitive!!
  26.  
  27. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  28. Onoitsu2 did all the heavy lifting, I just worked out a couple bugs and added the buffpot
  29. crap into the mix. -Bottomfeeder
  30. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  31.  
  32. healpot (short: hp)- gets set heal potion from set bag, and quaffs it
  33. manapot (short: mp)- gets set mana potion from set bag, and quaffs it
  34. buffpot (short: bp)- gets set an auxillary buff potion from set bag, and quaffs it
  35.  
  36. potionbag = NAME - sets the name of the bag to retrive potions from
  37. (can be none, use a space for NAME i.e. potionbag = )
  38.  
  39. healpot = NAME - sets the name to use to retrieve and quaff heal potions
  40. (i.e. jade elixir)
  41. healdesc = DESC - sets the heal description to use to autoset values using pots command
  42. (i.e. Jade Elixir)
  43.  
  44. manapot = NAME - sets the name to use to retrieve and quaff mana potions
  45. (i.e. tea)
  46. manadesc = DESC - sets the mana description to use to autoset values using pots command
  47. (i.e. Green Herbal Tea)
  48.  
  49. ---
  50. buffpot = NAME - sets the name to use to retrieve and quaff buff potions
  51. (i.e. refreshing)
  52. buffdesc = DESC - sets the buff description to use to autoset values using pots command
  53. (i.e. Refreshing Idea)
  54. ---
  55.  
  56. healnum = # - sets number of heal pots manually if not automatically done when examined bag
  57. mananum = # - sets number of mana pots manually if not automatically done when examined bag
  58. buffnum = # - sets number of buff pots manually if not automatically done when examined bag
  59.  
  60. pots - examines bag set, and sets potion numbers to those detected
  61. (auto detect only work if you can see it in the bag, WITHOUT
  62. having to 'press enter to continue'
  63.  
  64. potgalert (on|off) - turns on or off the alert to gtell channel of how
  65. many potions remain (sent after each potion use)
  66.  
  67. pquaff list - lists current settings for plugin
  68.  
  69. pquaff help - displays this help file
  70.  
  71. pquaff clear - to be used ONLY if this plugin stops functioning properly,
  72. his will clear ALL settings to being as if you are
  73. installing the plugin for the first time.
  74.  
  75. buy (#) (heal|mana|buff) - will attempt to buy # of heal or mana pots, from
  76. the current store,
  77. THE NUMBER IS OPTIONAL, AND OMITTING IT WILL ATTEMPT TO BUY 1 POTION
  78.  
  79. Recommended Ideas:
  80. If you use the numberpad to move about in the game, you know the simplicity of it,
  81. and how fast it is... Well go into the Keypad settings for the world
  82. (Ctrl + Shift + 1 [ONE]) and CHECK 'Show Contents If CTRL Held Down'
  83. Once checked, look at the values for the keypad, and set one of these
  84. to healpot OR manapot, and then UNCHECK What you just checked, and hit OK,
  85. then when moving about all you need is to hit CTRL and the keypad number you set
  86. To use a heal potion, or mana potion.
  87.  
  88. ]]>
  89. </description>
  90.  
  91. </plugin>
  92.  
  93.  
  94. <!-- Get our standard constants -->
  95.  
  96. <include name="constants.lua"/>
  97.  
  98. <!-- Triggers -->
  99.  
  100. <triggers>
  101. <trigger
  102. enabled="y"
  103. expand_variables="y"
  104. ignore_case="y"You buy((\s(.*)\s\*\s)|\sa\s)(?:@healdesc) from (.*) for (.*) gold
  105. match="^You buy((\s(.*)\s\*\s)|\sa\s)(?:@healdesc) from (.*) for (.*) gold.$"
  106. name="Shop_Heal"
  107. regexp="y"
  108. script="Shop_Heal"
  109. sequence="50"
  110. >
  111. </trigger>
  112. <trigger
  113. enabled="y"
  114. expand_variables="y"
  115. ignore_case="y"
  116. match="^You buy((\s(.*)\s\*\s)|\sa\s)(?:@manadesc) from (.*) for (.*) gold.$"
  117. name="Shop_Mana"
  118. regexp="y"
  119. script="Shop_Mana"
  120. sequence="50"
  121. >
  122. </trigger>
  123. <trigger
  124. enabled="y"
  125. expand_variables="y"
  126. ignore_case="y"
  127. match="^You buy((\s(.*)\s\*\s)|\sa\s)(?:@buffdesc) from (.*) for (.*) gold.$"
  128. name="Shop_Buff"
  129. regexp="y"
  130. script="Shop_Buff"
  131. sequence="50"
  132. >
  133. </trigger>
  134. <trigger
  135. enabled="y"
  136. expand_variables="y"
  137. ignore_case="y"
  138. match="^You receive (@healdesc) from (.*?)\.$"
  139. name="Handed_Heal"
  140. regexp="y"
  141. script="Handed_Heal"
  142. sequence="50"
  143. >
  144. </trigger>
  145. <trigger
  146. enabled="y"
  147. expand_variables="y"
  148. ignore_case="y"
  149. match="^You receive (@manadesc) from (.*?)\.$"
  150. name="Handed_Mana"
  151. regexp="y"
  152. script="Handed_Mana"
  153. sequence="50"
  154. >
  155. </trigger>
  156. <trigger
  157. enabled="y"
  158. expand_variables="y"
  159. ignore_case="y"
  160. match="^You receive (@buffdesc) from (.*?)\.$"
  161. name="Handed_Buff"
  162. regexp="y"
  163. script="Handed_Buff"
  164. sequence="50"
  165. >
  166. </trigger>
  167. <trigger
  168. enabled="n"
  169. group="PotionMonitor"
  170. match="^\[Enter key for more or \'q\' to stop\]$"
  171. name="AutoEnter"
  172. omit_from_output="y"
  173. regexp="y"
  174. send_to="12"
  175. sequence="1"
  176. >
  177. <send>SendNoEcho("")</send>
  178. </trigger>
  179. <trigger
  180. enabled="n"
  181. expand_variables="y"
  182. group="PotionMonitor"
  183. ignore_case="y"
  184. match="^\s*\((\s\d|\d*)\)\s(?:\((\w+)\))*\s*(@healdesc)\s\((.*)\)$"
  185. name="Locate_Heal"
  186. regexp="y"
  187. script="Heal_Found"
  188. sequence="50"
  189. >
  190. </trigger>
  191. <trigger
  192. enabled="n"
  193. expand_variables="y"
  194. group="PotionMonitor"
  195. ignore_case="y"
  196. match="^\s*\((\s\d|\d*)\)\s(?:\((\w+)\))*\s*(@manadesc)\s\((.*)\)$"
  197. name="Locate_Mana"
  198. regexp="y"
  199. script="Mana_Found"
  200. sequence="50"
  201. >
  202. </trigger>
  203. <trigger
  204. enabled="n"
  205. expand_variables="y"
  206. group="PotionMonitor"
  207. ignore_case="y"
  208. match="^\s*\((\s\d|\d*)\)\s(?:\((\w+)\))*\s*(@buffdesc)\s\((.*)\)$"
  209. name="Locate_Buff"
  210. regexp="y"
  211. script="Buff_Found"
  212. sequence="50"
  213. >
  214. </trigger>
  215. </triggers>
  216.  
  217. <!-- Aliases -->
  218.  
  219. <aliases>
  220. <alias
  221. name="Buy_Heal_Pots"
  222. match="^buy(\s(\d{0,}))? heal$"
  223. enabled="y"
  224. expand_variables="y"
  225. regexp="y"
  226. send_to="12"
  227. ignore_case="y"
  228. sequence="100"
  229. >
  230. <send>if string.lower("%0") == "buy heal" then
  231. Send("buy '@healpot'")
  232. else
  233. Send("buy %2 '@healpot'")
  234. end -- if
  235. if GetVariable("potionbag") ~= "" and GetVariable("potionbag") ~= nil then
  236. SendNoEcho("put 'all.@healpot' '@potionbag'")
  237. end -- if
  238. --Note("Type 'pots' for auto detection of potions, or 'healnum #'")</send>
  239. </alias>
  240. <alias
  241. name="Buy_Mana_Pots"
  242. match="^buy(\s(\d{0,}))? mana$"
  243. enabled="y"
  244. expand_variables="y"
  245. regexp="y"
  246. send_to="12"
  247. ignore_case="y"
  248. sequence="100"
  249. >
  250. <send>if string.lower("%0") == "buy mana" then
  251. Send("buy '@manapot'")
  252. else
  253. Send("buy %2 '@manapot'")
  254. end -- if
  255. if GetVariable("potionbag") ~= "" and GetVariable("potionbag") ~= nil then
  256. SendNoEcho("put 'all.@manapot' '@potionbag'")
  257. end -- if
  258. --Note("Type 'pots' for auto detection of potions, or 'mananum #'")</send>
  259. </alias>
  260. <alias
  261. name="Buy_Buff_Pots"
  262. match="^buy(\s(\d{0,}))? buff$"
  263. enabled="y"
  264. expand_variables="y"
  265. regexp="y"
  266. send_to="12"
  267. ignore_case="y"
  268. sequence="100"
  269. >
  270. <send>if string.lower("%0") == "buy buff" then
  271. Send("buy '@buffpot'")
  272. else
  273. Send("buy %2 '@buffpot'")
  274. end -- if
  275. if GetVariable("potionbag") ~= "" and GetVariable("potionbag") ~= nil then
  276. SendNoEcho("put 'all.@buffpot' '@potionbag'")
  277. end -- if
  278. --Note("Type 'pots' for auto detection of potions, or 'buffnum #'")</send>
  279. </alias>
  280. <alias
  281. name="Healpot"
  282. match="^(hp|healpot|healpot\s?\=?\s?(.*?)|healdesc\s?\=?\s?(.*?)|healnum\s?\=?\s?(\d+))$"
  283. enabled="y"
  284. regexp="y"
  285. script="Use_Set_Heal"
  286. omit_from_output="y"
  287. ignore_case="y"
  288. sequence="100"
  289. >
  290. </alias>
  291. <alias
  292. name="Manapot"
  293. match="^(mp|manapot|manapot\s?\=?\s?(.*?)|manadesc\s?\=?\s?(.*?)|mananum\s?\=?\s?(\d+))$"
  294. enabled="y"
  295. regexp="y"
  296. script="Use_Set_Mana"
  297. omit_from_output="y"
  298. ignore_case="y"
  299. sequence="100"
  300. >
  301. </alias>
  302. <alias
  303. name="Buffpot"
  304. match="^(bp|buffpot|buffpot\s?\=?\s?(.*?)|buffdesc\s?\=?\s?(.*?)|buffnum\s?\=?\s?(\d+))$"
  305. enabled="y"
  306. regexp="y"
  307. script="Use_Set_Buff"
  308. omit_from_output="y"
  309. ignore_case="y"
  310. sequence="100"
  311. >
  312. </alias>
  313. <alias
  314. name="PotionBag"
  315. match="^potionbag\s?\=?\s?(.*?)$"
  316. enabled="y"
  317. regexp="y"
  318. script="Potion_Bag_Set"
  319. omit_from_output="y"
  320. ignore_case="y"
  321. sequence="100"
  322. >
  323. </alias>
  324. <alias
  325. name="AlertToggle"
  326. match="^potgalert (on|off)$"
  327. enabled="y"
  328. regexp="y"
  329. script="AlertToggle"
  330. omit_from_output="y"
  331. ignore_case="y"
  332. sequence="100"
  333. >
  334. </alias>
  335. <alias
  336. name="PotsLocate"
  337. match="^pots$"
  338. enabled="y"
  339. regexp="y"
  340. script="Pots_Locate"
  341. omit_from_output="y"
  342. ignore_case="y"
  343. sequence="100"
  344. >
  345. </alias>
  346. </aliases>
  347.  
  348. <!-- Plugin help -->
  349.  
  350. <aliases>
  351. <alias
  352. script="OnHelp"
  353. ignore_case="y"
  354. match="pquaff help"
  355. enabled="y"
  356. >
  357. </alias>
  358. <alias
  359. script="pquaff_clear"
  360. ignore_case="y"
  361. omit_from_command_history="y"
  362. match="pquaff clear"
  363. enabled="y"
  364. >
  365. </alias>
  366. <alias
  367. script="pquaff_list"
  368. ignore_case="y"
  369. match="pquaff list"
  370. enabled="y"
  371. >
  372. </alias>
  373. </aliases>
  374.  
  375. <script>
  376. <![CDATA[
  377.  
  378. function resetvar(var, value, hreset)
  379. if GetVariable(var) == nil or GetVariable(var) == "" or hreset then
  380. SetVariable(var,value)
  381. end -- if
  382. end
  383.  
  384. function Shop_Heal(sName,sLine,wildcards)
  385. local num = tonumber(GetVariable("healnum"))
  386. if tonumber(wildcards[3]) == nil then
  387. num = num + 1
  388. else
  389. num = num + tonumber(wildcards[3])
  390. end -- if
  391. SetVariable("healnum",num)
  392. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  393. end -- Shop_Heal
  394.  
  395. function Shop_Mana(sName,sLine,wildcards)
  396. local num = tonumber(GetVariable("mananum"))
  397. if tonumber(wildcards[3]) == nil then
  398. num = num + 1
  399. else
  400. num = num + tonumber(wildcards[3])
  401. end -- if
  402. SetVariable("mananum",num)
  403. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  404. end -- Shop_Mana
  405.  
  406. function Shop_Buff(sName,sLine,wildcards)
  407. local num = tonumber(GetVariable("buffnum"))
  408. if tonumber(wildcards[3]) == nil then
  409. num = num + 1
  410. else
  411. num = num + tonumber(wildcards[3])
  412. end -- if
  413. SetVariable("buffnum",num)
  414. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  415. end -- Shop_Buff
  416.  
  417. function Handed_Heal(sName,sLine,wildcards)
  418. if GetVariable("potionbag") ~= "" and GetVariable("potionbag") ~= nil then
  419. SendNoEcho("put '" .. GetVariable("healpot") .. "' '" .. GetVariable("potionbag") .. "'")
  420. end -- if
  421. SetVariable("healnum",tonumber(GetVariable("healnum"))+1)
  422. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  423. end -- Handed_Heal
  424.  
  425. function Handed_Mana(sName,sLine,wildcards)
  426. if GetVariable("potionbag") ~= "" and GetVariable("potionbag") ~= nil then
  427. SendNoEcho("put '" .. GetVariable("manapot") .. "' '" .. GetVariable("potionbag") .. "'")
  428. end -- if
  429. SetVariable("mananum",tonumber(GetVariable("mananum"))+1)
  430. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  431. end -- Handed_Mana
  432.  
  433. function Handed_Buff(sName,sLine,wildcards)
  434. if GetVariable("potionbag") ~= "" and GetVariable("potionbag") ~= nil then
  435. SendNoEcho("put '" .. GetVariable("buffpot") .. "' '" .. GetVariable("potionbag") .. "'")
  436. end -- if
  437. SetVariable("buffnum",tonumber(GetVariable("buffnum"))+1)
  438. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  439. end -- Handed_Buff
  440.  
  441. function Pots_Locate(sName,sLine,wildcards)
  442. EnableTriggerGroup("PotionMonitor",true)
  443. SetVariable("healnum",0)
  444. SetVariable("mananum",0)
  445. SetVariable("buffnum",0)
  446. if GetVariable("potionbag") ~= "" and GetVariable("potionbag") ~= nil then
  447. SendNoEcho("examine '" .. GetVariable("potionbag") .. "'")
  448. else
  449. SendNoEcho("inventory")
  450. end -- if
  451. DoAfterSpecial(6,'EnableTriggerGroup("PotionMonitor",false)',12)
  452. if GetVariable("alert") == "on" then
  453. DoAfterSpecial(5,'SendNoEcho("gtell I have @G" .. GetVariable("healnum") .. " @gHeal @YPots Total! (@BPotion_Quaffer @RPlugin@Y)")',12)
  454. DoAfterSpecial(5,'SendNoEcho("gtell I have @G" .. GetVariable("mananum") .. " @CMana @YPots Total! (@BPotion_Quaffer @RPlugin@Y)")',12)
  455. DoAfterSpecial(5,'SendNoEcho("gtell I have @G" .. GetVariable("buffnum") .. " @BBuff @YPots Total! (@BPotion_Quaffer @RPlugin@Y)")',12)
  456. end -- if
  457. end -- Pots_Locate
  458.  
  459. function AlertToggle(sName,sLine,wildcards)
  460. if string.lower(wildcards[1]) == "on" then
  461. ColourNote("white","green","Potion Quaffer Group Alert Enabled!")
  462. SetVariable("alert","on")
  463. else
  464. ColourNote("white","red","Potion Quaffer Group Alert Disabled!")
  465. SetVariable("alert","off")
  466. end -- if
  467. SaveState()
  468. end -- AlertToggle
  469.  
  470. function Potion_Bag_Set(sName,sLine,wildcards)
  471. if GetVariable("potionbag") ~= "" and GetVariable("potionbag") ~= nil then
  472. ColourNote("white","burlywood","Potion Bag Set To: " .. wildcards[1])
  473. ColourNote("white","burlywood"," Previous Bag Was: " .. GetVariable("potionbag"))
  474. SetVariable("potionbag",wildcards[1])
  475. else
  476. ColourNote("white","burlywood","Potion Bag Set To: " .. wildcards[1])
  477. SetVariable("potionbag",wildcards[1])
  478. end -- if
  479. SaveState()
  480. end -- Potion_Bag_Set
  481.  
  482. function Use_Set_Heal(sName,sLine,wildcards)
  483. if string.lower(wildcards[0]) == "healpot" or string.lower(wildcards[0]) == "hp" then
  484. if GetVariable("healpot") == "unknown" or GetVariable("healpot") == nil then
  485. Note("")
  486. Note("Potion Quaffer: Heal Setup")
  487. Note("You must set up this command with the name of a potion")
  488. Note("ie. 'healpot = jade elixir'")
  489. Note("If you will be using the 'pots' command, you also need to set the description")
  490. Note("i.e. 'healdesc = jade elixir'")
  491. else
  492. if tonumber(GetVariable("healnum")) > 0 then
  493. if GetVariable("potionbag") ~= "" and GetVariable("potionbag") ~= nil then
  494. Send("get '" .. GetVariable("healpot") .. "' '" .. GetVariable("potionbag") .. "'")
  495. end -- if
  496. Send("quaff '" .. GetVariable("healpot") .. "'")
  497. SetVariable("healnum",tonumber(GetVariable("healnum"))-1)
  498. if tonumber(GetVariable("healnum")) > 2 then
  499. ColourNote("white","green",GetVariable("healnum") .. " Heal Pot(s) Left!")
  500. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  501. else
  502. ColourNote("white","red",GetVariable("healnum") .. " Heal Pot(s) Left!")
  503. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  504. end -- if
  505. if GetVariable("alert") == "on" then
  506. SendNoEcho("gtell I have @G" .. GetVariable("healnum") .. " @gHeal @YPots @RLeft@Y! (@BPotion_Quaffer @RPlugin@Y)")
  507. end -- if
  508. else
  509. ColourNote("white","red","NO HEAL POTS LEFT!")
  510. if GetVariable("alert") == "on" then
  511. SendNoEcho("gtell @RI AM OUT OF @gHEAL @RPOTS!@Y")
  512. end -- if
  513. end -- if
  514. end -- if
  515. elseif string.sub(string.lower(wildcards[0]),1,8) == "healdesc" then
  516. ColourNote("black","powderblue","Healpot Description (What You See Item As) is: " .. wildcards[3])
  517. SetVariable("healdesc",wildcards[3])
  518. elseif string.sub(string.lower(wildcards[0]),1,7) == "healnum" then
  519. ColourNote("white","green","Number Of Healpots Set To: " .. wildcards[4])
  520. SetVariable("healnum",wildcards[4])
  521. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  522. else
  523. ColourNote("white","green","Healpot set to: " .. wildcards[2])
  524. SetVariable("healpot",wildcards[2])
  525. end -- if
  526. SaveState()
  527. end -- Use_Set_Heal
  528.  
  529. function Use_Set_Mana(sName,sLine,wildcards)
  530. if string.lower(wildcards[0]) == "manapot" or string.lower(wildcards[0]) == "mp" then
  531. if GetVariable("manapot") == "unknown" or GetVariable("manapot") == nil then
  532. Note("")
  533. Note("Potion Quaffer: Mana Setup")
  534. Note("You must set up this command with the name of a potion")
  535. Note("ie. 'manapot = tea'")
  536. Note("If you will be using the 'pots' command, you also need to set the description")
  537. Note("i.e. 'manadesc = green tea'")
  538. else
  539. if tonumber(GetVariable("mananum")) > 0 then
  540. if GetVariable("potionbag") ~= "" then
  541. Send("get '" .. GetVariable("manapot") .. "' '" .. GetVariable("potionbag") .. "'")
  542. end -- if
  543. Send("quaff '" .. GetVariable("manapot") .. "'")
  544. SetVariable("mananum",tonumber(GetVariable("mananum"))-1)
  545. if tonumber(GetVariable("mananum")) > 2 then
  546. ColourNote("white","green",GetVariable("mananum") .. " Mana Pot(s) Left!")
  547. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  548. else
  549. ColourNote("white","red",GetVariable("mananum") .. " Mana Pot(s) Left!")
  550. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  551. end -- if
  552. if GetVariable("alert") == "on" then
  553. SendNoEcho("gtell I have @G" .. GetVariable("mananum") .. " @CMana @YPots @RLeft@Y! (@BPotion_Quaffer @RPlugin@Y)")
  554. end -- if
  555. else
  556. ColourNote("white","red","NO MANA POTS LEFT!")
  557. if GetVariable("alert") == "on" then
  558. SendNoEcho("gtell @I AM OUT OF @CMANA @RPOTS!@Y")
  559. end -- if
  560. end -- if
  561. end -- if
  562. elseif string.sub(string.lower(wildcards[0]),1,8) == "manadesc" then
  563. ColourNote("black","powderblue","Manapot Description (What You See Item As) is: " .. wildcards[3])
  564. SetVariable("manadesc",wildcards[3])
  565. elseif string.sub(string.lower(wildcards[0]),1,7) == "mananum" then
  566. ColourNote("white","green","Number Of Manapots Set To: " .. wildcards[4])
  567. SetVariable("mananum",wildcards[4])
  568. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  569. else
  570. ColourNote("white","green","Manapot set to: " .. wildcards[2])
  571. SetVariable("manapot",wildcards[2])
  572. end -- if
  573. SaveState()
  574. end -- Use_Set_Mana
  575.  
  576. function Use_Set_Buff(sName,sLine,wildcards)
  577. if string.lower(wildcards[0]) == "buffpot" or string.lower(wildcards[0]) == "bp" then
  578. if GetVariable("buffpot") == "unknown" or GetVariable("buffpot") == nil then
  579. Note("")
  580. Note("Potion Quaffer: Buff Setup")
  581. Note("You must set up this command with the name of a potion")
  582. Note("ie. 'buffpot = refreshing'")
  583. Note("If you will be using the 'pots' command, you also need to set the description")
  584. Note("i.e. 'buffdesc = Refreshing Idea'")
  585. else
  586. if tonumber(GetVariable("buffnum")) > 0 then
  587. if GetVariable("potionbag") ~= "" then
  588. Send("get '" .. GetVariable("buffpot") .. "' '" .. GetVariable("potionbag") .. "'")
  589. end -- if
  590. Send("quaff '" .. GetVariable("buffpot") .. "'")
  591. SetVariable("buffnum",tonumber(GetVariable("buffnum"))-1)
  592. if tonumber(GetVariable("buffnum")) > 2 then
  593. ColourNote("white","green",GetVariable("buffnum") .. " Buff Pot(s) Left!")
  594. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  595. else
  596. ColourNote("white","red",GetVariable("buffnum") .. " Buff Pot(s) Left!")
  597. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  598. end -- if
  599. if GetVariable("alert") == "on" then
  600. SendNoEcho("gtell I have @G" .. GetVariable("buffnum") .. " @CBuff @YPots @RLeft@Y! (@BPotion_Quaffer @RPlugin@Y)")
  601. end -- if
  602. else
  603. ColourNote("white","red","NO BUFF POTS LEFT!")
  604. if GetVariable("alert") == "on" then
  605. SendNoEcho("gtell @I AM OUT OF @CBUFF @RPOTS!@Y")
  606. end -- if
  607. end -- if
  608. end -- if
  609. elseif string.sub(string.lower(wildcards[0]),1,8) == "buffdesc" then
  610. ColourNote("black","powderblue","Buffpot Description (What You See Item As) is: " .. wildcards[3])
  611. SetVariable("buffdesc",wildcards[3])
  612. elseif string.sub(string.lower(wildcards[0]),1,7) == "buffnum" then
  613. ColourNote("white","green","Number Of Buffpots Set To: " .. wildcards[4])
  614. SetVariable("buffnum",wildcards[4])
  615. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  616. else
  617. ColourNote("white","green","Buffpot set to: " .. wildcards[2])
  618. SetVariable("buffpot",wildcards[2])
  619. end -- if
  620. SaveState()
  621. end -- Use_Set_Buff
  622.  
  623. function Heal_Found(sName,sLine,wildcards)
  624. if wildcards[1] ~= " " and wildcards[1] ~= "" then
  625. SetVariable("healnum",wildcards[1])
  626. else
  627. SetVariable("healnum",1)
  628. end -- if
  629. ColourNote("white","green",GetVariable("healnum") .. " Heal Potion(s) Detected!")
  630. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  631. SaveState()
  632. EnableTrigger("Heal_Found",false)
  633. end -- Heal_Found
  634.  
  635. function Mana_Found(sName,sLine,wildcards)
  636. if wildcards[1] ~= " " and wildcards[1] ~= "" then
  637. SetVariable("mananum",wildcards[1])
  638. else
  639. SetVariable("mananum",1)
  640. end -- if
  641. ColourNote("white","green",GetVariable("mananum") .. " Mana Potion(s) Detected!")
  642. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  643. SaveState()
  644. EnableTrigger("Mana_Found",false)
  645. end -- Mana_Found
  646.  
  647. function Buff_Found(sName,sLine,wildcards)
  648. if wildcards[1] ~= " " and wildcards[1] ~= "" then
  649. SetVariable("buffnum",wildcards[1])
  650. else
  651. SetVariable("buffnum",1)
  652. end -- if
  653. ColourNote("white","green",GetVariable("buffnum") .. " Buff Potion(s) Detected!")
  654. SetStatus("[PotionQuaffer v2] Heals: " .. GetVariable("healnum") .. " Manas: " .. GetVariable("mananum") .. " Buffs: " .. GetVariable("buffnum"))
  655. SaveState()
  656. EnableTrigger("Buff_Found",false)
  657. end -- Buff_Found
  658.  
  659. function pquaff_reset(hreset)
  660. resetvar("healnum", 0, hreset)
  661. resetvar("healpot", "unknown", hreset)
  662. resetvar("healdesc", "unknown", hreset)
  663. resetvar("mananum", 0, hreset)
  664. resetvar("manapot", "unknown", hreset)
  665. resetvar("manadesc", "unknown", hreset)
  666. resetvar("buffnum", 0, hreset)
  667. resetvar("buffpot", "unknown", hreset)
  668. resetvar("buffdesc", "unknown", hreset)
  669. resetvar("potionbag", "unknown", hreset)
  670. resetvar("alert", "off", hreset)
  671. SaveState()
  672. end
  673.  
  674. function OnPluginInstall()
  675. pquaff_reset()
  676. OnHelp()
  677. end
  678.  
  679. function OnHelp ()
  680. Note (GetPluginInfo (GetPluginID (), 3))
  681. end
  682.  
  683. function pquaff_clear(sName,sLine,wildcards)
  684. pquaff_reset(true)
  685. ColourNote("white","red","ALL POTION QUAFFER SETTINGS REMOVED!!")
  686. ColourNote("white","red","Reloading Plugin in 2 seconds...")
  687. DoAfterSpecial(2,'ReloadPlugin("59358039c72bc395fb31922e")',12)
  688. end -- pquaff_clear
  689.  
  690. function pquaff_list(sName,sLine,wildcards)
  691. ColourNote("blue","black","PotionQuaffer:","red","black"," Heal Potion = ","darkred","black",GetVariable("healpot"))
  692. ColourNote("blue","black","PotionQuaffer:","red","black"," Heal Description = ","darkred","black",GetVariable("healdesc"))
  693. ColourNote("blue","black","PotionQuaffer:","red","black"," Heals Remaining = ","darkred","black",GetVariable("healnum"))
  694.  
  695. ColourNote("blue","black","PotionQuaffer:","deepskyblue","black"," Mana Potion = ","blue","black",GetVariable("manapot"))
  696. ColourNote("blue","black","PotionQuaffer:","deepskyblue","black"," Mana Description = ","blue","black",GetVariable("manadesc"))
  697. ColourNote("blue","black","PotionQuaffer:","deepskyblue","black"," Manas Remaining = ","blue","black",GetVariable("mananum"))
  698.  
  699. ColourNote("blue","black","PotionQuaffer:","lightgreen","black"," Buff Potion = ","green","black",GetVariable("buffpot"))
  700. ColourNote("blue","black","PotionQuaffer:","lightgreen","black"," Buff Description = ","green","black",GetVariable("buffdesc"))
  701. ColourNote("blue","black","PotionQuaffer:","lightgreen","black"," Buffs Remaining = ","green","black",GetVariable("buffnum"))
  702.  
  703. ColourNote("blue","black","PotionQuaffer:","lightblue","black"," Potion Bag = ","darkblue","black",GetVariable("potionbag"))
  704. ColourNote("blue","black","PotionQuaffer:","lightblue","black"," Group Alert = ","darkblue","black",GetVariable("alert"))
  705. Note("")
  706. end -- pquaff_list
  707.  
  708. function getmemoryusage()
  709. return collectgarbage('count')
  710. end
  711. ]]>
  712. </script>
  713.  
  714. </muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement