Twisol said:
Rivius said:
-I noticed that in most plugins, people have ID numbers. Where does one generate these numbers?
In MUSHclient, Edit -> Generate Unique ID.
Rivius said:
-Is every function within a plugin performed in every step?
No, functions are blocks of code that aren't executed until they are called. There are also events that call functions, such as a plugin being closed (OnPluginClose) or a trigger being fired (whatever you specify), but in general functions are only called when you call them.
Rivius said:
- I plan to use GCMP to get the variables of max hp and max mp from an IRE game. Is there a good tutorial or list of functions so I can get a basic idea of how I'd begin to do this? I want to study this to properly learn and understand it.
GMCP, not GCMP. :D
I have a plugin that wraps the GMCP protocol (GMCP.plugin) that you can get at my website[1], and I also have a plugin you can look at to see how you use it (roomname.plugin). There should be a README in both.
If you're new to Lua, I highly recommend reading "Programming in Lua" [2], which you can find online.
[1] http://jonathan.com/mushclient-achaea-plugins
[2] http://www.lua.org/pil/
Nick and Twisol, thank you very much for your reply.
Firstly, sorry for the typo! :P
In regards to my experience with lua, I'm not terribly great with it, but I do know at least most of the basics. I've been learning it slowly over the past few months in my free time.
Thanks for the id generation thing, I admit I never saw that before. It helped a lot in preloading a plugin from the script file.
I looked at your GMCP plugin and I'm afraid I still don't quite 'get' it. Is there official documentation regarding these functions anywhere and how I can use them? My main goal is just to get character vitals, but I also want to fully understand what I'm writing so I'm learning something new.
Also, about the functions question, I was confused about how functions worked in plugins specifically (I didn't understand exactly what the application of a plugin was and assumed it was a means of executing a piece of code upon every step or something). When you mentioned OnPlugin, I figured there must be events to it, so thanks for pointing me in the right direction with that. Instead now, I'm using aliases to call functions from my prompt. So, so far I've learned a bit about plugins.