Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. function get_mobs_list(event)
  2. if gmcp.Char.Items.List.location ~= "inv" then
  3. if not mobs_in_room then mobs_in_room = {} end
  4. if event == "gmcp.Char.Items.List" then
  5. mobs_in_room = {}
  6. for i,v in pairs(gmcp.Char.Items.List.items) do
  7. if v.attrib ~= "t" and v.attrib ~= "mdt" then
  8. mobs_in_room[tonumber(v.id)] = v.name
  9. end
  10. end
  11. elseif event == "gmcp.Char.Items.Remove" then
  12. for i,v in pairs(mobs_in_room) do
  13. if tonumber(i) == tonumber(gmcp.Char.Items.Remove.item.id) then
  14. mobs_in_room[i] = nil
  15. end
  16. end
  17. else
  18. if gmcp.Char.Items.Add.location == "room" and gmcp.Char.Items.Add.item.attrib ~= "t" and gmcp.Char.Items.Add.item.icon ~= "guard" then
  19. mobs_in_room[gmcp.Char.Items.Add.item.id] = gmcp.Char.Items.Add.item.name
  20. end
  21. end
  22.  
  23. agui_denizens_tracker:clear()
  24. for i,v in pairs(mobs_in_room) do
  25. if tonumber(i) == target then
  26. agui_denizens_tracker:cecho("<white>[<red>"..string.rep(" ", 6-string.len(i))..i.."<white>] <yellow>"..v.."\n")
  27. else
  28. agui_denizens_tracker:cecho("<white>[<green>"..string.rep(" ", 6-string.len(i))..i.."<white>] <yellow>"..v.."\n")
  29. end
  30. end
  31.  
  32. raiseEvent("targets updated")
  33. end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement