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

To-Do List

Started by SwordRecon, 23 December 2012 - 11:01 AM
SwordRecon #1
Posted 23 December 2012 - 12:01 PM
Hello, I am trying to make a to do list with the computer craft mod, i want it to pop up on startup
all i have is:

print(" To-Do List
1.something
2.something else
3.something diffrint")

what else do i have to do?
Doyle3694 #2
Posted 23 December 2012 - 12:06 PM
put it in a file named startup and you are good to go
SwordRecon #3
Posted 23 December 2012 - 12:41 PM
i did, i get:
bios:206: [string "startup"] :1: unfinished string

when i try it
Doyle3694 #4
Posted 23 December 2012 - 01:02 PM
oh. strings wont carry over lines. start and end your print() with [[ and ]], so

print( [[ "To-Do List
1.something
2.something else
3.something different" ]])
SwordRecon #5
Posted 23 December 2012 - 03:08 PM
Thank you soo much Doyle, I have been trying soo many different things, but could not make it work.
SwordRecon #6
Posted 23 December 2012 - 03:14 PM
2 more qwestions if your still looking at the thread
1. how do i make a moniter say welcome?
2. can i use rednet to send "E-mails" to other computers and have other people see them?
remiX #7
Posted 23 December 2012 - 10:05 PM
For monitors to work, you need to wrap them:

monitor = peripheral.wrap("left")  -- where the monitor would be on the left
and then to write stuff on it:

monitor.write("Welcome")  -- will display 'welcome' in the very top left of the monitor.
-- to write more stuff on the next line, you will need to change the cursor position, as it does not do this automatically.

And about the E-mails, yes you can, using Rednet. Check the programs sections, there are some e-mail programs there.
SwordRecon #8
Posted 24 December 2012 - 08:51 AM
thx
SwordRecon #9
Posted 24 December 2012 - 10:17 AM
how do you change the cursor position?
PixelToast #10
Posted 24 December 2012 - 10:24 AM
how do you change the cursor position?
the monitor api
Zambonie #11
Posted 25 December 2012 - 05:23 AM
I you want to change the cursor pos. then type:

term.setCursorPos(21,9)

That sets the text to the center.

If you type in: print("Calculater") or something there,It will be in the center when you run the program.Some text,which are ussaly for text with diffrent numbers,It will not be in the center.So you proboly want to change the (21,9)

Tip:The first number,21,is how far on that line.Its what makes it in the middle of the line.Thats what you want to change if you text is not in the center.The 9,tells it what line you want it to be.9 is the center on an computer.If you want to change it on what line it is,thats the number you want to change.

Tell me if this helped!
PixelToast #12
Posted 25 December 2012 - 06:00 AM
how i usually do it:
make a render function

function render(msg)
local Mx,My=term.getSize()
term.setCursorPos(math.floor((Mx/2)-msg/2),math.floor(My/2))
term.write(msg)
end
make a function that wraps it to a monitor

monitor=peripheral.wrap("right")
function mrender(func, ... )
func( ... )
term.redirect(monitor)
func( ... )
term.restore()
end
then run this whenever i need it:

mrender(render,"herrow")

now you are ready to make things show on the monitor AND the computer at the same time :D/>
see my disk player and its source code