Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- detects if there even is a force field attached
- local shield = peripheral.find("warpdriveForceFieldProjector")
- if not shield then
- print("No Force Field Projector Connected.")
- end
- if shield.isInterfaced() == false then
- print("No Computer Interface Upgrade Installed.")
- end
- local _, upgrades = shield.getUpgrades()
- ---
- --- this function is really janky but I don't want to make it better
- function getRange()
- if upgrades:match("1/4 x Range") then
- return 1
- elseif upgrades:match("2/4 x Range") then
- return 2
- elseif upgrades:match("3/4 x Range") then
- return 3
- elseif upgrades:match("4/4 x Range") then
- return 4
- elseif upgrades:match("0/4 x Range") then
- return 0
- end
- end
- Size = getRange() * 16
- function getTranslation()
- if upgrades:match("1/1 x Translation") then
- return true
- end
- end
- ---
- function freq()
- print("Input frequency (use 0 for no change): ")
- local input = tonumber(read())
- if input > 0 then
- shield.beamFrequency(input)
- print("Frequency has been changed to " ..input)
- end
- end
- function scale()
- print("Input the amount of blocks you would like the Force Field to be wide on the X axis, the max and default is " ..Size*2+1)
- sx = ((read() / 2) -1) / Size
- --print(sx)
- print("Input the amount of blocks you would like the Force Field to be wide on the Y axis, the max and default is " ..Size*2+1)
- sy = ((read() / 2) -1) / Size
- --print(sy)
- print("Input the amount of blocks you would like the Force Field to be wide on the Z axis, the max and default is " ..Size*2+1)
- sz = ((read() / 2) -1) / Size
- --print(sz)
- shield.max(sx, sy, sz)
- --print(shield.max())
- shield.min(-sx, -sy, -sz)
- --print(shield.min())
- print("Shield scale has been changed accordingly")
- end
- freq()
- scale()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement