Difference between revisions of "Krafties Scripting API"

From Krafties
Jump to navigation Jump to search
Line 1: Line 1:
 
The Krafties Scripting API is a feature which allows you to get data from your Kraftie Creature for your own scripted third party addons.   
 
The Krafties Scripting API is a feature which allows you to get data from your Kraftie Creature for your own scripted third party addons.   
  
Currently this is read only although gives access to a wide range of possibilities.  This scripting api will be a permenant feature although we will be releasing a seperate way for 2 way communication in the near future with Krafties Script.
+
Currently this is read only although gives access to a wide range of possibilities.   
  
 
This API relies on listening to 1 minute pings on channel -748382747 from inworld Krafties Creatures.
 
This API relies on listening to 1 minute pings on channel -748382747 from inworld Krafties Creatures.
  
 +
Creatures will communicate on this channel once on_rez and then every 60 seconds during battle.
  
  
'''For a demo script see here: http://pastebin.com/CwagAwvC'''
+
Message format is a string delimited by "|" containing every prim UUID. (16 Prims)
  
 +
prim1UUID|prim2UUID|prim3UUID|prim4UUID|prim5UUID|prim6UUID|prim7UUID|prim8UUID|prim9UUID|prim10UUID|prim11UUID|prim12UUID|prim13UUID|prim14UUID|prim15UUID|prim16UUID
  
  
 +
Parsing this string to a list you can get the prims data from the description using llGetObjectDetails
  
'''Notes:'''
 
  
If the current Kraftie is attached, it will Whisper
 
  
If the current Kraftie is not attached, it will RegionSay
+
PRIM DESCRIPTION FORMATS
  
For feature requests please use the suggestion
+
Prim 1 Description: "Bonded "+(string)species+ " - "+(string)elementType
 
+
Prim 2 Description:  (string)creatureID()+";"+(string)elementType+";"+(integer)unixTimeCaught+";"+(string)elementAffinity
All Krafties must be version 1.05 to work with this API
+
Prim 3 Description:  (string)battleStyle
 +
Prim 4 Description:  (integer)hitpoints
 +
Prim 5 Description:  (string)volumeString+";"+(float)volumeFloat
 +
Prim 6 Description:  (integer)attackBonusLevels+","+(integer)attackBonusLevels+","+(integer)strengthBonusLevels+","+(integer)defenseBonusLevels+","+(integer)hitpointsBonusLevels+","+(integer)craftingBonusLevels+";"+(integer)intellectBonusLevels+";"+(integer)focusBonusLevels+";"+(integer)fortitudeBonusLevels+";"+(float)attackBonusMult+","+(float)strengthBonusMult+","+(float)defenseBonusMult+","+(float)hitpointsBonusMult+","+(float)craftingBonusMult+","+(float)intellectBonusMult+","+(float)focusBonusMult+","+(float)fortitudeBonusMult
 +
Prim 7 Description: (float)attackNaturalMult+","+(float)attackNaturalMult+","+(float)strengthNaturalMult+","+(float)defenseNaturalMult+","+(float)hitpointsNaturalMult+","+(float)intellectNaturalMult+","+(float)focusNaturalMult+","+(float)fortitudeNaturalMult
 +
Prim 8 Description: (integer)recentAttackExp+","+(integer)recentAttackExp+","+(integer)recentStrengthExp+","+(integer)recentDefenseExp+","+(integer)recentHitpointsExp+","+(integer)recentCraftingExp+","+(integer)recentIntellectExp+","+(integer)recentFocusExp+","+(integer)recentFortitudeExp+","+(key)expEarnerPlayerKey
 +
Prim 9 Description: (integer)isInPvp+";"+(integer)isInCrafting+";"+(integer)isHovertextOn
 +
Prim 10 Description: UNUSED
 +
Prim 11 Description: (integer)getAffinity
 +
Prim 12 Description: UNUSED
 +
Prim 13 Description: (integer)silverMembershipExpiryUnixTime+";"+(integer)goldMembershipExpiryUnixTime
 +
Prim 14 Description: UNUSED
 +
Prim 15 Description: (integer)isPetDisabled
 +
