This is an update to MSN2.0, including bug fixes and several improvements. A simple echo bot is included.
Thanks for the change/addition suggestions everyone! This revision, though near final, is one of the biggest yet! I implemented almost all of your requests and a few more I dreamed up. Please read the changelog and handlers files in the docs directory. I will post on the other topic what changes I didn't make and why.
Main changes
sendmsg has been deprecated, it will work until the next revision
sendMessage is the new method that replaces it
events renamed - see handlers.txt in docs
Error.pm renamed Util.pm - it contains more functionality than just errors
setMessageStyle - lets you set the default font, effect and P4 name
ClientCaps - event called when a user sends clientcaps to your bot
setClientCaps - to set your bot's own clientcaps, see changelog in docs
Clientcaps is going to require some discussion by all of us. I'll start a new topic explaining more about how it works and some other ideas I have.
If you are using an existing template, please wait for it to be updated before using this new MSN.pm.
When you run your bot, the first line of your script should say:
This is a value that shows that you are running an unedited version of the modules, which will help us determine any problems you might have. When you have errors or bugs, including the first line (most importantly the Checksum) will help us debug things for you faster.
I see that you are trying to break away from the old type of MSN.pm, but I honestly think that changing all these chances to the methods (such as sendmsg *whoops, I mean sendMessage*) are pointless, and will just make people have to change their (already fine) code. The rest of the changes are good, but I think that it should be optional. Changing everything will also get some newbies asking "why doesn't this command work for me? [link to command from last week]" etc.
Overall good work though _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Joined: 03 May 2006 Posts: 2292 Location: Colorado
Posted: Tue Nov 23, 2004 2:16 pm Post subject:
QUOTE(darkmonkey @ Nov 23 2004, 05:32 AM)
Awsome!
One little comment:
I see that you are trying to break away from the old type of MSN.pm, but I honestly think that changing all these chances to the methods (such as sendmsg *whoops, I mean sendMessage*) are pointless, and will just make people have to change their (already fine) code. The rest of the changes are good, but I think that it should be optional. Changing everything will also get some newbies asking "why doesn't this command work for me? [link to command from last week]" etc.
Overall good work though
A lot of the renaming is needed, and for me welcome. The consistence in nameing is worth a little bit of change. I think we can all survive that, but the old lack of naming conventions was annoying. Hopefully we can produce some nice documentation for this, including a nameing convention to be used in it by future programmers.
Of course I'm a tiny bit biased in the matter. Either way when Mojave mentioned depreciated commands before he made them throw warnings when used, i'm sure thats what he is doing this time around, if not maybe I can go through and add those. That only works for methods though, for events you just have to accept the fact that they are changing. _________________ Eric256
Proud previous owner and current admin of Bot-depot.com
Sure would be nice if we had as much dev work on Net::Oscar as we do MSN.pm LOL _________________ Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com
Joined: 03 May 2006 Posts: 2292 Location: Colorado
Posted: Tue Nov 23, 2004 3:56 pm Post subject:
QUOTE(alienz @ Nov 23 2004, 07:47 AM)
Sure would be nice if we had as much dev work on Net::Oscar as we do MSN.pm LOL
I was under the impression that Net::OSCAR was working great. No need t fix stuff thats not broken . _________________ Eric256
Proud previous owner and current admin of Bot-depot.com
Yea because otherwise you've got to rember if its got caps, or not , or some are...with the way mojave is GRADUALLY (notice that so we only have to do bit by bit) doing it , it keeps it the same.
Joined: 22 Feb 2004 Posts: 121 Location: Richmond, VA
Posted: Tue Nov 23, 2004 5:41 pm Post subject:
Great update Mojave. I can't wait for the final! I have no problem with changing the name of sendmsg to sendMessage. Since it accept so many new things now I think it needed a facelift. Since I already wrap sendmsg with another function, I have about 1 line of code to change.
Joined: 15 Mar 2004 Posts: 661 Location: Manchester, UK
Posted: Tue Nov 23, 2004 6:11 pm Post subject:
Yer as darkmonkey and matt007 said maybe you should have left in sendmsg just for a few more issues of msn.pm with warnings then eventully faded it out. But anyway nice! _________________ MSN: gavin [at] gavinbrittain [dot] co [dot] uk
E-Portfolio: www.gavinbrittain.co.uk (New version comming soon)
Well, I *did* leave sendmsg in... and with warnings, exactly for the reasons you all are suggesting - because so many people are used to it and have it spread throughout their code. This is the reason for deprecation. Deprecation for events is too complicated and since you only have to change the name once where you setHandlers, I thought people could deal. For sendmsg, you just have to do a grep and replace in all of your files - seems so easy.
Just wanted to add that consistency is very important, because it allows new users of MSN.pm to think logically about what a method might be named and how it is cased.
If you are using sendTyping, sendInk, sendClientCaps... you see that this is full words, mixed case, first letter lower, so when you think well I wonder how to send a message... sendMessage makes sense, sendmsg doesn't.
Maybe I should have done this is the very first release, but I didn't want to scare everyone off. As DazzEH said, it's better to do things gradually.
ClientCaps is great! Very helpful for what me and my mate are doing atm, were trying to create a RPG bot that interacts with other bots of the same template, this is great for recognising them!
I was under the impression that Net::OSCAR was working great. No need t fix stuff thats not broken .
I just meant adding new features, improving things, etc. _________________ Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com