Public paste
minirc
By: MinIRC | Date: Mar 22 2011 02:12 | Format: None | Expires: never | Size: 7.7 KB | Hits: 905

  1. ; 末末末末末末末末末末末末末末末末末末末末
  2. ; NNScript by ESNation v4.22 - MinIRC - coded by greeny & mute
  3. ; Don't edit anything in here unless you REALLY know what you're doing!
  4. ; 末末末末末末末末末末末末末末末末末末末末
  5. alias minirc {
  6.   if (!$1) { tokenize 32 $active }
  7.   if ($2 != $null) { thmerror -a invalid window. }
  8.   else {
  9.     if ($window(@MinIRC)) { minirc.chg $1 }
  10.     else {
  11.       if (!$readini($mircini,windows,@MinIRC)) { .writeini $mkfullfn($mircini) windows @MinIRC $calc($window(-1).w -400) $+ , $+ 400 $+ , $+ $calc($window(-1).h -170) $+ ,170,0,0,1 }
  12.       window -dok0 $+ $iif(!%minirc.disableeditbox,e) $iif(%minirc.disableborder,+fs,+fnst) @MinIRC $qt($window(Status Window).font) $int($calc($window(Status Window).fontsize *(1- %minirc.fsize)))
  13.       if (!%minirc.trs) { set %minirc.trs 255 }
  14.       setlayer %minirc.trs @MinIRC
  15.       minirc.chg $1
  16.       if (%minirc.minmirc) { showmirc -m }
  17.     }
  18.   }
  19. }
  20. alias minirc.chgopc {
  21.   set %minirc.trs $iif($1,$1,255)
  22.   setlayer $1 $active
  23. }
  24. alias minirc.targetcon { if ($1 isnum 1- $+ $scon(0)) { return $iif($wd(%minirc,2) == $scon($1),$style(1),$iif(!$chan(0) && !$query(0),$style(2))) $replace($scon($1).curconserv,$chr(123),[,$chr(125),],:,;) $+ :minirc.chgcid $scon($1) } }
  25. alias minirc.targetchan { if ($1 isnum 1- $+ $chan(0)) { return $iif($wd(%minirc,1) == $chan($1),$style(1)) $replace($chan($1),$chr(123),[,$chr(125),],:,;) $+ :minirc.chg $chan($1) } }
  26. alias minirc.targetquery { if ($1 isnum 1- $+ $query(0)) { return $iif($wd(%minirc,1) == $query($1),$style(1)) $replace($query($1),$chr(123),[,$chr(125),],:,;) $+ :minirc.chg $query($1) } }
  27. alias minirc.chgcid {
  28.   close -@ @MinIRC
  29.   scid $1
  30.   minirc $iif($chan(1),$v1,$query(1))
  31.   scid -r
  32. }
  33. on *:open:?:*:{
  34.   if ($wd(%minirc,1)) {
  35.     thmecho @MinIRC $thmhl($nick) queried you $+ $iif($wd(%minirc,2) != $cid,$chr(32) $+ on $thmhl($iif($scid($cid).network,$v1,$scid($cid).server))) $+ : $1-
  36.   }
  37. }
  38. on *:text:*:#:{
  39.   if ($wd(%minirc,1)) {
  40.     if ($isachl($1-)) {  
  41.       if ($wd(%minirc,2) != $cid) || ($wd(%minirc,1) != $chan) {
  42.         thmecho @MinIRC $thmhl($nick) highlighted you in $iif($wd(%minirc,2) != $cid,$thmhl($chan) on $thmhl($iif($scid(cid).network,$v1,$scid($cid).server)),$thmhl($chan)) $+ : $1-
  43.       }
  44.     }
  45.   }
  46. }
  47. on *:text:*:?:{
  48.   if ($wd(%minirc,1)) {
  49.     if ($isachl($1-)) {  
  50.       if ($wd(%minirc,2) != $cid) || ($wd(%minirc,1) != $nick) {
  51.         thmecho @MinIRC $thmhl($nick) highlighted you in a query $+ $iif($wd(%minirc,2) != $cid,$chr(32) $+ on $thmhl($iif($scid($cid).network,$v1,$scid($cid).server))) $+ : $1-
  52.       }
  53.     }
  54.   }
  55. }
  56. on *:nick:{
  57.   if ($nick == $wd(%minirc,1)) && ($cid == $wd(%minirc,2)) {
  58.     set %minirc $newnick $cid
  59.     titlebar @MinIRC - $newnick on $curconserv
  60.     thmecho @MinIRC Target changed to $thmhl($newnick) $+ .
  61.   }
  62. }
  63. alias minirc.chg {
  64.   titlebar @MinIRC - $1 on $curconserv
  65.   set %minirc $1 $cid
  66.   if ($window($1)) {
  67.     thmecho @MinIRC MinIRC window for $thmhl($1) opened on $thmhl($longtime)
  68.     aline @MinIRC 
  69.     if ($gettok($readini($mircini,options,n2),36,44)) { filter -cwwp $1 @MinIRC }
  70.     else {
  71.       var %i = $iif($line($1,0) > 5,6,$line($1,0))
  72.       filter -wwpr $calc($line($1,0)-%i) $+ - $+ $line($1,0) $1 @MinIRC
  73.     }
  74.   }
  75.   else {
  76.     if ($left($1,1) isin $chantypes) {
  77.       thmecho @MinIRC $thmhl($1) not joined! Joining...
  78.       aline @MinIRC 
  79.       join -n $1
  80.     }
  81.     else {
  82.       thmecho @MinIRC No query with $thmhl($1) open! Opening...
  83.       aline @MinIRC 
  84.       query -n $1
  85.     }
  86.   }
  87. }
  88. alias minirc.actchan {
  89.   if ($active == @MinIRC) { return $wd(%minirc,1) }
  90.   else { return $active }
  91. }
  92. on *:close:@MinIRC:{ unset %minirc }
  93. alias minirc.restoremirc {
  94.   if ($window(-2).state == minimized) || ($window(-2).state == tray) { showmirc -r }
  95.   else { showmirc -s }
  96. }
  97. menu @MinIRC {
  98.   dclick:minirc.restoremirc
  99.   $style(2) $shorten(12,$wd(%minirc,1)) $+ $chr(58):return
  100.   -
  101.   &Target
  102.   .&Connection
  103.   ..$submenu($minirc.targetcon($1))
  104.   ..-
  105.   .C&hannel
  106.   ..$submenu($minirc.targetchan($1))
  107.   .&Query
  108.   ..$submenu($minirc.targetquery($1))
  109.   -
  110.   $iif(!$osgen,$style(2)) &Opacity
  111.   .$submenu($minirc.opcsub($1))
  112.   &Font size
  113.   .$iif(!%minirc.fsize,$style(1)) &Default:minirc.chgfsize 0
  114.   .-
  115.   .$submenu($minirc.fsize($1))
  116.   $iif(!%minirc.disableborder,$style(1)) &Border:minirc.toggleborder
  117.   $iif(!%minirc.disableeditbox,$style(1)) &Editbox:minirc.toggleeditbox
  118.   $iif(%minirc.minmirc,$style(1)) &Min. mIRC:minirc.toggleminmirc
  119.   $iif($window(@MinIRC).ontop,$style(1)) &On top:window $iif($window(@MinIRC).ontop,-u,-o) @MinIRC
  120.   $iif(!%minirc.disabletimestamp,$style(1)) &Timestamp:minirc.toggletimestamp
  121.   -
  122.   C&lear:clear
  123.   &Close:{
  124.     unset %minirc
  125.     window -c $active
  126.   }
  127. }
  128. alias minirc.chgfsize {
  129.   set %minirc.fsize $1
  130.   font @MinIRC $qt($window(Status Window).font) $int($calc($window(Status Window).fontsize *(1- %minirc.fsize)))
  131. }
  132. alias minirc.fsize { if ($1 isnum 1-10) { return $iif(%minirc.fsize == $calc($1 *0.05),$style(1)) $+(-&,$calc($1 *5),%,:minirc.chgfsize) $calc($1 *0.05) } }
  133. alias minirc.toggleminmirc {
  134.   toggle minirc.minmirc
  135.   thmecho @MinIRC mIRC will $iif(%minirc.minmirc,now,no longer) be minimized on MinIRC start.
  136. }
  137. alias minirc.toggletimestamp {
  138.   toggle minirc.disabletimestamp
  139.   thmecho @MinIRC Timestamping $iif(%minirc.disabletimestamp,disabled!,enabled!)
  140. }
  141. alias minirc.toggleeditbox {
  142.   toggle minirc.disableeditbox
  143.   var %t = $wd(%minirc,1)
  144.   close -@ @MinIRC
  145.   .minirc %t
  146.   thmecho @MinIRC Editbox $iif(%minirc.disableeditbox,disabled!,enabled!)
  147. }
  148. alias minirc.toggleborder {
  149.   toggle minirc.disableborder
  150.   var %t = $wd(%minirc,1)
  151.   close -@ @MinIRC
  152.   .minirc %t
  153.   thmecho @MinIRC Border $iif(%minirc.disableborder,disabled!,enabled!)
  154. }
  155. alias minirc.opcsub {
  156.   if ($1 isnum 1-10) {
  157.     var %t = $calc(25.5* $1)
  158.     return $iif(%minirc.trs == %t,$style(1)) $calc($1 *10) $+ % $+ :minirc.chgopc %t
  159.   }
  160. }
  161. alias window {
  162.   var %new,%rg = $regex(wdw,$1-,/^((?:-[^ ]+ )?(?:-t[^ ]+ )?(?:+[^ ]+ )?(".+"|[^ ]+))((?: -?d+){1,4})?(.*)$/),%j = $remove($regml(wdw,2),")
  163.   if (!$window(%j)) { %new = 1 }
  164.   if ($regml(wdw,3)) || ($vwin(%j)) || (-*d* iswmcs $1) { !window $1- }
  165.   else {
  166.     if (%winarr.auto) && (%new) {
  167.       if (%winarr == -s) { !window $regml(wdw,1) $winarr.arr.hybrid.pos $regml(wdw,4) }
  168.       elseif (%winarr == -i) { !window $regml(wdw,1) $winarr.arr.inflate.pos $regml(wdw,4) }
  169.       else { !window $1- }
  170.     }
  171.     else { !window $1- }
  172.   }
  173.   if (!$window(@MinIRC)) { unset %minirc }
  174. }
  175. alias echo {
  176.   tokenize 32 $left($1-,4000)
  177.   !echo $1-
  178.   if ($1 isnum) { tokenize 32 $2- }
  179.   if (-*n* iswmcs $1) { return }
  180.   if (-*c* iswmcs $1) { var % = $1-2,%t = $3,%e = $4- }
  181.   elseif (-* iswm $1) { var % = $1,%t = $2,%e = $3- }
  182.   else { var %,%t = $1,%e = $2- }
  183.   if (%t == $wd(%minirc,1)) && ($cid == $wd(%minirc,2)) {
  184.     if ($window(@MinIRC)) {
  185.       if (%minirc.disabletimestamp) { !echo $iif($remove(%,f,b,t) != -,$v1) @MinIRC %e }
  186.       else { !echo $iif($remove(%,f,b) != -,$v1) @MinIRC %e }
  187.     }
  188.     else { unset %minirc }
  189.   }
  190.   if (-*a* iswmcs $1) || ((%t == $wd(%minirc,1)) && ($cid == $wd(%minirc,2))) { return }
  191. }
  192. alias nick {
  193.   if (%nickretry. [ $+ [ $cid ] ] == $1) {
  194.     if (!$2) {
  195.       unset %nickretry. $+ $cid
  196.       .timernickchg. $+ $cid off
  197.     }
  198.   }
  199.   !nick $1-
  200. }
  201. alias close {
  202.   !close $1-
  203.   if (!$window(@MinIRC)) { unset %minirc }
  204.   if (-*m* iswmcs $1) {
  205.     var %w = $+(%,qcls.ls.,$cid,.*),%z = $var(%w,0)
  206.     while (%z) {
  207.       var %g = $var(%w,%z)
  208.       if (!$query($gettok(%g,4-,46))) { unset [ %g ] }
  209.       dec %z
  210.     }
  211.   }
  212. }
  213. on *:active:@MinIRC:{ window -g0 $wd(%minirc,1) }
  214. ; 末末末末末末末末末末末末末末末末末末末末
  215. ; End of file
  216. ; 末末末末末末末末末末末末末末末末末末末末