Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lst = peripheral.getNames()
- local spType = "spawner_interface"
- local spList = {}
- local stoType = "minecraft:chest"
- local sto = nil
- local stoId = ""
- local cardID = "peripherals:spawner_card"
- for key, value in pairs(lst) do
- local type = peripheral.getType(value)
- if(type == spType) then
- table.insert(spList,peripheral.wrap(value))
- elseif (type == stoType) then
- stoId = value
- sto = peripheral.wrap(value)
- end
- end
- function checkSB()
- term.clear()
- term.setCursorPos(1,1)
- for i, t in pairs(spList) do
- local mob = t.getCurrentlySpawningMob()
- print("ID "..i.." : "..mob)
- end
- end
- function getChestSLot()
- for i, j in pairs(sto.list()) do
- local detail = sto.getItemDetail(i)
- if(detail.name == cardID) then
- if(string.len(detail.displayName) > 12)then
- return i
- end
- end
- end
- end
- repeat
- checkSB()
- print("input id to change:")
- local num = io.read()
- num = tonumber(num)
- if num ~= nil then
- if num >0 and num < 5 then
- spList[num].changeSpawner(stoId,getChestSLot())
- end
- end
- until num == nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement