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

A few questions.

Started by Sivarias, 10 June 2013 - 03:06 AM
Sivarias #1
Posted 10 June 2013 - 05:06 AM
I want a simple timer that sends a pulse every 20 minutes. The idea is for it to set off a grinder to kill all the adult animals.

I was thinking of a codes of the sort:

Code: startup

while true do
redstone.setOutput("side", true)
sleep(1200)
redstone.setOutput("side", false)
end

While this would be functional I would rather have a cleaner code that could save current progress so I wasn't waiting everytime I started a new game.

I was also hoping to use the progress saver for my turtles mining program.

Secondary question, anyone know any decent lua tutorials out there?

Tertiary, do ender chests save thier color code when you break them?

Quadrary, do you have to open a computer for it's startup program to run or does it run as soon as the computer itself loads?
Lyqyd #2
Posted 10 June 2013 - 11:03 AM
Split into new topic.

3: Yes, if you mean the ones from the EnderStorage mod.

4: As soon as it loads.
JustPingo #3
Posted 10 June 2013 - 05:25 PM
1: Try somthing that each seconds, open a file and write the current state of the timer (for i = 1, 1200 do). When the computer reboot, it get the last state from the file.

2 : Only my tutorials, of course.
No, seriously, I don't know. However, if you're looking for French tuto (maybe, I don't know xD), mine is available. Search me on YouTube.
Lyqyd #4
Posted 10 June 2013 - 05:27 PM
For two, they're not exactly tutorial format, but the Lua PIL and the Lua-users wiki are both good resources.
theoriginalbit #5
Posted 10 June 2013 - 06:18 PM
Also additionally to what Lyqyd said (which I totally agree, they are both invaluable resources) the ComputerCraft wiki cannot be passed up to learn about the CC specific functions and APIs…