Jump to content




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


8 replies to this topic

#1 makeme

  • Members
  • 60 posts

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

#2 CometWolf

  • Members
  • 1,283 posts

Posted 05 February 2014 - 05:07 PM

You're using "=" instead of "==" to compare values. "=" is used to define values.

#3 makeme

  • Members
  • 60 posts

Posted 05 February 2014 - 05:14 PM

View PostCometWolf, on 05 February 2014 - 05:07 PM, said:

You're using "=" instead of "==" to compare values. "=" is used to define values.

Thanks I knew It would be something stupid

#4 makeme

  • Members
  • 60 posts

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 by makeme, 05 February 2014 - 05:26 PM.


#5 surferpup

  • Members
  • 286 posts
  • LocationUnited States

Posted 05 February 2014 - 11:17 PM

So are you still having a problem or did you solve it?

#6 Jim

  • Members
  • 33 posts
  • Locationtekkit.craftersland.net:25567

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 by Jim, 05 February 2014 - 11:52 PM.


#7 surferpup

  • Members
  • 286 posts
  • LocationUnited States

Posted 06 February 2014 - 12:04 AM

Jim --

View PostJim, on 05 February 2014 - 11:52 PM, said:

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


I a take off of:

Quote

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 by surferpup, 06 February 2014 - 12:06 AM.


#8 Jim

  • Members
  • 33 posts
  • Locationtekkit.craftersland.net:25567

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]

#9 makeme

  • Members
  • 60 posts

Posted 06 February 2014 - 08:24 AM

Thanks Ive got it fixed.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users