function writeLine()
local file = fs.open("file", "w")
if file then
file.writeLine(cmd)
file.close()
end
end
function runLine()
shell.run("file")
end
rednet.open("top")
rednet.open("bottom")
rednet.open("back")
rednet.open("front")
rednet.open("right")
rednet.open("left")
while true do
user, cmd = rednet.receive()
writeLine()
runLine()
end
[Lua]
Started by Spongy141, Dec 16 2012 12:26 PM
9 replies to this topic
#1
Posted 16 December 2012 - 12:26 PM
I was trying to make a program for my wireless turtle so it can turn a message I sent to it to a line, such as if I send it turtle.up() it would go up, ect. but No matter what the function wouldn't work right to do that.
#2
Posted 16 December 2012 - 12:33 PM
loadstring(cmd)()
ofcourse you cant send "turtle.forward()" but you'll have to send just "turtle.forward" without parentheses
ofcourse you cant send "turtle.forward()" but you'll have to send just "turtle.forward" without parentheses
#3
Posted 16 December 2012 - 12:36 PM
Doyle3694, on 16 December 2012 - 12:33 PM, said:
loadstring(cmd)()
ofcourse you cant send "turtle.forward()" but you'll have to send just "turtle.forward" without parentheses
ofcourse you cant send "turtle.forward()" but you'll have to send just "turtle.forward" without parentheses
#4
#5
Posted 16 December 2012 - 12:38 PM
Human, on 16 December 2012 - 12:37 PM, said:
#6
Posted 16 December 2012 - 03:13 PM
Post your revised code.
#7
Posted 18 December 2012 - 06:11 AM
ChunLing, on 16 December 2012 - 03:13 PM, said:
Post your revised code.
loadstring(cmd)() os.pullEvent = loadstring(cmd)()it looped the one command I gave the turtle, and if something was in its path it crashed. But as you can see I edited it to work right, no offense but you guys weren't very good help.
#8
Posted 18 December 2012 - 08:43 AM
nice to see you got it finised, i was going to add my little fix in there
#9
Posted 18 December 2012 - 12:48 PM
Spongy141, on 18 December 2012 - 06:11 AM, said:
ChunLing, on 16 December 2012 - 03:13 PM, said:
Post your revised code.
loadstring(cmd)() os.pullEvent = loadstring(cmd)()it looped the one command I gave the turtle, and if something was in its path it crashed. But as you can see I edited it to work right, no offense but you guys weren't very good help.
Yeah, really easy to help when you cant post your code... if you edit something, you got to give us the new code. You weren't very co-operative either.
#10
Posted 18 December 2012 - 08:35 PM
It's fixed, so that's good enough.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











