Guest User

hud.lua

a guest
Jan 21st, 2017
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.62 KB | None | 0 0
  1. local component = require("component")
  2. local colors = require("colors")
  3. local bridge = component.openperipheral_bridge
  4. local table = require("table")
  5.  
  6. local Users, UUID = {}
  7.  
  8. function EnderPouchSystem(tempX, tempY)
  9.   local startX = tempX
  10.   local startY = tempY
  11.   local endX = 112
  12.  
  13.   local paddingIconY = 16 --distance between vertical placement of icons
  14.   local paddingIconX = 16 --distance between horizontal placement of icons
  15.  
  16.   local paddingTextX = 4 --horizontal additional padding to add text
  17.   local paddingTextY = 5 --vertical additional padding to add text
  18.  
  19.   --bridge.addBox(startX,startY,endX,paddingIconY + paddingIconY,colors.black,0.2)
  20.  
  21.   bridge.addIcon(startX,startY,"EnderStorage:enderPouch")
  22.   bridge.addText(startX + paddingIconX + paddingTextX,startY + paddingTextY,"Storage Deposit",0xFFFFFF)
  23.  
  24.   bridge.addIcon(startX,startY + paddingIconY,"EnderStorage:enderPouch",4095)
  25.   bridge.addText(startX + paddingIconX + paddingTextX,startY + paddingIconY + paddingTextY,"Exchanging pouch",0xFFFFFF)
  26. end
  27.  
  28. function PlayerFun()
  29.   Users, UUID = bridge.getUsers()
  30.   for i = 0, table.getn(Users) do
  31.     if Users[i] == "TheTrueReaper" then
  32.       print("Torben")
  33.     end
  34.     if Users[i] == "CliffordMiller" then
  35.       print("Sjobbe")
  36.     end
  37.   end
  38.  
  39.   print(users)
  40. end  
  41.  
  42. function start()
  43.   bridge.clear()
  44.  
  45.   --Put functions here(if they are static)
  46.  
  47.      --Example function()
  48.  
  49.   --End of static functions
  50.  
  51.     while true do
  52.     bridge.clear()
  53.  
  54.     --Put functions here(if they need to be updated every tick)
  55.  
  56.       EnderPouchSystem(2,2)
  57.       PlayerFun()
  58.  
  59.     --End of ticking functions
  60.    
  61.     bridge.sync()
  62.     os.sleep(0.1)
  63.     end
  64. end
  65.  
  66. start()
Advertisement
Add Comment
Please, Sign In to add comment