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

[Lua][Help]Turtle avaitCommand

Started by Skillexs, 20 May 2013 - 05:31 AM
Skillexs #1
Posted 20 May 2013 - 07:31 AM
I have an problem with rednet and turtles plese help

code:
Turtle avait command
http://pastebin.com/yQSvCCQK
I tried:
senderID, message, distance = rednet (too long wihout yelding)
senderID, message, distance = rednet.receive() (attemt to call nill)
Master pc
http://pastebin.com/jypAecUh
Mackan90096 #2
Posted 20 May 2013 - 07:44 AM
What error message are you getting? In wich program? Which line? error:


err:1: attempt to index ? (a nil value)
err = the program name
:1: = the line
attempt to index ? (a nil value) = the error message

type your problem in this way and you'll get help faster

Edit:

You are trying to send "Cycle" to "i" in the "Master pc program"
if you want a variable as the id to send to, do:
id = idofthingtosendto

and

rednet.send(id, "Cycle")
LBPHacker #3
Posted 20 May 2013 - 08:27 AM
senderID, message, distance = rednet.receive() (attempt to call nil)
OK, that's impossible, unless you've overwritten rednet, what I highly doubt. Double-check for typos.
theoriginalbit #4
Posted 20 May 2013 - 08:29 AM
edit nvm derp
Skillexs #5
Posted 20 May 2013 - 02:29 PM
What error message are you getting? In wich program? Which line? error:


err:1: attempt to index ? (a nil value)
err = the program name
:1: = the line
attempt to index ? (a nil value) = the error message

type your problem in this way and you'll get help faster

Edit:

You are trying to send "Cycle" to "i" in the "Master pc program"
if you want a variable as the id to send to, do:
id = idofthingtosendto

and

rednet.send(id, "Cycle")

I have multiple turtles
Skillexs #6
Posted 20 May 2013 - 02:31 PM
senderID, message, distance = rednet.receive() (attempt to call nil)
OK, that's impossible, unless you've overwritten rednet, what I highly doubt. Double-check for typos.

It can't be these are the codes i use for rednet controling
Skillexs #7
Posted 22 May 2013 - 02:46 AM
Somebody can help me?
Zudo #8
Posted 22 May 2013 - 03:00 AM

rednet.open("right")
while true do
   senderID, message, distance = rednet.receive()
   print (message)
   shell.run(message)
end

This is fine…


rednet.open("right")
for i = 1, 15 do
   rednet.send(i, "Cycle")
end

Add a sleep command in the for-loop
LordIkol #9
Posted 22 May 2013 - 03:20 AM
If i were you i would reinstall Computercraft.

The Code you postet above is correct. The error that he attemps to call nil is, like someone mentioned before, impossible if you did not mess up the rednet API.

Greets
Loki