paramus

Brain Implant

Jan 19th, 2026 (edited)
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.83 KB | Gaming | 0 0
  1. local modules = peripheral.find("neuralInterface")
  2. local canvas
  3. local scanInterval = 0.2
  4. local hover = false
  5.  
  6. function OreScanner()
  7.     if (modules.hasModule("plethora:scanner", 0) == false) then
  8.         return
  9.     end
  10.    
  11.     while(true) do
  12.        
  13.         -- Show ores thru walls
  14.         if (canvas ~= nil) then
  15.             canvas.remove()
  16.         end
  17.         canvas = modules.canvas3d()
  18.         local blocks = modules.scan()
  19.         for _, block in pairs(scanner.scan()) do
  20.             if (string.find("ore", block.name)) then
  21.                 local block = canvas.addBox(block.x, block.y, block.z, block.name)
  22.                 --local block = canvas.addItem({block.x, block.y, block.z}, block.name)
  23.                 block.setDepthTested(false)
  24.             end
  25.         end
  26.         sleep(scanInterval)
  27.        
  28.     end
  29. end
  30.  
  31. function keyPress()
  32.     while (true) do
  33.        
  34.         local event, key, is_held = os.pullEvent("key")
  35.  
  36.         if (key == "r") then -- Fire laser
  37.             if (modules.hasModule("plethora:laser", 0)) then
  38.                 local meta = modules.getMetaOwner()
  39.                 modules.fire(meta.yaw, meta.pitch, 5)
  40.             end
  41.         elseif (key == "x") then
  42.             if (modules.hasModule("plethora:kinetic", 0)) then
  43.                 hover = ~hover
  44.             end
  45.         end
  46.        
  47.     end
  48. end
  49.  
  50. function Fly()
  51.     while(true) do
  52.        
  53.         if (hover) then
  54.             local mY = meta.motionY
  55.             mY = (mY - 0.138) / 0.8
  56.            
  57.             if mY > 0.5 or mY < 0 then
  58.                 local sign = 1
  59.                 if mY < 0 then sign = -1 end
  60.                 modules.launch(0, 90 * sign, math.min(4, math.abs(mY)))
  61.             end
  62.         else
  63.             sleep(0.1)
  64.         end
  65.        
  66.     end
  67. end
  68.  
  69. --Main
  70. parallel.waitForAll(keyPress(), OreScanner(), Fly())
Advertisement
Add Comment
Please, Sign In to add comment