diff --git a/Plugins/AutoGG/main.js b/Plugins/AutoGG/main.js new file mode 100644 index 0000000..d6f77c4 --- /dev/null +++ b/Plugins/AutoGG/main.js @@ -0,0 +1,20 @@ +let mod = new Module("AutoGG", "Auto GG", "Responds with \"gg\" in chat on victory.", 0); +client.getModuleManager().registerModule(mod); + +function sendGGChatMessage() { + game.sendChatMessage("gg"); +} + +client.on("title", title => { + let text = title.text; + + if (game.getFeaturedServer() == "Hive") + { + if (text.includes("Sweet Victory") || text.includes("Game Over")) + { + sendGGChatMessage(); + } + } + + // more soon +}); diff --git a/Plugins/AutoGG/plugin.json b/Plugins/AutoGG/plugin.json new file mode 100644 index 0000000..2a12cfb --- /dev/null +++ b/Plugins/AutoGG/plugin.json @@ -0,0 +1,6 @@ +{ + "name": "AutoGG Plugin", + "author": "chyves", + "version": "1.0.0", + "description": "AutoGG" +} diff --git a/Plugins/plugins.json b/Plugins/plugins.json index bc476bc..b6b2cd6 100644 --- a/Plugins/plugins.json +++ b/Plugins/plugins.json @@ -34,6 +34,13 @@ "modWhereAmIHUD.js", "modAutoGG.js" ] + }, + { + "name": "AutoGG", + "files": [ + "main.js", + "plugin.json" + ] } ] } diff --git a/how-to-make-a-plugin.md b/how-to-make-a-plugin.md index dfa61a3..1218325 100644 --- a/how-to-make-a-plugin.md +++ b/how-to-make-a-plugin.md @@ -5,7 +5,7 @@ - Some basic JS/TS experience to learn how the language works - The definitions for autocomplete/checking -If you plan to debug using the Visual Studio workspace, click [here](https://.com/LatiteScripting/Scripts/blob/master/debugging.md) (you need to install VS first though). +If you plan to debug using the Visual Studio workspace, click [here](https://github.com/LatiteScripting/Scripts/blob/master/debugging.md) (you need to install VS first though). ### Useful info for JS/TS **Learn JS/TS** - these are just some websites, there are many more - [Exercism](https://exercism.org/) @@ -28,4 +28,4 @@ It's time to make some plugins! You can debug your code using the Visual Studio workspace. -See the [documentation](https://latitescripting.github.io/) for everything you can do with the scripting API \ No newline at end of file +See the [documentation](https://latitescripting.github.io/) for everything you can do with the scripting API