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

Lua Help

Started by soccer16x, 08 September 2012 - 01:49 AM
soccer16x #1
Posted 08 September 2012 - 03:49 AM
I don't see where i am going wrong, the script should be working i dont see a problem, its a script to tell the mining turtle where to go given the x y and z but when i type in the command ( ex. goto 1 69 0) it returns Must supply X Y Z which its supposed to if it isnt given one of the points but it clearly has all 3 and also returns a attempt to call nil on line 110.

Here is the code if you would like to browse through it and see where i went wrong:
http://pastebin.com/23JbB5ZD
Luanub #2
Posted 08 September 2012 - 04:03 AM
The line 110 issue it because you don't have a function named exit() in the program and there is no default exit() function in lua. You will need to put one together.

I'm going through the code to see what I can find on the other issue. Will update post if I find anything.

Try changing the first line of the code:

local tArgs = (...) -- the ()'s make it a string

local tArgs = {...} -- {}'s are for tables
soccer16x #3
Posted 08 September 2012 - 04:05 AM
The line 110 issue it because you don't have a function named exit() in the program and there is no default exit() function in lua. You will need to put one together.

I'm going through the code to see what I can find on the other issue. Will update post if I find anything.

okay i did that and now it returns no error but for some reason it isnt moving?
Edited on 08 September 2012 - 02:20 AM
Lyqyd #4
Posted 08 September 2012 - 05:11 AM
Do you have the GPS hosts set up nearby? There should be four or so in the vicinity.
Zoinky #5
Posted 08 September 2012 - 05:15 AM
You could use error() instead of exit() . I think that'll work? Note sure.
soccer16x #6
Posted 08 September 2012 - 05:42 AM
Do you have the GPS hosts set up nearby? There should be four or so in the vicinity.
yes i have multiple gps hosts set up so that isnt the problem
like if i do gps locate, it can find it's location but for some reason it isnt moving to the desired location