mIRC Home    About    Download    Register    News    Help

Print Thread
#101629 26/10/04 06:52 PM
Joined: Oct 2004
Posts: 18
B
boxbred Offline OP
Pikka bird
OP Offline
Pikka bird
B
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

#101630 26/10/04 07:20 PM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
Code:
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:

Code:
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
#101631 26/10/04 07:39 PM
Joined: Oct 2004
Posts: 18
B
boxbred Offline OP
Pikka bird
OP Offline
Pikka bird
B
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

#101632 26/10/04 07:41 PM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
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
#101633 26/10/04 07:42 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
You could use something like:

Code:
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
#101634 26/10/04 08:04 PM
Joined: Oct 2004
Posts: 18
B
boxbred Offline OP
Pikka bird
OP Offline
Pikka bird
B
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



#101635 26/10/04 08:08 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Yeah.


New username: hixxy
#101636 26/10/04 09:16 PM
Joined: Oct 2004
Posts: 18
B
boxbred Offline OP
Pikka bird
OP Offline
Pikka bird
B
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


#101637 26/10/04 09:24 PM
Joined: Oct 2004
Posts: 18
B
boxbred Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Oct 2004
Posts: 18
* /if: close bracket not found
-

Im getting this message

#101638 26/10/04 09:33 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
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
#101639 26/10/04 10:13 PM
Joined: Oct 2004
Posts: 18
B
boxbred Offline OP
Pikka bird
OP Offline
Pikka bird
B
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

#101640 26/10/04 10:32 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
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
#101641 26/10/04 10:49 PM
Joined: Oct 2004
Posts: 18
B
boxbred Offline OP
Pikka bird
OP Offline
Pikka bird
B
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

#101642 26/10/04 11:01 PM
Joined: Sep 2003
Posts: 7
P
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
P
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
#101643 27/10/04 02:08 AM
Joined: Mar 2004
Posts: 175
Vogon poet
Offline
Vogon poet
Joined: Mar 2004
Posts: 175
Wouldn't it be more accurate if you used $Wildtok instead of "isin"?
Code:
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
#101644 27/10/04 03:37 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
on $*:TEXT:/jim\??/Si:*: msg $iif($target ischan,#,$nick) Yes $Nick $+ ?


Gone.
#101645 27/10/04 11:32 AM
Joined: Mar 2004
Posts: 175
Vogon poet
Offline
Vogon poet
Joined: Mar 2004
Posts: 175
*Learns Regex Strings* :P


- Relinsquish
#101646 27/10/04 04:00 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
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.

Link Copied to Clipboard