You mean translate the comments.
It's an inventory management program for turtles, like he said.
Codewise, I see that there is room for improvement. For example:
Spoiler
function iralcofre(n) --Lista de los cofres con sus respectivas localizacion.
if n==1 then
shell.run ("Pach","-211","64","-323","0") --"Pach" es mi programa de busqueda de caminos, las coordenadas son las del mapa del video.
return true
elseif n==2 then
shell.run ("Pach","-213","64","-323","0")
return true
elseif n==3 then
shell.run ("Pach","-214","64","-323","1")
return true
elseif n==4 then
shell.run ("Pach","-214","64","-325","1")
return true
elseif n==5 then
shell.run ("Pach","-214","64","-327","1")
return true
elseif n==6 then
shell.run ("Pach","-213","64","-327","2")
return true
elseif n==7 then
shell.run ("Pach","-211","64","-327","2")
return true
else
return false
end
end
could be replaced by a table lookup, like so:
Spoiler
iralcofre = {function() shell.run ("Pach","-211","64","-323","0") end,
function ()shell.run ("Pach","-211","64","-323","0") end,
function() shell.run ("Pach","-213","64","-323","0") end,
function() shell.run ("Pach","-214","64","-323","1") end,
function() shell.run ("Pach","-214","64","-325","1") end,
function() shell.run ("Pach","-214","64","-327","1") end,
function() shell.run ("Pach","-213","64","-327","2") end,
function() shell.run ("Pach","-211","64","-327","2") end
}
Then the relevant function would be called by "if iralcofre[n] then iralcofre[n]() else print("error message "..n) end"
You could further tighten the code by only storing the coordinate values in the table and just having a function that accepted the table…but there are more basic flaws to address first.
Like the fact that we don't have the program Pach that is needed to make use of this code. Or that you've only got room for a few chests.
Forgot a "()"…not that it matters since we can't run the code anyway.