ElijahCrafter

Monitor Res Test

Dec 7th, 2025 (edited)
158
0
Never
8
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.03 KB | Source Code | 0 0
  1. -- Resolution Demo - Shows same image at all 4 GPU tiers
  2. -- Demonstrates OpenComputers-style resolution levels
  3. -- Adapts to actual monitor size
  4.  
  5. local monitor = peripheral.find("monitor")
  6. if not monitor then
  7.     print("No monitor found! Connect a monitor via cable.")
  8.     return
  9. end
  10.  
  11. -- Get monitor's physical limits
  12. local maxW, maxH = monitor.getMaxResolution()
  13. local gpuMaxW, gpuMaxH = maxW, maxH
  14.  
  15. -- Calculate resolution tiers based on monitor size
  16. -- Each tier is a percentage of max resolution
  17. local function calcTiers()
  18.     return {
  19.         {name = "Basic (Tier 1)", w = math.floor(maxW * 0.15), h = math.floor(maxH * 0.15), color = colors.gray},
  20.         {name = "Standard (Tier 2)", w = math.floor(maxW * 0.35), h = math.floor(maxH * 0.35), color = colors.green},
  21.         {name = "Advanced (Tier 3)", w = math.floor(maxW * 0.6), h = math.floor(maxH * 0.6), color = colors.cyan},
  22.         {name = "Elite (Tier 4)", w = maxW, h = maxH, color = colors.magenta}
  23.     }
  24. end
  25.  
  26. local tiers = calcTiers()
  27.  
  28. -- Draw a simple house with tree
  29. local function drawScene(m, w, h)
  30.     m.clear()
  31.    
  32.     -- Sky (top 40%)
  33.     m.setBackgroundColor(colors.lightBlue)
  34.     for y = 1, math.floor(h * 0.4) do
  35.         m.setCursorPos(1, y)
  36.         m.write(string.rep(" ", w))
  37.     end
  38.    
  39.     -- Sun
  40.     m.setBackgroundColor(colors.yellow)
  41.     m.setTextColor(colors.orange)
  42.     local sunX = math.floor(w * 0.8)
  43.     local sunY = math.floor(h * 0.15)
  44.     for dy = -1, 1 do
  45.         m.setCursorPos(sunX - 1, sunY + dy)
  46.         m.write("   ")
  47.     end
  48.    
  49.     -- Ground (bottom 60%)
  50.     m.setBackgroundColor(colors.green)
  51.     for y = math.floor(h * 0.4) + 1, h do
  52.         m.setCursorPos(1, y)
  53.         m.write(string.rep(" ", w))
  54.     end
  55.    
  56.     -- House body
  57.     local houseX = math.floor(w * 0.3)
  58.     local houseY = math.floor(h * 0.4)
  59.     local houseW = math.max(10, math.floor(w * 0.2))
  60.     local houseH = math.max(5, math.floor(h * 0.3))
  61.    
  62.     m.setBackgroundColor(colors.brown)
  63.     for y = houseY, houseY + houseH do
  64.         m.setCursorPos(houseX, y)
  65.         m.write(string.rep(" ", houseW))
  66.     end
  67.    
  68.     -- Roof
  69.     m.setBackgroundColor(colors.red)
  70.     local roofY = houseY - math.floor(houseH * 0.4)
  71.     for i = 0, math.floor(houseH * 0.4) do
  72.         local roofW = houseW + (math.floor(houseH * 0.4) - i) * 2
  73.         local roofX = houseX - (math.floor(houseH * 0.4) - i)
  74.         m.setCursorPos(math.max(1, roofX), roofY + i)
  75.         m.write(string.rep(" ", roofW))
  76.     end
  77.    
  78.     -- Door
  79.     m.setBackgroundColor(colors.orange)
  80.     local doorX = houseX + math.floor(houseW / 2) - 1
  81.     local doorH = math.max(2, math.floor(houseH * 0.5))
  82.     for y = houseY + houseH - doorH, houseY + houseH do
  83.         m.setCursorPos(doorX, y)
  84.         m.write("  ")
  85.     end
  86.    
  87.     -- Window
  88.     m.setBackgroundColor(colors.lightBlue)
  89.     local winX = houseX + 2
  90.     local winY = houseY + 2
  91.     m.setCursorPos(winX, winY)
  92.     m.write("  ")
  93.     m.setCursorPos(winX, winY + 1)
  94.     m.write("  ")
  95.    
  96.     -- Tree trunk
  97.     local treeX = math.floor(w * 0.7)
  98.     local treeY = math.floor(h * 0.5)
  99.     m.setBackgroundColor(colors.brown)
  100.     for y = treeY, h do
  101.         m.setCursorPos(treeX, y)
  102.         m.write("  ")
  103.     end
  104.    
  105.     -- Tree leaves
  106.     m.setBackgroundColor(colors.lime)
  107.     local leafSize = math.max(3, math.floor(h * 0.15))
  108.     for dy = -leafSize, 0 do
  109.         local leafW = (leafSize - math.abs(dy)) * 2
  110.         m.setCursorPos(treeX - leafW / 2 + 1, treeY + dy)
  111.         m.write(string.rep(" ", leafW))
  112.     end
  113.    
  114.     -- Title bar
  115.     m.setBackgroundColor(colors.black)
  116.     m.setTextColor(colors.white)
  117.     m.setCursorPos(1, 1)
  118.     m.write(string.rep(" ", w))
  119.     m.setCursorPos(2, 1)
  120.     m.write("Resolution: " .. w .. "x" .. h)
  121.    
  122.     -- Reset colors
  123.     m.setBackgroundColor(colors.black)
  124.     m.setTextColor(colors.white)
  125. end
  126.  
  127. -- Demo each resolution tier
  128. print("=== Resolution Demo ===")
  129. print("Adapts to your monitor size!")
  130. print("")
  131.  
  132. print("Monitor max resolution: " .. maxW .. "x" .. maxH)
  133. print("GPU max resolution: " .. gpuMaxW .. "x" .. gpuMaxH)
  134. print("")
  135. print("Press Enter to cycle through resolutions...")
  136. print("")
  137.  
  138. for i, tier in ipairs(tiers) do
  139.     -- Ensure minimum size
  140.     tier.w = math.max(20, tier.w)
  141.     tier.h = math.max(8, tier.h)
  142.    
  143.     print("Tier " .. i .. ": " .. tier.name .. " (" .. tier.w .. "x" .. tier.h .. ")")
  144.    
  145.     -- Check if GPU supports this resolution
  146.     if tier.w <= gpuMaxW and tier.h <= gpuMaxH then
  147.         local success = monitor.setResolution(tier.w, tier.h)
  148.         if success then
  149.             drawScene(monitor, tier.w, tier.h)
  150.             print("  [RENDERED] - Check monitor!")
  151.         else
  152.             print("  [FAILED] Could not set resolution")
  153.         end
  154.     else
  155.         print("  [SKIPPED] GPU tier too low (max: " .. gpuMaxW .. "x" .. gpuMaxH .. ")")
  156.     end
  157.    
  158.     print("Press Enter for next...")
  159.     read()
  160. end
  161.  
  162. -- Reset to default
  163. monitor.resetResolution()
  164. monitor.clear()
  165. print("")
  166. print("Demo complete! Monitor reset.")
  167.  
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Ulrcegxy
    11 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment