Hi there.
im currently googling my ass of about computercraft and player detection now this is fairly easy but my question is, is it only "player detector" from "MiscPeripherals" mod that has the function to get the player NAME? I've seen a tutorial where they use it and they can os.pullEvent("player") and then print the name of the player on computecraft monitor!!
i love the draconic evolution "advanced player detection" block cause you dont have to right click it to make it detect player! but i cant find any info on that block if it can detect player NAME!
0
Computercraft and player detection
Started by KrisRevi, Jun 25 2016 09:32 PM
4 replies to this topic
#1
Posted 25 June 2016 - 09:32 PM
#2
Posted 26 June 2016 - 03:09 AM
Without any extra mods you can use a command computer and use
while true do if command.exec("/testfor @p [r=5,name=KrisRevi]") then print("Found KrisRevi") end endbut I can't think of any way of getting it without MiscPeripherals or a command computer.
Edited by Actiquack322, 26 June 2016 - 03:11 AM.
#3
Posted 26 June 2016 - 05:24 AM
os.pullEvent() doesn't generate event data, it collects it - if no one clicks the detector block then the script sits on that line until someone does.
Usually the sensors from OpenCCSensors or OpenPeripheral are used to find players within a given area.
Usually the sensors from OpenCCSensors or OpenPeripheral are used to find players within a given area.
#4
Posted 26 June 2016 - 12:06 PM
Actiquack322, on 26 June 2016 - 03:09 AM, said:
Without any extra mods you can use a command computer and use
while true do if command.exec("/testfor @p [r=5,name=KrisRevi]") then print("Found KrisRevi") end endbut I can't think of any way of getting it without MiscPeripherals or a command computer.
does this scan the entire area/server? or?
#5
Posted 26 June 2016 - 01:26 PM
That particular command checks to see if the closest player, within a radius of five blocks around where the command was executed, has the name of "KrisRevi".
If you want to use a Command Computer for this, you may find this useful. If you want to build the commands yourself, you can read up on the syntax here.
If you want to use a Command Computer for this, you may find this useful. If you want to build the commands yourself, you can read up on the syntax here.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users