Skip to content
Keridos edited this page Feb 13, 2020 · 6 revisions

A list of all the functions for OC/CC peripherals.

Note that this requires a serial access addon. Recent builds also have this enabled by default on tier 5 bases.

Turret Bases

function name description
getOwner() function():string; returns owner of turret base.
isAttacksMobs() function():boolean; returns if the turret is currently set to attack hostile mobs.
setAttacksMobs(args) function(state:boolean):void; set attack hostile mobs or not.
isAttacksNeutrals() function():boolean; returns if the turret is currently set to attack neutral mobs.
setAttackNeutrals(args) function(state:boolean):void; set attack neutral mobs or not.
isAttacksPlayers() function():boolean; returns if the turret is currently set to attack players.
setAttacksPlayers(args) function(state:boolean):void; sets attack players or not.
getTrustedPlayers() function():table; returns a table of all trusted players on this base.
getTrustedPlayer(args) function():table; tries to return a specific trusted player from this base
addTrustedPlayer(args) function(name:String, [accessLevel:Integer]):boolean; adds trusted player to trustlist. Can return error.
removeTrustedPlayer(args) function(name:String):string; removes trusted player from trust list.
changeAccessLevel(args) function(name:String, accessLevel:Integer):string; change players access level. Can return error.
getMaxEnergyStorage() function():int; returns maximum energy storage.
getCurrentEnergyStorage() function():int; returns current energy stored.
getActive() function():boolean; returns if the turret is currently active.
getMode() function():int; shows base mode. 0 always on, 1 always off, 2 inverted, 3 non-inverted
setMode() function(state:int):void; toggles turret redstone inversion state.
getRedstone() function():boolean; shows redstone state.
setAllYawPitch(args) function(yaw:double, pitch:double):void; Set yaw and pitch for all turrets (deactivate auto targeting before).
setTurretYawPitch(args) function(side:int, yaw:double, pitch:double):boolean; Set yaw and pitch for a turret (deactivate auto targeting before).
setAllAutoForceFire(args) function(state:boolean):void; Enable auto firing for all Turrets (deact. auto targ. before).
setTurretAutoForceFire(args) function(side:int, state:boolean):boolean; Enable auto firing for specified Turret (deact. auto targ. before).
forceShootAll() function():int; Try to shoot all turrets, returns number of successful shots
forceShootTurret(args) function(side:int):boolean; Try to shoot specified turret, returns true if successful