prostoshu

ET_ExpTerminal

Apr 6th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.13 KB | None | 0 0
  1. local component = require("component")
  2. local event = require("event")
  3. local term = require("term")
  4.  
  5. local gpu = component.gpu
  6. local sensor = component.openperipheral_sensor
  7. local cb = component.command_block
  8.  
  9. local inWork = false
  10.  
  11. gpu.setResolution(40,20)
  12.  
  13.  
  14. --Заголовок и края
  15. gpu.setForeground(0x8B4513)
  16. gpu.setBackground(0xFFFF00)
  17. term.clear()
  18. --gpu.setForeground(0x00008B)
  19. --gpu.setBackground(0xFFFF00)
  20. gpu.set(13,4, "      ██████      ")
  21. gpu.set(13,5, "    ██████████    ")
  22. gpu.set(13,6, "    ██████████    ")
  23. gpu.set(13,7, "      ██  ██      ")
  24. gpu.set(13,8, "      ██  ██      ")
  25. gpu.set(13,9, "    ██      ██    ")
  26. gpu.set(13,10,"  ██          ██  ")
  27. gpu.set(13,11,"██              ██")
  28. gpu.set(13,12,"██              ██")
  29. gpu.set(13,13,"██              ██")
  30. gpu.set(13,14,"██              ██")
  31. gpu.set(13,15,"████          ████")
  32. gpu.set(13,16,"    ██████████    ")
  33.  
  34. gpu.setForeground(0x00FF00)
  35.  
  36. gpu.set(21,7, "▒▒")
  37. gpu.set(21,8, "▒▒")
  38. gpu.set(19,9, "▒▒▓▓▒▒")
  39. gpu.set(17,10,"▒▒░░▓▓▓▓▒▒")
  40. gpu.set(15,11,"▒▒░░▓▓▓▓▓▓▓▓▒▒")
  41. gpu.set(15,12,"▒▒░░▓▓▓▓▓▓▓▓▒▒")
  42. gpu.set(15,13,"▒▒▓▓▓▓▓▓▓▓░░▒▒")
  43. gpu.set(15,14,"▒▒▓▓▓▓▓▓▓▓░░▒▒")
  44. gpu.set(17,15,"▒▒▓▓▓▓░░▒▒")
  45.  
  46. gpu.setForeground(0xFFFFFF)
  47. gpu.setBackground(0x000000)
  48.  
  49.  
  50. function ClickScreen(name,adr,x,y,mousekey,player)
  51.   if inWork then
  52.     return
  53.   else
  54.     inWork = true
  55.   end
  56.    
  57.   xplevel = sensor.getPlayerByName(player).all().player.experience.level
  58.   if xplevel > 0 then
  59.     RunCommand("/XP -1L "..player)
  60.     RunCommand("/give "..player.." 384 2")
  61.   else
  62.     RunCommand("/msg "..player.." Недостаточно опыта")
  63.   end
  64.  
  65.   inWork = false
  66. end
  67.  
  68.  
  69. function RunCommand(text)
  70.   if cb.setCommand(text) then
  71.     cb.executeCommand()
  72.   end
  73. end
  74.  
  75.  
  76. event.listen("touch",ClickScreen)
  77.  
  78. while true do
  79.   os.sleep(5)
  80. end
Add Comment
Please, Sign In to add comment