mIRC Home    About    Download    Register    News    Help

Print Thread
#231351 14/04/11 06:11 AM
Joined: Jan 2011
Posts: 20
R
ricfaus Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Jan 2011
Posts: 20
Hi, guys help me about my script..
Code:
on *:text:$($iif(!find* iswm $strip($1),$1)):#:{ 
  if (!%p) && ($isfile(lobbys.txt)) { 
    inc -u3 %p 
    if $0 = 1 { 
      .notice $nick Usage: !find <nick> 
    } 
    elseif $read(lobbys.txt,w,$+(*,$strip($2-),*)) { 
      .msg $nick $v1 
    } 
    else { 
      .notice $nick There are no results for: $2- 
    } 
  } 
}


i perceived that when i !find nick . the result is only 1 ,but i have 3 nicks save in my data with different Ips. like nick 'Gosh' . here his nick/IP.

USER@42F106EE.B21DC933.8221D45C.IP - Gosh
USER@B0C3AA6.E7230239.157C0E0A.IP - Gosh
USER@9F44A988.A1C9F827.9842A930.IP - Gosh

he use different host ips. so, if i !find gosh .the result must be all of these,
USER@42F106EE.B21DC933.8221D45C.IP - Gosh
USER@B0C3AA6.E7230239.157C0E0A.IP - Gosh
USER@9F44A988.A1C9F827.9842A930.IP - Gosh

-thnx in advance laugh

ricfaus #231353 14/04/11 01:23 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Using $read will only return the first match found.
In order to use $read and get later matches, you have to include the last parameter mentioned in the help file under $read

Quote:
$read(filename, [ntswrp], [matchtext], [N])

If you specify the s, w, or r switches, you can also specify the N value to specify the line you wish to start searching from in the file, eg.:

//echo $read(versions.txt, w, *mirc*, 100)

ricfaus #231358 14/04/11 03:36 PM
Joined: Jan 2011
Posts: 20
R
ricfaus Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Jan 2011
Posts: 20
uhh..i need help to this cause this help me a lot in our network.pls ty..
sir russelB, can you paste here your code to this.? pls. thnk u :|

Last edited by ricfaus; 14/04/11 03:54 PM.
ricfaus #231363 14/04/11 10:30 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Try this. It's based upon the code you already provided and my knowledge of the alterations I suggested, but has not been tested.
P.S.: Next time you have a code/script problem, please use the Scripts & Pop-ups forum.
Code:
on *:text:$($iif(!find* iswm $strip($1),$1)):#:{ 
  if (!%p) && ($isfile(lobbys.txt)) { 
    inc -u3 %p 
    if $0 = 1 { 
      .notice $nick Usage: !find <nick> 
    } 
    elseif !$read(lobbys.txt,w,$+(*,$strip($2-),*)) { 
      .notice $nick There are no results for: $2- 
    } 
    else { 
      var %a = 1
      while $read(lobbys.txt,w,$+(*,$strip($2-),*,%a)) {
        .msg $nick $v1 
        %a = $readn
      }
    } 
  } 
}


RusselB #231372 15/04/11 06:38 AM
Joined: Jan 2011
Posts: 20
R
ricfaus Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Jan 2011
Posts: 20
uhmm,i test but still have a problem,.
<ricfaus> !find
<botibot> Usage: !find <nick>
<ricfaus> !find haheiawheiwa
<botibot> There are no results for: haheiawheiwa
<ricfaus> !find Gosh
?????
The bot not response . thats the problem sir..

Last edited by ricfaus; 15/04/11 06:38 AM.
ricfaus #231407 17/04/11 03:42 AM
Joined: Jan 2011
Posts: 20
R
ricfaus Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Jan 2011
Posts: 20
i test many times but still no response of the bot.

ricfaus #231433 18/04/11 01:13 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Try changing
Code:
.msg $nick $v1 
to
Code:
.msg $nick $v2 


If that still doesn't work, please relay which version of mIRC your bot is using.

RusselB #231435 18/04/11 01:43 AM
Joined: Jan 2011
Posts: 20
R
ricfaus Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Jan 2011
Posts: 20
Im using v7.19 ,i think thats the latest ryt?.
i change the .msg $nick $v1 to .msg $nick $v2 but still no response from the bot..

ricfaus #231440 18/04/11 05:54 AM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
$v1 is correct.
If you set %a to $readn then you will always $read the same line. Your script should get stuck in an infinite loop due to this, although I don't see you mentioning that.
Setting %a to $readn +1 should fix that.

5618 #231489 18/04/11 10:27 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Thanks for the help. Not sure how I missed that.

RusselB #231493 19/04/11 01:33 AM
Joined: Jan 2011
Posts: 20
R
ricfaus Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Jan 2011
Posts: 20
i hope you guys help me...thnx in advance..i really need it as soon as possible.. smile

ricfaus #231496 19/04/11 02:58 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
See the post by 5618


Link Copied to Clipboard