simple massjoin socket

By Celeron on Apr 15, 2010

massjoin socket on test... :=)

on *:sockopen:c: {
  if ($sockerr > 0) .halt
  .var %rv.nik`usr = $+($gettok(i l I,$r(1,3),32),I,$gettok(i l I,$r(1,3),32),i,$gettok(i l I,$r(1,3),32),l,$gettok(i l I,$r(1,3),32),il,$gettok(i l I,$r(1,3),32)), %rv`nik.ver = %nik.ver  
  .sockwrite -tn c user %rv.nik`usr x x $+(celeron,$crlf,nick %rv.nik`usr)
}
on *:sockread:c: {
  .var %c
  .sockread %c
  .tokenize 32 %c
  if ($1 == PING) { .sockwrite -tn c pong $2  }
  if ($2 == 001) {  
    .set %ownip $gettok($mask($11,4),2-3,46) 
    .sockwrite -tn c nick kekekeke
  } 
  if ($1 == error) { titlebar Error: $1- | .timer`er 1 4 f1 }
  if ($2 == 221) {  .sockwrite -tn c invite %channel  }
  if ($2 == KICK)  {

    if  (%knick == %ownick) {
      .inc %mykick
    }
    if ($4 == %ownick) { 
      echo @kick $1-
      inc %kena
      if ($istok(1.2.3,%kena,46)) {
        set %kickers %knick
        sockwrite -nt c cs deop %channel %kickers
        sockwrite -nt c cs invite %channel
      }
      else f1
    }
  }
  if ($2 == JOIN) {
    .var %rv.msk4 =  $gettok($mask($1,4),2-3,46)
    inc  -u1 $+(%,mass,%channel)
    if ($($+(%,mass,%channel),2) > 3) {  
      .add2hash
      .set %channel $remove($gettok($3,1,33),:)
      if (%rv.msk4 !isin %mj)  .set %mj %mj $+ $+($chr(44),*,%rv.msk4,*) 
      $hget(a,a)  
      .timerkikmj2.5 -m 1 500  .unset %mj
    }
    if ($numtok(%mj,44) > 2) { $hget(a,b)   | .timerkikmj2.d -m 1 500  .unset %mj }
  }
}

;--------------------------- f
alias f1 { unset %kena |  sockclose c |  .sockopen c irc.webchat.org 6667  }
alias f2 { set %nik.sock $$?="nick:" | set %nik.pas $$?="Password:" | set %channel $$?="Channel:" | f1 }
alias f3 {
  .timercx 1 5 sockwrite -nt c ping irc.webchat.org 6667
  .hfree -sw a 
.unset %mj*
  sockwrite -nt c privmsg %channel 4Total kick  0 $iif(%mykick,%mykick,0)  : 
  .timer 1 2 unset %mykick 
}
;--------------------------- l
alias logo2 return  4-1,8 E  x 1 1,8 P 4-
alias logo3 return  4-1,0 E  x 2 1,0 P 4-
alias logo4 return  4-1,4 E  x 3 1,4 P 4-
;--------------------------- h

Comments

Sign in to comment.
Celeron   -  Apr 16, 2010

ic.... i forgot delete @kick $1- ... haha.. ;=)

 Respond  
WorldDMT   -  Apr 16, 2010

spelling mistake :p
edited :D

 Respond  
Jethro   -  Apr 16, 2010

WorldDMT, were you trying to say "useless" instead of "unless?" :p lol

 Respond  
WorldDMT   -  Apr 16, 2010

if ($sockerr > 0) the "> 0" is useless
echo @kick $1- and if @kick isnt exist?

on *:sockread:c: {
  .var %c
  .sockread %c
  .tokenize 32 %c <== i think tokenize is useless
  if ($1 == PING) {
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.