Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- side = "left" --Bildschirmseite
- mon = peripheral.wrap(side)
- mon.setBackgroundColor(32768)
- mon.setTextScale(3)
- mon.clear()
- --Hilfs-Funktionen--
- function calc_color(color)
- return math.pow(2, color - 1)
- end
- function msg(gap, line, color, groundb, text)
- mon.setBackgroundColor(calc_color(groundb))
- mon.setCursorPos(gap,line)
- mon.setTextColor(calc_color(color))
- text = mon.write(text)
- end
- --Haupt-Funktionen--
- function input()
- mon.setBackgroundColor(32768)
- mon.clear()
- msg(05,1,5,16,"Trading Machine")
- msg(05,2,5,16,"~~~~~~~~~~~~~~~")
- msg(01,3,9,16,"Ready to insert Items.")
- msg(01,5,9,16,"Please dont through more")
- msg(01,6,9,16,"then 16 Stacks inside.")
- end
- function counting()
- mon.setBackgroundColor(32768)
- mon.clear()
- msg(05,1,5,16,"Trading Machine")
- msg(03,3,5,16,"Counting your Items")
- i = 10
- while i > 0 do
- msg(11,4,10,16," "..i.." ")
- i = i - 1
- sleep(0.9)
- end
- end
- function choose()
- mon.setBackgroundColor(32768)
- mon.clear()
- msg(05,1,5,16,"Trading Machine")
- msg(05,2,5,16,"~~~~~~~~~~~~~~~")
- msg(01,3,9,16,"Now choose a type of")
- msg(01,4,9,16,"item, that you want to")
- msg(01,5,9,16,"get for your stuff.")
- end
- function restart()
- mon.setBackgroundColor(32768)
- mon.clear()
- msg(05,1,05,16,"Trading Machine")
- msg(05,2,05,16,"~~~~~~~~~~~~~~~")
- msg(01,3,05,16,"System is restarting,")
- msg(01,4,10,16,"wait")
- i = 16
- while i > 0 do
- msg(06,4,10,16,""..i.." seconds ")
- i = i - 1
- sleep(1)
- end
- end
- input()
- while true do
- if rs.getInput("bottom") then
- sleep(0.5)
- counting()
- choose()
- end
- if rs.getInput("top") then
- sleep(0.5)
- restart()
- shell.run("startup")
- end
- sleep(0.5)
- end
Add Comment
Please, Sign In to add comment