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

How would you be able to have a screen somewhere where u can randomly send messages from your computer

Started by Seksan2, 11 August 2012 - 03:05 AM
Seksan2 #1
Posted 11 August 2012 - 05:05 AM
Hello computercraft users
i plan on having a board in my servers spawn that can have messages beemed to it from my computer using a modem
i was wondering if there is any way to do this
ta
seksan2
Cranium #2
Posted 11 August 2012 - 05:18 AM
You can with rednet, but it is limited by distance. What you can do is to use the HTTP API to request the day's messages from a pastebin link. You can even have it update every 5 minutes(or sooner).
Pharap #3
Posted 11 August 2012 - 06:58 AM
I'm assuming you want to be able to have a computer where you just type a message in and it will appear on the monitor at the spawn point?
Seksan2 #4
Posted 11 August 2012 - 08:41 AM
yes pharap so i can be type somethin on my computer and in real time the text on moniroe updates
Stevenseegal #5
Posted 11 August 2012 - 06:31 PM
Funny to see this post. Í had the same toughts and saw this post
http://www.computerc...-board-monitor/

i'm nearly finished with adding monitor support on it and let the client wait for more input until quit is typed


Edit:
I posted the code in his thread because i felt wrong to pretend it's my idea ;)/>/>
Pharap #6
Posted 11 August 2012 - 07:30 PM
That's easy enough to do.

Have the computer by the monitor setup to run the following on the monitor:

args = {...}
MainID = args[1] --ID of computer to expect messages from
do while true
e, id, msg = os.pullEvent()
if e == "rednet_message" and id == MainID then
print(msg)
end
end

and the computer you're using to send messages to it would have a program like this:

args = {...}
MonID = args[1]
msg = args[2]
side = args[3]
rednet.open(side)
rednet.send(MonID, msg)
rednet.close

I'll leave you to tweak it and optimise it, but that's the basic structure.
If you want me to make a more complicated system, I'd need more time, this was cobbled together in about 5 minutes.