Advertisement
Guest User

MobFarm

a guest
Sep 2nd, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. --Desktop
  2.  
  3. slc = 0
  4. tBarC = 8
  5. tBartC = 1
  6. backColor = 32
  7. term.setBackgroundColor(1)
  8. term.clear()
  9. function titleBar()
  10.   term.setCursorPos(1,1)
  11.   term.setBackgroundColor(tBarC)
  12.   term.setTextColor(tBartC)
  13.   term.clearLine()
  14.   term.setCursorPos(3,1)
  15.   print("[Mobs Spawner Selection]")
  16. end
  17. function drawDesktop()
  18.   term.setBackgroundColor(backColor)
  19.   term.clear()
  20.   bground = paintutils.loadImage("desktop")
  21.   paintutils.drawImage(bground,1,1)
  22.   titleBar()
  23.  
  24. end
  25.  
  26. function drawMenu1()
  27. term.setTextColor(256)
  28. term.setBackgroundColor(128)
  29. term.setCursorPos(1,2)
  30. print("          ")
  31. term.setCursorPos(1,3)
  32. print(" Creeper  ")
  33. term.setCursorPos(1,4)
  34. print(" Enderman ")
  35. term.setCursorPos(1,5)
  36. print(" Skeleton ")
  37. term.setCursorPos(1,6)
  38. print(" Zombie   ")
  39. term.setCursorPos(1,7)
  40. print(" Blaze    ")
  41. term.setCursorPos(1,8)
  42. print(" Spider   ")
  43. term.setCursorPos(1,9)
  44. print(" Slime    ")
  45. term.setCursorPos(1,10)
  46. print(" Cow      ")
  47. term.setCursorPos(1,11)
  48. print("          ")
  49.  
  50. end
  51.  
  52. drawDesktop()
  53. while true do
  54. local event, button, x, y = os.pullEventRaw()
  55.   if slc == 0 then
  56.     if event == "mouse_click" then
  57.       if X >=2 and X <=8 and Y ==1 and button ==1 then
  58.       drawMenu1()
  59.       slc = 1
  60.         else
  61.         drawDesktop()
  62.       end
  63.     end
  64.    elseif slc == 1 then
  65.      if X >=1 and X <=11 and button ==1 and Y==3 then slc = 0
  66.        os.reboot()
  67.        else
  68.        slc = 0
  69.        drawDesktop()
  70.        
  71.      end
  72.   end
  73. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement