Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- make a new script file.. caled UpdateGroup in name at top middle (or right) i think this is the function it will call for the handlers...
- in add user event handler: right side, middle small little text box put "msdp.HEALTH" and press enter
- this means this script will get msdp updates.. and it gets all at once so just really need one to activate
- CODE BELOW:
- -- check if you are in a group right now..
- function in_group()
- count = 0
- for a,b in pairs(msdp.GROUP) do
- count = count + 1
- end
- if count > 1 then
- return true
- end
- return false
- end
- -- how many users in the group? (i check if its above 3-4 so i know its a major xp run so i can ignore some things)
- function groupcount()
- local gcount = 0
- for a,b in pairs(msdp.GROUP) do
- gcount = gcount + 1
- end
- return gcount
- end
- -- check if a user is a member of your group.. so you can do bigger triggers more dynamic
- function group_member(which)
- for a,b in pairs(msdp.GROUP) do
- if b["NAME"] == which then
- return true
- end
- end
- return false
- end
- -- get the name of specific position in your group ie, Leader
- function group_position(which)
- for a,b in pairs(msdp.GROUP) do
- if b["POSITION"] == which then
- return b["NAME"]
- end
- end
- return false
- end
- function makegroup()
- if in_group() ~= true then
- return
- end
- height = 250
- createMiniConsole("GroupWindow",0,0,350,height)
- setMiniConsoleFontSize("GroupWindow", 12)
- setBackgroundColor("GroupWindow",255,200,0,20)
- end
- function pairsByKeys (t, f)
- local a = {}
- for n in pairs(t) do table.insert(a, n) end
- table.sort(a, f)
- local i = 0 -- iterator variable
- local iter = function () -- iterator function
- i = i + 1
- if a[i] == nil then return nil
- else return a[i], t[a[i]]
- end
- end
- return iter
- end
- function cechowin(win,s)
- for colour, text in string.gmatch("<white>"..s, "<([a-z_]+)>([^<>]+)") do
- setFgColor(win, color_table[colour][1], color_table[colour][2], color_table[colour][3])
- echo(win,text)
- stats_linecount = stats_linecount + 1
- end
- --echo(win,"\n")
- end
- -- display stats in window
- function gstats()
- clearWindow("GroupWindow")
- line_count = 0
- for n,e in pairsByKeys(msdp.GROUP) do
- cechowin("GroupWindow",e["NAME"].." ["..e["CLASS"].."]")
- l = string.len(e["NAME"])
- for i = 12 - l, 1, -1 do
- cechowin("GroupWindow"," ")
- end
- hp_color = "white"
- hp_str = " H:<"..hp_color..">"..e["HITPOINTS"].."<white>/"..e["MAX_HITPOINTS"]..""
- cechowin("GroupWindow",hp_str)
- l = string.len(hp_str)
- for i = 29 - l, 1, -1 do
- cechowin("GroupWindow"," ")
- end
- mana_color = "white"
- mp_str = " M:<"..mana_color..">"..e["MANA"].."<white>/"..e["MAX_MANA"]..""
- cechowin("GroupWindow",mp_str)
- l = string.len(mp_str)
- for i = 29 - l, 1, -1 do
- cechowin("GroupWindow"," ")
- end
- move_color = "white"
- mv_str = " V:<"..move_color..">"..e["MOVES"].."<white>/"..e["MAX_MOVES"]..""
- cechowin("GroupWindow",mv_str)
- l = string.len(mv_str)
- for i = 29 - l, 1, -1 do
- cechowin("GroupWindow"," ")
- end
- cechowin("GroupWindow","\n")
- line_count = line_count + 1
- end
- height = line_count * 20
- createMiniConsole("GroupWindow",0,0,580,height)
- end
- function UpdateGroup()
- stat_linecount = 0
- if in_group() == true and group_hide ~= true then
- makegroup()
- showWindow("GroupWindow")
- clearWindow("GroupWindow")
- gstats()
- if always_invisible == true then
- always_invisible = false
- end
- else
- hideWindow("GroupWindow")
- end
- end
- -------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement