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

last 2 questions

Started by djhackerr, 12 May 2012 - 08:56 PM
djhackerr #1
Posted 12 May 2012 - 10:56 PM
1st.

is there any way that some of my computers can run "startup" every 1minute?!

2nd.

where can i easilly learn lua programming? (CC)
Lyqyd #2
Posted 12 May 2012 - 11:04 PM
Why would you want them to run startup every minute? What are you actually trying to accomplish? I get the feeling an os.pullEvent and a timer would work much better here.

Google is your friend. Look for lua tutorials online.
djhackerr #3
Posted 13 May 2012 - 08:37 PM
because they need to recive redstone signal, and so if they do recive it without launching startup (or "exec") this cant be accomplished
Luanub #4
Posted 13 May 2012 - 08:40 PM
sleep(1) os.reboot()?? There is no way to trigger it from an off state to run anything without a player clicking on the terminal unfortunately. There was a recommendation for a function to turn them on via redstone but if I remember right it was rejected.

You could however have a computer running next to the computer that you want to check for the signal and have it turn it on every 60 seconds.
PixelToast #5
Posted 13 May 2012 - 11:43 PM
lol i dont use tutorials online, i learn by editing other peoples code and figuring out what other people made, however i am still trying to understand some of dan's code

what are the computers receiving the redstone from and what do you plan on doing with it? im sure running a program every 60 seconds is unnecessary because you can just use the parallel api in a loop
Lyqyd #6
Posted 14 May 2012 - 12:43 AM
Why not just have them running a program that listens for a redstone event with os.pullEvent("redstone") or something?
libraryaddict #7
Posted 14 May 2012 - 06:56 AM
Why not run startup with a "while true do" and some sleeps?
PixelToast #8
Posted 15 May 2012 - 12:02 AM
Why not run startup with a "while true do" and some sleeps?
Why not just have them running a program that listens for a redstone event with os.pullEvent("redstone") or something?
something like this?:
function myCode()
  --code goes here--
end
while true do
  os.pullEvent("redstone")
  parallel.waitForAny(myCode())
  sleep(60)
end