1 posts
Posted 01 November 2013 - 11:14 PM
I am trying to create a program that will replace Etho's Horse Timer from the Mindcrack map but with ComputerCraft. I have a loop going where it starts a timer and that works fine. The problem I have when I try and work with it is that I need the loop to be terminated by a boolean event being true even though the loop is not with strings. Is it even possible to terminate a loop with a boolean event? Sorry if that does not make much sense. I am a n00b at programing.
8543 posts
Posted 02 November 2013 - 02:15 PM
Split into new topic.
I think you've gone a fair distance down the wrong path trying to make this work a certain way when there are easier ways. Post your current code and we'll help you correct it to do this the easy way using os.clock(). I've really no idea what you're doing with using timers to do this.
1852 posts
Location
Sweden
Posted 02 November 2013 - 02:48 PM
What exactly do you mean with the loop being terminated with a 'boolean event'?
Are you meaning something like this?
This is some really simple examples of exiting a loop depending on a boolean value.
Examples
local boolean = false
while not boolean do -- Will not continue if the boolean is true
-- Stuff here
end
local boolean = false
while true do
if boolean then
return true
end
end
And as mentioned above, Please post your current code( And errors if there are any )