Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tick = 0.05
- local tArgs = { ... }
- if #tArgs < 1 then
- print("Usage: bruteforce <side>")
- return
- end
- side = tArgs[1]
- print("Bruteforcing on "..side)
- e = peripheral.wrap(side)
- print(e)
- local i = 1
- local name = ""
- while fs.exists(name) == true do
- name = "logs_"..i
- i = i+1
- end
- function writeLog(text)
- f = fs.open(name, "a")
- print(text)
- f.writeLine(text)
- f.close()
- end
- if peripheral.getType(side) == "ender_tank" then
- for a=0,15 do
- for b=0,15 do
- for c=0,15 do
- e.setColors(2^a,2^b,2^c)
- tank = e.getTankInfo()[1]
- if tank.contents.amount > 0 then
- writeLog(a..","..b..","..c..","..tank.contents.name)
- end
- end
- sleep(tick)
- end
- end
- elseif peripheral.getType(side) == "ender_chest" then
- for a=0,15 do
- for b=0,15 do
- for c=0,15 do
- e.setColors(2^a,2^b,2^c)
- inventory = e.getAllStacks()
- if #inventory > 0 then
- if inventory[1] ~= nil then
- writeLog(a..","..b..","..c..","..tostring(inventory[1].name))
- else
- writeLog(a..","..b..","..c..",unknown")
- end
- end
- end
- sleep(tick)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement