mIRC Home    About    Download    Register    News    Help

Print Thread
#167793 30/12/06 05:42 PM
Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
I can think of no other words nor contexts that it would bother...

So I ask you brigt minded people. (Who know scripting.)

Is there a line I could add in my "alt+r" thingy?

I got an alias, that works on /asl ...

I just wonder if you can help me automate it.
So as if ANYONE ask in a PM/msg; Asl please..
Hey, asl? and so on..


I mean, could you help me say the /asl, automated, anytime anyone mention 'asl' in a PM?


Last edited by gomp; 30/12/06 05:43 PM.
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Code:
on *:text:*asl*:?: {
  msg $nick I an XX year old male/female and live in XX.
}

Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
Quote:
...
<nick1> I'm tired. I only got a measly 3 hours sleep last night.
<nick2> I an XX year old male/female and live in XX.
<nick1> OK... So anyway, I think I'm about to fall asleep
<nick2> I an XX year old male/female and live in XX.
...


Regular expressions to the rescue!:
Code:
on $*:text:/\ba([\.\\\/-]?)s\1l\b/Si:?:{
  msg $nick I'm XX years old, male/female, and live in XX.
}

S
SICORPS
SICORPS
S
this code is perfect but a litle dangerous any user with bad intention could flood you right off the server (excess flood)

Code:

on $*:text:/\ba([\.\\\/-]?)s\1l\b/Si:?:{
  inc -u20 %asl
  if %asl > 5 timer 1 %asl msg $nick I an XX year old male/female and live in XX.
}



been there done that !!)

Last edited by SICORPS; 30/12/06 08:12 PM.
#167804 30/12/06 08:57 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Better would be:

Code:
set -u10 %asl
if (!%asl) { msg $chan your asl info }


Yeah, starbucks_mafia, I knew it would trigger if it was in the middle of another word. I just couldn't think of anything with asl in it that would likely be used in a private message. I didn't think of asleep. As for the regex, I don't know it well... what will that trigger on? asl by itself? asl with a punctuation next to it and nothing else?

Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
It'll trigger on "asl", "a/s/l", "a.s.l", "a-s-l", or "a\s\l" next to any non-alphanumeric characters (ie. at the start/end of text, next to punctuation, spaces, quotes, etc.) regardless of any control codes.

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Ah, that's what all those escape codes were for. Knowing you were doing it for a/s/l, a.s.l, etc, I can actually read what you did and understand it (though I couldn't write it yet). smile

#171920 02/03/07 06:33 PM
Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
So there is no safe way to have an automated respon on "asl" in a /msg chat?



/me is confused confused

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
All you'd need to do is combine starbucks_mafia's code with mine and it will work.

Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
I do not understand how to do that, could you please help me again?

I am really not getting this code stuff.. frown

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Code:
on $*:text:/\ba([\.\\\/-]?)s\1l\b/Si:?:{
  if (!%asl) msg $nick I'm XX years old, male/female, and live in XX.
  set -u10 %asl On
}


Link Copied to Clipboard