Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- component = require("component")
- term = require("term")
- gpu = component.gpu
- event = require("event")
- sides = require("sides")
- ---------- Redstone Signals -----
- VoidMiner = component.proxy(component.get("7b164978-e55f-466b-9e10-296577b3494d"))
- AE = component.proxy(component.get("4a7fcdbc-42d4-46d4-bc47-9e6681317d4f"))
- OreProcess = component.proxy(component.get("475688b1-7a63-4b5c-a0c6-596590043f3c"))
- Woot = component.proxy(component.get("5293fa86-e3a4-4061-b8f0-00f876ec5ed0"))
- ---------- TABLES -----------
- colors = { black = 0x000000, white = 0xf8f8ff, blue = 0x0000ff, lightGray = 0xd9d9d9, red = 0xff0000,
- purple = 0x9b30ff, carrot = 0xffa500, magenta = 0xcd00cd, lightBlue = 0x87cefa, yellow = 0xffff00,
- lime = 0x32cd32, pink = 0xffc0cb, gray = 0x696969, brown = 0x8b4500, green = 0x006400, cyan = 0x008b8b,
- olive = 0x6b8e23, gold = 0x8b6914, orangered = 0xdb4e02, diamond = 0x0fa7c7,crimson = 0xaf002a,fuchsia = 0xfd3f92,
- folly = 0xff004f, frenchBlue = 0x0072bb, lilac = 0x86608e, flax = 0xeedc82, darkGray = 0x563c5c,
- englishGreen = 0x1b4d3e, eggplant = 0x614051, deepPink = 0xff1493, ruby = 0x843f5b, orange = 0xf5c71a,
- lemon = 0xffd300, darkBlue = 0x002e63, bitterLime = 0xbfff00 }
- ------- VARIABLES -------------
- Border_bg = colors.diamond
- Default_bg = colors.gray
- text_col = colors.blue
- status_col = colors.black
- barBack = colors.black
- barFill = colors.white
- header = colors.orange
- Applied = true
- VoidMine = true
- Ore = true
- woot = false
- --Side = sides.east
- -------- FUNCTIONS --------------
- function guiBorders(x,y,len,height,str) -- BORDER FUNC FOR GUI
- gpu.setBackground(Border_bg)
- gpu.fill(x,y,len,height,str)
- gpu.setBackground(Default_bg)
- end
- function GUI() -- SETS THE GUI LAYOUT (GRAPHICAL USER INTERFACE)
- gpu.setBackground(Default_bg)
- term.clear()
- w, h = gpu.getResolution()
- guiBorders(1,1,w,1," ")
- guiBorders(1,5,w,1," ")
- for i = 1,h do
- guiBorders(1,i,1,1," ")
- guiBorders(w,i,1,1," ")
- end
- for i = 5,h do
- --guiBorders(7,i,1,5," ")
- end
- for i = 5,h do
- --guiBorders(w-6, i,1,5," ")
- end
- guiBorders(1,h,w,1," ")
- gpu.setForeground(header)
- Center(3,"--[[ Base Control ]]--")
- end
- function Center(y, text)
- w, h = gpu.getResolution()
- term.setCursor((w-string.len(text))/2+1, y)
- term.write(text)
- end
- function addButton(x, y, col,text)
- leng = string.len(text)
- gpu.setBackground(col)
- gpu.fill(x, y, (leng + 2), 3," ")
- gpu.setForeground(status_col)
- gpu.set(x+1, y+1, text)
- gpu.setBackground(Default_bg)
- end
- function detect()
- if Applied == true then
- addButton(10,10, colors.lime, "Applied Energistics")
- AE.setOutput(sides.top, 15)
- else
- addButton(10,10, colors.red , "Applied Energistics")
- AE.setOutput(sides.top, 0)
- end
- if VoidMine == true then
- addButton(10, 15, colors.lime, "Void Miner")
- VoidMiner.setOutput(sides.east, 0)
- else
- addButton(10,15, colors.red, "Void Miner")
- VoidMiner.setOutput(sides.east, 15)
- end
- if Ore == true then
- addButton(10,20, colors.lime, "Ore Processing")
- OreProcess.setOutput(sides.top, 15)
- else
- addButton(10,20, colors.red, "Ore Processing")
- OreProcess.setOutput(sides.top, 0)
- end
- if woot == true then
- addButton(10,25, colors.lime, "Woot Spawner")
- Woot.setOutput(sides.top, 0)
- else
- addButton(10,25, colors.red,"Woot Spawner")
- Woot.setOutput(sides.top, 15)
- end
- end
- gpu.setResolution(50,30)
- GUI()
- while true do
- _,_,x,y = event.pull(1, "touch")
- if x~=nil and y~= nil then
- if x >= 10 and x <= 40 and y >= 10 and y <= 13 then
- if Applied == true then
- Applied = false
- elseif Applied == false then
- Applied = true
- end
- end
- if x >= 10 and x <= 30 and y >= 15 and y <= 17 then
- if VoidMine == true then
- VoidMine = false
- elseif VoidMine == false then
- VoidMine = true
- end
- end -- Void
- if x >= 10 and x <= 30 and y>= 20 and y <= 23 then
- if Ore == true then
- Ore = false
- elseif Ore == false then
- Ore = true
- end
- end -- Ore
- if x >= 10 and x <= 30 and y >= 25 and y <= 27 then
- if woot == true then
- woot = false
- else
- woot = true
- end
- end
- end
- detect()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement