|
Joined: Oct 2004
Posts: 18
Pikka bird
|
OP
Pikka bird
Joined: Oct 2004
Posts: 18 |
Another script question. How would I go about auto answering someone..for instance... Jim? or Jim either one...AN I would auto reply and say the screen name of the person who typed my name. Any help is appreciated. Thanks
|
|
|
|
Joined: Dec 2002
Posts: 1,543
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,543 |
on *:text:*:*: {
if ((Jim isin $1-) || (Jim $+ $chr(63) isin $1-)) { echo $nick said $v1 }
} Remember, $v1 (and $v2 also) will return what $ifmatch used to ($ifmatch still works but this seems to be the new method mirc will use) And for those who say this way's better: on *:text:*:*: {
if ((Jim isin $1-) || ($+(Jim,$chr(63)) isin $1-)) { echo $nick said $v1 }
} And then I SUPPOSE you could use regex if you knew it which I dont.
Those who fail history are doomed to repeat it
|
|
|
|
Joined: Oct 2004
Posts: 18
Pikka bird
|
OP
Pikka bird
Joined: Oct 2004
Posts: 18 |
Thanks, I will try this. Elseif is just a command right? For instance, if I was writing a script to shorten..be right back, I would use elseif with a command of brb, and it would spell out be right back, correct?..Once again Thanks
|
|
|
|
Joined: Dec 2002
Posts: 1,543
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,543 |
well, it would depend on how it was coded but yes, you most certainly can use elseif for something like that
Those who fail history are doomed to repeat it
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
You could use something like: alias myacros {
if ($1 == brb) { return be right back }
elseif ($1 == lol) { return laughing out loud }
elseif ($1 == moca) { return my other cool acronym }
} //echo -a $myacros(brb)
New username: hixxy
|
|
|
|
Joined: Oct 2004
Posts: 18
Pikka bird
|
OP
Pikka bird
Joined: Oct 2004
Posts: 18 |
I was thinking of something like this......
elseif ( $1- == brb ) { msg $active 9Be 11Right 9Back.. | halt }
Would this be correct? Thanks again
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
New username: hixxy
|
|
|
|
Joined: Oct 2004
Posts: 18
Pikka bird
|
OP
Pikka bird
Joined: Oct 2004
Posts: 18 |
Alright..I put that in my remotes...and it isn't working...This is exactly what I have ...
on *:text:*:*: { if ((Jim isin $1-) || (Jim $+ $chr(63) isin $1-)) { echo $nick said $v1 }}
Did I do something wrong? I put this in remotes
|
|
|
|
Joined: Oct 2004
Posts: 18
Pikka bird
|
OP
Pikka bird
Joined: Oct 2004
Posts: 18 |
* /if: close bracket not found -
Im getting this message
|
|
|
|
Joined: Jun 2003
Posts: 5,024
Hoopy frood
|
Hoopy frood
Joined: Jun 2003
Posts: 5,024 |
echo $nick said $v1 [color:red]}}[/color]
should be
echo $nick said $v1 [color:red]} }[/color]
Notice the spaces between the close brackets.
Regards,
Mentality/Chris
|
|
|
|
Joined: Oct 2004
Posts: 18
Pikka bird
|
OP
Pikka bird
Joined: Oct 2004
Posts: 18 |
Ok, I done that and it fixed the message I was recieving in "status" window. Now it alerts me in status window that someone said my name but it doesnt respond back with that persons screen name? Any idea where we went wrong? Once again Thanks
|
|
|
|
Joined: Jun 2003
Posts: 5,024
Hoopy frood
|
Hoopy frood
Joined: Jun 2003
Posts: 5,024 |
I can't see why it wouldn't return the nickname that said the text, that is what $nick is in an on text event. If you want it to echo in the active window, use echo -a $nick said $v1.
Regards,
Mentality/Chris
|
|
|
|
Joined: Oct 2004
Posts: 18
Pikka bird
|
OP
Pikka bird
Joined: Oct 2004
Posts: 18 |
Ok, now when said name types my name its showing in main window, but still not replying back with said screen name. I appreciate your guys help, I'm just going to give up now. Thanks though
|
|
|
|
Joined: Sep 2003
Posts: 7
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Sep 2003
Posts: 7 |
i think most misread your request: i think the correct way should be: on *:text:*:#: { if ( (Jim isin $1- ) || (Jim $+ $chr(63) isin $1- ) ) { /msg $chan yes $nick $+ ? } } on *:text:*:?: { if ( (Jim isin $1- ) || (Jim $+ $chr(63) isin $1- ) ) { /msg $nick yes $nick $+ ? } }
in this way you'll react on who-ever calls your name (in channel (#) or in private (?))
when nothing else matters but irc
|
|
|
|
Joined: Mar 2004
Posts: 175
Vogon poet
|
Vogon poet
Joined: Mar 2004
Posts: 175 |
Wouldn't it be more accurate if you used $Wildtok instead of "isin"? On *:TEXT:*:#: {
If ($Wildtok($1-,Jim*,1,32)) { msg $Chan Yes $Nick $+ ? }
}
On *:TEXT:*:?: {
If ($Wildtok($1-,Jim*,1,32)) { msg $Nick Yes $Nick $+ ? }
} Just a thought. O_o
- Relinsquish
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
on $*:TEXT:/jim\??/Si:*: msg $iif($target ischan,#,$nick) Yes $Nick $+ ?
Gone.
|
|
|
|
Joined: Mar 2004
Posts: 175
Vogon poet
|
Vogon poet
Joined: Mar 2004
Posts: 175 |
*Learns Regex Strings* :P
- Relinsquish
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
Hehe,
regex sure is handy for a text based program like mIRC.
Come to think of it, a better regex would have been: /\bjim\b/Si
\b matches a word boundary[/b], S means strip text, and i means case insensitive.
Greets
Gone.
|
|
|
|
|