Advertisement
FalownPSA

Coffer Opener v0.2

Sep 24th, 2014
597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.10 KB | None | 0 0
  1. -- MAKE A MACRO : /tell <me> check
  2. function open_coffer()
  3.     CofferType = "Velkk Coffer"
  4.     if player.inventory[CofferType] then
  5.     NCoffer = player.inventory[CofferType].count
  6.     bag = windower.ffxi.get_bag_info(0).count
  7.     max = windower.ffxi.get_bag_info(0).max
  8.     spots = max-bag
  9.     if spots > 0 then
  10.     add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..NCoffer..'x '..CofferType..' to open - Inventory('..bag..'/'..max..') ] *-*-*-*-*-*-*-*-*')
  11.     local nextcommand = ""
  12.     for i=1, spots do
  13.         nextcommand = nextcommand .. 'input /item "'..CofferType..'" <me>; wait 2;'
  14.     end
  15.     nextcommand = nextcommand .. 'input /tell '..player.name..' check'
  16.     send_command(nextcommand)
  17.     else
  18.         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Inventory('..bag..'/'..max..') ] *-*-*-*-*-*-*-*-*')
  19.     end
  20.     else
  21.         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ No '..CofferType..' in inventory ] *-*-*-*-*-*-*-*-*')
  22.     end
  23. end
  24.  
  25.  
  26. windower.register_event('chat message', function(original, sender, mode, gm)
  27.     local match
  28.  
  29.                 if sender == player.name then
  30.                     if original == "check" then
  31.                         open_coffer()
  32.                     end
  33.                 end
  34.  
  35.     return sender, mode, gm
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement