Krafties Fishing API

From Krafties
Jump to: navigation, search

The Krafties Fishing API is made up of messages broadcast on channel -325234765

Messages are broadcast both when a player casts their pole, and when a pole is reeled in. The delimiter "|" is used in both broadcasts. The easiest way to grab the applicable data is using the llParseString2List() function in a listen event

- ie:
   listen(integer channel, string name, key id, string message)
   {
       list fishingAPIData = llParseString2List(message, ["|"], []);
       .....
   }


__________________________________________________________________________________________

  • When player casts:
   Broadcast Format:
   ----------------------
       - FISHING_CAST|playerKey
       
       
   
   Data Descriptions:
   ----------------------
       ~ playerKey [key] : The key of the player casting their pole
   
   
   
   LSL Code:
   ------------
       - llRegionSay(-325234765, "FISHING_CAST|"+(string)playerKey);


__________________________________________________________________________________________

  • When player reels:
    Broadcast Format:
    ---------------------
       - FISHING_REEL|playerKey|poleType|catchType|catchSize|relativeSizeString|catchRarity|xpAwarded|fishingLevel
       
       
       
   Data Descriptions:
   ----------------------
       ~ playerKey [key] : The key of the player reeling their pole
       ~ poleType [string] : The type of fishing pole this player has active
       ~ catchType [string] : The result of the reel process. Will usually be a type of fish or a kraftie, but other types may be added in the future
       ~ catchSize [float(cm)] : The size of whatever was caught, measured in centimeters. If not applicable, this will be set to -1.
       ~ relativeSizeString [string] : Describes the relative size of this catch result compared to others of the same species. Possible values are:
           - EXTRA TINY
           - TINY
           - AVERAGE
           - BIG
           - GIANT
       ~ catchRarity [string] : The rarity of the catch result. More may be added in the future, but current possible values are:
           - VERY COMMON
           - COMMON
           - UNCOMMON
           - RARE
           - VERY RARE
       ~ xpAwarded [integer] : The amount of experience points awarded to the player for this catch
       ~ fishingLevel [integer] : The current fishing level of this player
   
   
   
   LSL Code:
   ------------
       - llRegionSay(-325234765, "FISHING_REEL|"+(string)playerKey+"|"+poleType+"|"+catchType+"|"+(string)catchSize+"|"+relativeSizeString+"|"+catchRarity+"|"+(string)xpAwarded+"|"+(string)fishingLevel);