Prim 16 Description: (integer)attackLevel+","+(integer)strengthLevel+","+(integer)defenseLevel+","+(integer)hitpointsLevel+","+(integer)craftingLevel+","+(integer)intellectLevel+","+(integer)focusLevel+","+(integer)fortitudeLevel+";"+(integer)attackExp+","+(integer)strengthExp+","+(integer)defenseExp+","+(integer)hitpointsExp+","+(integer)craftingExp+","+(integer)intellectExp+","+(integer)focusExp+","+(integer)fortitudeExp

Revision as of 23:04, 20 January 2013

The Krafties Scripting API is a feature which allows you to get data from your Kraftie Creature for your own scripted third party addons.

Currently this is read only although gives access to a wide range of possibilities.

This API relies on listening to 1 minute pings on channel -748382747 from inworld Krafties Creatures.

Creatures will communicate on this channel once on_rez and then every 60 seconds during battle.


Message format is a string delimited by "|" containing every prim UUID. (16 Prims)

prim1UUID|prim2UUID|prim3UUID|prim4UUID|prim5UUID|prim6UUID|prim7UUID|prim8UUID|prim9UUID|prim10UUID|prim11UUID|prim12UUID|prim13UUID|prim14UUID|prim15UUID|prim16UUID


Parsing this string to a list you can get the prims data from the description using llGetObjectDetails


PRIM DESCRIPTION FORMATS

Prim 1 Description: "Bonded "+(string)species+ " - "+(string)elementType Prim 2 Description: (string)creatureID()+";"+(string)elementType+";"+(integer)unixTimeCaught+";"+(string)elementAffinity Prim 3 Description: (string)battleStyle Prim 4 Description: (integer)hitpoints Prim 5 Description: (string)volumeString+";"+(float)volumeFloat Prim 6 Description: (integer)attackBonusLevels+","+(integer)attackBonusLevels+","+(integer)strengthBonusLevels+","+(integer)defenseBonusLevels+","+(integer)hitpointsBonusLevels+","+(integer)craftingBonusLevels+";"+(integer)intellectBonusLevels+";"+(integer)focusBonusLevels+";"+(integer)fortitudeBonusLevels+";"+(float)attackBonusMult+","+(float)strengthBonusMult+","+(float)defenseBonusMult+","+(float)hitpointsBonusMult+","+(float)craftingBonusMult+","+(float)intellectBonusMult+","+(float)focusBonusMult+","+(float)fortitudeBonusMult Prim 7 Description: (float)attackNaturalMult+","+(float)attackNaturalMult+","+(float)strengthNaturalMult+","+(float)defenseNaturalMult+","+(float)hitpointsNaturalMult+","+(float)intellectNaturalMult+","+(float)focusNaturalMult+","+(float)fortitudeNaturalMult Prim 8 Description: (integer)recentAttackExp+","+(integer)recentAttackExp+","+(integer)recentStrengthExp+","+(integer)recentDefenseExp+","+(integer)recentHitpointsExp+","+(integer)recentCraftingExp+","+(integer)recentIntellectExp+","+(integer)recentFocusExp+","+(integer)recentFortitudeExp+","+(key)expEarnerPlayerKey Prim 9 Description: (integer)isInPvp+";"+(integer)isInCrafting+";"+(integer)isHovertextOn Prim 10 Description: UNUSED Prim 11 Description: (integer)getAffinity Prim 12 Description: UNUSED Prim 13 Description: (integer)silverMembershipExpiryUnixTime+";"+(integer)goldMembershipExpiryUnixTime Prim 14 Description: UNUSED Prim 15 Description: (integer)isPetDisabled Prim 16 Description: (integer)attackLevel+","+(integer)strengthLevel+","+(integer)defenseLevel+","+(integer)hitpointsLevel+","+(integer)craftingLevel+","+(integer)intellectLevel+","+(integer)focusLevel+","+(integer)fortitudeLevel+";"+(integer)attackExp+","+(integer)strengthExp+","+(integer)defenseExp+","+(integer)hitpointsExp+","+(integer)craftingExp+","+(integer)intellectExp+","+(integer)focusExp+","+(integer)fortitudeExp