User Tools

Site Tools



cherrycore

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cherrycore [2024/05/06 00:27] onslaughtcherrycore [2024/05/07 17:54] (current) onslaught
Line 1: Line 1:
 {{::cherry:core_addon_logo.png?150|}} {{::cherry:core_addon_logo.png?150|}}
  
- +======Cherry Core====== 
-==== Cherry Core ====+
  
  
Line 11: Line 10:
 ==== Cherry Add-ons List==== ==== Cherry Add-ons List====
  
-^ ^ Addon+^ ^ Add-on
-| {{:cherry:core_addon_logo.png?100|}}| **[[https://wiki.mmominion.com/doku.php?id=cherrycore&do=edit|Cherry Core]]** |+| {{:cherry:core_addon_logo.png?100|}}| **[[cherrycore|Cherry Core]]** |
 |:::                                  |This add-on. Cherry Core is required for all other Cherry add-ons     | |:::                                  |This add-on. Cherry Core is required for all other Cherry add-ons     |
-| {{:cherry:telegram_addon_logo.png?100|}}| **[[https://wiki.mmominion.com/doku.php?id=cherrytelegram&do=edit|Cherry Telegram]]** |+| {{:cherry:telegram_addon_logo.png?100|}}| **[[cherrytelegram|Cherry Telegram]]** |
 |:::                                  |Utilizes Telegram's bot technology to transfer messages back and forth to the game. Telegram is free and creating a bot is free as well as easy. No coding skills are needed. Follow the instructions carefully to ensure that you don't have any issues| |:::                                  |Utilizes Telegram's bot technology to transfer messages back and forth to the game. Telegram is free and creating a bot is free as well as easy. No coding skills are needed. Follow the instructions carefully to ensure that you don't have any issues|
 +| {{:cherry:cherry:discord_wiki_logo.png?100|}}| **[[cherrydiscord|Cherry Discord]]** |
 +|:::                                  |Send in game messages directly to your discord server. Utilize commands to communicate directly with your friends and free company members and any other message based usage you can think of. Directly command and receive message from supported add-ons mods.|
  
  
-====Cherry Connect API Referance====+====Cherry Connect API Reference==== 
 + 
 +Cherry Connect allows your add-on to send and receive messages from any Cherry communication add-on the user has installed. When Your add-on requests access, Cherry Connect automatically registers with all communication add-ons that the user currently employs. The user has full control over which, if any, communication add-ons your add-on is allowed to connect to. Cherry Connect abstracts the individual details away and allows you to focus on sending and receiving messages without the details of the specific communication client that the user has deployed.
  
 The Cherry Connect API is fairly simple and is accessed by the global variable  The Cherry Connect API is fairly simple and is accessed by the global variable 
Line 26: Line 29:
  
 Communication with the code is done in two ways: Callback functions and immediate result structs. The immediate function results will notify the user that the initial step taken was either successful or was an error. This handles cases where there are no clients registered or some other local issue happens. Further results and errors will be communicated in the callback function once the bot hears back from the communication Clients.  Communication with the code is done in two ways: Callback functions and immediate result structs. The immediate function results will notify the user that the initial step taken was either successful or was an error. This handles cases where there are no clients registered or some other local issue happens. Further results and errors will be communicated in the callback function once the bot hears back from the communication Clients. 
 +
 +=== Main Communication function ===
 +
 +The function that is passed to CherryConnect.Register will be the function that which most user messages and commands will be routed. The exception would be Cherry Connect.MessageOptions where the user-selected option will be routed directly to the specially supplied function.
 +
 +The When the user sends a message or command that is routed to cmd_func The signature will be function(result). The result will either be an error or a message result:
 +
 +On errors:
 +<code>
 +{
 +   mode = result_modes.error,
 +   err_code = error.error_code,
 +   message = message,
 +}
 +</code>
 +// See below for possible error codes and messages//
 +
 +
 +On success:
 +<code>
 +{
 +   mode = "message",
 +   message = 
 +   
 +     cmd = "ORIGINAL_COMMAND", 
 +     text = "USER_MESSAGE"
 +   },
 +}
 +</code>
 +
 +
 +=== Results & Errors ===
 +
 +**Result Modes**
 +<code> 
 +result_modes = {
 +   new_id = "new_id",
 +   success = "success",
 +   error = "error",
 +   message = "message",
 +}
 +</code>
 +
 +**Error Codes**
 +<code> 
 +errors = {
 + setting_commands = {
 + error_code = 1001,
 + message = "Error Setting Commands."
 + },
 + missing_fields = {
 + error_code = 1002,
 + message = "Please provide an author, command function, mod name, and description."
 + },
 + mod_name_spaces = {
 + error_code = 1003,
 + message = "Mod name cannot contain spaces."
 + },
 + cmdFunc_not_function = {
 + error_code = 1004,
 + message = "[cmdFunc] must be a function."
 + },
 + duplicate_mod = {
 + error_code = 1005,
 + message = "Mod already registered. Please use a different author / name combination."
 + },
 + mod_not_found = {
 + error_code = 1006,
 + message = "Mod not found."
 + },
 + id_not_supplied = {
 + error_code = 1007,
 + message = "ID not supplied."
 + },
 + mod_not_allow_posting = {
 + error_code = 1008,
 + message = "Mod does not allow posting."
 + },
 + message_not_supplied = {
 + error_code = 1009,
 + message = "Please supply a message."
 + },
 + no_registered_clients = {
 + error_code = 1010,
 + message = "The user has not registered any communication clients."
 + },
 +}
 +</code>
 +
 +
 +
 +
  
  
Line 70: Line 165:
  
 The mod name cannot conflict with any other mod or command. Mods do not share a 1 to 1 relationship with an add-on, so a single add-on can register multiple mods. The mod name cannot conflict with any other mod or command. Mods do not share a 1 to 1 relationship with an add-on, so a single add-on can register multiple mods.
-**MOD_ID** Will be used in all the other API calls to identify which mod is making the call. The **MOD_ID** must be saved for as long as Cherry Core is not unloaded or until the mod is unregistered. Once the mod is unregistered you must re-register the mod to access a new **MOD_ID**+**MOD_ID** Will be used in all the other API calls to identify which mod is making the call. The **MOD_ID** must be saved for as long as Cherry Core is not unloaded or until the mod is unregistered. Once the mod is unregisteredyou must re-register the mod to access a new **MOD_ID**
  
 {{:cherry:mod_view.png?600|}} {{:cherry:mod_view.png?600|}}
Line 84: Line 179:
  
 //Notes// //Notes//
-Most of the time you will not need to unregister a mod. The mod will need to be re-registered anytime the addons are all reloaded and a new mod_id will be generated. If you're going to lose the mod_id and you need to re-register your mod without reloading Cherry Core, Then you will need to unregister the mod.+Most of the timeyou will not need to unregister a mod. The mod will need to be re-registered anytime the add-ons are all reloaded and a new mod_id will be generated. If you're going to lose the mod_id and you need to re-register your mod without reloading Cherry Core, Then you will need to unregister the mod.
  
  
Line 130: Line 225:
  
   * **mod_id** - //required//   * **mod_id** - //required//
-    * The id of the mod that has been registered.+    * The ID of the mod that has been registered.
   * **options** - //required//   * **options** - //required//
     * A list of options that the user has to select from. The options are in the format of: {"Option1","Option2","Option3",...}      * A list of options that the user has to select from. The options are in the format of: {"Option1","Option2","Option3",...} 
Line 166: Line 261:
 Usage: Usage:
 <code> CherryConnect.MessageResponse(mod_id, callback_id, message)</code> <code> CherryConnect.MessageResponse(mod_id, callback_id, message)</code>
-Let'the user's client know That the option has been received successfully+Let the user's client know That the option has been received successfully
  
  * **mod_id** - //required//  * **mod_id** - //required//
Line 175: Line 270:
     * A simple message to the user acknowledging that the option was selected.     * A simple message to the user acknowledging that the option was selected.
  
-**returns**+**Returns**
  
 On errors: On errors:
Line 198: Line 293:
 //Notes// //Notes//
 This should be used immediately after an option is selected from CherryConnect.MessageResponse to provide a good experience for the end user to understand that the option that they selected was acknowledged. This should be used immediately after an option is selected from CherryConnect.MessageResponse to provide a good experience for the end user to understand that the option that they selected was acknowledged.
- 
-=== Main Communication function === 
- 
-The function that is passed to CherryConnect.Register will be the function that which most user messages and commands will be routed. The exception would be CherryConnect.MessageOptions where the user-selected option will be routed directly to the specially supplied function. 
- 
-The When the user sends a message or command that is routed to cmd_func The signature will be function(result). The result will either be an error or a message result: 
- 
-On errors: 
-<code> 
-{ 
-   mode = result_modes.error, 
-   err_code = error.error_code, 
-   message = message, 
-} 
-</code> 
-// See below for possible error codes and messages// 
- 
- 
-On success: 
-<code> 
-{ 
-   mode = "message", 
-   message = "FULL_USER_MESSAGE", 
-} 
-</code> 
- 
- 
-=== Results & Errors === 
- 
-**Result Modes** 
-<code>  
-result_modes = { 
-   new_id = "new_id", 
-   success = "success", 
-   error = "error", 
-   message = "message", 
-} 
-</code> 
- 
-**Error Codes** 
-<code>  
-errors = { 
- setting_commands = { 
- error_code = 1001, 
- message = "Error Setting Commands." 
- }, 
- missing_fields = { 
- error_code = 1002, 
- message = "Please provide an author, command function, mod name, and description." 
- }, 
- mod_name_spaces = { 
- error_code = 1003, 
- message = "Mod name cannot contain spaces." 
- }, 
- cmdFunc_not_function = { 
- error_code = 1004, 
- message = "[cmdFunc] must be a function." 
- }, 
- duplicate_mod = { 
- error_code = 1005, 
- message = "Mod already registered. Please use a different author / name combination." 
- }, 
- mod_not_found = { 
- error_code = 1006, 
- message = "Mod not found." 
- }, 
- id_not_supplied = { 
- error_code = 1007, 
- message = "ID not supplied." 
- }, 
- mod_not_allow_posting = { 
- error_code = 1008, 
- message = "Mod does not allow posting." 
- }, 
- message_not_supplied = { 
- error_code = 1009, 
- message = "Please supply a message." 
- }, 
- no_registered_clients = { 
- error_code = 1010, 
- message = "The user has not registered any communication clients." 
- }, 
-} 
-</code> 
- 
  
  
cherrycore.1714955247.txt.gz · Last modified: 2024/05/06 00:27 by onslaught