Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - shell.run("clear")
 - term.setBackgroundColor(colors.orange)
 - local h = fs.open("coords",'w')
 - local lastx, lasty
 - while true do
 - local e = {os.pullEvent()}
 - if e[1] == "mouse_click" then
 - if e[2] == 1 then
 - paintutils.drawPixel(e[3],e[4])
 - h.writeLine("paintutils.drawPixel("..tostring(e[3])..', '..tostring(e[4])..")")
 - h.flush()
 - elseif e[2] == 2 then
 - if lastx and lasty then
 - paintutils.drawFilledBox(lastx,lasty,e[3],e[4])
 - h.writeLine("paintutils.drawFilledBox("..tostring(lastx)..', '..tostring(lasty)..', '..tostring(e[3])..', '..tostring(e[4])..")")
 - h.flush()
 - lastx,lasty = nil,nil
 - else
 - lastx,lasty = e[3],e[4]
 - paintutils.drawPixel(e[3],e[4])
 - end
 - end
 - end
 - end
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment