Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local portal = peripheral.wrap("bottom")
- local monitor = peripheral.wrap("monitor_0")
- local w, h = monitor.getSize()
- --For the Buttons & taking the names from the Dialing Device to the Touch Screen
- function dialLocation(i)
- portal.terminate()
- portal.dialStored(i - 1)
- end
- newLine = function()
- local _,cY = monitor.getCursorPos()
- monitor.setCursorPos((w/2)-5,cY+1)
- end
- monitor.setTextScale(1.5)
- local color = colors.black
- monitor.setBackgroundColor(colors.black)
- monitor.clear()
- monitor.setCursorPos(3,1)
- --For the Buttons & taking the names from the Dialing Device to the Touch Screen
- for i=0, portal.getStoredCount()-1 do
- monitor.setBackgroundColor(color)
- color = colors.blue
- monitor.write(" " .. portal.getStoredName(i) .. " ")
- newLine()
- end
- --for Dialing to location after touched the screen on a name
- address_count = portal.getStoredCount()
- while(true) do
- event, side, xPos, yPos = os.pullEvent("monitor_touch")
- portal.terminate()
- if yPos == 2 then
- portal.dialStored(1)
- end
- if(yPos <= address_count) then
- dialLocation(yPos)
- end
- os.sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement