Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE MudletPackage>
- <MudletPackage version="1.001">
- <TimerPackage>
- <Timer isActive="yes" isFolder="no" isTempTimer="no" isOffsetTimer="no">
- <name>GroupUpdate</name>
- <script>sendGMCP("char.Group.List")</script>
- <command></command>
- <packageName></packageName>
- <time>00:00:10.000</time>
- </Timer>
- </TimerPackage>
- <ScriptPackage>
- <Script isActive="yes" isFolder="no">
- <name>GroupUpdate</name>
- <packageName></packageName>
- <script>-------------------------------------------------
- -- Put your Lua functions here. --
- -- --
- -- Note that you can also use external scripts --
- -------------------------------------------------
- function GroupUpdate()
- --hide all the labels
- for M,K in pairs(GroupieTable) do
- GroupieTable[M]:hide()
- end
- --added test code for sleeping
- MyState = ""
- TheirState = ""
- for k,v in ipairs(gmcp.Char.Group.List) do
- GroupieTable[k]:show()
- if(v.name == gmcp.Char.Status.character_name) then
- --this is what your doing
- MyState = v.position
- elseif(v.position == "Fight") then
- --someone else is fighting
- TheirState = "Fight"
- end
- NameLabel = Geyser.Label:new({
- name = "NameLabel"..tostring(k),
- x = "0", y = "0",
- width = "22%", height = "90%",
- fgColor = "yellow",
- message = [["<left>"..v.name"..</left>]]
- }, GroupieTable[k]) -- this is where we tell it what container to go into
- NameLabel:setColor(0,0,0,0)
- if(v.leader == true) then
- NameLabel:echo("<b><left><span style='color: rgb(255,0,0)'>"..v.name.."</left></b>")
- else
- NameLabel:echo("<left>"..v.name.."</left>")
- end
- GroupInfoLabel = Geyser.Label:new({
- name = "GroupInfoLabel"..tostring(k),
- x = "22%", y = "0",
- width = "13%", height = "90%",
- fgColor = "yellow",
- message = [["<left>"..v.name"..</left>]]
- }, GroupieTable[k]) -- this is where we tell it what container to go into
- GroupInfoLabel:setColor(0,0,0,0)
- GroupInfoLabel:echo("<left>" .. v.race .. "-" .. v.class .. "</left>")
- PositionLabel = Geyser.Label:new({
- name = "PositionLabel"..tostring(k),
- x = "36%", y = "0",
- width = "12%", height = "90%",
- fgColor = "white",
- message = [["<left>"..v.name"..</left>]]
- }, GroupieTable[k]) -- this is where we tell it what container to go into
- PositionLabel:setColor(0,0,0,0)
- if(v.position == "Busy" or v.position == "STUN") then
- PositionLabel:echo("<right><span style='color: rgb(128,0,128)'>" .. v.position .. "</right>")
- elseif(v.position == "Rest") then
- PositionLabel:echo("<right><span style='color: rgb(0,255,0)'>" .. v.position .. "</right>")
- elseif(v.position == "Fight") then
- PositionLabel:echo("<right><span style='color: rgb(255,0,0)'>" .. v.position .. "</right>")
- elseif(v.position == "Stand") then
- PositionLabel:echo("<right><span style='color: rgb(0,255,0)'>" .. v.position .. "</right>")
- else
- PositionLabel:echo("<right>" .. v.position .. "</right>")
- end
- --GroupieTable[k]:echo(v.name.. " " .. v.hp .. "/" .. v.maxhp .. "<br>".. v.mp .. "/" .. v.maxmp .. " " .. v.position .. "<br> " )
- hpbar = Geyser.Gauge:new({
- name="hpbar"..tostring(k),
- x="45%", y="3%",
- width="25%", height="80%",
- },GroupieTable[k])
- hpbar.front:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #f04141, stop: 0.1 #ef2929, stop: 0.49 #cc0000, stop: 0.5 #a40000, stop: 1 #cc0000);
- border-top: 1px black solid;
- border-left: 1px black solid;
- border-bottom: 1px black solid;
- border-radius: 2;
- padding: 3px;]])
- hpbar.back:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FFFFFF, stop: 1 #FFFFFF);
- border-width: 1px;
- border-color: black;
- border-style: solid;
- border-radius: 2;
- padding: 3px;]])
- manabar = Geyser.Gauge:new({
- name="manabar"..tostring(k),
- x="72%", y="3%",
- width="25%", height="80%",
- },GroupieTable[k])
- manabar.front:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #000099, stop: 0.1 #000099, stop: 0.49 #3399ff, stop: 0.5 #0000ff, stop: 1 #0033cc);
- border-top: 1px black solid;
- border-left: 1px black solid;
- border-bottom: 1px black solid;
- border-radius: 2;
- padding: 3px;]])
- manabar.back:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FFFFFF, stop: 1 #FFFFFF);
- border-width: 1px;
- border-color: black;
- border-style: solid;
- border-radius: 2;
- padding: 3px;]])
- temphp = v.hp
- tempmax = v.maxhp
- if(tonumber(temphp)>tonumber(tempmax)) then temphp = tempmax end
- hpbar:setValue(tonumber(temphp),tonumber(tempmax),"<center><font-size ='4px'><span style='color: rgb(0,0,0)'>".. v.hp .. "/" .. v.maxhp .. " HP</center>")
- tempmana = v.mp
- tempmaxmana = v.maxmp
- if(tonumber(tempmana)>tonumber(tempmaxmana)) then tempmana = tempmaxmana end
- if(v.maxmp == null or v.maxmp == nill or v.maxmp == "0") then
- manabar:setValue(1,1,"<center><font-size ='5px'>No MP</center>")
- else
- manabar:setValue(tonumber(tempmana),tonumber(tempmaxmana),"<center><font-size ='4px'><span style='color: rgb(0,0,0)'>".. v.mp .. "/" .. v.maxmp .. "</center>")
- end
- end
- --outside of loop.. report back findings
- if(MyState == "Sleep" and TheirState == "Fight") then
- echo("groupies fighting")
- end
- --end function
- end
- </script>
- <eventHandlerList>
- <string>gmcp.Char.Group.List</string>
- </eventHandlerList>
- </Script>
- </ScriptPackage>
- </MudletPackage>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement