Advertisement
SenpaiJody

Untitled

Oct 15th, 2022 (edited)
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.82 KB | None | 0 0
  1. local mon = peripheral.wrap("right")
  2. local oreProcessor = require("oreProcessor")
  3.  
  4. function setPalette()
  5.     mon.setPaletteColor(1,0.6078431372549019,0.6078431372549019,0.6078431372549019)
  6.     mon.setPaletteColor(2,1.0,1.0,1.0)
  7.     mon.setPaletteColor(4,0.6980392156862745,0.6980392156862745,0.6980392156862745)
  8.     mon.setPaletteColor(8,0.7529411764705882,0.7529411764705882,0.7529411764705882)
  9.     mon.setPaletteColor(16,0.23137254901960785,0.20392156862745098,0.1607843137254902)
  10.     mon.setPaletteColor(32,0.34901960784313724,0.34901960784313724,0.34901960784313724)
  11.     mon.setPaletteColor(64,0.0,0.0,0.0)
  12.     mon.setPaletteColor(128,0.996078431372549,0.9333333333333333,0.8901960784313725)
  13.     mon.setPaletteColor(256,0.9098039215686274,0.9098039215686274,0.9098039215686274)
  14.     mon.setPaletteColor(512,0.8470588235294118,0.6862745098039216,0.5764705882352941)
  15.     mon.setPaletteColor(1024,0.6784313725490196,0.5529411764705883,0.4666666666666667)
  16.     mon.setPaletteColor(2048,1.0,0.30980392156862746,0.30980392156862746)
  17.     mon.setPaletteColor(4096,0.5568627450980392,0.17254901960784313,0.17254901960784313)
  18. end
  19. function display()
  20.     setPalette()
  21.     mon.setTextScale(0.5)
  22.  
  23.     local pc = term.redirect(mon)
  24.     mon.clear()
  25.     paintutils.drawImage(paintutils.loadImage("base"),1,1)
  26.     term.redirect(pc)
  27. end
  28.  
  29. function displayImage(fp, x, y)
  30.     setPalette()
  31.     local pc = term.redirect(mon)
  32.     paintutils.drawImage(paintutils.loadImage(fp),x,y)
  33.     term.redirect(pc)
  34.     end
  35.  
  36. function start()
  37.     oreProcessor.processOres()
  38.     end
  39.  
  40. while true do
  41.   event, side, xPos, yPos = os.pullEvent("monitor_touch")
  42.     print(xPos..", "..yPos)
  43.   if xPos > 26 and xPos < 52 and yPos > 26 and yPos < 32 then
  44.         displayImage("button_pressed",27,27)
  45.         start()
  46.         displayImage("base",1,1)
  47.         end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement