You might need to edit it to get it to work, it's been ripped out of a larger script block.
ppl = ppl or {} ppl.here = ppl.here or {} ppl.track = function(event) if event == "gmcp.Room.Players" then ppl.here = {} for k,v in pairs(gmcp.Room.Players) do if gmcp.Room.Players[k].name ~= gmcp.Char.Status.name then table.insert(ppl.here, gmcp.Room.Players[k].name) --all the names go into this table end end elseif event == "gmcp.Room.RemovePlayer" then listRemove(ppl.here, gmcp.Room.RemovePlayer) else -- gmcp.Room.AddPlayer table.insert(ppl.here, gmcp.Room.AddPlayer.name) end
end -- event handlers registerAnonymousEventHandler("gmcp.Room.AddPlayer", "ppl.track") registerAnonymousEventHandler("gmcp.Room.RemovePlayer", "ppl.track") registerAnonymousEventHandler("gmcp.Room.Players","ppl.track")
You can then iterate table ppl.here for the list of names, eg
for _,v in ppl.here do
echo("\n"..v)
end
Tharos, the Announcer of Delos shouts, "It's near the end of the egghunt and I still haven't figured out how to pronounce Clean-dat-hoo."
How did you get it working? I have tried everything and cant get any of the GMCP room information to get in the box. can we see the finished script pleasee!?
How did you get it working? I have tried everything and cant get any of the GMCP room information to get in the box. can we see the finished script pleasee!?
</code></pre>This is what I used.. <br><br><pre class="CodeBlock"><code>[code]<br><p>function inRoomPlayers()</p><p>-- CREATE A WINDOW </p><p> openUserWindow("Players In Room")<br></p><p> oldRoomID = oldRoomID or 0<br></p><p>-- PULL THE GMCP IN AND CREATE A TABLE OF NAMES (may not be needed but I intend to use this info in other ways later, so I want it in a table) </p><p> if tonumber(gmcp.Room.Info.num) ~= oldRoomID then</p><p> -- If room changes, empty the table and pull in the list of new names </p><p> playersInRoom = {}</p><p> for k,v in pairs(gmcp.Room.Players) do</p><p> if v.name ~= gmcp.Char.Status.name then</p><p> if not table.contains(playersInRoom, v.name) then</p><p> table.insert(playersInRoom, v.name) --all the names go into this table</p><p> end -- Adding players to a table</p><p> end -- Check to make sure your own name isn't added</p><p> end -- Sort through the list</p><p> end -- If the room changes</p><p> oldRoomID = tonumber(gmcp.Room.Info.num)</p><p> clearWindow("Players In Room")<br></p><p> cecho("Players In Room", "<PowderBlue>\n Players Here\n -------------")<br></p><p>-- Add names from table into the Window </p><p> for k, v in ipairs(playersInRoom) do</p><p> cecho("Players In Room", "\n"..v)</p><p> end</p><p>end</p><p>inRoomPlayers()</p><p>[/code]</p>
Also trying to get this to work. Could you put it in pastebin or something easier to copy and paste? Also, should the window just pop up when you add this script?
Also trying to get this to work. Could you put it in pastebin or something easier to copy and paste? Also, should the window just pop up when you add this script?
Too late to edit... I should also let you know I have an alias called WHERE (my var names need work and the overall cleanliness of the code, but I just wanted to get something up and running fairly quickly)
Also trying to get this to work. Could you put it in pastebin or something easier to copy and paste? Also, should the window just pop up when you add this script?
Comments
You can then iterate table ppl.here for the list of names, eg
Results of disembowel testing | Knight limb counter | GMCP AB files
Site: https://github.com/trevize-achaea/scripts/releases
Thread: http://forums.achaea.com/discussion/4064/trevizes-scripts
Latest update: 9/26/2015 better character name handling in GoldTracker, separation of script and settings, addition of gold report and gold distribute aliases.
Did you get it working @Trentillian ?
http://pastebin.com/jU5ESHWP
For removing players when they leave:
http://pastebin.com/UXLA5VzL
For Adding players when they enter:
http://pastebin.com/WB0vB1rE
I have mine triggered to ^Your last login was from domain.*$ to do "inRoomPlayers()"
Throws the windows up and then I arrange them how I want
"lua inRoomPlayers()" on the command line
^where (\w+)$ TO USE: Just type WHERE <PERSON>
http://pastebin.com/11BEKWm8
The Trigger to begin capture:
http://pastebin.com/Kuu9eGmX
The Trigger to end capture:
http://pastebin.com/YGqNmNAx