Jump to content




use read() 2 times


4 replies to this topic

#1 J0P5

  • New Members
  • 12 posts

Posted 07 March 2012 - 11:54 AM

So as a real newbie in LUA I don't know how to do this, very simple thing.


I have 2 variables let's call them A and B, and I am trying to make the user input both of their values.

A = read()
B = read()

This ofcourse won't work, as this means A is equal to B, I want the user to put in their values, them being completely independant from eachother. This is probably real simple, I just don't know how to.


Thanks in advance

#2 Advert

    Custom Title

  • Moderators
  • 459 posts
  • LocationLondon

Posted 07 March 2012 - 12:07 PM

You should really try it before posting it, because doing what you posted will do exactly what you want it to!

read is a function, and it'll do the same thing each time you call it: let the user input some text.

#3 J0P5

  • New Members
  • 12 posts

Posted 07 March 2012 - 12:12 PM

View PostAdvert, on 07 March 2012 - 12:07 PM, said:

You should really try it before posting it, because doing what you posted will do exactly what you want it to!

read is a function, and it'll do the same thing each time you call it: let the user input some text.

View PostAdvert, on 07 March 2012 - 12:07 PM, said:

You should really try it before posting it, because doing what you posted will do exactly what you want it to!

read is a function, and it'll do the same thing each time you call it: let the user input some text.


hahaha what a fail by me! Thanks.

I did actually try this before, but it didn't work. I now figured out it was something else that was making it not work.

#4 imdacrazy1

  • New Members
  • 2 posts

Posted 06 August 2012 - 07:07 PM

Is it possible to read Two variables of a sent message that are both in the message part of rednet.send (sorry if this is confusing...)
ex*
rednet.receive(1)
M = io.read()
I = io.read()

(sent message: 5 Hello )
as in send message: Hello to computer 5

#5 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 06 August 2012 - 08:17 PM

Just send two messages to computer 5.
Next time, make a topic in this subforum.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users