Console showing people in room?

Share your scripts and packages with other Mudlet users.
Post Reply
Iktomi
Posts: 46
Joined: Sat Sep 03, 2011 4:00 am

Console showing people in room?

Post by Iktomi »

So I found this awesome script: http://forums.achaea.com/discussion/839 ... ry-console

There's a screenshot in there that shows what it does, but essentially it creates a mini console and shows all items in a room.

My question is, would someone be able to make, or walk me through how to make, one that would show people in a room? I tried taking this same script and changing all the label names and what not, and changing to the gmcp to look at gmcp.Room and the name table, but it didn't work.

I know it's asking a lot, but maybe someone already has something like this that they're willing to share?

tarkenton
Posts: 30
Joined: Thu Feb 07, 2013 7:33 am

Re: Console showing people in room?

Post by tarkenton »

I have three script files for this.

named updatepeople
Event Handler: gmcp.Room.Players
Code: [show] | [select all] lua
function updatepeople()
	my_people = {}
	for k,v in pairs(gmcp.Room.Players) do
      table.insert(my_people, [[<span style="color: ]] .. ndb.getcolor(gmcp.Room.Players[k].name) .. [[">]] .. gmcp.Room.Players[k].name .. [[</span>]])
	end
	whohere = table.concat(my_people,"\n")
	TarxUI.Box4A:echo([[<center><span style="color: red">People in the room: <br></span>]] .. (whohere) .. [[</center>]])
end
named addpeople
Event Handler: gmcp.Room.AddPlayer
Code: [show] | [select all] lua
function addpeople()
   table.insert(my_people, [[<span style="color: ]] .. ndb.getcolor(gmcp.Room.AddPlayer.name) .. [[">]] .. gmcp.Room.AddPlayer.name .. [[</span>]])
   table.insert(my_people, ndb.getcolor(gmcp.Room.AddPlayer.name) .. gmcp.Room.AddPlayer.name)
	whohere = table.concat(my_people,"\n")
	TarxUI.Box4A:echo([[<center><span style="color: red">People in the room: <br></span>]] .. (whohere) .. [[</center>]])
end
named removePeople
Event Handler: gmcp.Room.RemovePeople
Code: [show] | [select all] lua
function removepeople()
	listRemove(my_people,gmcp.Room.RemovePlayer)
	whohere = table.concat(my_people,"\n")
	TarxUI.Box4A:echo([[<center><span style="color: red">People in the room: <br></span>]] .. (whohere) .. [[</center>]])
end
I'll be posting a copy of my UI on Lusternia's forums in a bit, will throw a link here too if you want to see it in action.

Post Reply