Sartul

envenoming

May 12th, 2013
48
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- the alias
  2. ^envenom (\w.) with (\w.)$
  3. envenoming((matches[2]),(matches[3]))
  4. send("envenom "..matches[2].." with "..matches[3])
  5.  
  6. -- this calls...
  7. -- envenoming() function
  8. -- while simultaneously sending the envenom command to Aetolia
  9.  
  10. function envenoming(hand,venom)
  11. table.insert(_G["envenoming_"]..hand, venom)
  12. enableTimer("fst_envenom")
  13. end
  14.  
  15. -- which turns on this 1 second timer
  16. envenoming_left = nil
  17. envenoming_right = nil
  18. disableTimer("fst_envenom")
  19.  
  20. -- the command sent to Aetolia produces this line if successful
  21.  
  22. ^You wipe some (\w+) onto .+ in your (\w+) hand using your rag\.$
  23.  
  24. -- which runs this script
  25. envenom(matches[2],matches[3])
  26.  
  27. --envenom() is
  28.  
  29. function envenom(venom,hand)
  30.   table.insert("wvenom_"..hand, 1, venom)
  31.   for k,v in ipairs("envenoming_"..hand) do
  32.     if v == matches[2] then
  33.       table.remove("envenoming_"..hand, k)
  34.     end
  35.   end
  36.   if "envenoming_"..hand == nil then
  37.     disableTimer("fst_envenom")
  38.   else
  39.     enableTimer("fst_envenom")
  40.   end
  41. end
RAW Paste Data