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

use read() 2 times

Started by J0P5, 07 March 2012 - 10:54 AM
J0P5 #1
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
Advert #2
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.
J0P5 #3
Posted 07 March 2012 - 12:12 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.
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.
imdacrazy1 #4
Posted 06 August 2012 - 08: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
Tiin57 #5
Posted 06 August 2012 - 09:17 PM
Just send two messages to computer 5.
Next time, make a topic in this subforum.