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

[question][maybe lua related?]monitor question

Started by iganga, 19 September 2012 - 03:12 AM
iganga #1
Posted 19 September 2012 - 05:12 AM
ok im new to computer craft, and barely know html…so today i spent..shamed to admit….3 hours working on a code…and not even a hard code.

i just kept getting errors, then figured out what the number next to the error meant, (the line it was on..DOH!) and removed those lines eventually.


anyway heres my code

–i named it a-1 with "edit a-1" which i guess creates the program if it isnt already one?


mon = peripheral.wrap("right")
mon.setTextScale(3)
term.redirect(mon)
print("—————") –believe it or not thats is the correct amount of dashes–
print(" NOW ENTERING ") — each print has 15 characters–
print(" 'THE LABS' ")
print("—————")
term.restore()



now the code works, to run it on the monitor i use

monitor (side) (program) (arguments)

monitor right a-1 (i dont know what to put here, but it works when i dont write anything)


when i run the program it shows up on the monitor, but when i leave the server, and come back i have to run the program again.

how do i make it stay on the monitor permanently, or until i remove it?

and if i cant make it stay how do i make a "lock" for the computer, so only i can access it and put the program up, or people with admin/moderator rights?

i really dont know how to give a user admin/moderator rights, but when i do, it would work..probably..maybe..i have no freakin clue!
Mtdj2 #2
Posted 19 September 2012 - 09:05 AM
Uhm, first of all, you need to remove the – at the end of your comments, they are not needed. Second, you just run your code like: "a-1" , no messing with the monitor program (Because of the term.redirect()). Lemme fix:

mon = peripheral.wrap("right")
mon.setTextScale(3)
term.redirect(mon)
print("---------------") --believe it or not thats is the correct amount of dashes
print(" NOW ENTERING ") --- each print has 15 characters
print(" 'THE LABS' ")
print("---------------")
term.restore()

Run "a-1" for workingness.
Hope this helped.
PS: Saw what your problem were… Just name the program "startup"… And for the lock, use some bukkit plugin…
Cranium #3
Posted 19 September 2012 - 05:01 PM
You can create a program labelled startup with just one line- shell.run("a-1"), or you can rename "a-1" to "startup"
iganga #4
Posted 19 September 2012 - 06:45 PM
You can create a program labelled startup with just one line- shell.run("a-1"), or you can rename "a-1" to "startup"

Thanks cranium. Worked perfectly.

I recreated it and named it startup.







1.) Uhm, first of all, you need to remove the – at the end of your comments, they are not needed. Second, you just run your code like: "a-1" , no messing with the monitor program (Because of the term.redirect()).

2.) Run "a-1" for workingness.
Hope this helped.
3.)PS: Saw what your problem were… Just name the program "startup"… And for the lock, use some bukkit plugin…

1.) it doesnt matter if i have the – at the end or not, it doesn't change the fact that it's a comment. i could have this at the end

–comment here –> &&**&**((

and it is still a comment.

why is everyone so picky about how people write comments? (i've seen it on other forums). just a pet peeve of mine, sorry if it came out rude, but why are you focusing your attention on the comments, which are not even in the real code? maybe its just me, but it kinda makes me think that you want to find fault with it, before you even read the question. (maybe i am wrong?)

2.) run a-1? i have it running on command, i think you might have misread.

3.)THIS was the answer i was looking for, thank you. and this part did help. :)/>/>