Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Checks the screensize
- screenx, screeny = term.getSize()
- function getVersion()
- return "0.4"
- end
- function fill(x, x2, y, y2, colour)
- filling = true
- y2 = y2+1
- count = 1+y2-y
- while filling do
- paintutils.drawLine(x,y,x2,y,colour)
- y2 = y2 -1
- y = y2
- count = count-1
- if count == 0 then
- filling = false
- end
- end
- end
- function menu(x, x2, y, y2, colour, colour2)
- x3 = x + 1
- x4 = x2 - 1
- y3 = y + 1
- y4 = y2 - 1
- paintutils.drawLine(x, y, x2, y, colour)
- paintutils.drawLine(x, y2, x2, y2, colour)
- paintutils.drawLine(x, y, x, y2, colour)
- paintutils.drawLine(x2, y, x2, y2, colour)
- fill(x3, x4, y3, y4, colour2)
- end
- function colourpick(x, y, failcol)
- ymax = screeny - 6
- xmax = screenx - 6
- if y >= ymax then
- y = ymax
- end
- if x >= screenx then
- x = xmax
- end
- if x < 1 then
- x = 1
- end
- if y < 1 then
- y = 1
- end
- paintutils.drawImage(paintutils.loadImage("img/colourpick"), x, y)
- event, button, XS, YS = os.pullEvent("mouse_click")
- XSYS = XS..","..YS
- if YS == y+1 and XS == x+1 then
- return 32768
- elseif YS == y+1 and XS == x+2 then
- return 16384
- elseif YS == y+1 and XS == x+3 then
- return 8192
- elseif YS == y+1 and XS == x+4 then
- return 4096
- elseif YS == y+2 and XS == x+1 then
- return 2048
- elseif YS == y+2 and XS == x+2 then
- return 1024
- elseif YS == y+2 and XS == x+3 then
- return 512
- elseif YS == y+2 and XS == x+4 then
- return 256
- elseif YS == y+3 and XS == x+1 then
- return 128
- elseif YS == y+3 and XS == x+2 then
- return 64
- elseif YS == y+3 and XS == x+3 then
- return 32
- elseif YS == y+3 and XS == x+4 then
- return 16
- elseif YS == y+4 and XS == x+1 then
- return 8
- elseif YS == y+4 and XS == x+2 then
- return 4
- elseif YS == y+4 and XS == x+3 then
- return 2
- elseif YS == y+4 and XS == x+4 then
- return 1
- else
- return failcol
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment