lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Lua Programming Help (L)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Unread 09-14-2013, 01:40 PM
crys17p crys17p is offline
The Wary
 
Join Date: Sep 2013
Posts: 1
Map tracker

Hello guys i am new to lua and i have a problem. I am making a kind of map tracker for a turtle bot in minecraft(yes i know they have forums specifically for that but i am not getting a response form them). The map tracker stores the last five moves made into an array. Afterwards if the robot has a certain level of fuel it retraces it's steps by doing the inverse of the five last steps.

The robot stores the steps correctly the problem is when it enters the condition with low fuel that the values of the array become all nil and none of the conditions match and hence does nothing. It is strange because if i don't use the if statements for checking fuel level and fuel item count it works. Thank you for your response in advance.


map = {}
j = 5
i = 5


if turtle.getFuelLevel() < 100 then

if turtle.getItemCount(1) == 0 then

for count = 1,j do

if map[i] == 1 then
turtle.back()
end

if map[i] == 2 then
turtle.forward()
end

if map[i] == 3 then
turtle.down()
end

if map[i] == 4 then
turtle.up()
end

if map[i] == 5 then
turtle.turnRight()
end

if map[i] == 6 then
turtle.turnLeft()
end
i = i - 1
end

else
turtle.select(1)
turtle.refuel()
end


else
i = 5
turtle.forward()
map[1] = 1

turtle.up()
map[2] = 3


turtle.forward()
map[3] = 1


turtle.up()
map[4] = 3


turtle.back()
map[5] = 2


end
Reply With Quote
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Map's Quest Tracker XML? artificeren XML modification help (L) 1 08-26-2011 06:50 PM
Access to the map Fido Lua Programming Help (L) 4 08-10-2011 12:58 PM
Creep Map help Madduck Lua Programming Help (L) 4 09-16-2010 10:33 PM
Mini-map felgrath Interface Help (L) 2 03-01-2008 02:02 PM
Map tralkar General Authoring Discussion (L) 1 07-30-2007 12:06 AM


All times are GMT -5. The time now is 05:57 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui