Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s=peripheral.wrap("left")
- function scan()
- entity={}
- entity.item={}
- entity.mob={}
- entity.player={}
- entity.minecart={}
- entity.itemFrame={}
- mobs=s.getEntityIds("mob")
- for i=1, #mobs do
- data=nil
- data=s.getEntityData(mobs[i],"mob")
- if data~=nil then
- entity.mob[i]=data.all()
- else
- entity.mob[i]="lost"
- end
- end
- items=s.getEntityIds("item")
- for i=1, #items do
- data=nil
- data=s.getEntityData(items[i],"item")
- if data~=nil then
- entity.item[i]=data.all()
- else
- entity.item[i]="lost"
- end
- end
- players=s.getPlayers()
- for i=1, #players do
- data=nil
- data=s.getPlayerByName(players[i].name)
- if data~=nil then
- entity.player[i]=data.all()
- inv=entity.player[i].player.inventory
- for i2=1, 40 do
- if inv[i2]~=nil then
- fp=fs.open("temp","w")
- itemp=i
- i2temp=i2
- error=true
- fp.write("entity.player[itemp].player.inventory[i2temp]=inv[i2temp].all() error=false")
- fp.close()
- shell.run("temp")
- shell.run("rm temp")
- if error then
- entity.player[itemp].player.inventory[i2temp]=nil
- end
- end
- end
- else
- entity.player[i]="lost"
- end
- end
- minecarts=s.getEntityIds("minecart")
- for i=1, #minecarts do
- data=nil
- data=s.getEntityData(minecarts[i],"minecart")
- if data~=nil then
- entity.minecart[i]=data.all()
- else
- entity.minecart[i]="lost"
- end
- end
- itemFrames=s.getEntityIds("item_frame")
- for i=1, #itemFrames do
- data=nil
- data=s.getEntityData(itemFrames[i],"item_frame")
- if data~=nil then
- entity.itemFrame[i]=data.all()
- else
- entity.itemFrame[i]="lost"
- end
- end
- return entity
- end
- function string.cut(txt,char)
- while string.find(txt,char) do
- txt=string.sub(txt,1,string.find(txt,char)-1)..string.sub(txt,string.find(txt,char)+1,#txt)
- end
- return txt
- end
- function format(txt)
- txt=string.cut(txt,'\n')
- txt=string.cut(txt,'\r')
- txt=string.cut(txt,'\t')
- txt=string.cut(txt," ")
- txt=string.sub(txt,1,4000)
- return txt
- end
- --txr=textutils.serialise(scan())
- scan()
- for i=1,#entity.player do
- text=format(textutils.serialize(entity.player[i].player))
- a=http.post("http://www.gecco34.bplaced.net/Stuff/filewriter.php?message="..text.."&file=./scanner/"..entity.player[i].name..".txt")
- print(a)
- end
Add Comment
Please, Sign In to add comment