What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Betaish-Release] Recall Prefix

[Betaish-Release] Recall Prefix
Author: Message:
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
O.P. [Betaish-Release] Recall Prefix
Well some of you might remember a little registry setting in ye olde Messenger Plus! 3 that allowed you to add a prefix and suffix to messages sent using Text Recall (y'know, that Ctrl+Up/Down thingy).

It looked like this (well this is my script but that just shows how good its replicated eh :P)

[Image: RecallPrefix_Screenshot.png]

Well this script adds that little feature back, so without further ado here it is.

[Download]
12-26-2006 09:09 PM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: [Betaish-Release] Recall Prefix
Why not use one string (instead of Prefix and Suffix) which contains a tag which would be replaced by the message?

Like
code:
[i][b][c=14]Recall: "[/c][/b]%message%[b][c=14]"[/c][/b][/i]

This post was edited on 12-26-2006 at 09:55 PM by deAd.
12-26-2006 09:53 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Betaish-Release] Recall Prefix
Nice idea and thingie :P (y)...


some things though:

* function ShowConfigWindow(){
check if config window isn't already showing
(too bad it doesn't make me that tea I wanted at the moment)

* function OnGetScriptMenu(){
Config opens a new window, so add "..."

* function OnEvent_MenuClicked(MenuItemId){
- no need for checking on the menuid when you use only 1 item
- you're missing a closing } in that function

* function SaveSettings(){
put everything in a error handling routine because Messenger.MyEmail will not always be defined (eg: user is logged out while config window is still showing).

* var OnEvent_Initialize = Startup;
Initialize (and thus Startup()) can/will be called before Messenger.MyEmail is defined. Thus use if(Messenger.MyStatus > 1).

* function Startup(){
It is possible that that registry key doesn't exist, so again error checking (default DWORD value is 1). But better yet:

* Check on EnablePreviousRecall each time, since this can be changed while user is logged in. To avoid reading regisrty each time a key is pressed, maybe read it only when a chat window is created. Do if(RecallEnabled == 1) instead of using '===' because, maybe, there is a change someone screwed up and saved the key as a string.

* When user uses other keys than alfanumerical, etc (eg: copy/paste and stuff), the script isn't in 'Waiting' state anymore and thus quote isn't send as a quote. But that's hard to fix properly and 100% and it is something minor anyways.

* When user uses mouse to paste some text after a quote has been send for exalmple, the new text will also be send as a quote. Add Waiting=false in OnEvent_ChatWndSendMessage().

* When another user signs in to Messenger, the default prefix/suffix values are not loaded. aka: don't define default values in global scope of the script but in the LoadSettings function.

* Make Waiting variable chat-specific so that when you select a quote and temporarly chat in another window, you can still send the quote as a quote in the first one.



* love the comments :p



PS: for those who want to know, in Messenger Plus! 3 the registry key to add/change a prefix or suffix:  HKCU\Software\Patchou\MsgPlus2\your@email.com\Preferences\QuoteFormat
see Help: Registry Tweaks

This post was edited on 12-27-2006 at 04:37 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-27-2006 03:14 AM
Profile PM Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: [Betaish-Release] Recall Prefix
umm how exactly do i use it :S

dont worry i got it :P

nice work (Y)

This post was edited on 12-27-2006 at 05:20 AM by NanaFreak.
12-27-2006 05:13 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Betaish-Release] Recall Prefix
quote:
Originally posted by NanaFreak
umm how exactly do i use it :S
It adds a prexif and/or suffix to the quoted messages when you send them. So, simply select a quoted message and send it...

To select a quoted message in Messenger Plus! Live, press CTRL+UP or CTRL+DOWN in a conversation window (this is a standard feature of Plus!, the only thing the script does is altering the message a bit when it is send).

This post was edited on 12-27-2006 at 05:21 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-27-2006 05:19 AM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [Betaish-Release] Recall Prefix
I must say this script is great, but I have one problem with this script. As script developer, I have to test my script commands time and time again to make sure it works well, so I use CTRL+UP a lot to repeat a command. However, because the script adds a prefix in front of it, it doesn't get parsed. Therefore, I had to modify your script. :P

So, what you should do in your OnEvent_ChatWndSendMessage is:
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
  if(Waiting) {
    //If there are 2 slashes preceding the message (so it's an escaped command)...
    if(Message.substr(0,2) == "//") {
       //If the prefix contains some useful characters, return with one slash
       if(Prefix.length > 0) return Prefix + Message.substr(1) + Suffix;
       //Else, return with 2 slashes so it gets escaped by Plus!
       else return Message + Suffix;
    //Or, if the message is preceded by one slash (so it's a command), return it
    } else if(Message.charAt(0) == "/") return Message;
    //If there is no slash in front, add the prefix and suffix anyway
    else return Prefix + Message + Suffix;
  }
}
Tested and using! ;)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
12-27-2006 09:40 AM
Profile E-Mail PM Web Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
O.P. RE: [Betaish-Release] Recall Prefix
I can't be bothered saying exactly what I've changed, I just went through Cookie's comments and changed things accordingly (and yours Mattike ;)).
Please take another look Cookie :P

Download link same as before (here if you're too lazy to scroll up)
12-27-2006 11:53 AM
Profile PM Find Quote Report
linx05
Senior Member
****

Avatar
Charlie!!!

Posts: 973
Reputation: 25
38 / Other / Flag
Joined: Feb 2003
Status: Away
RE: [Betaish-Release] Recall Prefix
So simple yet so handy. This is definitely a keeper!
For news on anything Tremors, visit Tremors News
End Darko
My blog about my film


Scripts I want to get made:
Taskbar icon to change when contact is typing
12-27-2006 01:06 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On