mIRC Home    About    Download    Register    News    Help

Print Thread
#116854 10/04/05 08:03 AM
Joined: Jun 2003
Posts: 54
C
croyfer Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Jun 2003
Posts: 54
When I'm using the alias on *:TEXT:, how do I enclose a sentence who is gonna be the TEXT?

You see the TEXT contains colons ans other character that may ruin the code.

I tried this:
Code:
 on *:TEXT:"this is: live":#channel { /say lala }

but it does not work. I guess it's just me who's beeing stupid, but i really nedd help for this one. What characters do I use to enclose a TEXT-line ?


2nd question: Do I need color/bald-tags in the code to make it react on color/bald text in the channel ?


I'm Croyfer @ the EF.net -- #nesse
#116855 10/04/05 10:49 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
On Text is an event, not an alias hehe.

Code:
on 1:TEXT:$($+(*,$chr(34),this is,$chr(58) live"*)):#Channel: {
  do stuff
}



The following event is triggered one says "this is: live" and will only work in the channel #Channel.

And yes it will pick it up using colours.

-Andy

#116856 10/04/05 12:55 PM
Joined: Jun 2003
Posts: 54
C
croyfer Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Jun 2003
Posts: 54
Oh, an early-morning typo there :P

Tnx for the help ! =)

BTW: I have this little thing:

Code:
on *:text:COMPLETE*:#channel:{ if ($nick == _LAS_) { if ($window(@LAS).state) { aline @LAS $date - $time $1- } | else { window -ng2 @LAS | aline @LAS $date - $time $1- } } }


It picks out the lines I want and presents them in @LAS - but the window does now get highlighted (-g2) when a new line appears - I guess I've done something wrong here. Can anyone help me out ?


I'm Croyfer @ the EF.net -- #nesse
#116857 10/04/05 02:52 PM
Joined: Jun 2003
Posts: 54
C
croyfer Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Jun 2003
Posts: 54
Firgured that last one out by myself

Code:
 aline [color:red]-h[/color]   


I'm Croyfer @ the EF.net -- #nesse
#116858 10/04/05 03:30 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
From what I understand you said you dont actually want the " " ? but you want to capture with color and bold etc in it?

on $*:text:$($+(/^\Qthis is,$chr(58),$chr(32),live\E/iS)):#channel:{ /say lala }

your doing 3 levels of stuff here
1) $+(/^\Qthis is,$chr(58),$chr(32),live\E/iS) >>> this builds a single string /^\Qthis is: live\E/iS $chr(58) is a : , $chr(32) is a space, if oyu needed a , you must user $chr(44)
2) $( ) >>> this allows you to insert a string into the matchtext field
So if you could write it with out problems it would now look like
on $*:text:/^\Qthis is: live\E/iS:#channel:{ /say lala }
This is a regex and it says look for at the start of text for the string "this is: live" and ignore burko codes

But honestly some times i think its easier just doing
on *:text:*:#channel:{ if ($strip($1-) == this is: live) { /say lala } }

#116859 10/04/05 05:06 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hi Dave,

you could have omitted the $eval in the matchtext part and use the hex representation for : being \x3A or its octal version \072 (or \72, if there are less than 72 previous capturing subpatterns)

For the space you could have used \s or simply an actual space.

The \Q...\E construct wasn't needed since there are no characters which have a special meaning in the string.

So basically it would come down to this:

on $*:TEXT:/^this is\72 live$/Si:#channel: msg # lala

I agree, the regular simple method is more than sufficient for something trivial like this.

Greets


Gone.
#116860 10/04/05 06:17 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Yes but you see theres a good reason I didnt do that.

Its well ummm err well basiclly its ahhhhh, becuase im not very good with regex frown

And i even forget the $ to mark it as exact text mine was blah blah * wasnt it <groan>

Oh but i did give him the \Q \E on purpose since you know what would come next if i didnt (but only if i didnt), a reply "it didnt work when i looked for !help* +water"

#116861 11/04/05 01:43 PM
Joined: Jun 2003
Posts: 54
C
croyfer Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Jun 2003
Posts: 54
Tnx for the help all of you! =)

<3 This place


I'm Croyfer @ the EF.net -- #nesse

Link Copied to Clipboard