Advertisement
Hydrotronics

Extra Paint API

Nov 26th, 2015
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local prognam = shell.getRunningProgram()
  2. if not prognam == "PAPI" then
  3.   if fs.exists("PAPI") then
  4.     fs.delete("PAPI")
  5.     fs.copy(prognam,"PAPI")
  6.     fs.delete(prognam)
  7.   else
  8.     fs.copy(prognam,"PAPI")
  9.     fs.delete(prognam)
  10.   end
  11. end
  12.  
  13.  
  14. size = term.getSize()
  15.  
  16. function placeColor(x, y, color)
  17.   paintutils.drawPixel(x, y, color)
  18. end
  19.  
  20. function placeColour(x, y, color)
  21.   paintutils.drawPixel(x, y, color)
  22. end
  23.  
  24. function box(x1, y1, x2, y2, type, color)
  25.   if type == Filled then
  26.     paintutils.drawFilledBox(x1, y1, x2, y2, color)
  27.   elseif type == Empty then
  28.     paintutils.drawBox(x1, y1, x2, y2, color)
  29.   elseif type == filled then
  30.     paintutils.drawFilledBox(x1, y1, x2, y2, color)
  31.   elseif type == empty then
  32.     paintuils.drawBox(x1, y1, x2, y2, color)
  33.   else  
  34.     term.setTextColor(colors.red)
  35.     print"Error, function 'box' was used incorrectly"
  36.     term.setTextColor(colors.white)
  37.     error()
  38.   end
  39. end
  40.  
  41. function line(x1, y1, x2, y2, color)
  42.   paintutils.drawLine(x1, y1, x2, y2, color)
  43. end
  44.  
  45. function FImage(path)
  46.   paintutils.loadImage(path)
  47. end
  48.  
  49. function DImage(Image, x, y)
  50.   paintutils.drawImage(Image, x, y)
  51. end
  52.  
  53. white = colors.white
  54. orange = colors.orange
  55. magenta = colors.magenta
  56. lightBlue = colors.lightBlue
  57. yellow = colors.yellow
  58. lime = colors.lime
  59. pink = colors.pink
  60. gray = colors.gray
  61. lightGray = colors.lightGray
  62. cyan = colors.cyan
  63. purple = colors.purple
  64. blue = colors.blue
  65. brown = colors.brown
  66. green = colors.green
  67. red = colors.red
  68. black = colors.black
  69. grey = colors.gray
  70. lightGrey = colors.lightGray
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement