Advertisement
endminecraffter

endBaseControll

May 30th, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.71 KB | None | 0 0
  1. --##################--
  2. -- Programm von endminecraffter
  3. -- https://pastebin.com/u/endminecraffter
  4. -- Server: MyFTB.de Deutsches Minecraft modded Netzwerk
  5. -- Benötigte Mods/Apis: API Button(uhw8NuF3)
  6. -- MonSize: 8x5
  7. --##################--
  8.  
  9.  
  10. --Programm nicht benutzbar!
  11. os.loadAPI("Button")
  12. local t = Button.new("back")
  13. mon = peripheral.wrap("back")
  14. label = "endBaseControll"
  15.  
  16. os.loadAPI("button")
  17.  
  18.  
  19. function buttons()
  20. t:add("Abriegeln",nil,5,5,8,8,colors.red,colors.lime)
  21. t:draw()
  22. end
  23.  
  24. function monitor()
  25. mon.setTextScale(1)
  26. mon.setBackgroundColor(colors.black)
  27. mon.clear()
  28. mon.setTextScale(2)
  29. mon.setCursorPos(15,1)
  30. mon.write(label)
  31. mon.setTextScale(1)
  32. end
  33.  
  34. monitor()
  35.  
  36. function toggleFarm(name)
  37.     local colorss = 32768
  38.  
  39.     boiler[name]["active"] = not boiler[name]["active"]
  40.     btn.toggle(name)
  41.  
  42.     if not boiler[name]["active"] then
  43.         write("Farm ")
  44.         term.setTextColor(colors.green)
  45.         write(boiler[name]["name"])
  46.         term.setTextColor(colors.white)
  47.         print(" wurde aktiviert")
  48.     else
  49.         write("Farm ")
  50.         term.setTextColor(colors.red)
  51.         write(boiler[name]["name"])
  52.         term.setTextColor(colors.white)
  53.         print(" wurde deaktiviert")
  54.     end
  55.  
  56.     for name, data in pairs(boiler) do
  57.         if data["active"] then
  58.             colorss = colors.combine(colorss, data["color"])
  59.         else
  60.             colorss = colors.subtract(colorss, data["color"])
  61.         end
  62.     end
  63.  
  64.     rs.setBundledOutput(cfg["redSide"], colorss)
  65.     save()
  66. end
  67.  
  68. --while true do
  69. --    local event, p1 = t:handleEvents(os.pullEvent())
  70.        -- if event == "button_click" then
  71.        -- t:toggleButton(p1)
  72.         --monitor()
  73.    -- end
  74. --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement