Advertisement
makimaki

p's edit final

Jul 26th, 2010
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 12.58 KB | None | 0 0
  1. ; ###########################################################################################################################################################
  2. ;                                                                  "nth - to the utmost power"
  3. ;                     nth - is a Multi-server mIRC Based Connection Built for Buzzen, Koach, Sparkpea, Phreik, and "most" Irc servers.
  4. ;                         As a sockless connection that lends itself to more open ended ;options for the server you wish to join,
  5. ;                    it is designed to be built upon. Features include Mass modes, incorporating a custom queue to prevent flooding out,
  6. ;                        a style stripper for Buzzen, a ;custom lite theme, and simple proxy option is easy to edit and understand.
  7. ;                                                                   ________________________
  8. ;                                                                          * Credits *
  9. ;                                     Thank you to the following people without whom this would never have been completed :
  10. ;                                                        * err0r his sockless con inspired me to try this.
  11. ;                                        * James aka PoD his support, testing and sharing code to improve and learn from.
  12. ;                * Paul aka extremity the hours spent testing versions,  giving me input,  cleaning up code, and immense help in things I had trouble with.
  13. ;           * pania aka seraphim My Angel that has supported me always, editing, testing, put up with my moods, limited time and so much more thank you.
  14. ;                  * Finally, thanks also to Dabba, Nick, Tewl, Travis, Spooks, and Roo for bits of code to learn from and answering when I had questions.
  15. ;                                                                    ________________________
  16. ;                                                                         * Disclaimer *
  17. ;                                    A big FUCK YOU to any bitch that wants to talk shit. Fuck right off and whine on some forum how your'e a loser.
  18. ;                            ALL code I used was written BY ME or credited to the appropriate people listed above with their permission.
  19. ;                                                                        - Makimaki & seraphim
  20. ; ###########################################################################################################################################################
  21.  
  22. ;STATUP
  23. on *:start:{
  24.   .timestamp -f hh:nn:sstt
  25.   .titlebar nth Multi Network Connection - By MakiMaki & seraphim
  26.   echo -sa 1nth Multi Network Connection.
  27.   echo -sa 1Ready to join Networks and rooms.
  28. }
  29.  
  30. ;SERVER/LOGIN
  31. on ^*:LOGON:*: {
  32.   if ($server == irc.buzzen.net) {
  33.     if (%buzzen == $null) { set %buzzen $$?="Enter Passport details:" $$?="Enter Your Password:" }
  34.     rw LOGINH $gettok(%buzzen,1,32) $md5($gettok(%buzzen,2,32))  $+ $lf $+ user %e  * * :anon
  35.     haltdef
  36.   }
  37. }
  38. ;Most Servers
  39. on *:connect: {
  40.   if ($network == PhreikNET) {
  41.     if (%phreik == $null) { cookie }
  42.     /account %phreik
  43.     mode $me +c
  44.   }
  45.   elseif ($network == Sparkpea.Net) {
  46.     if (%sparkpea == $null) { set %sparkpea $$?="Enter Passport details:" $$?="Enter Your Password:" }
  47.     /NickServ IDENTIFY %sparkpea
  48.   }
  49.   elseif ($network == koach.com) {
  50.     if (%koach == $null) { set %koach $$?="Enter Nickname:" $$?="Enter Your Password:" }
  51.     nick $gettok(%koach,1,32) | /NickServ IDENTIFY $gettok(%koach,2,32)
  52.   }
  53. }
  54. ;PhreikNet Account Cookie Grabber
  55. alias cookie {
  56.   set %phreik $$?="Enter User Name:" $$?="Enter Your Password:"
  57.   if ($sock(cookie)) sockclose cookie
  58.   sockopen cookie www.phreik.net 80
  59. }
  60. on *:SOCKOPEN:cookie:{
  61.   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
  62. }
  63. on *:SOCKREAD:cookie:{
  64.   if ($sockerr > 0) return
  65.   var %t | sockread %t
  66.   while ($sockbr > 0) {
  67.     tokenize 32 %t
  68.     if ($1 == TICKET:) {
  69.       if ($2 == VALID:) { echo -s 12 * Account Cookie $4- | set %phreik $4-  }
  70.       else { echo -s Error Grabbing Cookie. | cookie }
  71.     }
  72.     return
  73.   }
  74.   sockread %t
  75. }
  76.  
  77. ;ALIASES
  78. ;Debug
  79. alias debug { debug -pt @ $+ $network }
  80. alias restart { disconnect | /run mirc.exe | exit }
  81. ;NOTICES/SEL USER NOTICE
  82. alias notice {  rw notice $1- | echo $chan $timestamp 5* $me Notice sent to $$2 : $3- }
  83. alias sn { var %i $numtok($snicks,44) | while (%i) { notice $active $gettok($snicks,%i,44) $1- | dec %i } }
  84. ;AWAYS/RETURNS
  85. alias away {
  86.   if ($istok(%awaychan,$active,32)) { .raw away $active | set %awaychan $remtok(%awaychan,$active,32) }
  87.   else { .raw away $active $iif($1,$1-,[br]) | set %awaychan $addtok(%awaychan,$active,32) }
  88. }
  89. alias globalaway { var %i $chan(0) |  while (%i) { .raw away $chan(%i) $1- [br] | set %awaychan $addtok(%awaychan,$chan(%i),32) | dec %i } }
  90. alias globalback  { var %i $chan(0) |  while (%i) { .raw away $chan(%i) | set %awaychan $remtok(%awaychan,$chan(%i),32) | dec %i } }
  91. ;JOIN/CHANNEL LISTER - Needs Channel Lister Addon  to work for Buzzen
  92. alias list { if ($network == Buzzen) { dialog -m chan chan | halt } | else { list } }
  93. alias join {
  94.   if ($network == Buzzen) {
  95.     set -u10 %lastjoin $1-
  96.     var %c $remove($1,$chr(37))
  97.     rw join $iif($network  == Buzzen,$bcnr($gettok(%c,1,44)),$gettok(%c,1,44))
  98.     var %c $deltok(%c,1,44)    
  99.     if ($numtok(%c,44)) .timer 1 1 join %c
  100.   }
  101.   elseif (Sparkpea isin $network) { rw join $chr(37) $+ $remove($1-,$chr37)  }
  102.   else { rw join $1- }
  103.   haltdef
  104. }
  105. ;Modes,Kicks ect
  106. alias kick { rw kick $1- }
  107. alias mode { rw mode $1- }
  108. ;Mass Modes Thanks extremity
  109. alias mmode {
  110.   var %c $1, %m $$2, %i $nick(%c,0)
  111.   while (%i) { rw mode %c %m $nick(%c,%i) | dec %i }
  112. }
  113. alias mkick {
  114.   var %c $$1, %n $$2-, %d 1
  115.   KICK %c $gettok(%n, 1, 44)
  116.   var %n $remtok(%n, $gettok(%n, 1, 44), 1, 44)
  117.   if ($numtok(%n, 44)) { .timer -m 1 %d mkick %c %n }
  118. }
  119. ;Echos a link plus popups a window of the users profile
  120. alias profiles {
  121.   if ($network == Sparkpea.Net) { var %n sparkpea.net/profile.php?epuid=  }
  122.   elseif ($network == PhreikNET) { var %n phreik.net/profile.msnw?epuid=   }
  123.   elseif ($network == Buzzen) { var %n buzzen.net/profile.aspx?pid= }
  124.   echo -a * $1  Profile Link is12 http://www. $+ %n $+ $2 
  125.   run http://www. $+ %n $+ $2
  126. }
  127. ; Buzzen specific
  128. alias access { rw access $1- }
  129. alias bcnr { return $+($chr(37),$chr(35),$replace($remove($$1-,$chr(58),$chr(37),$chr(35)),$chr(32),\b)) }
  130. ;Thanks to Nick for the regx
  131. alias bcnstrip return $iif($network = Buzzen, $regsubex($1-, /\[(?:style\x20.*?|/style)\]/gi,$null), $1-)
  132.  
  133. ;QUEUE
  134. ;Thanks extremity      
  135. alias -l rw {
  136.   hinc -m que total
  137.   hadd que $hget(que,total) $1-
  138.   if (!$hget(que,idx)) { hinc que idx }
  139.   if (!$hget(que,run)) {
  140.     hadd que run 1
  141.     que
  142.   }
  143. }
  144. alias -l que {
  145.   :start
  146.   var %i $hget(que,idx)
  147.   .raw $hget(que, %i)
  148.   hinc que idx
  149.   if (11 // %i) {
  150.     .timer -m 1 1300 que
  151.     return
  152.   }
  153.   if (%i >= $hget(que, total)) {
  154.     hdel que run
  155.     .timerqr -m 1 1300 qclr
  156.     return
  157.   }
  158.   goto start
  159. }
  160. alias -l qclr { if (!$hget(que,run)) {
  161.     hdel que total
  162.     hdel que idx 0
  163.   }
  164. }
  165.  
  166. ;RAWS
  167. raw *:*: {
  168.   if (%raw == on) {
  169.     if (!$window(raws)) { window @raws }
  170.     echo -t @raws =========================
  171.     echo -t @raws   Number: $numeric
  172.     echo -t @raws   RawMsg: $rawmsg
  173.     echo -t @raws   Params: $1-
  174.     echo -t @raws  
  175.   }
  176.   if ($gettok($rawmsg,2,32) isin 002 003 004 005 251 265 329 353 366 422 803 804 805 914) { haltdef }
  177.   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 }
  178.   elseif ($numeric == 403) { CREATE $2 | haltdef }
  179.   elseif ($numeric == 801) { echo -t $2 5Added $3 to access for $4  | haltdef }
  180.   elseif ($numeric == 332) { echo $2 3 $timestamp * Topic : $bcnstrip($3-)  | haltdef }
  181.   elseif ($numeric == 821) { var %n $mid($gettok($rawmsg,1,33),2-) | echo -t $1 7 %n has returned. | cline -m 2 $1 %n  | haltdef }
  182.   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 } }
  183.   elseif ($3 == PUID) {  profiles $2 $4 }
  184.   elseif ($2 == PID) { profiles $3 $4 }
  185.   elseif ($numeric == 999) {
  186.     var %i $scon(0)
  187.     while (%i) {
  188.       scon %i
  189.       if ($chan(0) < 11) { join %lastjoin | haltdef }
  190.       dec %i
  191.     }
  192.     server -m irc.buzzen.net -j %lastjoin | haltdef
  193.   }
  194. }
  195.  
  196. ;EVENTS/THEME
  197. on *:INPUT:#: {
  198.   if ($left($1,1)  != /) {
  199.     rw PRIVMSG # $+(:,$iif($network = buzzen,%style $+ $1- $iif(%style,[/style]),$1-))
  200.     echo  -ti2 $chan 10 $+ $me  $+ : $1-
  201.     haltdef
  202.   }
  203. }
  204. on *:INPUT:?: {
  205.   if ($network == Buzzen) && ($left($1-,1) != /) && ($comchan($active,0) > 0) { rw WHISPER $comchan($active,1) $active $+(:,$1-,) }
  206.   else { privmsg $active $1-  }
  207.   echo  -ti2 $chan 1 $+ $me $+ : $1-
  208.   haltdef  
  209. }
  210. on ^*:TEXT:*:#: {
  211.   if ($chr(37) isin $nick) { echo $chan 10 $timestamp * Welcome : $bcnstrip($1-) }
  212.   else { echo  -ti2 $chan 2 $nick  $+ :14 $bcnstrip($1-) }
  213.   haltdef
  214. }
  215. on ^*:ACTION:*:#: { echo  -ti2 $chan 6* $nick $bcnstrip($1-) | haltdef }
  216. on *:CLOSE:?: { if (%bw. [ $+ [ $target ] ]) { unset %bw. [ $+ [ $target ] ] } }
  217. on ^*:NOTICE:*:*: {  
  218.   if ($nick != MemoServ) {
  219.     if ($nick === NeoStats) {  echo -a 12* Server Notice 01: $1- }
  220.     elseif ($nick === opsb) { echo $chan 12* Server Notice 01: $1- }  
  221.     elseif ($nick == Global) && ($4 != from) { echo -s 12* Global Message from $network : 1 $1- }
  222.     elseif ($nick == ChanServ) { echo $chan  14* Channel Message3: 14 $2-  }
  223.     haltdef
  224.   }
  225.   tokenize 32 $Rawmsg
  226.   echo $chan $timestamp 5* Notice From $nick : $remove($$5,:) $6-
  227.   haltdef
  228. }
  229. on ^*:SNOTICE:*: { echo -st 5* Server Notice: $1- | halt }
  230. on ^*:JOIN:#: {
  231.   if ($nick == $me $nick == $me && $chr(37) isin #) { set # # | haltdef }
  232.   var %a $readini(data\nicklog.ini,Nicklog,$address($nick,1))
  233.   if (!%a) { writeini -n data\nicklog.ini Nicklog $address($nick,1) $+($chr(44),$nick) }
  234.   elseif (%a) && ($nick !isin %a) { writeini -n data\nicklog.ini Nicklog $address($nick,1) $+(%a,$chr(44),$nick) }
  235.   else { echo $chan $numtok(%a,44) entries for %a }
  236. }
  237. on ^*:PART:#: { if ($nick == $me && $chr(37) isin #) { unset # # | haltdef } }
  238. on ^*:RAWMODE:#: { echo # $timestamp 7 $nick sets mode 1 $+ $1 7 $+ $2- | haltdef }
  239. ;NICKLIST MENU
  240. menu Nicklist {
  241.   $1 (Info)
  242.   .$iif($network != Buzzen, Info) :/uwho $1
  243.   .$iif($network != Koach.Com, Profile): { $iif($network != Buzzen,.Prop $1 PUID, Pid $$1) }
  244.   -
  245.   User Modes
  246.   .+q(Owner): mode # +q $1
  247.   .-q(DeOwner): mode # -q $1
  248.   .-
  249.   .$iif($network != Buzzen, +a(Admin)): mode # +a $1
  250.   .$iif($network != Buzzen, -a(DeAdmin)): mode # -a $1
  251.   .-
  252.   .+o(Host): mode # +o $1
  253.   .-o(DeHost): mode # -o $1
  254.   .-
  255.   .+h(Helpop): mode # +h $1
  256.   .-h(DeHelpop: mode # -h $1
  257.   .-
  258.   .+v(Voice): mode # +v $1
  259.   .-v(DeVoice): mode # -v $1
  260.   .-
  261.   .+e(Exempt): Mode # +e $1
  262.   -
  263.   Ignore
  264.   .Add: ignore -w $address($snick($active,1),1)
  265.   .Remove: ignore -rw $address($snick($active,1),1)
  266.   -
  267.   $iif($chr(37) isin #, Channel Accses)
  268.   .Add Owner : .raw  ACCESS # ADD OWNER *! $+ $ial($$1).user $+ @* 0 : Owner
  269.   .Remove Owner: .raw  ACCESS # DELETE OWNER *! $+ $ial($$1).user $+ @*
  270.   .-
  271.   .Add Host: .raw  ACCESS # ADD HOST *! $+ $ial($$1).user $+ @* 0 : Host
  272.   .Remove Host : .raw  ACCESS # DELETE HOST *! $+ $ial($$1).user $+ @*
  273.   .-
  274.   .Clear Owners : .raw access $chan clear owner
  275.   .Clear Hosts : .raw access $chan clear host
  276.   .Clear Denys : .raw access $chan clear deny
  277.   .Clear ALL : .raw access $chan clear all
  278.   -
  279.   Mass Modes
  280.   .+q Owner: { mmode # +q  }
  281.   .-q Owner: { mmode # -q }
  282.   .-
  283.   .+o Host: { mmode # +o  }
  284.   .-o Host: { mmode # -o  }
  285.   .-
  286.   .+v Voice: { mmode # +v  }
  287.   .-v Voice: { mmode # -v  }
  288.   .-
  289.   .+e Exempt : { mmode # +e }
  290.   -
  291.   Kicks
  292.   .Kick(No Msg): kick # $1
  293.   .Kick(With Msg): var %km $$?="Enter Kick Msg" | kick # $1 : %km
  294.   .Mass Kick:{ mkick # $$snicks }
  295.   -
  296.   Bans
  297.   .$iif($chr(37) !isin #, Ban) : mode # +b $1 | mode # +b *! $+ $ial($$1).user $+ @* | kick # $1
  298.   .$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
  299.   -
  300. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement