Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Terrasteel-Dropper von Thor_s_Crafter --
- -- Version 1.1 --
- local c = peripheral.find("chest")
- local side = "SOUTH"
- local sec = 10
- function input()
- if loadconfig == false then
- term.clear()
- term.setCursorPos(1,1)
- print("Auf welcher Seite befindet sich die 2. Kiste?")
- print("NORTH,EAST,SOUTH,WEST,TOP,BOTTOM")
- print("z.B. EAST = Osten (siehe JorneyMap)")
- write("Eingabe: ")
- eingabe = read()
- if eingabe == "NORTH" or eingabe == "EAST" or eingabe == "SOUTH" or eingabe == "WEST" or eingabe == "TOP" or eingabe == "BOTTOM" then
- side = eingabe
- saveConfig()
- else
- input()
- end
- end
- input2()
- end
- function input2()
- term.clear()
- term.setCursorPos(1,1)
- print("Wieviele Sekunden soll gewartet werden?")
- write("Eingabe: ")
- eingabe2 = read()
- if tonumber(eingabe2) > 0 then
- sec = tonumber(eingabe2)
- else
- input2()
- end
- end
- function loadConfig()
- if not fs.exists("config.txt") then
- return false
- else
- local file = fs.open("config.txt","r")
- tmp = file.readAll()
- print(tmp[1])
- sleep(1)
- side = tmp[1]
- return true
- end
- end
- function saveConfig(text)
- local file = fs.open("config.txt","w")
- file.writeLine(text)
- file.close()
- end
- function dropItems()
- local dias = 0
- local pearls = 0
- local steel = 0
- --term.clear()
- --term.setCursorPos(1,1)
- c.condenseItems()
- items = c.getAllStacks()
- for i=1,#items,1 do
- local tmp = items[i]
- local item = tmp.all()
- if item.raw_name == "item.manadiamond" then
- if dias == 0 then
- c.pushItemIntoSlot(side,i,1)
- print("dia")
- dias = dias + 1
- end
- elseif item.raw_name == "item.manapearl" then
- if pearls == 0 then
- c.pushItemIntoSlot(side,i,1)
- print("pearl")
- pearls = pearls + 1
- end
- elseif item.raw_name == "item.manasteel" then
- if steel == 0 then
- c.pushItemIntoSlot(side,i,1)
- print("steel")
- steel = steel + 1
- end
- end
- end
- sleep(sec)
- term.clear()
- end
- while true do
- dropItems()
- end
Advertisement
Add Comment
Please, Sign In to add comment