Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bridge = peripheral.wrap("right")
- function loadimg( url, startx, starty, white)
- resp = http.post("http://ccpost.esy.es/hex.php","imgurl="..url)
- y = starty
- local line = resp.readLine()
- while line do
- x = startx
- for color in line:gmatch('%S+') do
- rgb = {}
- for rgba in color:gmatch('[^%.]+') do
- table.insert(rgb, rgba)
- end
- newcol = #rgb[2] ~= 3 and rgb[2] or rgb[2]..rgb[2]
- if white == true then
- if newcol ~= "ffffff" then
- bridge.addBox(x,y,1,1,tonumber(newcol,16), 1 - rgb[1]/255)
- end
- elseif white == false then
- bridge.addBox(x,y,1,1,tonumber(newcol,16), 1 - rgb[1]/255)
- end
- x = x + 1
- end
- sleep(0.05)
- y = y + 1
- line = resp.readLine()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement