Creeper9207

portals

Feb 7th, 2015
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.00 KB | None | 0 0
  1. --un = paintutils.loadImage("/.os/1")
  2. --paintutils.drawImage(un, 1, 1)
  3. paintutils.drawFilledBox(1, 1, 20, 26, colors.grey)
  4. term.setCursorPos(3, 2)
  5. term.write("TAZE PORTALS")
  6. sleep(5)
  7. --var
  8.  
  9. ms = 0
  10. msm = 0
  11. --Desktop drawer
  12. draw = function() do
  13.     running = 1
  14.     term.clear()
  15.     term.setBackgroundColor( colors.red )
  16.     un3 = paintutils.loadImage("/.os/3")
  17.     paintutils.drawImage(un3, 1, 3)
  18.     paintutils.drawImage(un3, 1, 1)
  19.     un2 = paintutils.loadImage("/.os/2")
  20.     paintutils.drawImage(un2, 2, 2)
  21.     --un = paintutils.loadImage("/.os/1")
  22.     --paintutils.drawImage(un, 1, 16)
  23.     term.setBackgroundColor( colors.lime )
  24.     term.setCursorPos(1, 1)
  25.     term.setBackgroundColor(colors.blue)
  26.     term.clearLine()
  27.     term.setBackgroundColor(colors.lime)
  28.     term.write("start  worm")
  29.     term.setBackgroundColor(colors.red)
  30.     term.setCursorPos(1, 15)
  31.     --term.write("Files")
  32. end
  33. end
  34. draw()
  35. while running == 1 do
  36.     event, button, x, y = os.pullEvent()
  37.     if event == "mouse_click" and button == 1 and x < 6 and y == 1 then
  38.         if msm == 0 then
  39.             un5 = paintutils.loadImage("/.os/5")
  40.             paintutils.drawImage(un5, 1, 2)
  41.             term.setCursorPos(1, 2)
  42.             term.write("files")
  43.             msm = 1
  44.         elseif msm == 1 then
  45.             msm = 0
  46.             draw()
  47.         end
  48.     end
  49.     if event == "mouse_click" and button == 2 then
  50.         if ms == 0 then
  51.             un4 = paintutils.loadImage("/.os/4")
  52.             paintutils.drawImage(un4, x, y)
  53.             term.setBackgroundColor( colors.cyan )
  54.             term.setCursorPos(x, y)
  55.             term.setTextColor(colors.white)
  56.             term.write("menu")
  57.             term.setCursorPos(x, (y+1))
  58.             term.write("op1")
  59.             term.setTextColor(colors.white)
  60.             ms = 1
  61.         elseif ms == 1 then
  62.             ms = 0
  63.             draw()
  64.         end
  65.     end
  66.     if event == "mouse_click" and x < 6 and y == 2 and msm == 1 and button == 1 then
  67.         shell.run("/.os/fm")
  68.     end
  69.     if event == "mouse_click" and x < 13 and x > 7 and button == 1 and y == 1 then
  70.         running = 0
  71.         shell.run("/.os/worm")
  72.     end
  73.     if event == "mouse_click" and x < 6 and y < 15 and y > 19 and button == 1 then
  74.         running = 0
  75.         shell.run("/.os/fm")
  76.     end
  77. end
  78. draw()
Advertisement
Add Comment
Please, Sign In to add comment