Skip to content
MSN Addons

findu

A TG007 community discussion started by Kurupt.

Discussion 8 posts
Page 1 of 1
Open
Topic #6315 · 8 published posts · 1,175 views

im currently using a private connection due to ripping i cant post the connection what im looking for is a findu code that will work on msn i have a alias that "is suppose" to find users on a server (got it from mircscripts.org) but when i /findu err0r it wont show results or anything at all not even a bug lol can u help me? thanks in advance.

 

alias findu {
 if $hget(findu) { .hfree findu }
 if -* !iswm $1 {
   var %sock = findu. [ $+ [ $r(1,99999) ] ]
   var %i = 2
   while $ [ $+ [ %i ] ] {
     if %i == $0 { return }
     %sock = findu. [ $+ [ $r(1,99999) ] ]
     sockopen %sock $ [ $+ [ %i ] ] $ [ $+ [ $0 ] ]
     sockmark %sock $1 $ [ $+ [ %i ] ]
     inc %i
   }
 }
 elseif $1 == -locate {
   hadd -m findu locate 1
   var %sock = findu. [ $+ [ $r(1,99999) ] ]
   var %i = 3
   while $ [ $+ [ %i ] ] {
     if %i == $0 { return }
     %sock = findu. [ $+ [ $r(1,99999) ] ]
     sockopen %sock $ [ $+ [ %i ] ] $ [ $+ [ $0 ] ]
     sockmark %sock $2 $ [ $+ [ %i ] ]
     inc %i
   }
 }
}
on *:sockopen:findu.*:{
 if $sockerr {
   echo -s problem connecting to $gettok($sock($sockname).mark,2,32)
   return
 }
 var %s = sockwrite -n $sockname, %sock = $remove($sockname,.)
 %s nick %sock
 %s user %sock . . %sock
}
on *:sockread:findu.*:{
 if $sockerr { echo -s problem connecting to $gettok($sock($sockname).mark,2,32) }
 var %s = sockwrite -n $sockname, %sock
 sockread %sock
 tokenize 32 %sock
 if $1 == ping { %s pong $2 }
 elseif $2 == 318 {
   echo -s $4 not found in any channels on $gettok($sock($sockname).mark,2,32)
   sockclose $sockname
 }
 elseif $2 == 319 {
   if $hget(findu) { .hfree findu }
   var %i = 5, %chans
   while $ [ $+ [ %i ] ] {
     %chans = %chans $mid($ifmatch,$pos($ifmatch,$chr(35)))
     inc %i
   }
   echo -s $4 found in %chans on $gettok($sock($sockname).mark,2,32)
   if %chans { sockclose $sockname }
 }
 elseif $2 == 303 {
   if $4 == : {
     echo -s $gettok($sock($sockname).mark,1,32) not found on $gettok($sock($sockname).mark,2,32)
     sockclose $sockname
   }
   elseif $4 == : $+ $gettok($sock($sockname).mark,1,32) {
     if !$hget(findu) {
       echo -s $right($4,-1) found on $gettok($sock($sockname).mark,2,32)
       sockclose $sockname
     }
     elseif $hget(findu) { %s WHOIS $gettok($sock($sockname).mark,1,32) }
   }
 }
 elseif $2 == 376 { %s WATCH C $+(+,$gettok($sock($sockname).mark,1,32)) S }
 elseif $2 == 421 { %s ISON $gettok($sock($sockname).mark,1,32) }
 elseif $2 == 604 {
   if !$hget(findu) {
     echo -s $4 found on $gettok($sock($sockname).mark,2,32)
     sockclose $sockname
   }
   elseif $hget(findu) { %s WHOIS $gettok($sock($sockname).mark,1,32) }
 }
 elseif $2 == 607 {
   if !$hget(findu) {
     echo -s $gettok($sock($sockname).mark,1,32) not found on $gettok($sock($sockname).mark,2,32)
     sockclose $sockname
   }
 }
}
on *:sockclose:findu.*:{ echo -s problem connecting to $gettok($sock($sockname).mark,2,32) }

u can't find meh :P

can anybody help me with this code please?

No one really rips connectins anymore. That went out with Godzilla. You just posted that...give people some time. But, seeing as how your asking and being impatient, go look at Coldstalker and take little bits from that. Thats really one of the more advanced findu's out. Go look at that and come back if you have problems.

alias Findu { 
 var %Socket = <Finds Socket Here>
 if (!$sock(%Socket)) { echo -a Sorry Finds Socket Not Connected, Reconnecting... }
 else {
   .set %Findu $1-
   sockwrite -n %Socket FINDU %Findu
 }
}
on *:sockread:<Finds Socket Here>:{
 var %var = ""
 sockread %var
 tokenize 32 %var
 echo -s $sockname $1-
 if ($regex($2,/^641$/)) && (%Findu) { echo -at Finding: $ifmatch | .set %Findu 0 }
 if ($regex($2,/^642$/)) { echo -at - Chan: $6 Ip: $5 | inc %Findu }
 if ($regex($2,/^643$/)) && (%Findu) { echo -at Finished: %Findu Channels | .unset %Findu }
 if ($regex($2,/^709$/)) && (%Findu) { echo -at Error: %Findu Not Found | .unset %Findu }
}

 

this is just an example .. hope this helps .. :taz:

alias Findu { 
 var %Socket = <Finds Socket Here>
 if (!$sock(%Socket)) { echo -a Sorry Finds Socket Not Connected, Reconnecting... }
 else {
   .set %Findu $1-
   sockwrite -n %Socket FINDU %Findu
 }
}
on *:sockread:<Finds Socket Here>:{
 var %var = ""
 sockread %var
 tokenize 32 %var
 echo -s $sockname $1-
 if ($regex($2,/^641$/)) && (%Findu) { echo -at Finding: $ifmatch | .set %Findu 0 }
 if ($regex($2,/^642$/)) { echo -at - Chan: $6 Ip: $5 | inc %Findu }
 if ($regex($2,/^643$/)) && (%Findu) { echo -at Finished: %Findu Channels | .unset %Findu }
 if ($regex($2,/^709$/)) && (%Findu) { echo -at Error: %Findu Not Found | .unset %Findu }
}

 

this is just an example .. hope this helps .. :taz:

 

I don't see the point of using $regex there, but you could improve your way:

 

- $regex(%var, /^\S+ 64([1-3]) (?x) $me (?-x) \S+ :?(.+)/i)

 

- $regml(1) -> 1, 2, 3:

 

1.- $regml(2) -> Nick Server Channel

2.- $regml(2) -> Server Chan

3.- $regml(2) -> End of /findu

only just started to learn regex so thats why i did it that way.. dont know regex/regml..

that code u posted works thanks alot man