Difference between revisions of "Krafties Scripting API"
MyraMidnight (talk | contribs) m |
MyraMidnight (talk | contribs) |
||
Line 6: | Line 6: | ||
Currently this is read only although gives access to a wide range of possibilities. | 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 '''<code>-748382747</code>''' from inworld Krafties Creatures. |
Creatures will communicate on this channel once on_rez and then every 60 seconds. | Creatures will communicate on this channel once on_rez and then every 60 seconds. | ||
Line 13: | Line 13: | ||
Message format is a string delimited by "|" containing every prim UUID. (16 Prims) | 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 | + | <code><nowiki>prim1UUID|prim2UUID|prim3UUID|prim4UUID|prim5UUID|prim6UUID|prim7UUID|prim8UUID|prim9UUID|prim10UUID|prim11UUID|prim12UUID|prim13UUID|prim14UUID|prim15UUID|prim16UUID</nowiki></code> |
− | Parsing this string to a list you can get the prims data from the description using llGetObjectDetails (PRIM_DESC or PRIM_NAME) | + | Parsing this string to a list you can get the prims data from the description using <code><nowiki>llGetObjectDetails (PRIM_DESC or PRIM_NAME)</nowiki></code> |
Line 22: | Line 22: | ||
'''PRIM DESCRIPTION FORMATS''' | '''PRIM DESCRIPTION FORMATS''' | ||
− | *'''Prim 1 Description:''' <code>"Bonded "+(string)species+ " - "+(string)elementType</code> | + | *'''Prim 1 Description:''' <code><nowiki>"Bonded "+(string)species+ " - "+(string)elementType</nowiki></code> |
− | *'''Prim 2 Description:''' <code>(string)creatureID()+";"+(string)elementType+";"+(integer)unixTimeCaught+";"+(string)elementAffinity</code> | + | *'''Prim 2 Description:''' <code><nowiki>(string)creatureID()+";"+(string)elementType+";"+(integer)unixTimeCaught+";"+(string)elementAffinity</nowiki></code> |
− | *'''Prim 3 Description:''' <code>(string)battleStyle</code> | + | *'''Prim 3 Description:''' <code><nowiki>(string)battleStyle</nowiki></code> |
− | *'''Prim 4 Description:''' <code>(integer)hitpoints</code> | + | *'''Prim 4 Description:''' <code><nowiki>(integer)hitpoints</nowiki></code> |
− | *'''Prim 5 Description:''' <code>(string)volumeString+";"+(float)volumeFloat</code> | + | *'''Prim 5 Description:''' <code><nowiki>(string)volumeString+";"+(float)volumeFloat</nowiki></code> |
− | *'''Prim 6 Description:''' <code>(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</code> | + | *'''Prim 6 Description:''' <code><nowiki>(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</nowiki></code> |
− | *'''Prim 7 Description:''' <code>(float)attackNaturalMult+","+(float)attackNaturalMult+","+(float)strengthNaturalMult+","+(float)defenseNaturalMult+","+(float)hitpointsNaturalMult+","+(float)intellectNaturalMult+","+(float)focusNaturalMult+","+(float)fortitudeNaturalMult</code> | + | *'''Prim 7 Description:''' <code><nowiki>(float)attackNaturalMult+","+(float)attackNaturalMult+","+(float)strengthNaturalMult+","+(float)defenseNaturalMult+","+(float)hitpointsNaturalMult+","+(float)intellectNaturalMult+","+(float)focusNaturalMult+","+(float)fortitudeNaturalMult</nowiki></code> |
− | *'''Prim 8 Description:''' <code>(integer)recentAttackExp+","+(integer)recentAttackExp+","+(integer)recentStrengthExp+","+(integer)recentDefenseExp+","+(integer)recentHitpointsExp+","+(integer)recentCraftingExp+","+(integer)recentIntellectExp+","+(integer)recentFocusExp+","+(integer)recentFortitudeExp+","+(key)expEarnerPlayerKey</code> | + | *'''Prim 8 Description:''' <code><nowiki>(integer)recentAttackExp+","+(integer)recentAttackExp+","+(integer)recentStrengthExp+","+(integer)recentDefenseExp+","+(integer)recentHitpointsExp+","+(integer)recentCraftingExp+","+(integer)recentIntellectExp+","+(integer)recentFocusExp+","+(integer)recentFortitudeExp+","+(key)expEarnerPlayerKey</nowiki></code> |
− | *'''Prim 9 Description:''' <code>(integer)isInPvp+";"+(integer)isInCrafting+";"+(integer)isHovertextOn</code> | + | *'''Prim 9 Description:''' <code><nowiki>(integer)isInPvp+";"+(integer)isInCrafting+";"+(integer)isHovertextOn</nowiki></code> |
− | *'''Prim 10 Description:''' <code>(integer)playerExpEarnedLast24Hours + "," + (integer)playerExpEarnedLastWeek + "," + (integer)playerExpEarnedLastMonth + "," + (integer)playerExpEarnedAllTime + "," + (integer)battlesWonLast24Hours+ "," + (integer)battlesWonLast24Week + "," + (integer)battlesWonLast24Month + "," + (integer)battlesWonAllTime</code> | + | *'''Prim 10 Description:''' <code><nowiki>(integer)playerExpEarnedLast24Hours + "," + (integer)playerExpEarnedLastWeek + "," + (integer)playerExpEarnedLastMonth + "," + (integer)playerExpEarnedAllTime + "," + (integer)battlesWonLast24Hours+ "," + (integer)battlesWonLast24Week + "," + (integer)battlesWonLast24Month + "," + (integer)battlesWonAllTime</nowiki></code> |
− | *'''Prim 11 Description:''' <code>(integer)getAffinity</code> | + | *'''Prim 11 Description:''' <code><nowiki>(integer)getAffinity</nowiki></code> |
− | *'''Prim 12 Description:''' <code>(string)llList2CSV(weaknesses)</code> | + | *'''Prim 12 Description:''' <code><nowiki>(string)llList2CSV(weaknesses)</nowiki></code> |
− | *'''Prim 13 Description:''' <code>(integer)silverMembershipExpiryUnixTime+";"+(integer)goldMembershipExpiryUnixTime</code> | + | *'''Prim 13 Description:''' <code><nowiki>(integer)silverMembershipExpiryUnixTime+";"+(integer)goldMembershipExpiryUnixTime</nowiki></code> |
− | *'''Prim 14 Description :''' <code>(string)currentSpell</code> | + | *'''Prim 14 Description :''' <code><nowiki>(string)currentSpell</nowiki></code> |
*'''Prim 15 Description:''' UNUSED | *'''Prim 15 Description:''' UNUSED | ||
− | *'''Prim 16 Description:''' <code>(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</code> | + | *'''Prim 16 Description:''' <code><nowiki>(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</nowiki></code> |
− | *'''Prim 3 Name:''' <code>(string)attackXpLeft+","+(string)strengthXpLeft+","+(string)defenseXpLeft+","+(string)hpXpLeft+","+(string)craftXpLeft+","+(string)intellectXpLeft+","+(string)focusXpLeft+","+(string)fortitudeXpLeft</code> | + | *'''Prim 3 Name:''' <code><nowiki>(string)attackXpLeft+","+(string)strengthXpLeft+","+(string)defenseXpLeft+","+(string)hpXpLeft+","+(string)craftXpLeft+","+(string)intellectXpLeft+","+(string)focusXpLeft+","+(string)fortitudeXpLeft</nowiki></code> |
− | *'''Prim 5 Name:''' <code>(integer)allowBattleAssistance</code> | + | *'''Prim 5 Name:''' <code><nowiki>(integer)allowBattleAssistance</nowiki></code> |
== Creature Spell == | == Creature Spell == | ||
− | Worn Krafties pets will communicate on channel '''-748382747''' each time a spell is cast from the Cast Spell menu. | + | Worn Krafties pets will communicate on channel '''<code>-748382747</code>''' each time a spell is cast from the Cast Spell menu. |
== Overall Level == | == Overall Level == | ||
− | llRound( (combatLevel + craftingLevel + mentalLevel)/(float)3.0 ) | + | <code><nowiki>llRound( (combatLevel + craftingLevel + mentalLevel)/(float)3.0 )</nowiki></code> |
− | |||
= Wild API = | = Wild API = |
Revision as of 02:15, 20 August 2014
Creature/Pet API
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.
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_DESC or PRIM_NAME)
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)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:
(integer)playerExpEarnedLast24Hours + "," + (integer)playerExpEarnedLastWeek + "," + (integer)playerExpEarnedLastMonth + "," + (integer)playerExpEarnedAllTime + "," + (integer)battlesWonLast24Hours+ "," + (integer)battlesWonLast24Week + "," + (integer)battlesWonLast24Month + "," + (integer)battlesWonAllTime
- Prim 11 Description:
(integer)getAffinity
- Prim 12 Description:
(string)llList2CSV(weaknesses)
- Prim 13 Description:
(integer)silverMembershipExpiryUnixTime+";"+(integer)goldMembershipExpiryUnixTime
- Prim 14 Description :
(string)currentSpell
- Prim 15 Description: UNUSED
- 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
- Prim 3 Name:
(string)attackXpLeft+","+(string)strengthXpLeft+","+(string)defenseXpLeft+","+(string)hpXpLeft+","+(string)craftXpLeft+","+(string)intellectXpLeft+","+(string)focusXpLeft+","+(string)fortitudeXpLeft
- Prim 5 Name:
(integer)allowBattleAssistance
Creature Spell
Worn Krafties pets will communicate on channel -748382747
each time a spell is cast from the Cast Spell menu.
Overall Level
llRound( (combatLevel + craftingLevel + mentalLevel)/(float)3.0 )
Wild API
Sensor nearby wilds, using sensor to grab the wild UUID. Using llGetObjectDetails (PRIM_DESC), parse the description accordingly.
Experience fields are void and temporary data which should not be used.
Format is the same on Regular or Giant wilds.
Prim 1 Description: (integer)currentHealth+";"+(integer)attackLevel+","+(integer)strengthLevel+","+(integer)defenseLevel+","+(integer)hitpointsLevel+","+(integer)craftingLevel+","+(integer)intellectLevel+","+(integer)focusLevel+","+(integer)fortitudeLevel+";"+(integer)attackExpVoid+","+(integer)strengthExpVoid+","+(integer)defenseExpVoid+","+(integer)hitpointsExpVoid+","+(integer)craftingExpVoid+","+(integer)intellectExpVoid+","+(integer)focusExpVoid+","+(integer)fortitudeExpVoid
Battles API
The Krafties Battle Scripting API is a feature which allows you to get data from your battles for your own scripted third party addons such as scoreboards, contest/tournament boards or other assisting objects.
Currently this is read only although gives access to a wide range of possibilities.
This API relies on listening on channel -748382748 from inworld Battle temples.
Battle temples will communicate on different events:
Battle Start
Battle End
Player Eliminated
These messages will be send on the corresponding event. There are 2 lists delimited by "," & "|" into a string.
By matching matchID you will be able to link temples for successful battles.
list playersData = [playerKey, petKey, petID, petLevel, manaLeft, energyLeft, lastPingTime, playerKey, petKey, petID, petLevel, manaLeft, energyLeft, lastPingTime]; // 2 players strided by 7
list eliminatedPlayersData = [playerKey, petKey, petID, petLevel, manaLeft, energyLeft, lastPingTime, playerKey, petKey, petID, petLevel, manaLeft, energyLeft, lastPingTime, playerKey, petKey, petID, petLevel, manaLeft, energyLeft, lastPingTime]; // 3 players strided by 7
"PLAYER_ELIMINATED|"+(string)matchID+"|"+(string)playerKey+"|"+llDumpList2String(playersData, ",")+"|"+llDumpList2String(eliminatedPlayersData, ","));
"BATTLE_ENDED|"+(string)matchID+"|"+(string)win+"|"+llDumpList2String(playersData, ",")+"|"+llDumpList2String(eliminatedPlayersData, ","));
"BATTLE_STARTED|"+(string)matchID+"|"+battleMode+"|"+llDumpList2String(playersData, ",") );