Posted 11 February 2016 - 03:09 AM
Hello, I need some help with a program i tried to code
This program have for mission to sort "Ore berries" on a FTB server (For those who do not know, it's like a nugget but not only of gold), and
The code is here (some part in french ;)/> )
I didn't found any other way for just put 9 by 9, if someone have better idea and solution let me know :wub:/>
I found after a couple of times the turtle only drop items can you explain were is my mistake ? :unsure:/>
Thanks you very much and sorry for some mistake on the topic :rolleyes:/>
See you soon :)/>
This program have for mission to sort "Ore berries" on a FTB server (For those who do not know, it's like a nugget but not only of gold), and
The code is here (some part in french ;)/> )
-- Variable
local Berry = {1,2,3,4,5}
-- Fonctions
function Trie()
for j = 1,5 do
if turtle.compareTo(Berry[j]) == true then
turtle.transferTo(Berry[j])
else
turtle.drop()
end
end
end
function Modulo()
for i = 1,5 do
if turtle.getItemCount(Berry[i])%10 == 0 then
turtle.select(Berry[i])
turtle.dropDown(9)
end
end
end
-- Programme :
term.clear()
term.setCursorPos(1,1)
print ("Veuillez insérer les objets suivants dans les bons slots :")
print (" - Slot 1 : Iron Oreberry")
print (" - Slot 2 : Gold Oreberry")
print (" - Slot 3 : Copper Oreberry")
print (" - Slot 4 : Tin Oreberry")
print (" - Slot 5 : Aluminum Oreberry")
read()
term.clear()
term.setCursorPos(1,1)
for c = 1,5 do
print("Vérification... Veuillez patienter...")
sleep(5)
write("Slot n°")
write (c)
if turtle.getItemCount(c) == 1 then
write(" - OK \n")
else
print("Erreur, redémarrage en cours")
sleep(10)
os.reboot()
end
end
print("")
print("Vérification completer sans problême")
read()
term.clear()
term.setCursorPos(1,1)
while true do
turtle.select(16)
turtle.suckUp(1)
Trie()
Modulo()
end
I didn't found any other way for just put 9 by 9, if someone have better idea and solution let me know :wub:/>
I found after a couple of times the turtle only drop items can you explain were is my mistake ? :unsure:/>
Thanks you very much and sorry for some mistake on the topic :rolleyes:/>
See you soon :)/>