Posted 15 July 2013 - 08:59 PM
so i have having an issue with getting a sensor turtle to move to a players location
what i have so far also someone tell me how to use the spoiler button would be great.
os.loadAPI("ocs/apis/sensor")
prox = sensor.wrap("right")
while true do
for target in pairs(prox.getTargets())
local details = prox.getTargetDetails(target)
if details.Name == "Player" then
playerPos = details.Position
x = playerPos["X"]
Z = playerPos["Z"]
and thats as far as i can get for two reason
1) the locations are grid line based so numbers are never whole
2) if the turtle turns around i have to make sure he will still go the same way
so i can not use if x < 0 turtle.back() because if i turn the turtle to the left that is no longer true
main goal turtle will fly over a player and drop an anvil
what i have so far also someone tell me how to use the spoiler button would be great.
os.loadAPI("ocs/apis/sensor")
prox = sensor.wrap("right")
while true do
for target in pairs(prox.getTargets())
local details = prox.getTargetDetails(target)
if details.Name == "Player" then
playerPos = details.Position
x = playerPos["X"]
Z = playerPos["Z"]
and thats as far as i can get for two reason
1) the locations are grid line based so numbers are never whole
2) if the turtle turns around i have to make sure he will still go the same way
so i can not use if x < 0 turtle.back() because if i turn the turtle to the left that is no longer true
main goal turtle will fly over a player and drop an anvil