Kerbal Alarm Clock¶
Download: https://github.com/TriggerAu/KerbalAlarmClock/releases
Alternative download https://kerbalstuff.com/mod/231/Kerbal%20Alarm%20Clock
Forum thread, including full instructions: http://forum.kerbalspaceprogram.com/threads/24786
You can find out if Kerbal Alarm Clock addon is available in the
current game installation by usng the boolean expression
addons:available("KAC")
.
Note that due to changes in Kerbal Alarm Clock, kOS can no longer support versions of KAC that are older than 3.0.0.2. The API that Kerbal Alarm Clock publishes for other mods to use changed such that kOS can ether support newer Kerbal Alarm Clock, or older Kerbal Alarm Clock, but not both.
The Kerbal Alarm Clock is a plugin that allows you to create reminder alarms at future periods to help you manage your flights and not warp past important times.
Creator of the KAC provides API for integration with other mods. In KOS we provide limited access to KAC alarms via following structure and functions.
Access structure KACAddon via ADDONS:KAC
.
- structure KACAddon¶
Suffix
Type
Description
bool(readonly)
True if KAC is installed and KAC integration enabled. It is better to use
addons:available("KAC")
for this purpose.List
List all alarms
- KACAddon:AVAILABLE¶
- Type
bool
- Access
Get only
It is better to use
ADDONS:AVAILABLE("KAC")
first to discover if KAC is installed.True if KAC is installed and KAC integration enabled. Example of use:
if ADDONS:KAC:AVAILABLE { //some KAC dependent code }
- KACAddon:ALARMS()¶
- Returns
List of
KACAlarm
objects
List all the alarms set up in Kerbal Alarm Clock. Example of use:
for i in ADDONS:KAC:ALARMS { print i:NAME + " - " + i:REMAINING + " - " + i:TYPE+ " - " + i:ACTION. }
- structure KACAlarm¶
Suffix
Type
Description
string
(readonly)Unique identifier
Name of the alarm
What should the Alarm Clock do when the alarm fires
string
(readonly)What type of Alarm is this - affects icon displayed and some calc options
Long description of the alarm (optional)
scalar
(s)Time remaining until alarm is triggered
Should the alarm be repeated once it fires
scalar
(s)How long after the alarm fires should the next alarm be set up
Name of the body the vessel is departing from
Name of the body the vessel is arriving at
- KACAlarm:ACTION¶
- Type
- Access
Get/Set
Should be one of the following
MessageOnly - Message Only-No Affect on warp
KillWarpOnly - Kill Warp Only-No Message
KillWarp - Kill Warp and Message
PauseGame - Pause Game and Message
If set incorrectly will log a warning in Debug log and revert to previous or default value.
- KACAlarm:TYPE¶
- Type
- Access
Get only
Can only be set at Alarm creation. Could be one of the following as per API
Raw (default)
Maneuver
ManeuverAuto
Apoapsis
Periapsis
AscendingNode
DescendingNode
LaunchRendevous
Closest
SOIChange
SOIChangeAuto
Transfer
TransferModelled
Distance
Crew
EarthTime
Warning: Unless you are 100% certain you know what you’re doing, create only “Raw” AlarmTypes to avoid unnecessary complications.
- KACAlarm:NOTES¶
- Type
- Access
Get/Set
Long description of the alarm. Can be seen when alarm pops or by double-clicking alarm in UI.
Warning: This field may be reserved in the future version of KAC-KOS integration for automated script execution upon triggering of the alarm.
- KACAlarm:REPEATPERIOD¶
- Type
- Access
Get/Set
How long after the alarm fires should the next alarm be set up.
Available Functions¶
Function |
Description |
---|---|
Create new alarm of AlarmType at UT |
|
List alarms with type alarmType. |
|
Delete alarm with ID = alarmID |
- ADDALARM(AlarmType, UT, Name, Notes)¶
Creates alarm of type KACAlarm:ALARMTYPE at UT with Name and Notes attributes set. Attaches alarm to current CPU Vessel. Returns
KACAlarm
object if creation was successful and empty string otherwise:set na to addAlarm("Raw",time:seconds+300, "Test", "Notes"). print na:NAME. //prints 'Test' set na:NOTES to "New Description". print na:NOTES. //prints 'New Description'
- LISTALARMS(alarmType)¶
If alarmType equals “All”, returns
List
of allKACAlarm
objects attached to current vessel or have no vessel attached. Otherwise returnsList
of allKACAlarm
objects with KACAlarm:TYPE equeal to alarmType and attached to current vessel or have no vessel attached.:set al to listAlarms("All"). for i in al { print i:ID + " - " + i:name. }
- DELETEALARM(alarmID)¶
Deletes alarm with ID equal to alarmID. Returns True if successful, false otherwise:
set na to addAlarm("Raw",time:seconds+300, "Test", "Notes"). if (DELETEALARM(na:ID)) { print "Alarm Deleted". }