Kilometer

PortalCraft2

Aug 29th, 2015
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. portal = peripheral.wrap("ep_dialling_device_2")
  2. monitor = peripheral.wrap("monitor_1")
  3. dial = peripheral.wrap("ep_controller_1")
  4.  
  5. local w, h = monitor.getSize()
  6.  
  7. newLine = function()
  8. local _,cY = monitor.getCursorPos()
  9. monitor.setCursorPos((w/2)-5,cY+1)
  10. end
  11.  
  12. monitor.setTextScale(2)
  13. local color = colors.black
  14.  
  15. monitor.setBackgroundColor(colors.black)
  16.  
  17. monitor.clear()
  18. monitor.setCursorPos(3,1)
  19.  
  20. for i=0, portal.getStoredCount()-1 do
  21. monitor.setBackgroundColor(color)
  22. color = color/2
  23. monitor.write(" " .. portal.getStoredName(i) .. " ")
  24. newLine()
  25. end
  26.  
  27. while(true) do
  28. ecent, side, xPos, yPos = os.pullEvent("monitor_touch")
  29. portal.terminate()
  30. if yPos == 2 then
  31. portal.dialStored(1)
  32. elseif yPos == 3 then
  33. portal.dialStored(2)
  34. elseif uPos == 4 then
  35. portal.dialStored(3)
  36. end
  37. os.sleep(0.05)
  38. portal.terminate()
  39. end
Advertisement
Add Comment
Please, Sign In to add comment