We have CCSensors so that's not a problem at all. And I want to see it on a monitor.
Greets Matthijs
local prox = peripheral.wrap( "<side" )
local visitors = {}
local monitor
--# Find a monitor
for _, name in ipairs( peripheral.getNames() ) do
if peripheral.getType( name ) == "monitor" then
monitor = peripheral.wrap( name )
end
end
while true do
--# Get all targets and then insert them into the visitors table
local targets = prox.getTargets()
for name, _ in pairs( targets ) do
local n = {}
n.name = name
n.timestamp = textutils.formatTime( os.time() )
table.insert( visitors, n )
end
--# Loop through the visitor table and draw the stuff xP
monitor.clear()
for i = 1, #visitors do
monitor.setCursorPos( 1, i )
monitor.write( visitors[i].name .. " | " .. visitors[i].timestamp )
end
end
This is ofcourse very basic and it would go out of the screen if there are too many visitors :P/>
local monitor = peripheral.wrap( "<Side>" )
monitor.clear()
monitor.write( "Hello" )
monitor.setCursorPos( 1, 1 )
local w, h = monitor.getSize()
monitor.setCursorBlink( true )
etc.
You can also redirect the terminal to the monitor, and since you're using CC 1.5 I believe you can still use term.restore :P/>
local monitor = peripheral.wrap( "<Side>" )
term.redirect( monitor )
term.write( "This is going to be written on the monitor" )
term.restore()
term.write( "This is going to be written in the terminal" )
os.loadAPI("ocs/apis/sensor")
local prox = sensor.wrap("side")
oops forgot x)The first line of the above script needs to be changed to:os.loadAPI("ocs/apis/sensor") local prox = sensor.wrap("side")
Of course, replace "side" with the actual side name.
You have to change the "side" into the ACTUAL side, in your case "bottom".
You have to change the "side" into the ACTUAL side, in your case "bottom".
Some people can't read, if you saw that I posted a pastebin. There I have THE GOOD SIDE So I've you just clicked the link you know better by now.
Still is my question what am I doing wrong?
Please calm down, people aren't going to want to reply to YOUR question if you're getting mad at people who try to help you.You have to change the "side" into the ACTUAL side, in your case "bottom".
Some people can't read, if you saw that I posted a pastebin. There I have THE GOOD SIDE So I've you just clicked the link you know better by now.
Still is my question what am I doing wrong?