View difference between Paste ID: 3YqnD4xc and MqFPr59t
SHOW: | | - or go back to the newest paste.
1
os.loadAPI("ocs/apis/sensor")
2
3
s = sensor.wrap("right")
4
m = peripheral.wrap("top")
5
term.redirect(m)
6
7
while true do
8
  
9
  term.clear()
10
  term.setCursorPos(1, 1)
11
  
12
  t = s.getTargets()
13
  
14
  for k, v in pairs(t) do
15
    
16
    pos = v.Position
17
    --print(k.." : "..v.Name.." ("..tostring(pos.X)..", "..tostring(pos.Y)..", "..tostring(pos.Z)..")")
18
    	if v.Name == "Player" then
19
20
		print("Welcome , "..k.."!") 
21
		
22
		if k == "qentin1741" or k== "Lexus84" then
23
24
		else if(k ~= "qentin1741" or k ~= "Lexus84" ) then
25
			rs.setOutput("back", true)
26
		else
27
		rs.setOutput("back", false)
28
		end
29
		end
30
	else
31
		rs.setOutput("back",false)
32
  	end
33
34
end
35
36
  sleep(1)
37
end