mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2006
Posts: 21
S
sabbath Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2006
Posts: 21
What I'm trying to do is to make an on TEXT event trigger on a set value that may appear anywhere in a sentence. I have no real idea about the syntax though. I assumed the syntax would be the same as for identifiers. So what I need is to match like this
Code:
on *:TEXT:*%bword*:#chan:{


I've tried translating from identifiers $(* $bword *) to (ie %(* %bword *)) but can't get that to work. All and any help is appreciated!

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Randomly trying combinations?

You didn't try $(* %bword *)

$() is an identifier, but %bword is still a variable, and will always have the % prefix


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Quote:
I've tried translating from identifiers $(* $bword *) to (ie %(* %bword *)) but can't get that to work. All and any help is appreciated!


Your syntax is incorrect in both examples you show. You used '$bword' and '%( )'. It is '%bword' and '$( )'.

$(* %bword *)


Originally Posted By: "Help File"
$(...)

This identifier can only be used in the text match section of an event definition. It allows you to create a match parameter dynamically. You can use $1- to reference the incoming line.

on 1:TEXT:$(*hello $me $+ *):?:echo hello back!



Joined: Sep 2006
Posts: 21
S
sabbath Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2006
Posts: 21
Yes I know I used the wrong syntax there. I as just giving an example. What I do currently use is $(* $me *) which is perfectly fine. wink I'll try with the %s again now. Thanks both of you. smile

Joined: Sep 2006
Posts: 21
S
sabbath Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2006
Posts: 21
Originally Posted By: argv0
Randomly trying combinations?

You didn't try $(* %bword *)

$() is an identifier, but %bword is still a variable, and will always have the % prefix


That was the one! Thanks a bunch! Can't believe I missed that "obvious" combination. laugh

Last edited by sabbath; 01/02/08 10:02 AM.
Joined: Sep 2007
Posts: 65
X
Babel fish
Offline
Babel fish
X
Joined: Sep 2007
Posts: 65
Well, grats on making it work. Though, I prefer If-statements instead.


GamerzWoW
The Official GamerzPlanet WoW Server
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
I tend to use if statements as well, but the nice thing about this style is you can have more than one text event in a file instead of one that handles a bunch of if statements.

Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
anything in $() is always evaluated though even if it doesn't match, which is quite obvious. So depending on what it holds it might not always be very efficient.

You can always use more then one on text in a file as long as the match text doesn't cancel others out.


$maybe
Joined: Sep 2007
Posts: 65
X
Babel fish
Offline
Babel fish
X
Joined: Sep 2007
Posts: 65
I'm pretty sure it's faster to have one on TEXT event instead of having multiple events that mIRC must go through, though.


GamerzWoW
The Official GamerzPlanet WoW Server
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
if this hasnt aredy been stated, you can use
Code:
on *:TEXT:*:#: {
  if (blah* iswm $1) {
    do blah
  }
}

thats an easy way to do something... i think thats what your asking..
im not really reading what youve posted/ others posts


This is not the signature you are looking for

Link Copied to Clipboard