tglogo.png

Downloading File

Filename: nth Connection
; ###########################################################################################################################################################
; "nth - to the utmost power"
; nth - is a Multi-server mIRC Based Connection Built for Buzzen, Koach, Sparkpea, Phreik, and "most" Irc servers. 
; As a sockless connection that lends itself to more open ended options for the server you wish to join, 
; it is designed to be built upon. Features include Mass modes, incorporating a custom queue to prevent flooding out, 
; a style stripper for Buzzen, a custom lite theme, and simple proxy option is easy to edit and understand. 
; ________________________
; * Credits *
; Thank you to the following people without whom this would never have been completed :
; * err0r his sockless con inspired me to try this. 
; * James aka PoD his support, testing and sharing code to improve and learn from. 
; * Paul aka extremity the hours spent testing versions,  giving me input,  cleaning up code, and immense help in things I had trouble with. 
; * pania aka seraphim My Angel that has supported me always, editing, testing versions, put up with my moods, limited time and so much more thank you.
; * Finally, thanks also to Dabba, Nick, Tewl, Travis, Spooks, and Roo for bits of code to learn from and answering when I had questions.
; ________________________
; * Disclaimer *
; BIG FUCK YOU to any bitch that wants to talk shit. FuckOff and whine on some forum how your'e a loser. 
; All code I used was written BY ME or credited to the appropriate people listed above with their permission.
;                                 - Makimaki & seraphim
; ###########################################################################################################################################################

;STARTUP
on *:start:{ 
  .timestamp -f hh:nn:sstt 
  .titlebar nth Multi Network Connection - By MakiMaki & seraphim
  echo -sa 1nth Multi Network Connection. 
  echo -sa 1Ready to join Networks and rooms.
  server irc.buzzen.net
}

