Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local portal = peripheral.wrap("back")
- local monitor = peripheral.wrap("monitor_0")
- term.redirect(peripheral.wrap("monitor_0"))
- local w, h = monitor.getSize()
- --For the Buttons & taking the names from the Dialing Device to the Touch Screen
- function find(t, v)
- for k, l in pairs(t) do
- if l == v then
- return k
- end
- end
- end
- function dialLocation(i)
- portal.terminate()
- portal.dialStored(i - 1)
- end
- os.loadAPI( "simpleButton" )
- os.sleep(2)
- buttonNames = {};
- for i=0, portal.getStoredCount()-1 do
- table.insert(buttonNames, portal.getStoredName(i))
- end
- local t = simpleButton.makeButtonPages( colors.black, colors.red, colors.white, unpack(buttonNames))
- t:render()
- --for Dialing to location after touched the screen on a name
- address_count = portal.getStoredCount()
- while true do
- local event = {t:handleEvents( os.pullEvent() )}
- if event[1] == "button_click" then
- dialLocation(find(buttonNames, event[2]))
- os.sleep(2)
- t:render()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment