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

Bit rusty I've got stuck on a while loop :/

Started by makeme, 05 February 2014 - 04:04 PM
makeme #1
Posted 05 February 2014 - 05:04 PM
I've just got back into CC again and was looking into rednet but I've got snagged on a while loop. Could someone explain my mistake?


Program 1 "Host"
Its on line 16 and says it expects "do" but theres a do there
http://pastebin.com/Yfmk9KWD


Program 2 "Client"
Its on line 19 and has the same problem as above
http://pastebin.com/wHgMYJgh

Any other pointers or advice?

Thanks for you help
CometWolf #2
Posted 05 February 2014 - 05:07 PM
You're using "=" instead of "==" to compare values. "=" is used to define values.
makeme #3
Posted 05 February 2014 - 05:14 PM
You're using "=" instead of "==" to compare values. "=" is used to define values.

Thanks I knew It would be something stupid
makeme #4
Posted 05 February 2014 - 05:23 PM
Ive changed that but now it displays its own ID to the screen but when it gets to line 18 in Program 1 / 20 in program 2 it errors saying attempt to call nil

Edit wait damn spelling mistake ffs
Edited on 05 February 2014 - 04:26 PM
surferpup #5
Posted 05 February 2014 - 11:17 PM
So are you still having a problem or did you solve it?
Jim #6
Posted 05 February 2014 - 11:52 PM
And, for the first program, to display variables in strings you can simply do:

let's say


local x= 5
print("My ID is: "..x)
Edited on 05 February 2014 - 10:52 PM
surferpup #7
Posted 06 February 2014 - 12:04 AM
Jim –

"How others see you does not matter. What matters is how you see yourself."-Unknown.


I a take off of:

I have no right, by anything I do or say, to demean a human being in his own eyes. What matters is not what I think of him; it is what he thinks of himself. To undermine a man's self-respect is a sin.

Antoine de Saint-Exupery
Edited on 05 February 2014 - 11:06 PM
Jim #8
Posted 06 February 2014 - 12:18 AM
[OFFTOPIC] Yah, had just seen that somewhere and I thought it was cool. Thanks for that tip on the source. [/OFFTOPIC]
makeme #9
Posted 06 February 2014 - 08:24 AM
Thanks Ive got it fixed.