mIRC Homepage
Posted By: BlaDieBLa ON TEXT with SPACE - 17/09/12 12:23 AM
I want if someone type Hello you . That i response to that.

on *:TEXT:*Hello you .*:#: {
/msg $chan texttexttextt.

Someone can help me to response on a sense.
Posted By: Xar Re: ON TEXT with SPACE - 17/09/12 12:57 AM
That code works fine...
Posted By: BlaDieBLa Re: ON TEXT with SPACE - 17/09/12 01:09 AM
But if someone types Hello you . with space it doesnt work.
Posted By: Wims Re: ON TEXT with SPACE - 17/09/12 01:35 AM
That code only work if the string "hello you ." is somewhere in the line, if you don't want the space, don't put it..
Posted By: Tomao Re: ON TEXT with SPACE - 17/09/12 05:43 PM
I believe it's "everywhere" in the line.
Posted By: BlaDieBLa Re: ON TEXT with SPACE - 17/09/12 06:44 PM
Yes but it doesnt respond if someone write it but when i do it without space than it wil response

Code like this

Code:
on *:TEXT:*Hello you .*:#: {
  /msg $chan texttexttextt. veremicem $chan  . 
}
on *:TEXT:*Whenever say this than respond*:#: {
  .timermsg 1 $rand(4,15) /msg $chan ok i respond
}

Etc. etc.
Posted By: BlaDieBLa Re: ON TEXT with SPACE - 17/09/12 09:12 PM
New i was thinking i the problem the $rand array. Or does $rand stand for random, i think it's my timer . Any one ?
Posted By: BlaDieBLa Re: ON TEXT with SPACE - 17/09/12 10:50 PM
^^
Posted By: BlaDieBLa Re: ON TEXT with SPACE - 18/09/12 09:02 PM
Code:
on *:TEXT:*Hello you .*:#: {
  /msg $chan texttexttextt. veremicem $chan  . 
}
on *:TEXT:*Whenever say this than respond*:#: {
  /msg $chan ok i respond
}


This works now, how do i add a random timer(delay) between 2 and 6 seconds ?
Posted By: Tomao Re: ON TEXT with SPACE - 18/09/12 11:53 PM
Originally Posted By: BlaDieBLa
This works now, how do i add a random timer(delay) between 2 and 6 seconds ?
You already know it judging upon the post you've made above. Use $rand(2,6) or $r(2,6) interchangeably.
Posted By: Wims Re: ON TEXT with SPACE - 19/09/12 12:29 AM
"everywhere" would mean the string is only be composed of occurence of the string "hello you .", the wildcard at the start and at the end means that the string can appear anywhere in the line, but it has to be there.
Posted By: BlaDieBLa Re: ON TEXT with SPACE - 19/09/12 12:34 AM
Code:
.timermsg 1 $rand(4,15) /msg Answer.... 

like this ?
© mIRC Discussion Forums