How to make a player detector logging system using MiscPeripherals?
#1
Posted 14 May 2013 - 10:12 PM
-Star
#2
Posted 14 May 2013 - 11:22 PM
#3
Posted 15 May 2013 - 05:41 AM
#4
Posted 15 May 2013 - 05:43 AM
jllllloyd, on 15 May 2013 - 05:41 AM, said:
while true do event, user = os.pullEvent("player") if player == "StarburstDude" then rs.setOutput("nack", true) end end
#5
Posted 15 May 2013 - 10:42 AM
jllllloyd, on 15 May 2013 - 05:43 AM, said:
jllllloyd, on 15 May 2013 - 05:41 AM, said:
while true do event, user = os.pullEvent("player") if player == "StarburstDude" then rs.setOutput("nack", true) end end
should be something like this
event, user = os.pullEvent("player") if user == "StarburstDude" then -- do something end
#6
Posted 15 May 2013 - 11:39 AM
sasaa_86, on 15 May 2013 - 10:42 AM, said:
event, user = os.pullEvent("player") if user == "StarburstDude" then -- do something end
This would check if it's only for the username "StarburstDude", if you want it to print it on the screen + send out a redstone signal no matter who it is:
while true do event, user = os.pullEvent("player") if user then print(user) rs.setOutput("back", true) -- change back to whatever side you want the redstone signal to be emitted end end
Also, I'm not sure if this is required for the player detector, but make sure you wrap the player detector as a peripheral using
pDetector = peripheral.wrap("left") -- change left to whatever side its on
Again, I'm not familiar with it so I'm not sure if it's required
#7
Posted 16 May 2013 - 03:39 AM
sasaa_86, on 15 May 2013 - 10:42 AM, said:
jllllloyd, on 15 May 2013 - 05:43 AM, said:
jllllloyd, on 15 May 2013 - 05:41 AM, said:
while true do event, user = os.pullEvent("player") if player == "StarburstDude" then rs.setOutput("nack", true) end end
should be something like this
event, user = os.pullEvent("player") if user == "StarburstDude" then -- do something end
#8
Posted 16 May 2013 - 03:42 AM
W00dyR, on 15 May 2013 - 11:39 AM, said:
sasaa_86, on 15 May 2013 - 10:42 AM, said:
event, user = os.pullEvent("player") if user == "StarburstDude" then -- do something end
This would check if it's only for the username "StarburstDude", if you want it to print it on the screen + send out a redstone signal no matter who it is:
while true do event, user = os.pullEvent("player") if user then print(user) rs.setOutput("back", true) -- change back to whatever side you want the redstone signal to be emitted end end
Also, I'm not sure if this is required for the player detector, but make sure you wrap the player detector as a peripheral using
pDetector = peripheral.wrap("left") -- change left to whatever side its on
Again, I'm not familiar with it so I'm not sure if it's required
while true do event, user = os.pullEvent("player") if user then print(user) rs.setOutput("back", true) print("user: " .. user) end end
#9
Posted 16 May 2013 - 05:37 PM
W00dyR, on 15 May 2013 - 11:39 AM, said:
sasaa_86, on 15 May 2013 - 10:42 AM, said:
event, user = os.pullEvent("player") if user == "StarburstDude" then -- do something end
This would check if it's only for the username "StarburstDude", if you want it to print it on the screen + send out a redstone signal no matter who it is:
while true do event, user = os.pullEvent("player") if user then print(user) rs.setOutput("back", true) -- change back to whatever side you want the redstone signal to be emitted end end
Also, I'm not sure if this is required for the player detector, but make sure you wrap the player detector as a peripheral using
pDetector = peripheral.wrap("left") -- change left to whatever side its on
Again, I'm not familiar with it so I'm not sure if it's required
#10
Posted 06 June 2013 - 07:16 PM
Star
#11
Posted 07 June 2013 - 07:00 AM
StarburstDude, on 06 June 2013 - 07:16 PM, said:
Star
Yes, it was explained not to long ago, read up on this topic to get started on that part
#12
Posted 07 June 2013 - 07:04 AM
#13
Posted 07 June 2013 - 08:34 AM
theoriginalbit, on 07 June 2013 - 07:04 AM, said:
Yes, I overread that. My bad
To expand even more: I think you should even be able to use those two functions, do some math and calculate the real time. Seeing as every minecraft day lasts a certain amount of time, by adding a initial "zero" point (like, todays date) you should be able to calculate it.
This would make things a lot harder though and it would be way easier to just use os.day() and os.time() .
#14
Posted 07 June 2013 - 08:46 AM
W00dyR, on 07 June 2013 - 08:34 AM, said:
#15
Posted 07 June 2013 - 11:51 AM
By the way, you do not need to wrap the peripheral in order to receive the events. You don't need to do this for any other peripherals, plus it doesn't even have any way of knowing if it's been wrapped or not.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users