Jump to content




Movement Functions Not Working


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

#1 EnergyMatter

  • Members
  • 7 posts

Posted 13 August 2013 - 05:22 PM

I made an API to make some things about programming turtles easier, but for some reason, the function that are supposed to make the turtle move don't make it move. I had them on an older program for mining before I made the API, and they worked fine then. I think the problem might have occurred due to how I combined automatically digging the block in front of it and waiting if it can't move forward because of an entity being in the way. I looked at it, but I still have no idea why it doesn't work.

API: http://pastebin.com/fpbEfZAF

Thanks in advance!

#2 Yevano

  • Members
  • 376 posts
  • LocationUSA

Posted 13 August 2013 - 10:24 PM

You say you used it for an older program. Would this have been for the turtles were updated to require fuel? Turtles require fuel now to move. Other than that, I don't immediately see any problems with your API.

#3 campicus

  • Members
  • 164 posts

Posted 13 August 2013 - 11:12 PM

Should line 25 be "math.random()" instead of "math.random"? This isn't really relevant to your problem though and I cannot see why your movement functions don't work.

#4 EnergyMatter

  • Members
  • 7 posts

Posted 14 August 2013 - 10:55 AM

View PostYevano, on 13 August 2013 - 10:24 PM, said:

You say you used it for an older program. Would this have been for the turtles were updated to require fuel? Turtles require fuel now to move. Other than that, I don't immediately see any problems with your API.
I set turtlesNeedFuelToMove=false, so it isn't a problem

#5 LordIkol

  • Members
  • 197 posts
  • LocationSwitzerland

Posted 15 August 2013 - 07:31 AM

you always check if bedrock variable is false but you never set it to false it is set to nil initally.
if you change that part :

local enter = nil
local bedrockF = nil
local bedrockU = nil
local bedrockD = nil
local bedrockL = nil
local bedrockR = nil
local bedrockB = nil
local bedrock = nil

to this:

local enter = false
local bedrockF = false
local bedrockU = false
local bedrockD = false
local bedrockL = false
local bedrockR = false
local bedrockB = false
local bedrock = false

it should work

Greets
Loki

#6 EnergyMatter

  • Members
  • 7 posts

Posted 15 August 2013 - 08:32 AM

View PostLordIkol, on 15 August 2013 - 07:31 AM, said:

you always check if bedrock variable is false but you never set it to false it is set to nil initally.
if you change that part :

local enter = nil
local bedrockF = nil
local bedrockU = nil
local bedrockD = nil
local bedrockL = nil
local bedrockR = nil
local bedrockB = nil
local bedrock = nil

to this:

local enter = false
local bedrockF = false
local bedrockU = false
local bedrockD = false
local bedrockL = false
local bedrockR = false
local bedrockB = false
local bedrock = false

it should work

Greets
Loki

I'll try this now!

Thanks for helping me out!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users