LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

[RELEASE] chatJS Plugin Manager

Root / Site Discussion / [.]

MasterR3C0RDCreated:
Finally, the chatJS Plugin System v2.1.0 is out! Wait, what? What is this weird thing? The chatJS Plugin System is a framework for the quietly release chatJS system, that allows injecting JavaScript into the SmileBASIC Source Chat to add commands and features. A lot has been made already, from a bot that says quotes when you PM a certain message (outofcon.txt bot, Trinitro21) to a command that lets you style text (/style, 12Me21), to a command for running JavaScript without refreshing (runJS, ShadowCX11)). But this requires pasting a lot of text into a small editor, and it can get very crowded after a while. Also, a lot of this requires workarounds just to do simple tasks. The solution: the chatJS Plugin Systen. It's a convienence for both chat users and chatJS developers that makes both tasks much easier. It only requires putting a small script in your chatJS, and you have the power to load/unload plugins, see help for all commands, edit a global storage systen, and more! Alright, you've got me convinced, how do I install it? Just follow these steps! Well, now what? I've installed, what can I do? You can now use the following commands:
  • /loadplugin [name] - Loads a plugin, making it load automatically every time you open chat.
  • /unloadplugin [name] - Unloads a plugin from the current session, and stops loading the plugin automatically.
  • /localhelp [category?/plugin?] - Shows the categories for the commands if no argument, or shows the commands for said category/plugin.
  • /plugininfo [name] - Shows information for said plugin.
  • /myplugins - Shows the currently loaded plugins.
Okay, so what plugins can I load so far? Well, so far, there aren't many plugins. The current plugins are:
  • style - By 12Me21 Allows you to use special characters like ~ and ` to style text, making it bold, italic, etc. It's based on a script he created for the old system.
  • ooc - By Trinitro21 A plugin implementation of the outofcon.txt bot that he had running before moving to the new system. The name originated from a quote by slackerSnail:
    just use n3ds browser to watch **** smh >don't take this out of context
  • runjs - Based off an old plugin by Trinitro21, based off an older script by ShadowCX11 (ShadowCX13), adapted to the new system by ShadowCX11 (ShadowCX13) This is an adaptation of the plugin Trinitro21 made for the old plugin system, that was itself based off a script I made. It lets you evaluate JS immediately by either typing into a prompt or passing the code as a parameter.
  • webnotify - By ShadowCX11 (ShadowCX13) This is the "example" plugin. It uses most of the possible functions and APIs, including Global Storage and the events system. WebNotify shows a Web Notification when a message is recieved. You can make it only notify when your username or aliases added with /notifyalias is seen or when you're pinged (with @[username]. Ex: @ShadowCX13).
I'm a JavaScript developer. What can I do with this that I can't usually in normal chatJS? Well, first of all, you can load APIs from other JS files. These are basically scripts that return a value. Second, you can take advantage of init(), a function that runs when the page is loaded/Socket becomes available, and plugin.bind("unload", function(){}), which will run when your plugin is unloaded. Also, you don't have to override displayMessage, or onMessage, because you can just do events.bind("message", function(msg){}). You don't have to mess around with your chatJS every time you update your script either. Since the code is directly loaded from the chatJS GitHub repo, changes will automatically take place when any code is changed. We added addCommand, which basically loads your command automatically under your plugin's name. You just pass the command, the function to run, and the description for the plugin. Finally, we have the Global Storage API. This allows you to modify data stored by your plugin, or others. Instead of being stored in your browser, it's stored in you chatJS under the GlobalData section of your chatJS as a JSON string. You can access the Global Storage system, and use it like you would localStorage or sessionStorage. Who programmed this amazing piece of JavaScript? Well, it was teamwork by me (ShadowCX13), Trinitro21, and slackerSnail. 12Me21 also programmed one of the first plugins, so kudos to him. Here's what each of us have done: ShadowCX13 - Programmed the majority of the system, including most of the bootstrap and all of the init.js code Trinitro21 - Did bugfixes on the bootstrap, helped with GlobalStorage, and implemented the preboot area slackerSnail - Implemented plugininfo (don't worry, he's going to be doing more ;) ) Anyways, hope you enjoy! -ShadowCX11 [poll=p8][/poll]

NEW RELEASE cemote - By Trinitro21 This plugin allows adding custom emotes, or overriding ones already implemented. An amazing example of what can be made easier by using the plugin system!

tutorlialy for make own pluginz plaes

tutorlialy for make own pluginz plaes
Alright, I'm writing up a tutorial now. Sit tight.

Alright, so the plugin system is starting to lose traction due to not that many good plugins out. So I'm between a brick and a hard wall here. Here's the question. I have multiple ideas, but only 3 really make sense. Here are the possibilities
  • Create a Brainfuck interpreting plugin for the fun of using it, and allow sharing your creations with other users. This would add a "Global Sharing API" that could be used by other plugins in the future
  • Create a completely customizable native chat client in NW.js, and add a couple of APIs there, making UI customization easier, allowing Node.JS modules to be used in plugins with support for the client, and allowing minimal file system access.
  • Make the plugin system easier to develop for. I'd listen to your suggestions for making it better, and attempt to implement them. This would attract plugin developers to the plugin system more.
  • Scrap the Plugin System, release the currently closed source components (Butler: The Global Storage server, and Hitman: the OOC bot extras server) as open source under the MIT license, and end development. However, this would mean that I wouldn't run the required servers anymore, so users would have to run them theirselves, or remove all references to them.
Here's your poll. Carefully think before voting, as you're shaping the future of the chatJS Plugin System, a bit of me, Trinitro21, and slackerSnail's summer, and your own chat experience. [poll=p17][/poll] Bye for now, ShadowCX11