Advertisement
Guest User

monck

a guest
Jul 24th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. print("Welcome to the Main-Menu")
  2. print("Please choose an option below")
  3. print("ĺ82ĽA9 by Liquidicity")
  4.  
  5.  
  6. function getMonitorPos()
  7.   loc = {[0]="top", [1]="bottom", [2]="left", [3]="right", [4]="back"}
  8.  
  9.   for i=0,4 do
  10.     if peripheral.isPresent(loc[i]) == true then
  11.       if peripheral.getType(loc[i]) == "monitor" then
  12. --        print("Monitor found at "..loc[i])
  13.           monitor = loc[i]
  14.         return monitor
  15. --        break
  16.       end
  17.     end
  18.   end
  19. end
  20.  
  21. loc = getMonitorPos()
  22. --print("loc:"..loc)
  23. if loc == nil then
  24.   print("Monitor not found")
  25. else
  26.   mon = peripheral.wrap(loc)
  27.   mon.write("Monitor Test")
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement