Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- scanner=peripheral.wrap("back")
- monitor=peripheral.wrap("monitor_11")
- bridge=peripheral.wrap("right")
- local players={"UnstoppableN","theonlyraellol"}
- local args={...}
- local pos={0,0,0}
- player=args[1]
- ypos=1
- maxLines=39;
- startX=3827
- startY=60
- startZ=-1285
- buttonXstart=5
- buttonXsize=20
- buttonYstart=5
- buttonYsize=5
- counter=1
- function newWrite(text)
- monitor.setCursorPos(1,ypos)
- monitor.write(tostring(text))
- ypos=ypos+1
- if(ypos>maxLines) then
- read()
- monitor.clear()
- ypos=0
- end
- end
- function checkPlayer()
- if(player==nil) then
- print("What is the player's name? ")
- player=read()
- end
- end
- function postition(content)
- for x,y in pairs(content) do
- if(x=="x") then
- y=y+startX
- elseif(x=="y") then
- y=y+startY
- elseif(x=="z") then
- y=y+startZ
- end
- y=math.floor(y)
- newWrite(x.." "..tostring(y))
- pos[counter]=y
- counter=counter+1
- end
- end
- function mainShort()
- monitor.clear()
- monitor.setCursorPos(1,1)
- checkPlayer()
- --print("Searching data for:" .. player)
- data=scanner.getPlayerData(player)
- if not (data == nil) then
- for key,content in pairs(data) do
- if(key=="position") then
- postition(content)
- counter=1
- end
- end
- else
- newWrite("player "..player.." not found")
- end
- end
- function main()
- monitor.clear()
- checkPlayer()
- print("Searching data for:" .. player)
- data=scanner.getPlayerData(player)
- if not (data== nil) then
- for key,content in pairs(data) do
- if(key=="position") then
- postition(content)
- counter=1
- elseif(type(content)=="table") then
- for x,y in pairs(content) do
- if(type(y)=="table") then
- for a,b in pairs(y) do
- if(type(b) == "table") then
- for c,d in pairs(b) do
- newWrite(c.." " ..tostring(d))
- end
- else
- newWrite(a.." "..tostring(b))
- end
- end
- else
- newWrite(x.." "..tostring(y))
- end
- end
- else
- newWrite(key.." "..tostring(content))
- end
- end
- else
- newWrite("Player "..player.." not found")
- end
- end
- function fillTable()
- for i=1,#players do
- button.setTable(players[i], test, buttonXstart, buttonXstart+buttonXsize, buttonYstart, buttonYsize)
- buttonYstart=buttonYstart+buttonYsize
- end
- button.screen()
- end
- function test()
- print("hello world!")
- end
- function listPlayers()
- button.heading("test")
- end
- function tracking()
- while true do
- ypos=1
- mainShort()
- sleep(3)
- bridge.clear()
- for i=1,3 do
- bridge.addBox(1, 1, 60, 40, 0xFFFF00, 0.2)
- bridge.addText(5, 0+i*10,pos[i], 0x000000)
- end
- end
- end
- --executed code
- --fillTable()
- --listPlayers()
- --screen()
- --mainShort()
- tracking()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement