Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- senI = sensor.wrap("back")
- function uE()
- term.setCursorPos(1,16)
- term.setTextColor(colors.red)
- print("ungueltige Eingabe!")
- sleep(5)
- os.reboot()
- end
- term.clear()
- term.setTextColor(colors.white)
- term.setCursorPos(15,1)
- term.write("Teleporter-Calculator")
- term.setCursorPos(15,2)
- term.write("Version: ")
- term.setTextColor(colors.cyan)
- term.write("2.0")
- term.setCursorPos(15,4)
- term.setTextColor(colors.white)
- print("Hier kannst du den Stromverbrauch")
- term.setCursorPos(15,5)
- print("fuer einen Teleporter sehen.")
- term.setCursorPos(15,6)
- print("Trage einfach die X,Y,Z Koordinaten")
- term.setCursorPos(15,7)
- print("der 2 Teleporter ein.")
- term.setCursorPos(15,8)
- print("Danach wird dein Gewicht ueberprueft")
- term.setCursorPos(15,9)
- print("und die Kosten fuer eine")
- term.setCursorPos(15,10)
- print("Teleportation berechnet.")
- term.setCursorPos(15,12)
- term.write("made by ")
- term.setTextColor(colors.cyan)
- term.write("Nike622000")
- term.setCursorPos(1,1)
- term.setTextColor(colors.cyan)
- print("Teleporter 1")
- term.setTextColor(colors.white)
- term.setCursorPos(1,2)
- print("X-Coord: ")
- local XCoord1 = read()
- term.setCursorPos(1,4)
- print("Y-Coord: ")
- local YCoord1 = read()
- term.setCursorPos(1,6)
- print("Z-Coord: ")
- local ZCoord1 = read()
- term.setCursorPos(1,9)
- term.setTextColor(colors.cyan)
- print("Teleporter 2")
- term.setTextColor(colors.white)
- term.setCursorPos(1,10)
- print("X-Coord: ")
- local XCoord2 = read()
- term.setCursorPos(1,12)
- print("Y-Coord: ")
- local YCoord2 = read()
- term.setCursorPos(1,14)
- print("Z-Coord: ")
- local ZCoord2 = read()
- if type( XCoord1 ) == "number" then
- else
- XCoord1 = tonumber(XCoord1)
- end
- if type( YCoord1 ) == "number" then
- else
- YCoord1 = tonumber(YCoord1)
- end
- if type( ZCoord1 ) == "number" then
- else
- ZCoord1 = tonumber(ZCoord1)
- end
- if type( XCoord2 ) == "number" then
- else
- XCoord2 = tonumber(XCoord2)
- end
- if type( YCoord2 ) == "number" then
- else
- YCoord2 = tonumber(YCoord2)
- end
- if type( ZCoord2 ) == "number" then
- else
- ZCoord2 = tonumber(ZCoord2)
- end
- if XCoord1 == nil or YCoord1 == nil or ZCoord1 == nil or XCoord2 == nil or YCoord2 == nil or ZCoord2 == nil then
- uE()
- end
- if XCoord1 == XCoord2 and YCoord1 == YCoord2 and ZCoord1 == ZCoord2 then
- term.setCursorPos(1,16)
- term.setTextColor(colors.red)
- print("Teleporter an der selben Stelle!")
- sleep(5)
- os.reboot()
- end
- term.setCursorPos(1,16)
- term.setTextColor(colors.red)
- print("Inventar wird gescannt!")
- term.setCursorPos(1,17)
- print("vor den Computer stellen!")
- while true do
- b=2
- d=2
- eu=0
- menge = 0
- zieleinv = senI.getTargets()
- for k,v in pairs(zieleinv) do
- if v.Name == "Player"
- and v.Position.X<0.5 and v.Position.X>-0.5
- and v.Position.Y==-0.5
- and v.Position.Z<-1.5 and v.Position.Z>-2.5
- then
- details = senI.getTargetDetails(k)
- for i = 1,40 do
- item = details.Inventory[i].Name
- anzahl = details.Inventory[i].Size
- maxanzahl = details.Inventory[i].MaxStack
- if item == "empty" then
- else
- menge = menge + 100*anzahl/maxanzahl
- sleep(0.1)
- end
- XCoord = XCoord1-XCoord2
- YCoord = YCoord1-YCoord2
- ZCoord = ZCoord1-ZCoord2
- Entfernung = math.sqrt(XCoord^2+YCoord^2+ZCoord^2)
- Gesamt = menge+1000
- eu = math.floor(5 * math.floor(Gesamt) * (math.floor(Entfernung) + 10)^0.7)
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.lime)
- term.write("Gewicht: "..Gesamt.." / 5000")
- term.setCursorPos(1,2)
- term.setTextColor(colors.cyan)
- term.write("Teleportkosten: "..eu.."EU")
- term.setCursorPos(1,3)
- term.setTextColor(colors.yellow)
- term.write("Teleporter 1: X: "..XCoord1.." Y: "..YCoord1.." Z: "..ZCoord1)
- term.setCursorPos(1,4)
- term.write("Teleporter 2: X: "..XCoord2.." Y: "..YCoord2.." Z: "..ZCoord2)
- term.setCursorPos(1,6)
- term.setTextColor(colors.red)
- term.write("STRG + R halten um neuzustarten!")
- sleep(3)
- end
- end
- end
Add Comment
Please, Sign In to add comment