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

Stuck...

Started by spaites, 10 October 2012 - 03:02 AM
spaites #1
Posted 10 October 2012 - 05:02 AM
I need help making a code.
I'm trying to make like a to do board, and was wondering how to enter a task, and it would magicly pop it up on the monitor.
Please help.

P.S. the server i'm playing on is abit glitchy.
PixelToast #2
Posted 10 October 2012 - 05:13 AM
http://computercraft.info/wiki/index.php?title=Peripheral_%28API%29#Monitor

sould help
spaites #3
Posted 10 October 2012 - 05:39 AM

mon = peripheral.wrap("left")
mon.write("stuff")
My code :P/>/>
hope it helps.
JoshhT #4
Posted 10 October 2012 - 08:24 AM
Little demo code for you, uses two files. One of which, you simply type your todo list into.
The other, you run when you want to print the todo list. Simple to setup so it prints to a monitor.

Create a file called something like "todolist". This can be whatever you want it to be really, just remember it.
(This file will contain your list.)

Now create a file called something like "todo". Again, this can be whatever you want, but todo makes sense.

Now inside "todo", type this.


file = fs.open("todolist", "r") -- todolist is whatever you named the other file.
local list = {}
local line = file.readLine()

repeat
table.insert(list, line)
line = file.readLine()
until line == nil

file.close()

for i, v in pairs(list) do
  textutils.slowPrint(v)
  sleep(0.5)
end

Also, this is the incorrect section for this thread.
It belongs here.
spaites #5
Posted 10 October 2012 - 10:26 PM
Do I write exactly that? Or do I write something different in the (list) and (line) parts?
Thanks
JoshhT #6
Posted 14 October 2012 - 07:28 AM
Do I write exactly that? Or do I write something different in the (list) and (line) parts?
Thanks
I'm sorry what don't you understand exactly?
Just make a file called "todolist" and type in your list of things to do.
Each line being one thing todo.

Then make a new file called "todo" and put that exact code into it.
spaites #7
Posted 16 October 2012 - 05:49 AM
I've done that, and it didn't work.
I'll try it again.
Mads #8
Posted 16 October 2012 - 06:22 PM
Ain't this in the wrong section?