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

[QUESTION] Is there a "unless" command?

Started by Matrixmage, 09 August 2012 - 03:20 AM
Matrixmage #1
Posted 09 August 2012 - 05:20 AM
Title says it all, wondering if there is some kind of condition so something only happens if something else is or isn't true
brett122798 #2
Posted 09 August 2012 - 05:51 AM
For some reason this is taking a long time to process through my head, let me read this a few times..
Pharap #3
Posted 09 August 2012 - 05:52 AM
if (ConditionGoesHere) then
–blah
else
–different blah
end

or there's

if not (ConditionGoesHere) then
–blah
else
–other blah
end

Turns out I could help you out with something after all. That's a weight off my shoulders lol
D3matt #4
Posted 09 August 2012 - 06:37 AM
You mean like "Do this, unless this?"

How about

If (UnlessCondition) then
–Unless Code
else
–What should happen normally
end
Cranium #5
Posted 09 August 2012 - 03:15 PM
An example of what you are trying to do unless this is true would help a bit. You are breaking my brain.
Matrixmage #6
Posted 09 August 2012 - 05:56 PM
I think I was a bit of an idiot: elseif anyone? ;)/>/>
Matrixmage #7
Posted 09 August 2012 - 05:57 PM
if (ConditionGoesHere) then
–blah
else
–different blah
end

or there's

if not (ConditionGoesHere) then
–blah
else
–other blah
end

Turns out I could help you out with something after all. That's a weight off my shoulders lol

I love this community ;)/>/>
Pharap #8
Posted 10 August 2012 - 01:12 AM
if (ConditionGoesHere) then
–blah
else
–different blah
end

or there's

if not (ConditionGoesHere) then
–blah
else
–other blah
end

Turns out I could help you out with something after all. That's a weight off my shoulders lol

I love this community ;)/>/>

That comment made the dark cloud of all the arguing-over-tekkit nastiness go away :(/>/>

And yeah, I get annoyed when I try to help someone then get upstaged by the higher ups D:
(then again, they are probably annoyed with my 20 posts a day average lol)

I misinterpreted what you wanted though. If you had said 'multiple conditions' I would have been all 'boing, answer', but oh well : )