Jump to content




I Need Help


  • You cannot reply to this topic
2 replies to this topic

#1 tbyoran

  • Members
  • 16 posts

Posted 04 August 2012 - 06:52 PM

I'm try this code , it's work but just ones time.
When i write someting , monitor is showing.
But when i try agin it say Write: test:5: attempt to call string.

Please help me , how can i write unlimited?

term.clear()
term.setCursorPos(4,5)
write "Write: "
read = read()

mon = peripheral.wrap("right")
mon.clear()
mon.setTextScale(5)
mon.setCursorPos(4,5)
mon.write(read)



#2 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 04 August 2012 - 07:20 PM

Don't use function names as variable names, you'r overwriting the read function with whatever it returns. So the second time you run the program, read is a string, not a function. To fix the error just change the line:
read = read()
to something like:
local input = read()
And change the last line to this:
mon.write(input)


#3 tbyoran

  • Members
  • 16 posts

Posted 04 August 2012 - 07:25 PM

thx a lot





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users