Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os = require("os")
- io = require("io")
- component = require("component")
- sides = require("sides")
- BA = require("buttonAPI")
- colors = require("colors")
- transposer = component.transposer
- gpu = component.gpu
- gpu.setResolution(gpu.maxResolution())
- width,height = gpu.getResolution()
- portalSide = sides.north
- storageSide = sides.top
- function checkInventory(side)
- storageSize = transposer.getInventorySize(side)
- contents = {}
- for i=1,storageSize,1 do
- table.insert(contents,transposer.getStackInSlot(side,i))
- end
- end
- function GUI()
- end
- addButtons({a,b,c},2,2,1,5,5,colors.red,colors.white,15,3) -> {{a,b},{c,nil}}
- function addButtons(list,gridX,gridY,gridSpacing,xstart,ystart,buttonColor,textColor,buttonWidth,buttonHeight)
- for i=1,#list do
- BA.makeButton(xstart+((buttonWidth+gridSpacing)*((i-i%gridY-1)/gridY)),ystart+((buttonHeight+gridSpacing)*(i%gridY-1)),buttonColor,textColor,-1,-1,tostring(list[i]))
- end
- end
- function addRect(x1,y1,x2,y2,fillColor,borderColor,borderSize)
- gpu.setBackground(borderColor)
- gpu.fill(x1,y1,x2-x1,y2-y1," ")
- gpu.setBackground(fillColor)
- gpu.fill(x1+borderSize,y1+borderSize,x2-x1-borderSize,y2-y1-borderSize," ")
- end
- function addText(x,y,str,textColor,backgroundColor)
- gpu.setForeground(textColor)
- gpu.setBackground(backgroundColor)
- gpu.set(x,y,str)
- end
- function addTextCentered(y,x1,x2,str,textColor,backgroundColor)
- --centeres text between x1 and x2
- xcenter = (x1+x2)/2
- xtext = xcenter-(len(tostring(str))/2)
- addText(xtext,y,str,textColor,backgroundColor)
- end
Advertisement
Add Comment
Please, Sign In to add comment