Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.77 KB | None | 0 0
  1. init start
  2.     REGEX_LOOT          = '^loot of ?a?n? (.-): (.+)$' --TEMP FIX
  3.  local warnItems = {'Batwing Hat','Bonelord Helmet','Broken Visor','Crest of the Deep Seas','Cobra Crown','Crown Helmet','Crusader Helmet','Glacier Mask','Helmet of the Lost','jade Hat','Lightning Headband','Mages Cap','Magma Monocle','Mystic Turban','Royal Helmet','Rubber Cap','Skull Helmet','Terra Hood','Warrior Helmet','Witch Hat','Zaoan Helmet','Blue Robe','Buckle','Calopteryx Cape','Crown Armor','Divine Plate','Dragon Scale Mail','Focus Cape','Glacier Robe','Glooth Cape','Golden Armor','Heat Core','Knight Armor','Lightning Robe','Magic Plate Armor','Magma Coat','Mammoth Fur Cape','Moohtah Plate','Paladin Armor','Red Robe','Skullcracker Armor','Terra Mantle','Zaoan Armor','Zaoan Robe','Alloy Legs','Bast Skirt','Crown Legs','Glacier Kilt','Grasshopper Legs','Knight Legs','Lightning Legs','Magma Legs','Terra Legs','zaoan legs','Boots of Haste','Draken Boots','Guardian Boots','Glacier Shoes','Lightning Boots','Magma Boots','Metal Spats','Pirate Boots','Steel Boots','terra Boots','Zaoan Shoes','Carapace Shield','Crown Shield','Demon Shield','Depth Scutum','Dragon Shield','Mastermind Shield','Phoenix Shield','Shield of Corruption','Tempest Shield','Tower Shield','Vampire Shield','Warriors Shield','Snake Gods Wristguard','Spellbook of Enlightenment','Spellbook of Lost Souls','Spellbook of Mind Control','Spellbook of Warding','Spellscroll of Prophecies','Angelic Axe','Beastslayer Axe','Butchers Axe','Drakinata','Dreaded Cleaver','Execowtioner Axe','Executioner','Fire Axe','Glooth Axe','Glorious Axe','Guardian Halberd','Guardian Axe','Heavy Trident','Hive Scythe','Knight Axe','Mino Lance','Noble Axe','Titan Axe','Vile Axe','War Axe','Warriors Axe','Abyss Hammer','Amber Staff','Banana Staff','Bonebreaker','Chaos Mace','Deepling Squelcher','Crystal Mace','Deepling Staff','Diamond Sceptre','Dragon Hammer','Dragonbone Staff','Glooth Club','Hammer of Wrath','Heavy Mace','Jade Hammer','Metal Bat','Onyx Flail','Pair of Iron Fists','Sapphire Hammer','Shadow Sceptre','Skull Staff','Spiked Squelcher','War Hammer','Serpent Sword','Spike Sword ','Wyvern Fang','Fire Sword','Haunted Blade','Epee','Assassin Dagger','Mercenary Sword','Dragon Slayer','Sai','Relic Sword','Giant Sword','Bloody Edge','Zaoan Sword','Twiceslicer','Demonrage Sword','Berserker','Nightmare Blade','Glooth Blade','Blade of Corruption','Wand of Cosmic Energy','Wand of Defiance','Wand of Draconia','Wand of Everblazing','Wand of Inferno','Wand of Starstorm','Wand of Voodoo','Northwind Rod','Necrotic Rod','Terra Rod','Hailstorm Rod','Springsprout Rod','Underworld Rod','Glacial Rod','Muck Rod','Beetle Necklace','Demonbone Amulet','Gearwheel Chain','Glacier Amulet','Lightning Pendant','Magma Amulet','Necklace of the Deep','Platinum Amulet','Sacred Tree Amulet','Shockwave Amulet','Stone Skin Amulet','Terra Amulet','Wailing Widows Necklace','Broken Ring of Ending','Death Ring','Gold Ring','Life Ring','Might Ring','Ring of Healing','Ring of Wishes','Stealth Ring','Time Ring','Black Skull','Bag of Apple Slices','Bamboo Leaves','Carrot on a Stick','Control Unit','Decorative Ribbon','Fist on a Stick','Four-Leaf Clover','Foxtail','Giant Shrimp','Golden Can of Oil','Golden Fir Cone','Harness','Leather Whip','Maxilla Maximus','Reins','Scorpion Sceptre','Tin Key','Sweet Smelling Bait','Bear Paw','Behemoth Claw','Blue Piece of Cloth','Bonelord Eye','Cats Paw','Demon Horn','Dracoyle Statue','Green Piece of Cloth','Luminous Orb','Red Piece of Cloth','Shard','Skeleton Decoration','sniper Gloves','Spider Silk','Tusk','White Piece of Cloth','Yellow Piece of Cloth','Buggy Backpack','Deepling Backpack','Feedbag','Jewelled Backpack','Blood Goblet','Voodoo Doll','Heaven Blossom','Holy Orchid','Hook','Peg Leg','Eye Patch','Piece of Draconian Steel','Piece of Hell Steel','Piece of Royal Steel','Cluster of Solace','Spirit Container','Demonic Essence','Mysterious Voodoo Skull','Blue Crystal Shard','Blue Gem','Giant Shimmering Pearl','Gold Ingot','Green Crystal Shard','Green Gem','Red Gem','Silver Raid Token','Vampire Lord Token','Violet Gem','Yellow Gem'}
  4.  local maxLines = 10 -- max lines to display at once
  5.  
  6.  local lootMsgs = {}
  7. init end
  8.  
  9. setfontstyle('Tahoma', 7, 75, 0xFFFFFF, 1, 0x000000)
  10.  
  11. foreach newmessage m do
  12.  local creature, loot = string.lower(m.content):match(REGEX_LOOT)
  13.  if loot then
  14.   local message, color = m.content, 0xFFFFFF
  15.  
  16.   for k, v in ipairs(warnItems) do
  17.    if loot:find(string.lower(v), 1, false) then
  18.     color = 0xFF0000
  19.     break
  20.    end
  21.   end
  22.  
  23.   table.insert(lootMsgs, 1, {message = message, color = color})
  24.  end
  25. end
  26.  
  27. while #lootMsgs > maxLines do
  28.  table.remove(lootMsgs)
  29. end
  30.  
  31. for k, msg in ipairs(lootMsgs) do
  32.  setfontcolor(msg.color)
  33.  
  34.  drawtext(msg.message, 0, k * 10)
  35. end
  36. setposition($worldwin.left + 3, $worldwin.bottom - #lootMsgs * 10 - 13)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement