Advertisement
Guest User

securityManager.lua

a guest
Jan 21st, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.26 KB | None | 0 0
  1. local component = require("component")
  2. gpu = component.gpu
  3. gpu.setResolution(34,40)
  4. w,h = gpu.getResolution()
  5. local running=true
  6. local event = require("event")
  7. local interface = require("interface")
  8.  
  9. local function exit()
  10.   running = false
  11. end
  12. local function setAttackingPlayers()
  13.   for address in component.list("turretBase") do
  14.     local turret = component.proxy(address)
  15.     turret.setAttacksPlayers(true)
  16.   end
  17. end
  18. local function setAttackingPlayersNot()
  19.   for address in component.list("turretBase") do
  20.     local turret = component.proxy(address)
  21.     turret.setAttacksPlayers(false)
  22.   end
  23. end
  24.  
  25. interface.clearAllObjects()
  26. --[[interface.newButton("exit","Exit",w-19,h-5,20,6,exit,nil,0x00FF00,0x0000FF,1)--]]
  27. interface.newButton("attack","Spieler angreifen",0,0,w+1,h/2+2,setAttackingPlayers,nil,0x993333,0x990000,2)
  28.  
  29. interface.newButton("noattack","Spieler Nicht angreifen",0,h/2+2,w+1,h/2,setAttackingPlayersNot,nil,0x00FF00,0x00FF99,1)
  30.  
  31. interface.updateAll()
  32.  
  33.  
  34.  
  35.  
  36. while running do
  37.   local _,_,x,y = event.pull(1,"touch")
  38.     if x and y then
  39.         interface.processClick(x,y)
  40.     end
  41.     rand = math.random(1,100)
  42.     if screen == 1 then
  43.         interface.setBarValue("s1-4",rand)
  44.         interface.setLabelText("s1-5","Amount: "..rand)
  45.     end
  46. end
  47. interface.clearAllObjects()
  48. os.exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement