Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- locals
- local logs = {}
- local openTime = 30
- local textSize = 1
- local minimumNameLength = 4
- local buttonPadding = 1 --Min 1, Space before/after
- local centerPadding = 0 --Min 0, Space before/after
- local buttonColor = colors.lightGray
- local buttonActiveColor = colors.orange
- local pageBack = "Prev Page"
- local pageFore = "Next Page"
- local resetButton = "Refresh"
- -- Hub Portals
- --internal
- local monitor, touch
- local gate
- local monitorLocation
- local monX = 0
- local monY = 0
- local monMidL = 0
- local monMidR = 0
- local maxNameLength = 0
- local problem = false
- local names = {}
- local curPage = 1
- local lastPage = 1
- local namesPerPage = 1
- local pages = {}
- local gateType = 'Abstract Bus Adapter'
- function writeLog(text)
- print(text)
- end
- if not fs.exists('apis/json') then
- writeLog("You don't have the JSON API. Grabboring it.")
- shell.run("pastebin get 4nRg9CHU apis/json")
- end
- os.loadAPI('apis/json')
- monitorLocation = findSideFor('monitor')
- monitor = peripheral.wrap(monitorLocation)
- gate = peripheral.find(gateType)
- end
- function dialGate(address)
- writeLog('----')
- writeLog("Dialing "..address)
- result = gate.sendPacket("FFFF", "action: dial", "timeout: "..openTime, "address: "..address)
- writeLog("Gate told to dial. Result: "..result)
- return result
- end
- function closeGate()
- writeLog("Force closing the gate.")
- result = gate.sendPacket("FFFF", "action: disconnect")
- writeLog("Gate told to close. Result: "..result)
- end
- function findSideFor(typeToFind)
- local sides = peripheral.getNames()
- for i, side in ipairs(sides) do
- local type = peripheral.getType(side)
- if type == typeToFind then
- return(side)
- end
- end
- end
- init()
- if not problem then
- refresh()
- while true do
- dialGate("Coronat Protaac Ormet")
- -- dialGate("Dehsetcro Migomcor Ormpra")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment