Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- sen = sensor.wrap("top")
- os.pullEvent = os.pullEventRaw
- s = sen.getTargets()
- function getS()
- for v, k in pairs(s) do
- if k.Name == "ME Wireless Access Point" then
- target = v
- end
- end
- return target
- end
- Shard_Of_Minium_Amount = 0
- print("1 "..Shard_Of_Minium_Amount)
- f = getS()
- s1 = sen.getTargetDetails(target)
- for v, k in pairs(s1.Items) do
- if k.Name == "Shard of Minium" then
- Shard_Of_Minium_Amount = k.Size
- end
- print("2 "..Shard_Of_Minium_Amount)
- if Shard_Of_Minium_Amount > 0 then
- local file = fs.open("Craftings", "r")
- Craftings = file.readLine()
- file.close()
- Craftings = Craftings + (Shard_Of_Minium_Amount * 40)
- print("NEW Craftings "..Craftings)
- local file = fs.open("Craftings", "w")
- file.write(Craftings)
- file.close()
- if Craftings == 0 then
- sleep(5)
- os.reboot()
- end
- sleep(1)
- rs.setOutput("bottom", true)
- sleep(3)
- rs.setOutput("bottom", false)
- sleep(1)
- end
- end
- local file = fs.open("Craftings", "r")
- Craftings = file.readLine()
- file.close()
- print("Abfrage Craftings "..Craftings)
- Craftings = tonumber(Craftings)
- x = 0
- while true do
- if Craftings >= 8 then
- a = turtle.getItemCount(1)
- print("Übrige Craftings "..Craftings)
- if a == 64 then
- turtle.drop(64)
- Craftings = Craftings - 8
- local file = fs.open("Craftings", "w")
- file.write(Craftings)
- file.close()
- end
- else
- print("sleep10")
- sleep(30)
- os.reboot()
- end
- x = x + 1
- if x == 50 then
- os.reboot()
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement