Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("What is the image you want to have? (Image Address)")
- local image = read()
- print("What is the replit production link?")
- local link = read()
- local monitor = peripheral.wrap("top")
- monitor.setTextScale(0.5)
- local SizeX, SizeY = monitor.getSize()
- SizeX = SizeX * 2
- SizeY = SizeY * 3
- local image = http.post(
- link .. "/post",
- '{"Image":"' .. image .. '", "SizeX":' .. tostring(SizeX) .. ', "SizeY":' .. tostring(SizeY) .. '}',
- {["Content-Type"] = "application/json"}
- )
- shell.run("wget https://github.com/9551-Dev/apis/raw/main/pixelbox_lite.lua")
- local imageData = image.readAll()
- local count = 0
- local count2 = 1
- os.loadAPI("json")
- local data = json.decode(imageData)
- for a,b in pairs(data[1][1]) do
- monitor.setPaletteColor(2^(a-1), tonumber(b))
- print(a-1, tonumber(b), b)
- end
- local box = require("pixelbox_lite").new(monitor)
- for y = 1, SizeY do
- for x = 1, SizeX do
- box.CANVAS[y][x] = 2^tonumber(data[1][2][tostring(y-1)][tostring(x-1)])
- end
- end
- box:render()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement