Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local gpu = component.gpu
- local rs = component.redstone
- local w, h = gpu.getResolution()
- local mon = require("tty")
- local event = require("event")
- local side = require("sides")
- local color = require("colors")
- local best = ""
- local name = ""
- local prio = ""
- function startseite()
- mon.clear()
- gpu.setBackground(0x6E6E6E)
- gpu.fill(1, 1, w, h, " ")
- gpu.setForeground(0xB40404)
- mon.setCursor(w/2 - 7, 1)
- print("Lagerverwaltung")
- mon.setCursor(w/2 - 8, 2)
- print("----------------")
- gpu.setBackground(0xDF0101)
- gpu.fill(10, 10, 25, 7, " ")
- gpu.setForeground(0x000000)
- mon.setCursor(17, 13)
- print("Bestellung")
- local klick = true
- while klick do
- local _,_,x,y = event.pull("touch")
- if x>9 and x<35 and y>9 and y<17 then
- klick = false
- gpu.setBackground(0x01DF01)
- gpu.fill(10, 10, 25, 7, " ")
- gpu.setForeground(0x000000)
- mon.setCursor(17, 13)
- print("Bestellung")
- os.sleep(1)
- bestellung()
- end
- end
- end
- function bestellung()
- mon.clear()
- gpu.setBackground(0x6E6E6E)
- gpu.fill(1, 1, w, h, " ")
- gpu.setForeground(0xB40404)
- mon.setCursor(w/2 - 5, 1)
- print("Bestellung")
- mon.setCursor(w/2 - 6, 2)
- print("------------")
- mon.setCursor(10, 10)
- print("Bestellung:")
- gpu.setBackground(0xFFFFFF)
- gpu.fill(25, 9, w-35, 3, " ")
- mon.setCursor(26, 10)
- print(best)
- gpu.setBackground(0x6E6E6E)
- mon.setCursor(10, 16)
- print("Name:")
- gpu.setBackground(0xFFFFFF)
- gpu.fill(25, 15, 30, 3, " ")
- mon.setCursor(26, 16)
- print(name)
- gpu.setBackground(0x6E6E6E)
- mon.setCursor(60, 16)
- print("Priorität:")
- gpu.setBackground(0xDF0101)
- gpu.fill(75, 15, 20, 3, " ")
- gpu.setForeground(0xFFFFFF)
- mon.setCursor(83, 16)
- print("HOCH")
- gpu.setBackground(0xDF7401)
- gpu.fill(100, 15, 20, 3, " ")
- gpu.setForeground(0xFFFFFF)
- mon.setCursor(107, 16)
- print("MITTEL")
- gpu.setBackground(0xD7DF01)
- gpu.fill(125, 15, 20, 3, " ")
- gpu.setForeground(0xFFFFFF)
- mon.setCursor(132, 16)
- print("NIEDRIG")
- gpu.setBackground(0xDF0101)
- gpu.fill(10, h-4, 25, 3, " ")
- gpu.setForeground(0x000000)
- mon.setCursor(18, h-3)
- print("Abbrechen")
- gpu.setBackground(0xDF0101)
- gpu.fill(125, h-4, 25, 3, " ")
- gpu.setForeground(0x000000)
- mon.setCursor(135, h-3)
- print("Senden")
- gpu.setBackground(0xFFFFFF)
- gpu.fill(10, h-12, w-20, 6, " ")
- gpu.setForeground(0x000000)
- mon.setCursor(12, h-10)
- if best == "" then
- print("Geben Sie eine Bestellung ein.")
- elseif name == "" then
- print("Geben Sie einen Namen ein.")
- elseif prio == "" then
- print("Legen Sie eine Priorität fest.")
- end
- if prio == "hoch" then
- gpu.setBackground(0x0000FF)
- gpu.fill(75, 15, 1, 3, " ")
- gpu.fill(94, 15, 1, 3, " ")
- gpu.setBackground(0xFFFFFF)
- gpu.setForeground(0x000000)
- mon.setCursor(12, h-9)
- print("Priorität auf 'HOCH' festgelegt! ")
- elseif prio == "mittel" then
- gpu.setBackground(0x0000FF)
- gpu.fill(100, 15, 1, 3, " ")
- gpu.fill(119, 15, 1, 3, " ")
- gpu.setBackground(0xFFFFFF)
- gpu.setForeground(0x000000)
- mon.setCursor(12, h-9)
- print("Priorität auf 'MITTEL' festgelegt! ")
- elseif prio == "niedrig" then
- gpu.setBackground(0x0000FF)
- gpu.fill(125, 15, 1, 3, " ")
- gpu.fill(144, 15, 1, 3, " ")
- gpu.setBackground(0xFFFFFF)
- gpu.setForeground(0x000000)
- mon.setCursor(12, h-9)
- print("Priorität auf 'NIEDRIG' festgelegt! ")
- end
- local klickb = true
- while klickb do
- local _,_,x,y = event.pull("touch")
- if x>24 and x<w-10 and y>8 and y<13 then
- mon.setCursor(12, h-10)
- print("Bestätigen Sie mit 'ENTER' ! ")
- mon.setCursor(26, 10)
- best = io.read()
- bestellung()
- end
- if x>24 and x<56 and y>14 and y<19 then
- mon.setCursor(12, h-10)
- print("Bestätigen Sie mit 'ENTER' ! ")
- mon.setCursor(26, 16)
- name = io.read()
- bestellung()
- end
- if x>74 and x<96 and y>14 and y<19 then
- mon.setCursor(12, h-10)
- print("Priorität auf 'HOCH' festgelegt! ")
- prio = "hoch"
- gpu.setBackground(0x0000FF)
- gpu.fill(75, 15, 1, 3, " ")
- gpu.fill(94, 15, 1, 3, " ")
- bestellung()
- end
- if x>99 and x<121 and y>14 and y<19 then
- mon.setCursor(12, h-10)
- print("Priorität auf 'MITTEL' festgelegt! ")
- prio = "mittel"
- gpu.setBackground(0x0000FF)
- gpu.fill(100, 15, 1, 3, " ")
- gpu.fill(119, 15, 1, 3, " ")
- bestellung()
- end
- if x>124 and x<146 and y>14 and y<19 then
- mon.setCursor(12, h-10)
- print("Priorität auf 'NIEDRIG' festgelegt! ")
- prio = "niedrig"
- gpu.setBackground(0x0000FF)
- gpu.fill(125, 15, 1, 3, " ")
- gpu.fill(144, 15, 1, 3, " ")
- bestellung()
- end
- if x>9 and x<36 and y>h-5 and y<h-1 then
- klickb = false
- startseite()
- end
- end
- end
- startseite()
Advertisement
Add Comment
Please, Sign In to add comment