Jump to content




parallel.waitForAny()


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

#1 scyost

  • New Members
  • 2 posts

Posted 27 January 2014 - 12:05 PM

Hello, I am kinda new to computer craft. I was wondering if anyone can tell me why i keep on getting errors with the code

error : parallel :22: test:5: attempt to index ? (a function value)

r = rednet
r.open("top")
function listen()
  id,msg,dis=r.receive()
  shell.run(msg)
end
function shell()
  io.write("> ")
  io.read()
end
while true do
  parallel.waitForAny(shell, listen)
end


#2 CometWolf

  • Members
  • 1,283 posts

Posted 27 January 2014 - 12:31 PM

Because you define shell as it's own function, then attempt to call a function from the old shell table. Basically, change the name of your shell function.

#3 scyost

  • New Members
  • 2 posts

Posted 27 January 2014 - 12:34 PM

alright, thanks!





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users