48 posts
Posted 24 March 2013 - 03:24 PM
Hey people
Just a quick questions
So i have a "server room" for my admin building on my server and i want a few monitors to be running fake programs.
So what i want to achieve is to make a program like this
mon=peripheral.set("back")
mon.setTextScale(2)
mon.setCursorPos(1,1)
print"Running FTP on port 21"
print"Running Main servers on ports 43-28849"
(Print loads of other things)
But then when it gets to the bottom of writing all that (It will have some sleeps in it) it just repeats it again and again and again and never stops until i tell it to?
Thanks for anyone who responds!
1511 posts
Location
Pennsylvania
Posted 24 March 2013 - 03:26 PM
While true do
–Yourstuffhere
end
671 posts
Location
That place over there. Y'know. The one where I am.
Posted 24 March 2013 - 03:27 PM
Can you please post the entire code on pastebin and post the pastebin link here so we can see everything?
While true do
–Yourstuffhere
end
He doesn't WANT it to loop, it is and he's asking how to stop it.
48 posts
Posted 24 March 2013 - 03:28 PM
Can you please post the entire code on pastebin and post the pastebin link here so we can see everything?
While true do
–Yourstuffhere
end
He doesn't WANT it to loop, it is and he's asking how to stop it.
Will do it tomorrow when its finished! :)/>
48 posts
Posted 24 March 2013 - 03:30 PM
While true do
–Yourstuffhere
end
What exactly do you mean
Where you say –Yourstuffhere could i do this
While true do
--mon=peripheral.set("back")
print"iudhfosdiuh"
print"dilfhvdfio"
print"fdivhfiuhdifuhdofuv"
end
and it would just infinity loop it?
48 posts
Posted 24 March 2013 - 03:32 PM
Ohh OOPSSorry about that. No i want to know how to loop it.
I can just do Ctrl+T to stop it
233 posts
Location
Cleveland, Ohio
Posted 24 March 2013 - 04:14 PM
you can do this
for i=1, x do
--your looped program
end
replace x with number of loops you want it to do
7508 posts
Location
Australia
Posted 24 March 2013 - 04:27 PM
Hey people
Just a quick questions
So i have a "server room" for my admin building on my server and i want a few monitors to be running fake programs.
So what i want to achieve is to make a program like this
mon=peripheral.set("back")
mon.setTextScale(2)
mon.setCursorPos(1,1)
print"Running FTP on port 21"
print"Running Main servers on ports 43-28849"
(Print loads of other things)
But then when it gets to the bottom of writing all that (It will have some sleeps in it) it just repeats it again and again and again and never stops until i tell it to?
Thanks for anyone who responds!
a nice way to do it is
mon=peripheral.set("back")
mon.setTextScale(2)
mon.setCursorPos(1,1)
print"Running FTP on port 21"
print"Running Main servers on ports 43-28849"
(Print loads of other things)
while true do
local e, p = os.pullEvent()
if e == 'key' and p == keys.enter then
break
end
end
that will print all the code to the monitor and then just wait at the end of the program for you to press enter to quit it… this method is good as you aren't doing unnecessary refreshing of the screen and causing lag.
1511 posts
Location
Pennsylvania
Posted 24 March 2013 - 04:42 PM
Hey people
Just a quick questions
So i have a "server room" for my admin building on my server and i want a few monitors to be running fake programs.
So what i want to achieve is to make a program like this
mon=peripheral.set("back")
mon.setTextScale(2)
mon.setCursorPos(1,1)
print"Running FTP on port 21"
print"Running Main servers on ports 43-28849"
(Print loads of other things)
But then when it gets to the bottom of writing all that (It will have some sleeps in it) it just repeats it again and again and again and never stops until i tell it to?
Thanks for anyone who responds!
a nice way to do it is
mon=peripheral.set("back")
mon.setTextScale(2)
mon.setCursorPos(1,1)
print"Running FTP on port 21"
print"Running Main servers on ports 43-28849"
(Print loads of other things)
while true do
local e, p = os.pullEvent()
if e == 'key' and p == keys.enter then
break
end
end
that will print all the code to the monitor and then just wait at the end of the program for you to press enter to quit it… this method is good as you aren't doing unnecessary refreshing of the screen and causing lag.
This is how I was trying to explain it. I was on my phone so I wasn't about to write ten paragraphs when TOBIT could just do it.