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

[Lua][Error]Bad Argument #1(expected number) using REther Turtle

Started by sulliv57, 20 April 2013 - 12:18 PM
sulliv57 #1
Posted 20 April 2013 - 02:18 PM
http://pastebin.com/kXYBiBey
It gives me a bad argument error. Does the setFreq() function not work with variables or tables. Even after setting the table as a variable it didn't work. The 1st argument is stated as 1000.

Sorry if this is formatted/in the wrong section. First post here and not on the FTB reddit.
Engineer #2
Posted 20 April 2013 - 02:21 PM
tArgs is standard a string. Just use a tonumber(tArgs[1]) and you should be fine. Also in your if statement, you have to put "help" instead of help. Lua tries to take it as a variable, but there is none so its going to error out.
sulliv57 #3
Posted 20 April 2013 - 02:59 PM
That section worked, however the get() is always returning false. Is the use in this not the correct use. I could just hook up some redstone to the back from a reciever but I would much rather use the turtle itself to tell.
Engineer #4
Posted 20 April 2013 - 11:06 PM
I think w.get() instead of get() fixes it :P/>