Advertisement
Guest User

help

a guest
Jan 6th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.23 KB | None | 0 0
  1. local component = require("component")
  2. local term = require("term")
  3. local event = require("event")
  4. local unicode = require("unicode")
  5. local gpu = component.gpu
  6. local resw = 40
  7. local resh = 12
  8. gpu.bind('93f')
  9.  
  10. function cText(y, str)
  11.   gpu.set((resw/2-string.len(str)/2)+2, y, str)
  12. end
  13.  
  14. function drawUI()
  15.   term.clear()
  16.   local ico = {}
  17.   for i = 1, 10 do ico[i] = unicode.char(math.random(1000,2000)) end
  18.   gpu.setResolution(resw,resh)
  19.   gpu.setForeground(0xFF9900)
  20.   cText(2, ico[1].." ATYPICAL'S DIAMOND HUNTER "..ico[1])
  21.   gpu.setForeground(0x77FF77)
  22.   gpu.set(3, 4, ico[2].." XP:")
  23.   gpu.set(3, 5, ico[2].." RF:")
  24.   gpu.setForeground(0x9999FF)
  25.   gpu.set(3, 6, ico[3].." Diamond Patches:")
  26.   gpu.set(3, 7, ico[3].." Total Diamonds:")
  27.   gpu.setForeground(0xFF99FF)
  28.   gpu.set(3, 9, ico[4].." X: ".." Y: ")
  29.   gpu.setBackground(0xFF4444)
  30.   gpu.setForeground(0x000000)
  31.   for i = 1, 3 do
  32.     gpu.set(32, 8+i, "      ")
  33.   end
  34.   gpu.set(32, 10, " STOP")
  35.   gpu.setBackground(0x000000)
  36.   gpu.setForeground(0xFFFFFF)
  37. end
  38.  
  39. function getMessage()
  40.   --local msgTable = event.pull('modem_message')
  41.   gpu.set(1,1,'ASDASDASD')
  42. end
  43.  
  44. event.listen('modem_message', getMessage)
  45.  
  46. while true do
  47.   drawUI()
  48.   os.sleep(3)
  49. end
  50.  
  51. gpu.setResolution(80,25)
  52. gpu.setForeground(0xFFFFFF)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement