15 posts
Location
on a computer trying to code....
Posted 06 April 2013 - 08:05 AM
I am trying to make a slot option using io.read() but it doesnt seem to work:-
print("enter slot number")
g = io.read
turtle.select(g)
then it says
number expected :(/>
if you want to see the whole code then tell me
88 posts
Location
Toulouse, France
Posted 06 April 2013 - 08:17 AM
You have to do something like
turtle.select(tonumber(g))
Because read returns a string !
15 posts
Location
on a computer trying to code....
Posted 06 April 2013 - 08:48 AM
You have to do something like
turtle.select(tonumber(g))
Because read returns a string !
thanks! now i can do stuff now :D/>
2088 posts
Location
South Africa
Posted 06 April 2013 - 09:24 AM
You can also do it in one line :)/>
turtle.select( tonumber( read() ) )
io.read is not needed because you can just call read.
Note: read() / io.read() always returns a
string