Advertisement
Guest User

startup

a guest
Jan 24th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. n = peripheral.wrap("back")
  2. m = peripheral.wrap("right")
  3. x, y = m.getSize()
  4. m.clear()
  5. m.setBackgroundColor(colors.black)
  6. for bg1 = 1,x,1 do
  7.   for bg2 = 1,y,1 do
  8.     m.setCursorPos(bg1,bg2)
  9.     m.write(" ")
  10.   end
  11. end
  12. for count=2,25,1 do
  13.   m.setCursorPos(1,count)
  14.   m.setBackgroundColor(colors.white)
  15.   m.setTextColor(colors.black)
  16.   if count/2 == math.floor(count/2) then
  17.     m.setTextColor(colors.white)
  18.     m.setBackgroundColor(colors.lightGray)
  19.   end
  20.   --if count == 2 or count == 4 then
  21.   m.write("   ")
  22. end
  23. while true do
  24.   event, side, xPos, yPos = os.pullEvent("monitor_touch")
  25.   if xPos < 4 and yPos <= 25 and yPos > 1 and side == "right" then
  26.     n.setPitch(yPos-1)
  27.     n.triggerNote()
  28.   end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement