Shoutbox

code for replacing specific text with contactc name! - 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: code for replacing specific text with contactc name! (/showthread.php?tid=74642)

code for replacing specific text with contactc name! by Lux on 05-23-2007 at 10:06 PM

well....i'm writting a script wich would do the folowing thing....

if u know the mIRC "/me" predifined action texts u will know what I want...
I alterd the code of those texts so it would be compatabile with msg+( not big work just some of the commands needed to be removed or added, like removing the /say command, new line, and ect. )......so I need few tjhing if some1 can helo me....

it would be like this....


in the script codes, there would be text to send on commande wich would be sended to contact in conversation window from the my script  options, and i need the code wich would replace SOME text ( like #NAME# ) , wich is meant for name of persone wich u r sending a text to, in ALL of the predifend texts, whit NAME,  not email, of the contact wich u are talking to....so can u help me?

i putted the pic so u could understuund me better....


[Image: attachment.php?pid=819288]


P.S. sorry 'bout my english!I'm holping u understund me!


RE: code for replacing specific text with contactc name! by Sunshine on 05-23-2007 at 10:25 PM

You dont need to make a script to do that, a quicktext can do this. You can do that by using the tag (!N), wich displays your contacts friendlyname (name as set by contact him/herself).

Example of a quicktext using this:

[Image: attachment.php?pid=819291]

With this i can send the old/known /slap command.


RE: code for replacing specific text with contactc name! by Lux on 05-23-2007 at 10:34 PM

10x Sunshine ! :D
can that be addes in script file? cuz I alredy write the script! i just need to put the (!N) in it? would that work?


RE: RE: code for replacing specific text with contactc name! by Volv on 05-24-2007 at 01:42 AM

quote:
Originally posted by Luka88bg
can that be addes in script file? cuz I alredy write the script! i just need to put the (!N) in it? would that work?

Yes, (!N) is what you need to display nicknames. If you want emails use (!M).
RE: code for replacing specific text with contactc name! by Orgrim Doomhammer on 05-24-2007 at 04:34 PM

just a question... is there stg like (!N) that lets you display specific contacts nicknames? because if I use something like slap in a convo with more than one contact it will write the nick of every contact who's participating. I was wondering if there's a code like (!N1) etc. that shows the nick of the 1st contact participating to the convo etc.


RE: code for replacing specific text with contactc name! by CookieRevised on 05-24-2007 at 05:40 PM

quote:
Originally posted by Orgrim Doomhammer
just a question... is there stg like (!N) that lets you display specific contacts nicknames? because if I use something like slap in a convo with more than one contact it will write the nick of every contact who's participating. I was wondering if there's a code like (!N1) etc. that shows the nick of the 1st contact participating to the convo etc.
No, if you want to reply with only one of them you'll need to code it that way using an enumeration of the ChatWnd::Contacts object. More info in the Scripting Documentation.

eg:
code:
for (var e = new Enumerator(oChatWnd.Contacts); !e.atEnd(); e.moveNext()) {
        var Contact = e.item();
        Debug.Trace(Contact.Name);
}

RE: code for replacing specific text with contactc name! by Volv on 05-25-2007 at 04:56 AM

The problem with this is how the script is going to figure out which contact you want to slap or whatever...


RE: code for replacing specific text with contactc name! by Orgrim Doomhammer on 05-25-2007 at 12:51 PM

ok, I've understood.thx to cookie & volv 4 replying me


RE: code for replacing specific text with contactc name! by Matti on 05-25-2007 at 03:59 PM

Well, if you only want it to slap the first person found, you can use

code:
var ContactName = new Enumerator(ChatWnd.Contacts).item().Name
which will save the name of the first contact found to the variable ContactName