Shoutbox

[release] My MsgPlus!Live Script - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [release] My MsgPlus!Live Script (/showthread.php?tid=61814)

[release] My MsgPlus!Live Script by JonnyT on 06-27-2006 at 09:30 PM

I've been playing aroud a bit with the new scripts feature of messenger plus live, its nothing special its jsut very basic and was just me playing around basicly but try it out anyway and let me kno what ya think, and any errors, or perhaps what i could add/change.

Commands
#inbath - set status to “yourname { inbath }”, send open chat windows “Im going to have a bath” message
#toilet- set status to “yourname { in toilet }”, send open chat windows “Im going to th toilet” message
#bathroom - set status to “yourname { in bathroom }”, send open chat windows “Im in the bathroom” message
#eat - set status to “yourname { eat }”, send open chat windows “Im going to eat” message
#sleep - set status to “yourname { sleeping }”, send open chat windows “Im going to sleep” message
#smells namehere - send message “namehere smells” to current chat
#rocks namehere - send message “namehere rocks” to current chat
#slap - send “yourname slaps you!” message to current chat
#toast yourcontent - displays a toast with “yourcontent”

Download: http://www.anonymousjon.co.uk/download/Usefull%20Script.plsc
On my blog: http://www.anonymousjon.co.uk/blog/?p=12


RE: [release] My MsgPlus!Live Script by Chris4 on 06-27-2006 at 09:57 PM

Nice basic script :)


RE: [release] My MsgPlus!Live Script by JonnyT on 06-27-2006 at 09:59 PM

thanks :P

yup its just me layin around basicly. Im gonna improve it fix a few bits and hoefully add custom commands for the #inbath, #sleep etc


RE: [release] My MsgPlus!Live Script by CookieRevised on 06-27-2006 at 10:09 PM

looks good for your first script... Though you have some things you might want to correct:

code:
case 'MnuTest' :
        wnd.SendMessage('{ test goes here }');return;
        return;
You have 1 "return;" too many here... delete the one after the sendmessage line.

code:
case 'MnuInfo' :
(...)
What is shown here can also be shown with the (!VER) tag. Same with the part which handles the "#info" command.

code:
case 'MnuBath' :
        (...)
        if (IAm == "bath") {
                var ValRegPathIAm = MsgPlus.ScriptRegPath + "IAm";
                (...)
        }
        else
        {
                (...)
                var ValRegPathIAm = MsgPlus.ScriptRegPath + "IAm";
                (...)
        }
You already have "var ValRegPathIAm" defined before the if then else statement, no need to do it again in the "if" and again in the "else". Those lines can be deleted.

The same goes for "case 'MnuBath'" , "case 'MnuSleeping'", "case 'MnuEating'". And same goes for the parts of the equivalent commands.

--

And in general: you can make that script really extremely shorter.
(ps: and with this I don't mean the things I've said above. This is an additional thing you can do to the stuff listed above)

--

;)





EDIT:
quote:
Originally posted by JonnyT
(...) and hoefully add custom commands for the #inbath, #sleep etc
before you do that, find the ways to make your script shorter. It would be far more easier to add stuff to the shorter version than to the existing version.

RE: [release] My MsgPlus!Live Script by JonnyT on 06-27-2006 at 10:14 PM

thanks for the tips Cookie, I will definatly be making the script shorter, and fixing a few small errors before i even atempt to add custom commands.

On that point, at the moment im using the registry to store a couple of things but I was thinking the best way to store the custom commands would be in either a text or xml file, but how would I go about reading/writing to an external text file from a config window. Any help would be great :)


RE: [release] My MsgPlus!Live Script by deAd on 06-27-2006 at 10:29 PM

The registry is the best way. :P


RE: [release] My MsgPlus!Live Script by Lou on 06-28-2006 at 12:20 AM

quote:
Originally posted by deAd
The registry is the best way. :P
Not necessarily. If the user that installed the script does not have access to the registry, then the script won't even run.
RE: RE: [release] My MsgPlus!Live Script by alexp2_ad on 06-28-2006 at 12:26 AM

quote:
Originally posted by JonnyT
On that point, at the moment im using the registry to store a couple of things but I was thinking the best way to store the custom commands would be in either a text or xml file, but how would I go about reading/writing to an external text file from a config window. Any help would be great :)

http://mpwiki.h-master.net/Text_Files

Posted on mess.be too, but just in case ya miss it. :)
RE: [release] My MsgPlus!Live Script by CookieRevised on 06-28-2006 at 12:50 AM

quote:
Originally posted by .Lou
quote:
Originally posted by deAd
The registry is the best way. :P
Not necessarily. If the user that installed the script does not have access to the registry, then the script won't even run.
which would be very rare seeing the location (HKCU and not HKLM) where script settings are stored. I also doubt that someone without access to that location would even be able to properly run Plus!Live for that matter (can be, but very unlikely).

Also, if someone does not have access to the registry, I'm certain you can't even run scripts (unless you enable them again each and every time you start up Messenger as HKCU is also the location where Plus! stores if a script is enabled or not).

And for some simple settings like this I think using XML is a bit over the top (IMHO).

All in all, there is absolutely no reason why you shouldn't be using the registry for such small settings.
RE: [release] My MsgPlus!Live Script by JonnyT on 06-29-2006 at 04:28 PM

I've made alot of improvements to the code, and changed a couple of things, the "Im going to sleep" etc mssages are now sent to all open chat windows, and a new little feature which saves the last message your sent simply type #s1 to use it.

Im still trying to work out the custom messages. Im not sure how to do it I thought somthing like have each line as a new command like this:
#command | message sent to contact | set name to
but should this be done using text or registry. and would you do it/split the data for reading?

download http://www.anonymousjon.co.uk/download/Usefull Script.plsc


RE: [release] My MsgPlus!Live Script by Reload2 on 06-29-2006 at 04:29 PM

quote:
Originally posted by JonnyT
http://www.anonymousjon.co.uk/downloads/Usefull Script.plsc
Fix your link buddy ^^
RE: [release] My MsgPlus!Live Script by JonnyT on 06-29-2006 at 04:39 PM

sorry went for some strewberrys :) fixed the link

ok now im going crazy..im sure somone had just replied to this :s


hmm after some research i'v figured out hwo to do it, now I just need to create a window to add them from.

is there an example anywhere tht shows how to get information entered in a window?
RE: [release] My MsgPlus!Live Script by JonnyT on 06-29-2006 at 11:56 PM

well i've done it, leaving for newcastle in 3 hours (yup im leaving at 4am), but I have added custom commands. Using a very simple window you can add your own "Im going to the toilet" etc commands to the script. I would release a version now but theres some little bits I would like to sort first.

next i will be working on deleteing custom commands via a window, adding/deleteing to the #benice and #benasty commads, tweaking the custom comments so you can also choose what status you would like each to use (at the moment it ues Away)

and I will be working on changing the commands from # to / for plus style commands. although this might cause issues with people naming thier custom commands. we shall see

Jon