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

Loop ended by string event

Started by appleguy1999, 01 November 2013 - 10:14 PM
appleguy1999 #1
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.
Lyqyd #2
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.
TheOddByte #3
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 )