This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
xNightmare's profile picture

Terminal Glasses - grabbing playername and displaying on HUD

Started by xNightmare, 17 June 2015 - 04:22 PM
xNightmare #1
Posted 17 June 2015 - 06:22 PM
Hello there,

I've been trying to work on my own little custom HUD for the past day or so, and I was wondering how I could personify it to the extent where the program would be able to detect the name of the player who was wearing the glasses, then being able to display it on the HUD. I have no idea on how this would be achieved, hence why I came here.

I'd appreciate any help here.
The Crazy Phoenix #2
Posted 17 June 2015 - 07:52 PM
There is indeed a method that allows you to get a list of all connected players (however, I cannot remember). It returns an array of all players with the terminal glasses equipped. The command event also includes a player argument, which allows you to know which player issued a certain command. It is however impossible to make a player-specific HUD using only one Terminal Glasses Bridge, you would need multiple to do so.
xNightmare #3
Posted 18 June 2015 - 01:50 AM
Pretty sure it's possible. The "Plastic" program seems to cue the player by name.
doublequestionmark #4
Posted 18 June 2015 - 02:54 AM
Pretty sure it's possible. The "Plastic" program seems to cue the player by name.
if i recall correctly, the plastic program asks you to enter your name during setup
RootSlayers #5
Posted 23 July 2015 - 11:47 PM
Hello there !

To detect the name of the player(s) who wearing the Terminal Glasses you need to call this fonction :


Users = Glasses.getUsers()

Users is the array containing the player name.
Glasses is the T. Glasses object.

I hope this helps :)/>
Edited on 23 July 2015 - 09:47 PM