Advertisement
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 mainscreen()
- mon.setBackgroundColor(32768)
- mon.clear()
- msg(05,1,5,16,"Trading Machine")
- msg(01,3,9,16,"Dont throw more then 16")
- msg(01,4,9,16,"stack per item type")
- msg(01,5,9,16,"into the *****.")
- msg(10,5,6,16,"Input")
- end
- function counting()
- mon.setBackgroundColor(32768)
- mon.clear()
- msg(05,1,5,16,"Trading Machine")
- msg(03,3,5,16,"Counting your Items")
- msg(12,4,10,16,"10")
- sleep(0.9)
- msg(12,4,10,16,"9 ")
- sleep(0.9)
- msg(12,4,10,16,"8 ")
- sleep(0.9)
- msg(12,4,10,16,"7 ")
- sleep(0.9)
- msg(12,4,10,16,"6 ")
- sleep(0.9)
- msg(12,4,10,16,"5 ")
- sleep(0.9)
- msg(12,4,10,16,"4 ")
- sleep(0.9)
- msg(12,4,10,16,"3 ")
- sleep(0.9)
- msg(12,4,10,16,"2 ")
- sleep(0.9)
- msg(12,4,10,16,"1 ")
- sleep(0.9)
- end
- function output()
- mon.setBackgroundColor(32768)
- mon.clear()
- msg(05,1,5,16,"Trading Machine")
- 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
- mainscreen()
- while true do
- if rs.getInput("bottom") then
- sleep(0.5)
- counting()
- output()
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement