mIRC Homepage
Posted By: DjJax help on this - 10/02/06 05:22 AM
on ^1:text:*como:#: {
set %resp $rand(1,10)
echo -a %resp
if $1 == como && %resp == 1 { .echo -a 07 Bienvenido al Canal }
if $1 == como && %resp == 2 { .echo -a 07 bien y vos }
if $1 == como && %resp == 3 { .echo -a 07 tu familia? }
if $1 == como && %resp == 4 { .echo -a 07 gracias ,bien y vos }
if $1 == como && %resp == 5 { .echo -a 07 te parto en ocho }
if $1 == como && %resp == 6 { .echo -a 07 cague }
}



what is wrong pals , thnx
Posted By: RusselB Re: help on this - 10/02/06 05:35 AM
For future reference, please use the Code Tags

For your script:
Problem #1 is the fact that your on text event requires the entry to END with como, not necessarily to start with it, which is what the first part of your IF lines requires.

Problem #2 is that the random number can be between 1 & 10 (inclusive), yet you only check for 6

Here's a suggestion for a corrected code
Code:
on 1:text:como:#:{
var %resp = $r(1,6)
if (%resp == 1) { .echo -a 07 Bienvenido al Canal }
elseif (%resp == 2) { .echo -a 07 bien y vos }
elseif (%resp == 3) { .echo -a 07 tu familia? }
elseif (%resp == 4) { .echo -a 07 gracias ,bien y vos }
elseif (%resp == 5) { .echo -a 07 te parto en ocho }
else .echo -a 07 cague
}  
Posted By: DjJax Re: help on this - 10/02/06 06:17 AM
doesnt work
Posted By: hixxy Re: help on this - 10/02/06 06:24 AM
Quote:
Problem #1 is the fact that your on text event requires the entry to END with como, not necessarily to start with it, which is what the first part of your IF lines requires.


I fail to see how that's a problem. Maybe he wants to match "como welcomo", for example.

Happy birthday btw smile
Posted By: RusselB Re: help on this - 10/02/06 07:05 AM
Thanks for the birthday greetings, hixxy..and while I see your point about the problem mentioned, if that's what they want then they should use a match text of como*como not *como
Posted By: RusselB Re: help on this - 10/02/06 07:10 AM
Make sure you don't have any other on text events that match that one. The code works perfectly in my testing. If it's not working for you, I need to know what it is that you are or aren't seeing that indicates that the script isn't working.

Also remember that if you're running the code, then someone else has to issue the command.
© mIRC Discussion Forums