mIRC Home    About    Download    Register    News    Help

Print Thread
#82096 06/05/04 02:15 PM
Joined: May 2004
Posts: 2
N
Bowl of petunias
OP Offline
Bowl of petunias
N
Joined: May 2004
Posts: 2
I'm having a problem with them. I can't get them to work without placing an asterisk before the matchtext. I'll use a basic example.

on *:TEXT:*hello:#:/msg $chan Hello $nick

It refuses to work when I use:

on *:TEXT:hello*:#:/msg $chan Hello $nick

Any info, solutions, or corrections, etc. would be greatly appreciated.

#82097 06/05/04 08:33 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
When you put hello* the word 'hello' must be at the start of the sentence. No control codes or symbols can be put before the word 'hello'. So:

<Nickname> hello everyone

This should work. However...

<Nickname2> omg, hello

...this should NOT work. To match the word "hello" anywhere in the sentence, use *hello*.

Regards,


Mentality/Chris
#82098 06/05/04 08:47 PM
Joined: May 2004
Posts: 2
N
Bowl of petunias
OP Offline
Bowl of petunias
N
Joined: May 2004
Posts: 2
Sorry for not clarifying exactly what my problem was. My real problem is that the remote won't work when I use "matchtext*" even when the word is at the beginning of a sentence. For example:

"code" used: on *:TEXT:hello*:#:/msg $chan Hi $nick
<randomuser>hello
<where my script should respond, it doesn't>

It doesn't return "Hi $nick" like it should. For some reason there has to be an asterisk before the matchtext, otherwise it won't respond.
My main concern with this is that when I use remote commands I don't want them to be able to work in the middle of a sentence.

#82099 06/05/04 09:15 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
Tis indeed a strange problem then, as I tested the code you posted (the problematic one) and it worked fine for me. Only thing I can think of is make sure you're using the latest version of mIRC and the code is in a separate remote file, if possible.

If that doesn't work though, and nobody else suggests what it could be, you could apply the principal of the following for whatever you're trying to accomplish:

Code:
on *:text:*:#:{
 if (hello == $left($1,5)) { 
msg # Hi $nick 
 } 
}


Which is basically saying "if 'hello' is the first 5 characters from the left of the sentence, respond with Hi nickname".

Regards,


Mentality/Chris
#82100 07/05/04 07:24 AM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
...* Mentality adds something 10 hours later

Make sure you have no scripts using some sort of ON INPUT event that insert control codes (say, to colour text) before the sentence. Even with a colour code that is colourless (i.e. you haven't chosen any colours to display and just put the control code), the on text event will interpret it anyway even though you can't see it.

So basically, if you're writing in colours or perhaps using some other on input event, try disabling it temporarily, or indeed permanently if it's causing the issue.

Just a thought smile

Regards,


Mentality/Chris
#82101 07/05/04 03:49 PM
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Code:
on *:text:*:#:{
  var %text = $strip($1-)
  if (hello * iswm %text) { msg # Hi $nick | return }
  if (howdy * iswm %text) { msg # Howdy to you too, $nick | return }
}
cool
That may solve your problem.


Link Copied to Clipboard