[help] my first 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: [help] my first script.. (/showthread.php?tid=61502) [help] my first script.. by mltz2plz on 06-26-2006 at 05:58 AM
Hey, well i'm just sort of playing around and stuff trying to figure out the whole scripting thing. I've made a small script that doesn't work exactly how i wanted. What it does is when you change your status it adds a "note" at the front of your PSM saying whatever you wish, eg. if you set your status to "out to lunch" it will say "Shh! eating. - (old psm here)". or whatever you put for it to say. code: now, my problem is that when a person changes their status it will work how i wanted, eg *change to online* "online - this is the old personal message" but then say they change their status to busy it will show up like this: "Busy - Online - this is hte old personal message" is there a way i can get rid of the "online -" i'm pretty sure it is possible but am not too sure how to do it. please help. thanks in advanced, nick. RE: [help] my first script.. by Matti on 06-26-2006 at 06:22 AM
You can save the original personal message first in a variable, like this: code:Also, I recommend to use a switch case block instead of using every time if elseif. It makes the code easier to read. Here's a simplified version for your script: code:As you can see, every case block ends in a break statement. This is because if you don't, it will execute all the other code too! I hope that helps... RE: [help] my first script.. by mltz2plz on 06-26-2006 at 06:32 AM Hey thanks for the help. i'm just starting out so i dont really know much about what i'm doing so thanks for your help. RE: [help] my first script.. by can16358p on 06-26-2006 at 07:19 AM Also, don't forget updating originalPSM when the user changes it. I'm new to (Plus) scripting too so I don't remember the event names, but you can easily find that event in the documentation. RE: [help] my first script.. by mltz2plz on 06-26-2006 at 01:44 PM ok well i've been trying with your simplified code and that variable thing and it keep saying originalPSM undefined RE: RE: [help] my first script.. by The Brain on 06-26-2006 at 03:26 PM
quote: you will have to define the originalPSM variable outside of the function code: RE: [help] my first script.. by mltz2plz on 06-27-2006 at 09:49 AM thanks |