;SERVER/LOGIN
on ^*:LOGON:*: {
  if ($server == irc.buzzen.net) {
    if (%buzzen == $null) { set %buzzen $$?="Enter Passport details:" $$?="Enter Your Password:" }
    rw LOGINH $gettok(%buzzen,1,32) $md5($gettok(%buzzen,2,32))  $+ $lf $+ user %e  * * :anon
    haltdef 
  }
}
;Most Servers add to as needed
on *:connect: { 
  if ($network == PhreikNET) {
    if (%phreik == $null) { cookie } 
    /account %phreik
    mode $me +c 
  }
  elseif ($network == Sparkpea.Net) {
    if (%sparkpea == $null) { set %sparkpea $$?="Enter Passport details:" $$?="Enter Your Password:" }
    /NickServ IDENTIFY %sparkpea
  }
  elseif ($network == koach.com) {
    if (%koach == $null) { set %koach $$?="Enter Nickname:" $$?="Enter Your Password:" }
    nick $gettok(%koach,1,32) | /NickServ IDENTIFY $gettok(%koach,2,32)
  }
}
;PhreikNet Account Cookie Grabber
alias cookie { 
  set %phreik $$?="Enter User Name:" $$?="Enter Your Password:"
  if ($sock(cookie)) sockclose cookie
  sockopen cookie www.phreik.net 80
}
on *:SOCKOPEN:cookie:{
  sockwrite -n $sockname GET /noht/cookiegrabber.php?u= $+ $gettok(%phreik,1,32) $+ &p= $+ $gettok(%phreik,2,32) HTTP/1.1 $+ $crlf $+  Accept: */* $+ $crlf $+ Accept-Language: en-au $+ $crlf $+ Accept-Encoding: gzip, deflate $+ $crlf $+ User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322) $+ $crlf $+ Host: www.phreik.net $+ $crlf $+ Connection: close $+ $crlf $+ $crlf
} 
on *:SOCKREAD:cookie:{ 
  if ($sockerr > 0) return
  var %t | sockread %t 
  while ($sockbr > 0) { 
    tokenize 32 %t 
    if ($1 == TICKET:) {
      if ($2 == VALID:) { echo -s 12 * Account Cookie $4- | set %phreik $4- | /account %phreik   }
      else { echo -s Error Grabbing Cookie. | cookie }
    }
    return
  }
  sockread %t 
}

;ALIASES
;Debug
alias debug { debug -pt @ $+ $network }
alias restart { disconnect | /run mirc.exe | exit }
;NOTICES/SEL USER NOTICE
alias notice {  rw notice $1- | echo $chan $timestamp 5* $me Notice sent to $$2 : $3- }
alias sn { var %i $numtok($snicks,44) | while (%i) { notice $active $gettok($snicks,%i,44) $1- | dec %i } }
;AWAYS/RETURNS
alias away {
  if ($istok(%awaychan,$active,32)) { .raw away $active | set %awaychan $remtok(%awaychan,$active,32) }
  else { .raw away $active $iif($1,$1-,[br]) | set %awaychan $addtok(%awaychan,$active,32) } 
}
alias globalaway { var %i $chan(0) |  while (%i) { .raw away $chan(%i) $1- [br] | set %awaychan $addtok(%awaychan,$chan(%i),32) | dec %i } }
alias globalback  { var %i $chan(0) |  while (%i) { .raw away $chan(%i) | set %awaychan $remtok(%awaychan,$chan(%i),32) | dec %i } }
;JOIN/CHANNEL LISTER - Needs Channel Lister Addon  to work for Buzzen
alias list { if ($network == Buzzen) { dialog -m chan chan | halt } | else { list } }
alias join {
  if ($network == Buzzen) {
    set -u10 %lastjoin $1-
    var %c $remove($1,$chr(37))
    rw join $iif($network  == Buzzen,$bcnr($gettok(%c,1,44)),$gettok(%c,1,44))
    var %c $deltok(%c,1,44)    
    if ($numtok(%c,44)) .timer 1 1 join %c
  }
  elseif (Sparkpea isin $network) { rw join $chr(37) $+ $remove($1-,$chr37)  }
  else { rw join $1- }
  haltdef
}
;Modes,Kicks ect
alias kick { rw kick $1- }
alias mode { rw mode $1- }
;Mass Modes Thanks extremity
alias mmode {
  var %c $1, %m $$2, %i $nick(%c,0)
  while (%i) { rw mode %c %m $nick(%c,%i) | dec %i }
}
alias mkick {
  var %c $$1, %n $$2-, %d 1
  KICK %c $gettok(%n, 1, 44)
  var %n $remtok(%n, $gettok(%n, 1, 44), 1, 44)
  if ($numtok(%n, 44)) { .timer -m 1 %d mkick %c %n }
}
;Echos a link plus popups a window of the users profile
alias profiles { 
  if ($network == Sparkpea.Net) { var %n sparkpea.net/profile.php?epuid=  }
  elseif ($network == PhreikNET) { var %n phreik.net/profile.msnw?epuid=   }
  elseif ($network == Buzzen) { var %n buzzen.net/profile.aspx?pid= }
  echo -a * $1  Profile Link is12 http://www. $+ %n $+ $2 
  run http://www. $+ %n $+ $2
}
; Buzzen specific
alias access { rw access $1- }
alias bcnr { return $+($chr(37),$chr(35),$replace($remove($$1-,$chr(58),$chr(37),$chr(35)),$chr(32),\b)) }
;Thanks to Nick for the regx
alias bcnstrip return $iif($network = Buzzen, $regsubex($1-, /\[(?:style\x20.*?|/style)\]/gi,$null), $1-) 

;QUEUE
;Thanks extremity       
alias -l rw {
  hinc -m que total 
  hadd que $hget(que,total) $1-
  if (!$hget(que,idx)) { hinc que idx }
  if (!$hget(que,run)) { 
    hadd que run 1 
    que
  }
}
alias -l que {
  :start
  var %i $hget(que,idx)
  .raw $hget(que, %i)
  hinc que idx
  if (11 // %i) {
    .timer -m 1 1300 que 
    return
  }
  if (%i >= $hget(que, total)) { 
    hdel que run 
    .timerqr -m 1 1300 qclr 
    return 
  }
  goto start
}
alias -l qclr { if (!$hget(que,run)) {
    hdel que total 
    hdel que idx 0
  }
}

;RAWS
raw *:*: {
  if (%raw == on) { 
    if (!$window(raws)) { window @raws }
    echo -t @raws =========================
    echo -t @raws   Number: $numeric
    echo -t @raws   RawMsg: $rawmsg
    echo -t @raws   Params: $1-
    echo -t @raws  
  } 
  if ($gettok($rawmsg,2,32) isin 002 003 004 005 251 265 329 353 366 422 803 804 805 914) { haltdef }
  elseif ($gettok($rawmsg,2,32) == WHISPER) { if (!$window($nick)) { query -n $nick } | set %bw. $+ $nick $1 | echo -t $nick $nick (7 $+ $1 $+ ) : $bcnstrip($3-) | haltdef }
  elseif ($numeric == 403) { CREATE $2 | haltdef }
  elseif ($numeric == 801) { echo -t $2 5Added $3 to access for $4  | haltdef }
  elseif ($numeric == 332) { echo $2 3 $timestamp * Topic : $bcnstrip($3-)  | haltdef }
  elseif ($numeric == 821) { var %n $mid($gettok($rawmsg,1,33),2-) | echo -t $1 7 %n has returned. | cline -m 2 $1 %n  | haltdef }
  elseif ($numeric == 822) { if ($network == Buzzen) { var %n $mid($gettok($rawmsg,1,33),2-) | echo -t $1 7 %n is away: $2-  | cline -m 12 $1 %n | haltdef } }
  elseif ($3 == PUID) {  profiles $2 $4 } 
  elseif ($2 == PID) { profiles $3 $4 }
  elseif ($numeric == 999) {
    var %i $scon(0)
    while (%i) {
      scon %i
      if ($chan(0) < 11) { join %lastjoin | haltdef }
      dec %i
    }
    server -m irc.buzzen.net -j %lastjoin | haltdef
  }
}

;EVENTS/THEME
on *:INPUT:#: {
  if ($left($1,1)  != /) { 
    rw PRIVMSG # $+(:,$iif($network = buzzen,%style $+ $1- $iif(%style,[/style]),$1-))
    echo  -ti2 $chan 10 $+ $me  $+ : $1-
    haltdef
  }
}
on *:INPUT:?: {
  if ($network == Buzzen) && ($left($1-,1) != /) && ($comchan($active,0) > 0) { rw WHISPER $comchan($active,1) $active $+(:,$1-,) }
  else { privmsg $active $1-  }
  echo  -ti2 $chan 1 $+ $me $+ : $1- 
  haltdef   
}
on ^*:TEXT:*:#: { 
  if ($chr(37) isin $nick) { echo $chan 10 $timestamp * Welcome : $bcnstrip($1-) }
  else { echo  -ti2 $chan 2 $nick  $+ :14 $bcnstrip($1-) }
  haltdef
}
on ^*:ACTION:*:#: { echo  -ti2 $chan 6* $nick $bcnstrip($1-) | haltdef }
on *:CLOSE:?: { if (%bw. [ $+ [ $target ] ]) { unset %bw. [ $+ [ $target ] ] } }
on ^*:NOTICE:*:*: {  
  if ($nick != MemoServ) {
    if ($nick === NeoStats) {  echo -a 12* Server Notice 01: $1- } 
    elseif ($nick === opsb) { echo $chan 12* Server Notice 01: $1- }  
    elseif ($nick == Global) && ($4 != from) { echo -s 12* Global Message from $network : 1 $1- }
    elseif ($nick == ChanServ) { echo $chan  14* Channel Message3: 14 $2-  }
    haltdef
  }
  tokenize 32 $Rawmsg
  echo $chan $timestamp 5* Notice From $nick : $remove($$5,:) $6- 
  haltdef
}
on ^*:SNOTICE:*: { echo -st 5* Server Notice: $1- | halt }
on ^*:JOIN:#: {
  if ($nick == $me $nick == $me && $chr(37) isin #) { set # # | haltdef }
  var %a $readini(data\nicklog.ini,Nicklog,$address($nick,1))
  if (!%a) { writeini -n data\nicklog.ini Nicklog $address($nick,1) $+($chr(44),$nick) } 
  elseif (%a) && ($nick !isin %a) { writeini -n data\nicklog.ini Nicklog $address($nick,1) $+(%a,$chr(44),$nick) } 
  else { echo $chan $numtok(%a,44) entries for %a }
}
on ^*:PART:#: { if ($nick == $me && $chr(37) isin #) { unset # # | haltdef } }
on ^*:RAWMODE:#: { echo # $timestamp 7 $nick sets mode 1 $+ $1 7 $+ $2- | haltdef }
;NICKLIST MENU
menu Nicklist {
  $1 (Info)
  .$iif($network != Buzzen, Info) :/uwho $1
  .$iif($network != Koach.Com, Profile): { $iif($network != Buzzen,.Prop $1 PUID, Pid $$1) } 
  -
  User Modes
  .+q(Owner): mode # +q $1
  .-q(DeOwner): mode # -q $1
  .-
  .$iif($network != Buzzen, +a(Admin)): mode # +a $1
  .$iif($network != Buzzen, -a(DeAdmin)): mode # -a $1
  .-
  .+o(Host): mode # +o $1
  .-o(DeHost): mode # -o $1
  .- 
  .+h(Helpop): mode # +h $1
  .-h(DeHelpop: mode # -h $1
  .-
  .+v(Voice): mode # +v $1
  .-v(DeVoice): mode # -v $1
  .-
  .+e(Exempt): Mode # +e $1 
  -
  Ignore
  .Add: ignore -w $address($snick($active,1),1) 
  .Remove: ignore -rw $address($snick($active,1),1) 
  -
  $iif($chr(37) isin #, Channel Accses) 
  .Add Owner : .raw  ACCESS # ADD OWNER *! $+ $ial($$1).user $+ @* 0 : Owner 
  .Remove Owner: .raw  ACCESS # DELETE OWNER *! $+ $ial($$1).user $+ @* 
  .-
  .Add Host: .raw  ACCESS # ADD HOST *! $+ $ial($$1).user $+ @* 0 : Host
  .Remove Host : .raw  ACCESS # DELETE HOST *! $+ $ial($$1).user $+ @* 
  .-
  .Clear Owners : .raw access $chan clear owner
  .Clear Hosts : .raw access $chan clear host
  .Clear Denys : .raw access $chan clear deny
  .Clear ALL : .raw access $chan clear all
  -
  Mass Modes
  .+q Owner: { mmode # +q  }
  .-q Owner: { mmode # -q }
  .-
  .+o Host: { mmode # +o  }
  .-o Host: { mmode # -o  }
  .-
  .+v Voice: { mmode # +v  }
  .-v Voice: { mmode # -v  }
  .-
  .+e Exempt : { mmode # +e }
  -
  Kicks
  .Kick(No Msg): kick # $1
  .Kick(With Msg): var %km $$?="Enter Kick Msg" | kick # $1 : %km 
  .Mass Kick:{ mkick # $$snicks }
  -
  Bans
  .$iif($chr(37) !isin #, Ban) : mode # +b $1 | mode # +b *! $+ $ial($$1).user $+ @* | kick # $1 
  .$iif($chr(37) isin #, Ban(Msg)): var %km $$?="Enter Ban Msg" |  access $chan clear all | ACCESS # ADD DENY *! $+ $ial($$1).user $+ @* 1440 : $1 Ban | kick # $1 : %km 
  -
}

Related Files

by extremity
by unknown

Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand