Skip to content
ben-mkiv edited this page Jan 26, 2019 · 7 revisions

Energy Turret

A energy turret, uses OC Energy to fire energy beams at targets!

Methods

turret = component.os_energyturret
turret.powerOn() Turns the turret on, it needs to be on before you can call any other commands.
turret.powerOff() Turns the turret off.
turret.isReady() Returns true if the turret has cooled from it's previous fire, is armed, and the barrel is valid, else false.
turret.isPowered() returns true if the turret is powered on, else false.
turret.setArmed(boolean) true/false = Arms and disarms the turret, must be armed to fire.
turret.extendShaft(int) Valid range (0-2) extends/retracts the rotator shaft, must be at least 1 to fire.
turret.getShaftLength() Returns the shaft length.
turret.moveToRadians(int, int) Moves the turret in radians instead of degrees.
turret.moveTo(int, int) Valid ranges: (0-360), (-45,90) Moves the turret's aim to the provided coords and tries to use shortest rotation to move to them as quick as possible.
turret.isOnPoint() returns true if the turret has finished moving to it's target, false if not
turret.fire() returns true if fired, or false, error if it was unable to fire, not enough energy, or gun hasn't cooled down

The Energy Turret also has upgrade slots in it's GUI you can upgrade it's Damage, Movement Speed, Cooldown time, and Energy Usage.