Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.wrap("back")
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- local response = http.get("http://pastebin.com/raw.php?i=dgse1Ysa")
- if response then
- print("Update-suche erfolgreich!")
- local sSource = response.readAll()
- response.close()
- local file = fs.open( "startup", "r" )
- local sTarget = ""
- if file then
- sTarget = file.readAll()
- file.close()
- end
- if sSource ~= sTarget then
- term.write("Updates gefunden!")
- file = fs.open( "startup", "w" )
- file.write( sSource )
- file.close()
- print( "Wurde herruntergeladen als - startup - -Datei")
- print("Programm wird Neugestartet!")
- shell.run("startup")
- return
- else
- print("Es sind keine Updates vorhanden!")
- print("Programm wird gestartet!")
- sleep(3)
- clear()
- end
- else
- clear()
- print("ERROR! Informiere bitte TheBommel!!")
- clear()
- end
- -------------- Alle Quarry ausschalten nach reboot ----------------------------------------------------------------
- rednet.send(277, "off")
- rednet.send(277, "off")
- rednet.send(277, "off")
- rednet.send(277, "off")
- rednet.send(277, "off")
- rednet.send(277, "off")
- -----------------------------------------------------------------------------------------------------------------
- rednet.open("top")
- local mon = peripheral.wrap("back")
- -- Farbdecodierer
- function decode(int)
- if int == 1 then
- return 1
- elseif int == 2 then
- return 2
- elseif int == 3 then
- return 4
- elseif int == 4 then
- return 8
- elseif int == 5 then
- return 16
- elseif int == 6 then
- return 32
- elseif int == 7 then
- return 64
- elseif int == 8 then
- return 128
- elseif int == 9 then
- return 256
- elseif int == 10 then
- return 512
- elseif int == 11 then
- return 1024
- elseif int == 12 then
- return 2048
- elseif int == 13 then
- return 4096
- elseif int == 14 then
- return 8192
- elseif int == 15 then
- return 16384
- elseif int == 16 then
- return 32768
- end
- end
- -----------------------------------------------------------------------------------------------------------------
- term.clear()
- mon.setBackgroundColor(decode(16))
- mon.setCursorPos(14, 1)
- mon.write("Quarry-Control")
- -- Gruener Quarry
- mon.setBackgroundColor(decode(16))
- mon.setCursorPos(10, 5)
- mon.write("Quarry Gruen")
- mon.setCursorPos(30, 5)
- mon.setBackgroundColor(decode(15))
- mon.write("ON")
- mon.setCursorPos(35, 5)
- mon.setBackgroundColor(decode(14))
- mon.write("OFF")
- mon.setBackgroundColor(decode(16))
- -- Roter Quarry
- mon.setBackgroundColor(decode(16))
- mon.setCursorPos(10, 7)
- mon.write("Quarry Rot")
- mon.setCursorPos(30,7)
- mon.setBackgroundColor(decode(15))
- mon.write("ON")
- mon.setCursorPos(35, 7)
- mon.setBackgroundColor(decode(14))
- mon.write("OFF")
- mon.setBackgroundColor(decode(16))
- -- Cyan Quarry
- mon.setBackgroundColor(decode(16))
- mon.setCursorPos(10, 9)
- mon.write("Quarry Cyan")
- mon.setCursorPos(30, 9)
- mon.setBackgroundColor(decode(15))
- mon.write("ON")
- mon.setCursorPos(35, 9)
- mon.setBackgroundColor(decode(14))
- mon.write("OFF")
- mon.setBackgroundColor(decode(16))
- -- Brauner Quarry
- mon.setBackgroundColor(decode(16))
- mon.setCursorPos(10, 11)
- mon.write("Quarry Braun")
- mon.setCursorPos(30, 11)
- mon.setBackgroundColor(decode(15))
- mon.write("ON")
- mon.setCursorPos(35, 11)
- mon.setBackgroundColor(decode(14))
- mon.write("OFF")
- mon.setBackgroundColor(decode(16))
- -- Lime Quarry
- mon.setBackgroundColor(decode(16))
- mon.setCursorPos(10, 13)
- mon.write("Quarry Lime")
- mon.setCursorPos(30,13)
- mon.setBackgroundColor(decode(15))
- mon.write("ON")
- mon.setCursorPos(35, 13)
- mon.setBackgroundColor(decode(14))
- mon.write("OFF")
- mon.setBackgroundColor(decode(16))
- -- Oranger Quarry
- mon.setBackgroundColor(decode(16))
- mon.setCursorPos(10, 15)
- mon.write("Quarry Orange")
- mon.setCursorPos(30, 15)
- mon.setBackgroundColor(decode(15))
- mon.write("ON")
- mon.setCursorPos(35, 15)
- mon.setBackgroundColor(decode(14))
- mon.write("OFF")
- mon.setBackgroundColor(decode(16))
- -----------------------------------------------------------------------------------------------------------------
- -- ON/OFF Schaltung
- -- Gruen ON
- while true do
- e,d,x,y = os.pullEvent()
- if e == "monitor_touch" then
- if x == 30 and y == 5 then
- mon.setCursorPos(30, 5)
- mon.setBackgroundColor(decode(14))
- mon.write("ON")
- mon.setCursorPos(35, 5)
- mon.setBackgroundColor(decode(15))
- mon.write("OFF")
- g=1
- rednet.send(286, "lon")
- elseif x == 35 and y == 5 and g == 1 then
- mon.setCursorPos(35, 5)
- mon.setBackgroundColor(decode(14))
- mon.write("OFF")
- mon.setCursorPos(30,5)
- mon.setBackgroundColor(decode(15))
- mon.write("ON")
- g=2
- rednet.send(286, "loff")
- ----
- elseif x == 30 and y == 7 then
- mon.setCursorPos(30,7)
- mon.setBackgroundColor(decode(14))
- mon.write("ON")
- mon.setCursorPos(35, 7)
- mon.setBackgroundColor(decode(15))
- mon.write("OFF")
- rednet.send(286, "ron")
- r=1
- elseif x == 35 and y == 7 and r == 1 then
- mon.setCursorPos(30,7)
- mon.setBackgroundColor(decode(15))
- mon.write("ON")
- mon.setCursorPos(35, 7)
- mon.setBackgroundColor(decode(14))
- mon.write("OFF")
- rednet.send(286, "roff")
- r = 0
- -------
- elseif x == 30 and y == 9 then
- mon.setCursorPos(30,9)
- mon.setBackgroundColor(decode(14))
- mon.write("ON")
- mon.setCursorPos(35, 9)
- mon.setBackgroundColor(decode(15))
- mon.write("OFF")
- rednet.send(285, "lon")
- c=1
- elseif x == 35 and y == 9 and c == 1 then
- mon.setCursorPos(30,9)
- mon.setBackgroundColor(decode(15))
- mon.write("ON")
- mon.setCursorPos(35, 9)
- mon.setBackgroundColor(decode(14))
- mon.write("OFF")
- rednet.send(285, "loff")
- c = 0
- -------
- elseif x == 30 and y == 11 then
- mon.setCursorPos(30,11)
- mon.setBackgroundColor(decode(14))
- mon.write("ON")
- mon.setCursorPos(35, 11)
- mon.setBackgroundColor(decode(15))
- mon.write("OFF")
- rednet.send(285, "ron")
- b=1
- elseif x == 35 and y == 11 and b == 1 then
- mon.setCursorPos(30,11)
- mon.setBackgroundColor(decode(15))
- mon.write("ON")
- mon.setCursorPos(35, 11)
- mon.setBackgroundColor(decode(14))
- mon.write("OFF")
- rednet.send(285, "roff")
- b = 0
- -------
- elseif x == 30 and y == 13 then
- mon.setCursorPos(30,13)
- mon.setBackgroundColor(decode(14))
- mon.write("ON")
- mon.setCursorPos(35, 13)
- mon.setBackgroundColor(decode(15))
- mon.write("OFF")
- rednet.send(277, "lon")
- l=1
- elseif x == 35 and y == 13 and l == 1 then
- mon.setCursorPos(30,13)
- mon.setBackgroundColor(decode(15))
- mon.write("ON")
- mon.setCursorPos(35, 13)
- mon.setBackgroundColor(decode(14))
- mon.write("OFF")
- rednet.send(277, "loff")
- l = 0
- -------
- elseif x == 30 and y == 15 then
- mon.setCursorPos(30,15)
- mon.setBackgroundColor(decode(14))
- mon.write("ON")
- mon.setCursorPos(35, 15)
- mon.setBackgroundColor(decode(15))
- mon.write("OFF")
- rednet.send(277, "ron")
- o=1
- elseif x == 35 and y == 15 and o == 1 then
- mon.setCursorPos(30,15)
- mon.setBackgroundColor(decode(15))
- mon.write("ON")
- mon.setCursorPos(35, 15)
- mon.setBackgroundColor(decode(14))
- mon.write("OFF")
- rednet.send(277, "roff")
- o = 0
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement