mIRC Home    About    Download    Register    News    Help

Topic Options
#231351 - 14/04/11 07:11 AM edit help PLS.
ricfaus Offline
Ameglian cow

Registered: 09/01/11
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

Top
#231353 - 14/04/11 02:23 PM Re: edit help PLS. [Re: ricfaus]
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
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)

Top
#231358 - 14/04/11 04:36 PM Re: edit help PLS. [Re: ricfaus]
ricfaus Offline
Ameglian cow

Registered: 09/01/11
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 :|


Edited by ricfaus (14/04/11 04:54 PM)

Top
#231363 - 14/04/11 11:30 PM Re: edit help PLS. [Re: ricfaus]
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
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
      }
    } 
  } 
}


Top
#231372 - 15/04/11 07:38 AM Re: edit help PLS. [Re: RusselB]
ricfaus Offline
Ameglian cow

Registered: 09/01/11
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..


Edited by ricfaus (15/04/11 07:38 AM)

Top
#231407 - 17/04/11 04:42 AM Re: edit help PLS. [Re: ricfaus]
ricfaus Offline
Ameglian cow

Registered: 09/01/11
Posts: 20
i test many times but still no response of the bot.

Top
#231433 - 18/04/11 02:13 AM Re: edit help PLS. [Re: ricfaus]
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
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.

Top
#231435 - 18/04/11 02:43 AM Re: edit help PLS. [Re: RusselB]
ricfaus Offline
Ameglian cow

Registered: 09/01/11
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..

Top
#231440 - 18/04/11 06:54 AM Re: edit help PLS. [Re: ricfaus]
5618 Offline
Hoopy frood

Registered: 18/06/07
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.

Top
#231489 - 18/04/11 11:27 PM Re: edit help PLS. [Re: 5618]
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
Thanks for the help. Not sure how I missed that.

Top
#231493 - 19/04/11 02:33 AM Re: edit help PLS. [Re: RusselB]
ricfaus Offline
Ameglian cow

Registered: 09/01/11
Posts: 20
i hope you guys help me...thnx in advance..i really need it as soon as possible.. smile

Top
#231496 - 19/04/11 03:58 PM Re: edit help PLS. [Re: ricfaus]
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
See the post by 5618

Top