Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("buttonGui")
- ButtonGui.addButton("Old Base",old_base,xmin,xmax,ymin,ymax,idleColor,activeColor) --Adds buttons using buttonGui table
- ButtonGui.screenButton() --Adds buttons to monitor
- function getClick() -- Player interacting with monitor buttons.
- event,side,x,y = os.pullEvent("monitor_touch")
- buttonGui.checkxy(x,y)
- end
- --find peripherals
- pChest = waitforPeripheral('chest')
- pMonitor = waitforPeripheral('monitor')
- pMusic = waitforPeripheral('note_block')
- function waitforPeripheral(type)
- unit = nil
- repeat
- unit = peripheral.find(type)
- if (unit ==nil) then
- if (pMusic ~= nil) then
- pMusic.playSound('mob.villager.hurt', 1, 1)
- end
- print("Searching for",type)
- sleep(2.5)
- end
- until unit ~= nil
- return unit
- end
- function itemDetection() --Find out what the item is
- stacks = pChest.getAllStacks()
- for slot, stack in pairs(stacks) do
- if (stack.all ~= nil) then
- stack = stack.all()
- end
- if (stack.name == "teleporterMKI") then
- print(stack.display_name)
- else
- error("Could not find Dislocators...")
- end
- end
- end
- function old_base()
- local stack == itemDetection()
- if stack == "Old Base" then
- buttonGui.flash()
- print("Old Base selected!")
- recSwap()
- else
- end
- end
- function recSwap() --Swap dislocator with one in Portal
- end
- buttonGui.label(1,1,"Current Destination:") --Show Currnt Destination
- ButtonGui.label(1,2,Dislocator.Name)
- while true do -- Checks for Button Press
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement