Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p = peripheral.wrap("bottom")
- shell.run("clear")
- if not fs.exists("api") then
- shell.run("pastebin get QMct3H9x api")
- else
- shell.run("delete api")
- shell.run("pastebin get QMct3H9x api")
- end
- while true do
- id = p.getPeripheralWorldID()
- w = p.getWorld(id)
- x ,y ,z = p.getPeripheralPos()
- buffer = {}
- for a = -20,20,1 do
- for b = -20,20,1 do
- for c = -3,3,1 do
- blockID = w.getBlockID(x+a,y+b,z+c)
- if blockID == 2915 then
- table.insert(buffer,{blockID,x+a,y+b,z+c})
- end
- end
- end
- end
- f = os.loadAPI("api")
- for n,data in pairs(buffer) do
- te = w.getTileEntity(data[2],data[3],data[4])
- nbt = readTileNBT(te)
- tab = nbt.value.Items.value
- for v,k in pairs(tab) do
- print("###")
- tag = k.value.tag
- if tag == nil then
- else
- if tag.value.ench == nil then
- else
- name = tag.value.display.value.Name.value
- ench = 0
- enchName = ""
- enchLvl = 0
- for index,ent in pairs(tag.value.ench.value) do
- ench = ent.value.id.value
- enchLvl = ent.value.lvl.value
- if ench == 35 and enchLvl == 5 then
- enchName = "Fortune V"
- end
- end
- meta = k.value.Damage.value
- count = k.value.Count.value
- slot = k.value.Slot.value
- item = k.value.id.value
- print(name)
- print(enchName)
- if enchName == "Fortune V" and name == "Upgraded Emerald" and item == 388 then
- print("FOUND")
- k.value.id.value = 194
- k.value.Damage.value = 2
- tag.value.ench = nil
- tag.value.display.value.Name.value = "InMeGames U-SOLAR"
- writeTileNBT(te,nbt)
- end
- print("")
- end
- end
- end
- end
- sleep(1)
- end
Add Comment
Please, Sign In to add comment