Posted 16 August 2016 - 06:54 PM
I tried making a logistical centre which is made out of turtle who get items on request from better barrels and put em into a me system from ae2. This is the code and a website that analyses the code. It shows me an error. I found out it has the same error for all three functions: getdiffG, getdiffT and getdiffH. There are some german word but I think you might understand what I mean.
http://ideone.com/HuqzyU
http://ideone.com/HuqzyU
- Gang = 0
Tiefe = 0
Hoehe = 0
GangDiff = 0
TiefeDiff = 0
HoeheDiff = 0
Active = false
TgtGang = 5
TgtTiefe = 1
TgtHoehe = 3
–Gets the differential between the current Pos and
–the Target Pos
function getdiffG(Gang, TgtGang)
GangDiff = TgtGang-Gang
return GangDiff
end
–""
function getdiffT(Tiefe, TgtTiefe)
TiefeDiff = TgtTiefe-Tiefe
return TiefeDiff
end
–""
function getdiffH(Hoehe, TgtHoehe)
HoeheDiff = TgtHoehe-Hoehe
return HoeheDiff
end
–Makes the turtle move to the Target Pos
function move(GangDiff, TiefeDiff, HoeheDiff, TgtGang)
turtle.turnRight()
for i=1,GangDiff do
turtle.forward()
turtle.forward()
turtle.forward()
end
turtle.turnLeft()
for i=1,TiefeDiff do
turtle.forward()
end
for i=1,HoeheDiff do
turtle.up()
end
if TgtGang % 2 == 0 then
turtle.turnLeft()
else
turtle.turnRight()
end
return pos
end
–Returns the turtle to the starting position and rotation
function returner(TgtGang, TgtTiefe, TgtHoehe)
if TgtGang % 2 == 0 then
turtle.turnLeft()
else
turtle.turnRight()
end
for i=1,TgtHoehe do
turtle.down()
end
for i=1,TgtTiefe do
turtle.forward()
end
turtle.turnRight()
for i=1,TgtGang do
turtle.forward()
turtle.forward()
turtle.forward()
end
end
–Performs 1 Task and returns if it succeeded
function task(Gang, Tiefe, Hoehe, TgtGang, TgtTiefe, TgtHoehe, Quantity)
getdiffG(Gang, TgtGang)
getdiffT(Tiefe, TgtTiefe)
getdiffH(Hoehe, TgtHoehe)
move(GangDiff, TiefeDiff, HoeheDiff, TgtGang)
returner(TgtGang, TgtHoehe, TgtTiefe)
return done
end
task()