Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sensor = peripheral.wrap("top")
- local mon = peripheral.wrap("monitor_4")
- function securityCheck(masterName)
- local playerList={}
- while true do
- PlayerList = sensor.getPlayers()
- if not next(PlayerList) then
- return "no"
- end
- for i in pairs(list) do
- p = list[i].name
- if (p == masterName) then
- print("ok ", p)
- return "yes"
- else
- print("no ", p )
- return "no"
- end
- end
- end
- end
- function cWrite(w,s,msg1,msg2,msg3,msg4,msg5,msg6,msg7,msg8)
- msg1L = string.len(msg1)
- msg2L = string.len(msg2)
- msg3l = string.len(msg3)
- msg4L = string.len(msg4)
- msg5L = string.len(msg5)
- msg6L = string.len(msg6)
- msg7L = string.len(msg7)
- msg8L = string.len(msg8)
- xPos = (w-msg1L-msg2L-msg3L-msg4L-msg5L-msg6L-msg7L-msg8L)/2
- if s = "term" then
- term.setCursorPos(xPos)
- print(msg1,msg2,msg3,msg4,msg5,msg6,msg7,msg8)
- elseif s = "mon" then
- mon.write(msg1,msg2,msg3,msg4,msg5,msg6,msg7,msg8)
- else
- print("error, screen needed")
- end
- end
- cWrite(51, "mon", "test ", "does ","this work?")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement