Jump to content




(Error) Nil and Nil


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

#1 speedemon24

  • New Members
  • 5 posts

Posted 18 November 2012 - 08:28 AM

I have been having problems with a few goto progrmas from pastebin which I think should work correctly. But whenever I excute a command the turtle moves forwrd once then stops and it reads back
"goto:35: attempt to compare__lt on nil and nil"
Im asking here though becuase I tired other programs and got back the same thing.
Here is the link to the code in the example.
http://www.computerc...ram-for-turtle/

#2 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 18 November 2012 - 08:53 AM

Do you have a gps tower setup?

#3 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 18 November 2012 - 08:54 AM

Have you set up GPS before using the program?

EDIT: hNGGGFFF NINJAS

#4 speedemon24

  • New Members
  • 5 posts

Posted 18 November 2012 - 09:03 AM

yes i have at y 265. The gps locate function works fine

#5 speedemon24

  • New Members
  • 5 posts

Posted 18 November 2012 - 03:40 PM

ok guys I tired this on my server and thats when I was getting this error but in my single player I set up everything the same, same code, and it works fine.
Im wondering if it is a config file error on the server. Also my server is a vinalla FTB with one change to the CC config being allow HTTP. So if anyone can provide assassitance it would be great. Im going to post this link on the FTB fourms and see if they know what is going on. Here is a pic of it not working
Posted Image

#6 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 18 November 2012 - 03:51 PM

Can you try this in a lua terminal or as a program and see if the coordinates pop up?
rednet.open('right')
textutils.tabulate( { gps.locate(3,false) } )


#7 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 18 November 2012 - 04:15 PM

Just after this line
nx,ny,nz = gps.locate(3,false)
Check what this results in
print(cx.. " " .. cy.. " " .. cz.. " " .. nx.. " " .. ny.. " " .. nz)
Just to check if they are not nil.

#8 speedemon24

  • New Members
  • 5 posts

Posted 18 November 2012 - 05:30 PM

View PostsIdEkIcK_, on 18 November 2012 - 04:15 PM, said:

Just after this line
nx,ny,nz = gps.locate(3,false)
Check what this results in
print(cx.. " " .. cy.. " " .. cz.. " " .. nx.. " " .. ny.. " " .. nz)
Just to check if they are not nil.

I did this and I get "attempt to concatenate string and nil." See I dont even know if this is a coding program becuase the program worked fine in single player but in multiplayer it does not seem to work for me.

#9 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 18 November 2012 - 09:53 PM

That means one, or multiple of them are nil. And thats your problem to "goto:35: attempt to compare__lt on nil and nil"

And these cx, cy, cz, nx, ny, nz values are defined from
local cx,cy,cz = gps.locate(2,false)
and
nx,ny,nz = gps.locate(3,false)
I've never used gps.locate before but I'm sure the servers gps.locate is bugged ^^

#10 MaHuJa

  • Members
  • 26 posts

Posted 20 November 2012 - 01:49 AM

Here's a theory... when you're calling gps.locate(), and it works, it's because you've done something else (like the gps program) that did the rednet.open() for you.

Given that this is a turtle, the command is
rednet.open "right"
and when this is not already done, I would expect gps.locate() to return nils.

#11 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 20 November 2012 - 03:51 AM

View PostMaHuJa, on 20 November 2012 - 01:49 AM, said:

Here's a theory... when you're calling gps.locate(), and it works, it's because you've done something else (like the gps program) that did the rednet.open() for you.

Given that this is a turtle, the command is
rednet.open "right"
and when this is not already done, I would expect gps.locate() to return nils.
The code he links to does
rednet.open("right")
at the top. And I already asked him to do this:
rednet.open('right')
textutils.tabulate( { gps.locate(3,false) } )
But he didn't reply on that.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users