Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Alle Rechte am nachfolgenden Programm Code sind "SimlorLP" (oder in Minecraft auch nur "Simlor") vorbehalten.
- term.setBackgroundColor(128)
- term.clear()
- term.setBackgroundColor(1)
- term.setCursorPos(1,4)
- print(" ")
- print(" ")
- print(" ")
- term.setCursorPos(14,5)
- term.setTextColor(128)
- write("SimSoft - ")
- term.setTextColor(128)
- print("Big Reactors")
- --Variablen
- file = fs.open("SimSoft/SappS/BigReactorOrdner/daten","r")
- local fileData = {}
- local line = file.readLine()
- repeat
- table.insert(fileData,line)
- line = file.readLine()
- until line == nil
- file.close()
- sps = fileData[1]
- sps = (sps+1)
- sps = (sps-1)
- --Functionen
- function GraMenu()
- while true do
- local reactor = peripheral.wrap("BigReactors-Reactor_"..id)
- term.setBackgroundColor(128)
- shell.run("clear")
- term.setTextColor(32768)
- term.setCursorPos(3,2)
- print("SimSoft - BigReactor-SappS")
- term.setCursorPos(1,4)
- term.setBackgroundColor(256)
- print(" ")
- print(" ")
- print(" ")
- print(" ")
- print(" ")
- print(" ")
- print(" ")
- term.setCursorPos(2,18)
- term.setTextColor(256)
- term.setBackgroundColor(128)
- print("Verlassen")
- term.setBackgroundColor(256)
- term.setCursorPos(4,5)
- term.setTextColor(1)
- print("Speicher : ",reactor.getEnergyStored(),"RF von 10000000RF")
- term.setCursorPos(4,7)
- term.setTextColor(128)
- print("Temperatur : ",reactor.getFuelTemperature())
- tem = reactor.getFuelTemperature()
- if tem > 100 and tem < 1000 then
- term.setCursorPos(22,7)
- print("C ")
- elseif tem > 1000 and tem < 10000 then
- term.setCursorPos(23,7)
- print("C ")
- elseif tem > 10000 and tem < 100000 then
- term.setCursorPos(24,7)
- print("C ")
- elseif tem > 100000 then
- term.setCursorPos(25,7)
- print("C ")
- else
- term.setCursorPos(21,7)
- print("C ")
- end
- term.setBackgroundColor(128)
- term.setCursorPos(36,18)
- term.setTextColor(256)
- print("Reaktor ein/aus")
- term.setBackgroundColor(128)
- term.setCursorPos(2,12)
- term.setTextColor(256)
- write("Abschalten bei ")
- term.setTextColor(1)
- write(sps)
- write("%")
- term.setTextColor(256)
- print(" Speicher belegung")
- term.setBackgroundColor(256)
- term.setCursorPos(4,9)
- term.setTextColor(1)
- ak = reactor.getActive()
- if ak == true then
- aka = "Aktiv"
- else
- aka = "Inaktiv"
- end
- print("Status : ",aka)
- sleep(0.4)
- end
- end
- function UeberW()
- while true do
- local reactor = peripheral.wrap("BigReactors-Reactor_"..id)
- sna = reactor.getEnergyStored()
- if ak == true then
- if sps == 0 then
- elseif sps == 25 and sna > 2500000 then
- reactor.setActive(false)
- elseif sps == 25 and sna < 2500000 then
- reactor.setActive(true)
- elseif sps == 50 and sna > 5000000 then
- reactor.setActive(false)
- elseif sps == 50 and sna < 5000000 then
- reactor.setActive(true)
- elseif sps == 75 and sna > 7500000 then
- reactor.setActive(false)
- elseif sps == 75 and sna < 7500000 then
- reactor.setActive(true)
- elseif sps == 100 and sna > 9999999 then
- reactor.setActive(false)
- elseif sps == 100 and sna < 9999999 then
- reactor.setActive(true)
- end
- end
- sleep(1)
- end
- end
- function TouchMenu()
- while true do
- event,side,x,y = os.pullEvent()
- if event == "mouse_click" then
- local reactor = peripheral.wrap("BigReactors-Reactor_"..id)
- if x >= 2 and x <= 10 and y == 18 then
- break
- end
- if x >= 36 and x <= 50 and y == 18 then
- if ak == true then
- reactor.setActive(false)
- elseif ak == false then
- reactor.setActive(true)
- end
- end
- if x >= 17 and x <= 20 and y == 12 then
- if sps == 0 then
- sps = 25
- local file = fs.open("SimSoft/SappS/BigReactorOrdner/daten","w")
- file.writeLine(sps)
- file.close()
- elseif sps == 25 then
- sps = 50
- local file = fs.open("SimSoft/SappS/BigReactorOrdner/daten","w")
- file.writeLine(sps)
- file.close()
- elseif sps == 50 then
- sps = 75
- local file = fs.open("SimSoft/SappS/BigReactorOrdner/daten","w")
- file.writeLine(sps)
- file.close()
- elseif sps == 75 then
- sps = 100
- local file = fs.open("SimSoft/SappS/BigReactorOrdner/daten","w")
- file.writeLine(sps)
- file.close()
- elseif sps == 100 then
- sps = 0
- local file = fs.open("SimSoft/SappS/BigReactorOrdner/daten","w")
- file.writeLine(sps)
- file.close()
- end
- end
- end
- end
- end
- --Reaktor Suche
- term.setBackgroundColor(128)
- term.clear()
- term.setCursorPos(2,2)
- term.setTextColor(1)
- print("Reaktor Verbindung herstellen")
- term.setBackgroundColor(256)
- term.setCursorPos(1,4)
- print(" ")
- print(" ")
- print(" ")
- term.setCursorPos(4,5)
- term.setTextColor(128)
- print("Reaktor ID:")
- term.setTextColor(1)
- term.setCursorPos(16,5)
- id = read()
- local reactor = peripheral.wrap("BigReactors-Reactor_"..id)
- con = reactor
- if con == fasle then
- term.setCursorPos(1,9)
- term.setBackgroundColor(256)
- print(" ")
- print(" ")
- print(" ")
- term.setCursorPos(4,10)
- term.setTextColor(16384)
- print("Die ID konnte nicht gefunden werden :/")
- sleep(2)
- else
- term.setCursorPos(1,9)
- term.setBackgroundColor(256)
- print(" ")
- print(" ")
- print(" ")
- term.setCursorPos(4,10)
- term.setTextColor(32)
- print("Verbinde...")
- end
- --Hauptteil
- parallel.waitForAny(function() GraMenu() end,function() TouchMenu() end, function() UeberW() end)
- --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement