westor

MTS Themes

Nov 29th, 2018
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 66.08 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;; MTS loader 1.71 by Snake ;;;
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4.  
  5. ;; Dialogs
  6.  
  7. dialog mts {
  8.   title "MTS loader 1.71"
  9.   size -1 -1 449 245
  10.   option pixels
  11.   list 1, 4 0 148 189, size
  12.   text "Scheme:", 3, 8 193 48 16
  13.   combo 4, 58 191 94 200, size drop
  14.   text "Preview: None", 12, 162 10 148 16
  15.   icon 14, 158 40 290 147
  16.   button "Preview", 16, 325 8 60 20
  17.   button "Larger", 17, 385 8 60 20
  18.   button "Load", 20, 343 222 50 20
  19.   button "Unload", 21, 395 222 50 20
  20.   text "No preview generated at the moment", 22, 166 98 276 16, center
  21.   button "", 41, 0 0 0 0, hide ok
  22.   check "Accurate preview (slower)", 42, 162 192 280 20
  23.   edit "", 5, 160 2 285 2
  24.   edit "", 13, 160 32 285 2
  25.   edit "", 15, 4 216 441 2
  26.   menu "File", 6
  27.   item "Add", 7, 6
  28.   item "Edit", 8, 6
  29.   item "Remove", 9, 6
  30.   item break, 18, 6
  31.   item "Add folder", 26, 6
  32.   item "Clear list", 27, 6
  33.   item break, 10, 6
  34.   item "Info", 19, 6
  35.   item break, 28, 6
  36.   item "Close", 11, 6
  37.   menu "Options", 2
  38.   menu "Set path to", 35, 2
  39.   item "MDX", 39, 35
  40.   item "Popups", 40, 35
  41.   item break, 36, 2
  42.   item "Destroy previews", 37, 2
  43.   item "Preview on click", 23, 2
  44.   item "Clear windows on load/unload", 29, 2
  45.   item "Minimize windows on load", 38, 2
  46.   item break, 24, 2
  47.   item "Advanced", 25, 2
  48.   menu "Help", 30
  49.   item "Readme", 32, 30
  50.   item "Contents", 31, 30
  51.   item break, 33, 30
  52.   item "About", 34, 30
  53. }
  54. dialog mtsinfo {
  55.   title "MTS loader 1.71 - Info"
  56.   size -1 -1 151 113
  57.   option dbu
  58.   edit "", 1, 2 3 145 1
  59.   text "Info on theme: N/A", 2, 4 5 145 8
  60.   edit "", 3, 2 14 145 1
  61.   text "Name: N/A", 4, 4 19 141 8
  62.   text "Author: N/A", 5, 4 29 141 8
  63.   text "URL:", 7, 4 50 15 8
  64.   link "N/A", 8, 22 49 123 8
  65.   text "MTS Version: N/A", 9, 4 59 141 8
  66.   text "Description:", 10, 4 69 42 8
  67.   edit "N/A", 11, 2 79 147 32, read multi autovs
  68.   text "E-Mail:", 12, 4 39 20 8
  69.   link "N/A", 6, 25 39 120 8
  70.   button "", 13, 0 0 0 0, hide ok
  71. }
  72.  
  73. dialog mtsopt {
  74.   title "MTS loader 1.71 - Advanced options"
  75.   size -1 -1 125 131
  76.   option dbu
  77.   edit "", 1, 2 3 120 1
  78.   text "When loading themes, apply:", 2, 4 6 90 8
  79.   edit "", 3, 2 16 120 1
  80.   check "Pictures", 4, 4 19 63 10
  81.   check "Colors", 5, 4 27 50 10
  82.   check "Fonts", 6, 4 35 50 10
  83.   check "Nick colors", 7, 74 27 50 10
  84.   check "Timestamp", 8, 74 19 50 10
  85.   edit "", 9, 2 48 120 1
  86.   text "When a theme is loaded, hide:", 10, 4 51 90 8
  87.   edit "", 11, 2 61 120 1
  88.   check "Welcome messages", 13, 4 64 62 10
  89.   check "Stats (/lusers)", 14, 4 72 60 10
  90.   check "Nicks (/names)", 15, 74 64 64 10
  91.   check "Channel info", 16, 74 73 48 10
  92.   edit "", 17, 2 85 120 1
  93.   button "Ok", 18, 65 120 28 9, ok
  94.   button "Cancel", 19, 94 120 28 9, cancel
  95.   edit "", 21, 2 98 120 1
  96.   combo 22, 59 102 50 100, size drop
  97.   button "", 23, 111 102 10 10
  98.   check "Use custom nicklist colors", 20, 4 88 95 8
  99.   text "Status:", 25, 4 103 19 8
  100.   edit "", 26, 2 116 120 1
  101. }
  102.  
  103. dialog preaux {
  104.   title "MTS loader 1.71"
  105.   size -1 -1 175 61
  106.   text "", 1, 25 9 120 16, center
  107.   text "", 2, 9 33 152 16
  108.   button "", 3, 0 0 0 0, hide Ok
  109. }
  110.  
  111. dialog lpre {
  112.   title "MTS loader 1.71"
  113.   size -1 -1 518 342
  114.   option pixels
  115.   edit "", 1, 4 8 510 2
  116.   text "Preview:", 2, 8 14 216 16, disable
  117.   edit "", 3, 4 34 510 2
  118.   icon 4, 9 41 499 295
  119.   button "", 5, 0 0 0 0, hide ok
  120. }
  121.  
  122. dialog colors {
  123.   title "Colors"
  124.   size -1 -1 96 34
  125.   option dbu
  126.   button "", 1, 4 7 10 10
  127.   button "", 2, 15 7 10 10
  128.   button "", 3, 26 7 10 10
  129.   button "", 4, 37 7 10 10
  130.   button "", 5, 48 7 10 10
  131.   button "", 6, 59 7 10 10
  132.   button "", 7, 70 7 10 10
  133.   button "", 8, 81 7 10 10
  134.   button "", 9, 4 18 10 10
  135.   button "", 10, 15 18 10 10
  136.   button "", 11, 26 18 10 10
  137.   button "", 12, 37 18 10 10
  138.   button "", 13, 48 18 10 10
  139.   button "", 14, 59 18 10 10
  140.   button "", 15, 70 18 10 10
  141.   button "", 16, 81 18 10 10
  142.   box "", 17, 2 0 92 4
  143.   box "", 18, 2 28 92 4
  144.   button "", 19, 0 0 0 0, hide result
  145.   button "", 20, 0 0 0 0, hide ok
  146. }
  147.  
  148. ;; Events
  149.  
  150. on *:dialog:mts:*:*: {
  151.   if ($devent == init) {
  152.     .setmtsmdx
  153.     .mtsmdx SetControlMDX $dname 1 listview rowselect report single showsel > $mtsviews
  154.     .mtsmdx SetBorderStyle $dname 16,17 clientedge
  155.     .mtsmdx SetBorderStyle $dname 5,13,15 staticedge
  156.     .mtsmdx SetFont $dname 12 ANSI 13 700 Tahoma
  157.     .did -i $dname 1 1 headerdims 127
  158.     .did -i $dname 1 1 headertext Themes:
  159.     .did -b mts 12
  160.     .var %i = 1
  161.     .while ($read($mtspath(mts.tl),n,%i)) {
  162.       if ($isfile($read($mtspath(mts.tl),n,%i))) {
  163.         .did -a mts 1 $nopath($read($mtspath(mts.tl),n,%i))
  164.         .inc %i
  165.       }
  166.       else .write -dl %i $mtspath(mts.tl)
  167.     }
  168.     if ($did(mts,1,2)) {
  169.       .did -c mts 1 2
  170.       .dm 1
  171.     }
  172.     if ($isfile($mtsret(main,preview))) {
  173.       .var %t = $mtsret(main,preview)
  174.       .showpre " $+ %t $+ "
  175.       if ($didwm($dname,1,* 0 0 0 $deltok($nopath(%t),-1,45),1)) {
  176.         .did -c $dname 1 $v1
  177.         .dm $calc($v1 - 1)
  178.         .var %t = $remlast($gettok($nopath(%t),-1,45),4)
  179.         .did -c $dname 4 $iif(%t == mts,1,$calc($remove(%t,scheme) + 1))
  180.       }
  181.     }
  182.     .else did -b mts 37
  183.     .mtsinil click 23
  184.     .mtsinil clear 29
  185.     .mtsinil minimize 38
  186.     .mtsinil accurate 42
  187.     if (!$mtsh(current)) .did -b mts 21
  188.   }
  189.   elseif ($devent == sclick) {
  190.     if ($did == 1) && ($did(mts,1).sel) {
  191.       .var %t = $gettok($did(mts,1,1).text,1,32)
  192.       if (%t == item) {
  193.         .dm $calc($did(mts,1).sel - 1)
  194.         if ($did(mts,23).state) .mtspre $mpre(small)
  195.       }
  196.       elseif (%t == rclick) .mtspop
  197.     }
  198.     elseif ($did == 4) && ($did(mts,1).sel) && ($did(mts,23).state) mtspre $mpre(small)
  199.     elseif ($did == 16) {
  200.       if ($did(mts,1).sel) .mtspre $mpre(small)
  201.     }
  202.     elseif ($did == 17) && ($did(mts,1).sel) .mtspre $mpre(large)
  203.     elseif ($did == 20) && ($did(mts,1).sel) .mtsload $sch $read($mtspath(mts.tl),n,$calc($did(mts,1).sel - 1))
  204.     elseif ($did == 21) .mtsunload
  205.     elseif ($did == 42) .writeini $mtspath(mts.ini) .main accurate $did(mts,42).state
  206.   }
  207.   elseif ($devent == menu) {
  208.     if ($did == 7) .mtsadd
  209.     elseif ($did == 8) .mtsedit
  210.     elseif ($did == 9) .mtsdel
  211.     elseif ($did == 19) {
  212.       if ($did(mts,1).sel) .mtsinfo $+(",$read($mtspath(mts.tl),n,$calc($did(mts,1).sel - 1)),")
  213.     }
  214.     elseif ($did == 11) .dialog -x mts
  215.     elseif ($did == 25) .mtsopt
  216.     elseif ($did == 26) {
  217.       .var %dir = $$sdir(mts,Chosse a folder containing MTS themes,Ok)
  218.       .var %i = 1
  219.       .var %f2 = $mtspath(mts.tl)
  220.       .while ($findfile(%dir,*.mts,%i)) {
  221.         .var %f = $v1
  222.         if (!$read(%f2,wn,%f)) {
  223.           .write %f2 %f
  224.           .did -a mts 1 $nopath(%f)
  225.         }
  226.         .inc %i
  227.       }
  228.       if ($did(mts,1,2)) {
  229.         .did -c mts 1 %i
  230.         .dm $calc($did(mts,1).sel - 1)
  231.       }
  232.     }
  233.     elseif ($did == 27) {
  234.       .write -c $mtspath(mts.tl)
  235.       .did -r mts 1,4
  236.       .clearinfo
  237.     }
  238.     elseif ($did == 39) .setmdxpath
  239.     elseif ($did == 40) .setpoppath
  240.     elseif ($did == 23) .mtsini click 23
  241.     elseif ($did == 29) .mtsini clear 29
  242.     elseif ($did == 38) .mtsini minimize 38
  243.     elseif ($did == 37) {
  244.       .did -ra mts 12 Preview: None
  245.       .did -b mts 37
  246.       .while ($findfile($scriptdir $+ large,*,1)) .remove " $+ $v1 $+ "
  247.       .while ($findfile($scriptdir $+ small,*,1)) .remove " $+ $v1 $+ "
  248.       .did -h mts 14
  249.       .did -v mts 22
  250.     }
  251.     elseif ($did == 32) .run notepad.exe $mtspath(readme.txt)
  252.     elseif ($did == 31) .mtshelp
  253.     elseif ($did == 34) .var %n = $input(MTS loader 1.71 written by SolidSnake,oi,MTS loader)
  254.   }
  255. }
  256.  
  257. on *:dialog:mtsinfo:*:*: {
  258.   if ($devent == init) {
  259.     .setmtsmdx
  260.     .mtsmdx SetFont $dname 2 ANSI 13 700 Tahoma
  261.     .mtsmdx SetBorderStyle $dname 1,3,11 staticedge
  262.     .did -b mtsinfo 2
  263.   }
  264.   elseif ($devent == sclick) {
  265.     if ($did == 6) .run mailto: $+ $did(mtsinfo,6).text
  266.     elseif ($did == 8) {
  267.       .var %t = $did(mtsinfo,8).text
  268.       .run $iif(http:// isin %t,%t, http:// $+ %t)
  269.     }
  270.   }
  271. }
  272.  
  273. on *:dialog:mtsopt:*:*: {
  274.   if ($devent == init) {
  275.     .setmtsmdx
  276.     .mtsmdx SetControlMDX $dname 23 Text > $mtsctl_gen
  277.     .mtsmdx SetBorderStyle $dname 23 clientedge
  278.     .mtsmdx SetBorderStyle $dname 1,3,9,11,17,21,26 staticedge
  279.     .mtsmdx SetFont $dname 2,10 ANSI 13 700 Tahoma
  280.     .did -b mtsopt 2,10
  281.     .optaux2 yourself
  282.     .optaux2 owner
  283.     .optaux2 admin
  284.     .optaux2 op
  285.     .optaux2 hop
  286.     .optaux2 voice
  287.     .optaux2 regular
  288.     .optaux2 notify
  289.     .optaux2 protect
  290.     .optaux2 autoop
  291.     .optaux2 autovoice
  292.     .optaux2 ignore
  293.     .did -c mtsopt 22 1
  294.     .optaux3 yourself
  295.     .optaux pictures 4
  296.     .optaux colors 5
  297.     .optaux fonts 6
  298.     .optaux nicks 7
  299.     .optaux timestamp 8
  300.     .optaux welcome 13
  301.     .optaux lusers 14
  302.     .optaux names 15
  303.     .optaux chaninfo 16
  304.     .optaux nickcolors 20
  305.   }
  306.   elseif ($devent == sclick) {
  307.     if ($did == 22) optaux3 $did($did).seltext
  308.     elseif ($did == 23) {
  309.       .var %c = $stdc
  310.       .var %t = $did(mtsopt,22).seltext
  311.       .hadd mtsopt %t %c
  312.       .optaux3 %t
  313.     }
  314.     elseif ($did == 18) {
  315.       .optaux4 pictures 4
  316.       .optaux4 colors 5
  317.       .optaux4 fonts 6
  318.       .optaux4 nicks 7
  319.       .optaux4 timestamp 8
  320.       .optaux4 welcome 13
  321.       .optaux4 lusers 14
  322.       .optaux4 names 15
  323.       .optaux4 chaninfo 16
  324.       .optaux4 nickcolors 20
  325.       .optaux5 yourself
  326.       .optaux5 owner
  327.       .optaux5 admin
  328.       .optaux5 op
  329.       .optaux5 hop
  330.       .optaux5 voice
  331.       .optaux5 regular
  332.       .optaux5 notify
  333.       .optaux5 protect
  334.       .optaux5 autoop
  335.       .optaux5 autovoice
  336.       .optaux5 ignore
  337.     }
  338.   }
  339. }
  340.  
  341. on *:dialog:preaux:*:*:{
  342.   if ($devent == init) {
  343.     .setmtsmdx
  344.     .mtsmdx SetControlMDX $dname 2 progressbar smooth > $mtsctl_gen
  345.   }
  346. }
  347.  
  348. on *:dialog:lpre:init:*:{
  349.   .setmtsmdx
  350.   .mtsmdx SetBorderStyle $dname 1,3 staticedge
  351.   .mtsmdx SetFont $dname 2 ANSI 13 700 Tahoma
  352. }
  353.  
  354. on *:dialog:colors:*:*: {
  355.   if ($devent == init) {
  356.     .setmtsmdx
  357.     .mtsmdx SetBorderStyle $dname 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 clientedge
  358.     .mtsmdx SetControlMDX $dname 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 Text > $mtsctl_gen
  359.     .mtsmdx SetDialog $dname style 0 title
  360.     .var %i = 1
  361.     .while (%i <= 16) {
  362.       .mtsmdx SetColor $dname %i background $color($calc(%i - 1))
  363.       .inc %i
  364.     }
  365.   }
  366.   elseif ($devent == sclick) {
  367.     if ($did >= 1) && ($did <= 16) {
  368.       .did -a $dname 19 $calc($did - 1)
  369.       .dialog -k colors
  370.     }
  371.   }
  372. }
  373.  
  374. on *:START:{
  375.   if (!$isdir($scriptdir $+ small)) .mkdir " $+ $scriptdir $+ small $+ "
  376.   if (!$isdir($scriptdir $+ large)) .mkdir " $+ $scriptdir $+ large $+ "
  377.   .hmake mts 20
  378.   .hload mts $mtspath(mts.ah)
  379.   if ($isfile($mtsh(script))) && (!$script($mtsh(script))) .load -rs $shortfn($mtsh(script))
  380.   if ($mtsh(timestampformat)) .timestamp -f $v1
  381. }
  382.  
  383. on *:LOAD:{
  384.   .echo -s This is MTS loader v1.71 written by SolidSnake (liquidsnake@sapo.pt)
  385.   .echo -s type /mts to display the main MTS loader dialog box
  386.   .echo -s To know more about this theme loader and it's commands available, type /mtshelp
  387.   if ($version != 6.16) .echo -s This addon is meant to mIRC 6.16. It may not work as it should on this version ( $+ $version $+ )
  388.   .writeini $mtspath(mts.ini) main mdx $remove($scriptdir,$mircdir) $+ MDX\
  389.   .writeini $mtspath(mts.ini) main popups $remove($scriptdir,$mircdir) $+ popups.dll
  390. }
  391.  
  392. on *:UNLOAD:mtsunload
  393.  
  394. on *:EXIT:{
  395.   if ($mtsh(timestampformat)) {
  396.     .hadd mts timestampformat $timestampfmt
  397.     .hsave -o mts $mtspath(mts.ah)
  398.   }
  399. }
  400.  
  401. on ^&*:CHAT:*:{
  402.   if ($mts.event(textquery)) {
  403.     .mtsvars echo $color(normal) -mlt = $+ $nick
  404.     .set -nu %::nick $nick
  405.     .set -nu %::address $iif($address,$v1,N/A)
  406.     .set -nu %::text $1-
  407.     .set -u %::cnick $ncolor($nick)
  408.     .set -nu %::nick $+(,%::cnick,$nick,)
  409.     .theme.text
  410.   }
  411. }
  412.  
  413. on ^&*:TEXT:*:*:mts.tan $1-
  414.  
  415. on ^&*:ACTION:*:*:mts.tan $1-
  416.  
  417. on ^&*:NOTICE:*:*:mts.tan $1-
  418.  
  419. on &*:INPUT:?:mts.inp $1-
  420.  
  421. on &*:INPUT:=:mts.inp $1-
  422.  
  423. on &*:INPUT:#:{
  424.   if ($gettok($readini(mirc.ini,options,n1),23,44)) && ($2) && ($left($1,1) == !) && ($remfirst($1,1) ison $chan) {
  425.     msg $v1 $1-
  426.     .halt
  427.   }
  428.   mts.inp $1-
  429. }
  430.  
  431. on ^*:NOTIFY:.uno
  432.  
  433. on ^*:UNOTIFY:.uno
  434.  
  435. on ^&*:JOIN:#:.tjp $event $+ $iif($nick == $me,self)
  436.  
  437. on ^&*:PART:#:if ($nick != $me) .tjp $event $1-
  438.  
  439. on ^&*:NICK:{
  440.   if ($mts.event($iif($nick == $me,nickself,nick))) {
  441.     .set -nu %::nick $nick
  442.     .set -nu %::newnick $newnick
  443.     .set -nu %::address $iif($address,$v1,N/A)
  444.     .loopt $newnick
  445.   }
  446. }
  447.  
  448. on ^&*:QUIT:{
  449.   if ($mts.event(quit)) {
  450.     .set -nu %::nick $nick
  451.     .set -nu %::address $iif($address != $null,$v1,N/A)
  452.     .set -nu %::text $1-
  453.     .loopt $nick
  454.   }
  455. }
  456.  
  457. ctcp &*:*:*:{
  458.   if ($mts.event($iif($chan,ctcpchan,ctcp))) {
  459.     if ($1 == VERSION) || ($1 == DCC) || ($1 == SOUND) return
  460.     .mtsvars echo $color(ctcp) - $+ $iif($mts.onactive(ctcps),$mts.as,s) $+ t
  461.     .set -nu %::nick $nick
  462.     .set -nu %::address $iif($address,$v1,N/A)
  463.     .set -nu %::chan $chan
  464.     .set -nu %::ctcp $1
  465.     .set -nu %::text $2-
  466.     if ($1 == PING) .set -un %reply $2-
  467.     elseif ($1- == TIME) .set -un %reply $fulldate
  468.     elseif ($1- == FINGER) .set -un %reply $fullname ( $+ $emailaddr $+ ) Idle $idle second(s) $readini(mirc.ini,text,finger)
  469.     if (%reply) .ctcpreply $nick $1 %reply
  470.     .theme.text
  471.   }
  472. }
  473.  
  474. on &*:CTCPREPLY:*:{
  475.   if ($mts.event(ctcpreply)) {
  476.     .mtsvars echo $color(ctcp) - $+ $iif($mts.onactive(ctcps),$mts.as,s) $+ t
  477.     .set -nu %::nick $nick
  478.     .set -nu %::chan $chan
  479.     .set -nu %::ctcp $1
  480.     if ($1 == ping) .set -nu %::text $calc($ctime - $2) sec(s)
  481.     else .set -nu %::text $2-
  482.     .theme.text
  483.   }
  484. }
  485.  
  486. on &*:DNS:{
  487.   .var %t = $iif($dns(0) > 0,dnsresolve,dnserror)
  488.   if ($mts.event(%t)) {
  489.     .mtsvars echo $color(other) - $+ $mts.as
  490.     if (%t == dnsresolve) {
  491.       .var %i = 1
  492.       .while ($dns(%i)) {
  493.         .set -nu %::nick $dns(%i).nick
  494.         .set -nu %::address $dns(%i)
  495.         .set -nu %::iaddress $dns(%i).ip
  496.         .set -nu %::naddress $dns(%i).addr
  497.         .set -nu %::raddress $remtok(%::iaddress %::naddress,%::address,1,32)
  498.         .theme.text
  499.         .inc %i
  500.       }
  501.     }
  502.     else {
  503.       .set -nu %::address $address
  504.       .set -nu %::iaddress $iaddress
  505.       .set -nu %::raddress $raddress
  506.       .set -nu %::naddress $naddress
  507.       .theme.text
  508.     }
  509.   }
  510. }
  511.  
  512.  
  513. on ^&*:USERMODE:{
  514.   if ($mts.event(modeuser)) {
  515.     .mtsvars echo $color(mode) -s
  516.     .set -nu %::nick $nick
  517.     .set -nu %::modes $1-
  518.     .theme.text
  519.   }
  520. }
  521.  
  522. on ^&*:ERROR:*:{
  523.   if ($mts.event(servererror)) {
  524.     .mtsvars echo $color(info) -st
  525.     .set -nu %::text $1-
  526.     .theme.text
  527.     .halt
  528.   }
  529. }
  530.  
  531. on ^&*:INVITE:#:{
  532.   if ($mts.event($event)) {
  533.     .mtsvars echo $color(invite) - $+ $iif($mts.onactive(invites),$mts.as,s) $+ t
  534.     .set -nu %::nick $nick
  535.     .set -nu %::address $iif($address != $null,$v1,N/A)
  536.     .set -nu %::chan $chan
  537.     .set -nu %::text $1-
  538.     .theme.text
  539.   }
  540. }
  541.  
  542. on ^&*:SNOTICE:*:{
  543.   if ($mts.event(noticeserver)) {
  544.     .mtsvars echo $color(notice) -at
  545.     .set -nu %::nick $nick
  546.     .set -nu %::address $iif($address != $null,$v1,N/A)
  547.     .set -nu %::text $1-
  548.     .theme.text
  549.   }
  550. }
  551.  
  552. on ^&*:WALLOPS:*:{
  553.   if ($mts.event($event)) {
  554.     .mtsvars echo  $color(wallops) -st
  555.     .set -nu %::nick $nick
  556.     .set -nu %::address $iif($address != $null,$v1,N/A)
  557.     .set -nu %::text $1-
  558.     .theme.text
  559.   }
  560. }
  561.  
  562. on ^&*:RAWMODE:#:{
  563.   if ($mts.event(mode)) {
  564.     .var %t = $mtsplace(mode)
  565.     if (%t == 2) .halt
  566.     elseif (%t == 1) var %t = echo $color(mode) -ts
  567.     else var %t = echo $color(mode) -t $chan
  568.     .mtsvars %t
  569.     .set -u %::nick $nick
  570.     .set -u %::address $iif($address,$v1,N/A)
  571.     .set -u %::chan $chan
  572.     .set -u %::modes $1-
  573.     .theme.text
  574.   }
  575. }
  576.  
  577. on ^&*:TOPIC:#:{
  578.   if ($mts.event($event)) {
  579.     .var %t = $mtsplace($event)
  580.     if (%t == 2) .halt
  581.     elseif (%t == 1) .var %t = echo $color(topic) -as
  582.     else .var %t = echo $color(topic) -t $chan
  583.     .mtsvars %t
  584.     .set -u %::nick $nick
  585.     .set -u %::address $iif($address,$v1,N/A)
  586.     .set -u %::chan $chan
  587.     .set -u %::text $1-
  588.     .theme.text
  589.   }
  590. }
  591.  
  592. on ^&*:KICK:#:{
  593.   .var %t = $iif($knick == $me,kickself,$event)
  594.   if ($mts.event(%t)) {
  595.     .var %m = $mtsplace($event)
  596.     if (%m == 2) .halt
  597.     elseif (%m == 1) .var %m = echo $color(kick) -ts
  598.     else .var %m = echo $color(kick) $iif(%t == kickself,$iif($window($chan),-t $chan,-st),-t $chan)
  599.     .mtsvars %m
  600.     .set -u %::nick $nick
  601.     .set -u %::address $iif($address,$v1,N/A)
  602.     .set -u %::chan $chan
  603.     .set -u %::knick $knick
  604.     .set -u %::kaddress $iif($address($knick,5),$v1,N/A)
  605.     .set -u %::text $1-
  606.     .theme.text
  607.   }
  608. }
  609.  
  610. raw 001:*:{
  611.   if ($gettok($readini(mirc.ini,options,n1),11,44) == 1) .hadd -m motd $cid 1
  612.   if ($mtsret(options,lusers)) .hadd -m lusers $cid 1
  613.   .raw.aux -s $2-
  614. }
  615.  
  616. raw 372:*:.raw.aux6 $1-
  617.  
  618. raw 377:*:.raw.aux6 $1-
  619.  
  620. raw 378:*:.raw.aux6 $1-
  621.  
  622. raw 375:*:.raw.aux6 $1-
  623.  
  624. raw 376:*:{
  625.   if ($hget(motd,$cid)) {
  626.     .hdel motd $cid
  627.     .halt
  628.   }
  629.   raw.aux -s $2-
  630. }
  631.  
  632. raw 474:*:.raw.aux -s $2-
  633.  
  634. raw 421:*:.raw.aux -s $2-
  635.  
  636. raw 315:*:.raw.aux -s $2-
  637.  
  638. raw 367:*:.raw.aux -s $2-
  639.  
  640. raw 368:*:.raw.aux -s $2-
  641.  
  642. raw 366:*:{
  643.   if ($hget(join,names. $+ $2 $+ $cid) == 1) && ($mtsh(current)) {
  644.     .hdel join names. $+ $2 $+ $cid
  645.     .halt
  646.   }
  647.   if ($hget(join,chaninfo. $+ $2 $+ $cid) == 1) && ($mtsh(current)) {
  648.     .hdel join chaninfo. $+ $2 $+ $cid
  649.     .halt
  650.   }
  651.   .raw.aux -s $2-
  652. }
  653.  
  654. raw 332:*:{
  655.   if ($halted) return
  656.   if ($hget(join,$+(topic.,$2,$cid))) .halt
  657.   if ($mts.event(raw.332)) || ($mts.event(raw.other)) {
  658.     .mtsvars echo $color(join) -t $2  $+ $chr(9) $+ $3-
  659.     .set -u %::chan $2
  660.     .set -u %::nick $2
  661.     .set -u %::nick $2
  662.     .theme.text $+(raw.,$numeric)
  663.     .halt
  664.   }
  665. }
  666.  
  667. raw 352:*:{
  668.   if ($halted) return
  669.   if ($mts.event(raw.352)) || ($mts.event(raw.other)) {
  670.     .mtsvars echo $color(other) -s $+ $chr(9) $+ $2-
  671.     .set -u %::nick $6
  672.     .set -u %::address $3 $+ @ $+ $4
  673.     .set -u %::wserver $5
  674.     .set -u %::away $iif(h isin $7,h,g)
  675.     .set -u %::cmode $iif(. isin $7,.,$iif(@ isin $7,@,$iif(% isin $7,%,$iif(+ isin $7,+))))
  676.     .set -u %::isoper is $iif(* !isin $7,not)
  677.     .set -u %::value $8
  678.     .set -u %::realname $9-
  679.     .set -u %::text $3-
  680.     .theme.text $+(raw.,$numeric)
  681.     .halt
  682.   }
  683. }
  684.  
  685. raw 333:*:{
  686.   if ($halted) return
  687.   if ($hget(join,$+(topic.,$2,$cid))) {
  688.     .hdel join $+(topic.,$2,$cid)
  689.     .halt
  690.   }
  691.   if ($mts.event(raw.333)) || ($mts.event(raw.other)) {
  692.     .mtsvars echo $color(join) -t $2 $+ $chr(9) $+ $2-
  693.     .set -u %::nick $3
  694.     .set -u %::value $4
  695.     .set -u %::text $asctime($4)
  696.     .theme.text $+(raw.,$numeric)
  697.     .halt
  698.   }
  699. }
  700.  
  701. raw 353:*:{
  702.   if ($halted) return
  703.   if ($hget(join,names. $+ $3 $+ $cid)) .halt
  704.   if ($mts.event(raw.353)) || ($mts.event(raw.other)) {
  705.     .mtsvars echo $color(other) -s $+ $chr(9) $+ $2-
  706.     .set -u %::chan $3
  707.     .set -u %::text $4-
  708.     .theme.text $+(raw.,$numeric)
  709.     .halt
  710.   }
  711. }
  712.  
  713. raw 329:*:{
  714.   if ($halted) return
  715.   if ($mtsret(options,chaninfo)) .halt
  716.   if ($mts.event(raw.329)) || ($mts.event(raw.other)) {
  717.     .mtsvars echo $color(join) -t $2 $+ $chr(9) $+ $2-
  718.     .set -u %::value $3
  719.     .set -u %::text $asctime($3)
  720.     .theme.text $+(raw.,$numeric)
  721.     .halt
  722.   }
  723. }
  724.  
  725. raw 324:*:{
  726.   if (%raw_324 == $2) { unset %raw_324 | return }
  727.   if ($halted) return
  728.   if ($mtsret(options,chaninfo)) .halt
  729.   if ($mts.event(raw.324)) || ($mts.event(raw.other)) {
  730.     .mtsvars echo $color(join) -t $2 $+ $chr(9) $+ $2-
  731.     .set -u %::modes $3-
  732.     .theme.text $+(raw.,$numeric)
  733.     set -e %raw_324 $2
  734.     .halt
  735.   }
  736. }
  737.  
  738. raw 341:*:{
  739.   if ($halted) return
  740.   if ($mts.event(raw.341)) || ($mts.event(raw.other)) {
  741.     .mtsvars echo $color(other) -s $+ $chr(9) $+ $2-
  742.     .set -u %::nick $2
  743.     .set -u %::chan $3
  744.     .theme.text $+(raw.,$numeric)
  745.     .halt
  746.   }
  747. }
  748.  
  749. raw 251:*:{
  750.   if ($halted) return
  751.   if ($hget(lusers,$cid)) .halt
  752.   if ($mts.event(raw.251)) || ($mts.event(raw.other)) {
  753.     .mtsvars echo $color(other) -s $+ $chr(9) $+ $2-
  754.     .set -u %::users $4
  755.     .set -u %::text $6
  756.     .set -u %::value $11
  757.     .theme.text $+(raw.,$numeric)
  758.     .halt
  759.   }
  760. }
  761.  
  762. raw 255:*:.raw.aux2 3 6 $2-
  763.  
  764. raw 265:*:.raw.aux2 4 6 $2-
  765.  
  766. raw 266:*:.raw.aux2 4 6 $2-
  767.  
  768. raw 302:*:{
  769.   if ($halted) return
  770.   if ($mts.event(raw.302)) || ($mts.event(raw.other)) {
  771.     .mtsvars echo $color(other) -s $+ $chr(9) $+ $2-
  772.     .set -u %::nick $remove($gettok($2,1,61),-,*)
  773.     .set -u %::address $remove($gettok($2,2,61),-,*)
  774.     .theme.text $+(raw.,$numeric)
  775.     .halt
  776.   }
  777. }
  778.  
  779. raw 311:*:.raw.aux5 $1-
  780.  
  781. raw 314:*:.raw.aux5 $1-
  782.  
  783. raw 301:*:{
  784.   if ($halted) return
  785.   .var %t = $iif($hget($+(whois.,$2,$cid),311),whois,whowas)
  786.   if ($mts.event(raw.301)) || ($mts.event(%t)) || ($mts.event(raw.other)) {
  787.     .hadd -m $+(whois.,$2,$cid) $numeric $3-
  788.     if ($mtsget($mtsh(current),raw.301)) {
  789.       .var %t = $hget($+(whois.,$2,$cid),311)
  790.       .mtsvars echo $color(whois) - $+ $iif(!%t && $query($active) && $mts.onactive(away),a,$iif($mts.onactive(whois) && %t,$mts.as,s)) $+ $chr(9) $+ $3-
  791.       .set -u %::nick $2
  792.       .set -u %::away $3-
  793.       .theme.text $+(raw.,$numeric)
  794.     }
  795.     .halt
  796.   }
  797. }
  798.  
  799. raw 307:*:{
  800.   if ($halted) return
  801.   .var %t = $iif($hget($+(whois.,$2,$cid),311),whois,whowas)
  802.   if ($mts.event(raw.307)) || ($mts.event(%t)) || ($mts.event(raw.other)) {
  803.     .hadd -m $+(whois.,$2,$cid) $numeric is
  804.     if ($mtsget($mtsh(current),raw.307)) {
  805.       .mtsvars echo $color(whois) - $+ $iif($mts.onactive(whois),$mts.as,s) $+ $chr(9) $+ $2-
  806.       .set -u %::nick $2
  807.       .set -u %::isregd is
  808.       .theme.text $+(raw.,$numeric)
  809.     }
  810.     .halt
  811.   }
  812. }
  813.  
  814. raw 317:*:{
  815.   if ($halted) return
  816.   .var %t = $iif($hget($+(whois.,$2,$cid),311),whois,whowas)
  817.   if ($mts.event(raw.317)) || ($mts.event(%t)) || ($mts.event(raw.other)) {
  818.     .hadd -m $+(whois.,$2,$cid) $numeric $3-
  819.     if ($mtsget($mtsh(current),raw.317)) {
  820.       .mtsvars echo $color(whois) - $+ $iif($mts.onactive(whois),$mts.as,s) $+ $chr(9) $+ $2-
  821.       .set -u %::nick $2
  822.       .set -u %::idletime $3
  823.       .set -u %::signontime $asctime($4)
  824.       .theme.text $+(raw.,$numeric)
  825.     }
  826.     .halt
  827.   }
  828. }
  829.  
  830. raw 319:*:{
  831.   if ($halted) return
  832.   .var %t = $iif($hget($+(whois.,$2,$cid),311),whois,whowas)
  833.   if ($mts.event(raw.319)) || ($mts.event(%t)) || ($mts.event(raw.other)) {
  834.     .hadd -m $+(whois.,$2,$cid) $hget($+(whois.,$2,$cid),$numeric) $numeric $3-
  835.     if ($mtsget($mtsh(current),raw.319)) {
  836.       .mtsvars echo $color(whois) - $+ $iif($mts.onactive(whois),$mts.as,s) $+ $chr(9) $+ $2-
  837.       .set -u %::nick $2
  838.       .set -u %::chan $3-
  839.       .theme.text $+(raw.,$numeric)
  840.     }
  841.     .halt
  842.   }
  843. }
  844.  
  845. raw 312:*:{
  846.   if ($halted) return
  847.   .var %t = $iif($hget($+(whois.,$2,$cid),311),whois,whowas)
  848.   if ($mts.event(raw.312)) || ($mts.event(%t)) || ($mts.event(raw.other)) {
  849.     .hadd -m $+(whois.,$2,$cid) $numeric $3-
  850.     if ($mtsget($mtsh(current),raw.312)) {
  851.       .mtsvars echo $color(whois) - $+ $iif($mts.onactive(whois),$mts.as,s) $+ $chr(9) $+ $2-
  852.       .set -u %::nick $2
  853.       .set -u %::wserver $3
  854.       .set -u %::serverinfo $4-
  855.       .theme.text $+(raw.,$numeric)
  856.     }
  857.     .halt
  858.   }
  859. }
  860.  
  861. raw 313:*:{
  862.   if ($halted) return
  863.   .var %t = $iif($hget($+(whois.,$2,$cid),311),whois,whowas)
  864.   if ($mts.event(raw.313)) || ($mts.event(%t)) || ($mts.event(raw.other)) {
  865.     .hadd -m $+(whois.,$2,$cid) $numeric $3-
  866.     if ($mtsget($mtsh(current),raw.313)) {
  867.       .mtsvars echo $color(whois) - $+ $iif($mts.onactive(whois),$mts.as,s) $+ $chr(9) $+ $2-
  868.       .set -u %::nick $2
  869.       .set -u %::isoper is
  870.       .set -u %::operline $3-
  871.       .theme.text $+(raw.,$numeric)
  872.     }
  873.     .halt
  874.   }
  875. }
  876.  
  877. raw 316:*:.raw.aux3 $1-
  878.  
  879. raw 330:*:.raw.aux3 $1-
  880.  
  881. raw 309:*:.raw.aux3 $1-
  882.  
  883. raw 308:*:.raw.aux3 $1-
  884.  
  885. raw 379:*:.raw.aux3 $1-
  886.  
  887. raw 310:*:.raw.aux3 $1-
  888.  
  889. raw 441:*:.raw.aux4 $1-
  890.  
  891. raw 443:*:.raw.aux4 $1-
  892.  
  893. raw 318:*:.aux.318.369 $1-
  894.  
  895. raw 369:*:.aux.318.369 $1-
  896.  
  897. raw *:*:{
  898.   if ($halted) return
  899.   if ($hget(lusers,$cid)) && ($numeric >= 252) && ($numeric <= 254) && ($mtsh(current)) .halt
  900.   if (!$istok(600.601.602.603.604.605.606.321.322.323.364.365,$numeric,46)) .raw.aux -s $2-
  901. }
  902.  
  903. ;; Commands & identifiers
  904.  
  905. alias mts if (!$dialog(mts)) .dialog -m mts mts
  906.  
  907. alias -l stdc return $dialog(colors,colors)
  908.  
  909. alias -l mtsmdx dll " $+ $mtsret(main,mdx) $+ mdx.dll $+ " $1-
  910.  
  911. alias -l mtsviews return $mtsret(main,mdx) $+ views.mdx
  912.  
  913. alias -l mtsctl_gen return $mtsret(main,mdx) $+ ctl_gen.mdx
  914.  
  915. alias setmtsmdx {
  916.   .mtsmdx SetMircVersion $version
  917.   .mtsmdx MarkDialog $dname $dialog($dname).hwnd
  918. }
  919.  
  920. alias mtspopups  {
  921.   .var %t = $mtsret(main,popups)
  922.   if ($isid) return $dll(%t,$1,$2)
  923.   else .dll " $+ %t $+ " $1-
  924. }
  925.  
  926. alias -l remfirst return $right($1,$calc($len($1) - $2))
  927.  
  928. alias -l remlast return $left($1,$calc($len($1) - $2))
  929.  
  930. alias mtsinfo {
  931.   if (!$dialog(mtsinfo)) .dialog -hm mtsinfo mtsinfo  
  932.   .did -ra mtsinfo 2 Info on theme: $nopath($1-)
  933.   .did -ra mtsinfo 4 Name: $mtsinfo.aux($1-,name) $mtsget($1-,version)
  934.   .did -ra mtsinfo 5 Author: $mtsinfo.aux($1-,author)
  935.   .did -ra mtsinfo 6 $mtsinfo.aux($1-,email)
  936.   .did -ra mtsinfo 8 $mtsinfo.aux($1-,website)
  937.   .did -ra mtsinfo 9 MTS Version: $mtsinfo.aux($1-,mtsversion)
  938.   .did -ra mtsinfo 11 $mtsinfo.aux($1-,description)
  939. }
  940.  
  941. alias mtsopt if (!$dialog(mtsopt)) .dialog -hm mtsopt mtsopt
  942.  
  943. alias -l mtsadd {
  944.   .var %dir = $$sfile(mts\ $+ *.mts,Choose an MTS theme,Ok)
  945.   if (!$read($mtspath(mts.tl),wn,%dir)) {
  946.     .write $mtspath(mts.tl) %dir
  947.     .did -ac mts 1 $nopath(%dir)
  948.     .dm $calc($did(mts,1).sel - 1)
  949.   }
  950. }
  951.  
  952. alias -l mtsedit if ($did(mts,1).sel) .run notepad.exe $read($mtspath(mts.tl),n,$calc($v1 - 1))
  953.  
  954. alias -l mtsdel {
  955.   if ($did(mts,1).sel) {
  956.     .var %t = $v1
  957.     .did -d mts 1 %t
  958.     .write -dl $calc(%t - 1) $mtspath(mts.tl)
  959.     if ($did(mts,1,2)) {
  960.       if ($did(mts,1).lines >= %t) did -c mts 1 %t
  961.       else .did -c mts 1 $calc(%t - 1)
  962.       .dm $calc($did(mts,1).sel - 1)
  963.     }
  964.     else .clearinfo
  965.   }
  966. }
  967.  
  968. alias country {
  969.   if ($1) {
  970.     if ($readini($mtspath(country.ini),country,$gettok($1,-1,46))) return $v1
  971.     elseif ($gettok($1,1,46) == 127) return Fake Host
  972.     elseif ($remove($1,.) isnum) return Numeric IP
  973.     else return N/A
  974.   }
  975. }
  976.  
  977. alias mts.version return 1.3
  978.  
  979. alias -l mtsget {
  980.   if ($2) {
  981.     .var %t = $iif($3,ns,s)
  982.     if ($1 isnum) return $read($read($mtspath(mts.tl),$1),%t,$2)
  983.     else return $read($1,%t,$2)
  984.   }
  985. }
  986.  
  987. alias mtshelp .run $mtspath(contents.htm)
  988.  
  989. alias mtspre {
  990.   if ($isfile($3-)) {
  991.     .var %fpreview = $mtspath($1 $+ \ $+ $nopath($3-) $+ - $+ $2 $+ .bmp)
  992.     if ($isfile(%fpreview)) {
  993.       $iif($1 == small,showpre,showprel) %fpreview
  994.       return
  995.     }
  996.     .dialog -hm preaux preaux
  997.     .did -a preaux 1 Loading MTS preview
  998.     .mtssch $2-
  999.     if ($isfile($mtspath(preview.mts))) .remove $mtspath(preview.mts)
  1000.     .savebuf @mtsp1 $mtspath(preview.mts)
  1001.     .window -c @mtsp1
  1002.     if ($window(@mtsp2)) .window -c @mtsp2
  1003.     .var %f = $shortfn($mtspath(preview.mts))
  1004.     .set -u %p.colors $mtsget(%f,colors)
  1005.     if (!%p.colors) set -u %p.colors $cdef
  1006.     .set -u %p.basecolors $mtsget(%f,basecolors)
  1007.     .set -u %p.rgbcolors $mtsget(%f,rgbcolors)
  1008.     if (!%p.rgbcolors) set -u %p.rgbcolors $rgbdef
  1009.     .set -u %p.fontchan $mtsget(%f,fontchan)
  1010.     .set -u %p.clinecharop $mtsget(%f,clinecharop)
  1011.     .set -u %p.clinecharvoice $mtsget(%f,clinecharvoice)
  1012.     .set -u %p.parentext $mtsget(%f,parentext)
  1013.     .set -u %p.clineme $mtsget(%f,clineme)
  1014.     .set -u %p.clineop $mtsget(%f,clineop)
  1015.     .set -u %p.clinevoice $mtsget(%f,clinevoice)
  1016.     if ($mtsget(%f,basecolors)) {
  1017.       .set -u %::c1  $+ $gettok(%p.basecolors,1,44)
  1018.       .set -u %::c2  $+ $gettok(%p.basecolors,2,44)
  1019.       .set -u %::c3  $+ $gettok(%p.basecolors,3,44)
  1020.       .set -u %::c4  $+ $gettok(%p.basecolors,4,44)
  1021.     }
  1022.     .set -u %p.script $shortfn($nofile($3-) $+ $mtsget(%f,script))
  1023.     .set -u %::pre $mtspre.aux($mtsget(%f,prefix))
  1024.     .set -u %::parentext $mtspre.aux($mtsget(%f,parentext))
  1025.     .set -u %::timestamp $mtspre.aux($mtsget(%f,timestamp))
  1026.     .set -u %::timestampformat $time($mtspre.aux($mtsget(%f,timestampformat)))
  1027.     if ($isfile(%p.script)) && (!$script(%p.script)) {
  1028.       .load -rs %p.script
  1029.       .var %unload = 1
  1030.     }
  1031.     if (%::timestamp != off) && (%::timestamp != on) && (%::timestamp) .set -u %::timestampformat $time(%::timestamp)
  1032.     if (!%::timestampformat) .set -u %::timestampformat $time((HH:nn))
  1033.     .set -u %pre.ts $iif(%::timestamp,$v1,off)
  1034.     .set -u %::timestamp %::timestampformat
  1035.     if ($window(@pretext)) .window -c @pretext
  1036.     .window -h @pretext
  1037.     .set -u %::me $+(,%p.clineme,$me,)
  1038.     .set -u %::chan #anaconda
  1039.     .set -u %::nick FreΠ
  1040.     .set -u %::address MTS@loader.pt
  1041.     .set -u %::text See you later!
  1042.     .set -u %::modes +v $me
  1043.     .set -u %::ctcp PING
  1044.     .mtspre.aux2 8 joinself %f * Now talking in #anaconda
  1045.     .mtspre.aux2 8 join %f * FreΠ has joined #anaconda
  1046.     .mtspre.aux2 17 part %f * FreΠ has left #anaconda
  1047.     .set -u %::nick Snake
  1048.     .mtspre.aux2 10 mode %f * Snake sets mode: +v $me
  1049.     .set -u %::nick $+(,%p.clineop,SolidSnake)
  1050.     .set -u %::cmode $iif(%p.clinecharop,$+(,$v1,),@)
  1051.     .set -u %::text Grettings my friend
  1052.     .mtspre.aux2 12 textchan %f <Snake> %::text
  1053.     .set -u %::nick $+(,%p.clineop,LordNykon)
  1054.     .set -u %::text getting boring from this channel
  1055.     .mtspre.aux2 2 actionchan %f * LordNykon %::text
  1056.     .set -u %::nick [47]
  1057.     .set -u %::text $ctime
  1058.     .mtspre.aux2 3 ctcp %f [[47] PING]
  1059.     .set -u %::cmode $iif(%p.clinecharvoice,$+(,$v1,),+)
  1060.     .set -u %::text What channel is this?
  1061.     .mtspre.aux2 16 textchanself %f < $+ $me $+ > %::text
  1062.     .set -u %::text Quit: Anything that can go wrong, will go wrong
  1063.     .mtspre.aux2 18 quit %f * [47] has quit IRC ( $+ %::text $+ )
  1064.     .set -u %::nick [MissManson]
  1065.     .set -u %::chan #hot
  1066.     .mtspre.aux2 7 invite %f * [MissManson] invites you to join #hot
  1067.     .set -u %::nick Lazarus
  1068.     .set -u %::text Hello, why don't you join #burro?
  1069.     .mtspre.aux2 13 notice %f - $+ Lazarus $+ - %::text
  1070.     if ($1 != small) {
  1071.       .set -u %::nick Snake
  1072.       .set -u %::newnick SolidSnake
  1073.       .set -u %::chan #anaconda
  1074.       .set -u %::text I don't like your nick!
  1075.       .mtspre.aux2 9 kickself %f * You were kicked from #anaconda by Snake ( $+ %::text $+ )
  1076.       .mtspre.aux2 8 joinself %f * Rejoined channel #anaconda
  1077.       .mtspre.aux2 11 nick %f * Snake is now known as SolidSnake
  1078.       .set -u %::text MTS loader 1.71 for mIRC 6.16
  1079.       .set -u %::nick SolidSnake
  1080.       .mtspre.aux2 19 topic %f * SolidSnake changes topic to ' $+ %::text $+ '
  1081.       .set -u %::value SolidSnake
  1082.       .set -u %::fromserver $nick
  1083.       .set -u %::isoper is not
  1084.       .set -u %::isregd is not
  1085.       .set -u %::realname Classified
  1086.       .set -u %::country $country(pt)
  1087.       .set -u %::isregd is
  1088.       .set -u %::idletime 47
  1089.       .set -u %::signontime $asctime($ctime)
  1090.       .set -u %::wserver irc.ptnet.org
  1091.       .set -u %::serverinfo Portuguese IRC server
  1092.       .set -u %::isoper is not
  1093.       if ($mtsget(%f,whois)) {
  1094.         .set -u %::numeric 318
  1095.         .var %p.whois = $theme.parse($v1)
  1096.         .set -u %:echo aline @pretext 21
  1097.         if ($gettok(%p.whois,1,32) == !script) {
  1098.           if ($gettok(%p.whois,2-,32)) $v1
  1099.         }
  1100.         else .aline @pretext 21 %p.whois
  1101.       }
  1102.       else {
  1103.         .set -u %::numeric 311
  1104.         .mtspre.aux2 21 raw.311 %f SolidSnake is %::address *  $name
  1105.         .set -u %::numeric 307
  1106.         .mtspre.aux2 21 raw.307 %f SolidSnake is a registered and identified nick
  1107.         .set -u %::numeric 319
  1108.         .mtspre.aux2 21 raw.319 %f SolidSnake on #anaconda
  1109.         .set -u %::numeric 312
  1110.         .mtspre.aux2 21 raw.312 %f SolidSnake using irc.ptnet.org Portuguese IRC server
  1111.         .set -u %::numeric 317
  1112.         .mtspre.aux2 21 raw.317 %f SolidSnake has been idle 47secs, signed on %::signontime
  1113.         .set -u %::numeric 318
  1114.         .mtspre.aux2 21 raw.318 %f SolidSnake End of /WHOIS list.
  1115.       }
  1116.     }
  1117.     if ($window(@preview)) window -c @preview
  1118.     if ($mtsret(main,accurate)) && (%p.rgbcolors) {
  1119.       .var %i = 0
  1120.       .while (%i <= 15) {
  1121.         .var %rgbcurrent = %rgbcurrent $rgb($color(%i))
  1122.         .inc %i
  1123.       }
  1124.       .loadc1 %p.rgbcolors
  1125.       .color -ls mIRC Classic
  1126.     }
  1127.     .window -Bph +d @preview -1 -1 $iif($1 == small,280 146,499 290)
  1128.     .var %i = 1
  1129.     .while (%i <= 16) {
  1130.       .var %c = %c $rgb( [ $mts.namergb($gettok(%p.rgbcolors,%i,32)) ] )
  1131.       .inc %i
  1132.     }
  1133.     .var %preback = $gettok(%c,$calc($gettok(%p.colors,1,44) + 1),32)
  1134.     .drawfill -r @preview %preback %preback 1 1
  1135.     .var %prefont = " $+ $gettok(%p.fontchan,1,44) $+ "
  1136.     .var %presize = $gettok(%p.fontchan,2,44)
  1137.     .var %i = 1
  1138.     .var %l = $line(@pretext,0)
  1139.     .while ($line(@pretext,%i)) {
  1140.       .var %precolor = $gettok(%c,$calc($gettok(%p.colors,$gettok($v1,1,32),44) + 1),32)
  1141.       .var %preline = $gettok($v1,2-,32)
  1142.       .var %t = $iif(%pre.ts != off,%::timestamp) %preline
  1143.       .drawtext -rpb @preview %precolor %preback %prefont %presize 3 $iif(%i != 1,$calc(1 + ((%i - 1) * $height(%preline,%prefont,%presize))),1) $iif(%rgbcurrent,%t,$strip(%t,c))
  1144.       .did -a preaux 2 %i 0 %l
  1145.       .inc %i
  1146.     }
  1147.     if (%rgbcurrent) {
  1148.       .loadc1 $v1
  1149.       .color -ls mIRC Classic
  1150.     }
  1151.     .dialog -x preaux
  1152.     .drawsave @preview %fpreview
  1153.     if ($dialog(mts)) && ($1 == small) {
  1154.       .showpre %fpreview
  1155.       .did -v mts 14
  1156.       .did -e mts 37
  1157.     }
  1158.     else .showprel %fpreview
  1159.     .remove $mtspath(preview.mts)
  1160.     .window -c @preview
  1161.     .window -c @pretext
  1162.     if (%unload) .unload -rs %p.script
  1163.   }
  1164. }
  1165.  
  1166. alias mtsload {
  1167.   if ($isfile($2-)) {
  1168.     if ($mtsget($2-,mtsversion) > $mts.version) {
  1169.       .var %v = $input(This theme is meant for MTS format $v1 $+ . This theme loader is meant for $mts.version $+ . Procced?,yvq,Clone Scan)
  1170.       if (%v == $no) return
  1171.     }
  1172.     if ($mtsret(main,minimize)) .wins -n
  1173.     if ($mtsret(main,clear)) .clearall
  1174.     .dialog -hm preaux preaux
  1175.     .dialog -t preaux MTS load
  1176.     .did -a preaux 1 Generating source
  1177.     .current.unload
  1178.     .mtssch $1-
  1179.     if ($isfile($mtspath(current.mts))) .remove $mtspath(current.mts)
  1180.     .savebuf @mtsp1 $mtspath(current.mts)
  1181.     .window -c @mtsp1
  1182.     if ($window(@mtsp2)) .window -c @mtsp2
  1183.     .did -a preaux 2 1 0 9
  1184.     .var %f = $mtspath(current.mts)
  1185.     if (!$hget(mts)) .hmake mts 20
  1186.     if ($load.aux5(colors)) {
  1187.       .did -ra preaux 1 .Loading colors
  1188.       .hadd mts basecolors $mtsget(%f,basecolors)
  1189.       if ($mtsget(%f,rgbcolors)) {
  1190.         .hadd mts rgbcolors $v1
  1191.         .loadc1 $mtsh(rgbcolors)
  1192.       }
  1193.       else .rgbrst
  1194.       if ($mtsget(%f,colors)) {
  1195.         .hadd mts colors $v1
  1196.         .loadc2 $mtsh(colors)
  1197.       }
  1198.       else .colorrst
  1199.     }
  1200.     else {
  1201.       .colorrst
  1202.       .rgbrst
  1203.     }
  1204.     .did -a preaux 2 2 0 9
  1205.     .clinerst
  1206.     .did -ra preaux 1 Loading nickcolors
  1207.     if ($mtsret(options,nickcolors)) {
  1208.       .load.aux7 m0 yourself
  1209.       .load.aux7 om0 autoop
  1210.       .load.aux7 vm0 autovoice
  1211.       .load.aux7 pm0 protect
  1212.       .load.aux7 ym0 notify
  1213.       .load.aux7 im0 ignore
  1214.       .load.aux7 m0 owner .
  1215.       .load.aux7 m0 owner ~
  1216.       .load.aux7 m0 admin &
  1217.       .load.aux7 m0 op @
  1218.       .load.aux7 m0 hop %
  1219.       .load.aux7 m0 voice +
  1220.       .load.aux7 m0 regular
  1221.     }
  1222.     elseif ($load.aux5(nicks)) {
  1223.       if ($mtsget(%f,clineme) != $null) .cnick -m0 $!me $v1
  1224.       if ($mtsget(%f,clinefriend) != $null) {
  1225.         .cnick -om0 * $v1
  1226.         .cnick -vm0 * $v1
  1227.         .cnick -pm0 * $v1
  1228.         .cnick -ym0 * $v1
  1229.       }
  1230.       if ($mtsget(%f,clineenemy) != $null) .cnick -im0 * $v1
  1231.       .load.aux6 clineowner . %f
  1232.       .load.aux6 clineowner ~ %f
  1233.       .load.aux6 clineop & %f
  1234.       .load.aux6 clineop @ %f
  1235.       .load.aux6 clinehop % %f
  1236.       .load.aux6 clinevoice + %f
  1237.       if ($mtsget(%f,clineregular) != $null) .cnick -m0 * $v1
  1238.     }
  1239.     .hadd mts clinecharowner $mtsget(%f,clinecharowner)
  1240.     .hadd mts clineCharop $mtsget(%f,clinecharop)
  1241.     .hadd mts clineCharhop $mtsget(%f,clinecharhop)
  1242.     .hadd mts clineCharvoice $mtsget(%f,clinecharvoice)
  1243.     .hadd mts clineCharregular $mtsget(%f,clinecharregular)
  1244.     .did -a preaux 2 3 0 9
  1245.     .hadd mts pre $load.aux2($mtsget(%f,prefix))
  1246.     .hadd mts parentext $load.aux2($mtsget(%f,parentext))
  1247.     .tsrst
  1248.     if ($load.aux5(timestamp)) {
  1249.       .did -ra preaux 1 Loading timestamp
  1250.       .hadd mts timestamp $mtsget(%f,timestamp)
  1251.       .hadd mts timestampformat $load.aux2($mtsget(%f,timestampformat))
  1252.       .timestamp on
  1253.       if ($mtsh(timestamp)) && ($mtsh(timestamp) != on) && ($mtsh(timestamp) != off) {
  1254.         .hadd mts timestampformat $load.aux2($v1)
  1255.         .timestamp -f $mtsh(timestampformat)
  1256.       }
  1257.       elseif ($mtsh(timestamp) == on) .timestamp -f $iif($mtsh(timestampformat),$v1,[HH:nn])
  1258.       else .timestamp off
  1259.     }
  1260.     .did -a preaux 2 4 0 9
  1261.     if ($load.aux5(fonts)) {
  1262.       .did -ra preaux 1 Loading fonts
  1263.       .var %j = 1
  1264.       .while ($scon(%j)) {
  1265.         scon %j
  1266.         if ($mtsget(%f,fontdefault)) {
  1267.           .hadd mts fontdefault $mtsget(%f,fontdefault)
  1268.           .font -s $load.aux3($mtsh(fontdefault))
  1269.         }
  1270.         else {
  1271.           .font -s "fixedsys" 9
  1272.           .hdel mts fontdefault
  1273.         }
  1274.         .var %t = fixedsys,9
  1275.         if ($mtsget(%f,fontchan)) {
  1276.           .hadd mts fontchan $mtsget(%f,fontchan)
  1277.           .var %font = $load.aux3($mtsh(fontchan))
  1278.         }
  1279.         else {
  1280.           .var %font = $load.aux3(%t)
  1281.           .hdel mts fontchan
  1282.         }
  1283.         .var %fchannel = $iif($mtsh(fontchan),$v1,%t)
  1284.         .var %i = 1
  1285.         .while ($chan(%i)) {
  1286.           .font $chan(%i) %font
  1287.           .inc %i
  1288.         }
  1289.         if ($mtsget(%f,fontquery)) {
  1290.           .hadd mts fontquery $mtsget(%f,fontquery)
  1291.           .var %font = $load.aux3($mtsh(fontquery))
  1292.         }
  1293.         else {
  1294.           .var %font = $load.aux3(%t)
  1295.           .hdel mts fontquery
  1296.         }
  1297.         .var %fquery = $iif($mtsh(fontquery),$v1,%t)
  1298.         .var %fchat = %fquery
  1299.         .var %i = 1
  1300.         .while ($query(%i)) {
  1301.           .font $query(%i) %font
  1302.           .inc %i
  1303.         }
  1304.         .var %i = 1
  1305.         .while ($chat(%i)) {
  1306.           .font = $+ $chat(%i) %font
  1307.           .inc %i
  1308.         }
  1309.         .inc %j
  1310.       }
  1311.       .remini mirc.ini fonts
  1312.       .writeini mirc.ini fonts fchannel %fchannel
  1313.       .writeini mirc.ini fonts fquery %fquery
  1314.       .writeini mirc.ini fonts fchat %fchat
  1315.       .font -s $load.aux3($mtsh(fontdefault))
  1316.     }
  1317.     else .fontrst
  1318.     .did -a preaux 2 5 0 9
  1319.     .bgrst
  1320.     .hadd mts file $remove($2-,$mircdir)
  1321.     if ($load.aux5(pictures)) {
  1322.       .did -ra preaux 1 Loading pictures
  1323.       .remini mirc.ini background
  1324.       .var %j = 1
  1325.       .while ($scon(%j)) {
  1326.         scon %j
  1327.         .hadd mts imagestatus $mtsget(%f,imagestatus)
  1328.         if ($mtsh(imagestatus)) .background -s $+ $load.aux4($v1)
  1329.         .hadd mts imagechan $mtsget(%f,imagechan)
  1330.         if ($img.aux4($mtsh(imagechan))) {
  1331.           .var %i = 1
  1332.           .while ($chan(%i)) {
  1333.             .background - $+ $img.aux($mtsh(imagechan)) $chan(%i) $img.aux2($mtsh(imagechan))
  1334.             .inc %i
  1335.           }
  1336.           .writeini mirc.ini background wchannel $img.aux3($mtsh(imagechan))
  1337.         }
  1338.         .hadd mts imagequery $mtsget(%f,imagequery)
  1339.         if ($img.aux4($mtsh(imagequery))) {
  1340.           .var %i = 1
  1341.           .while ($query(%i)) {
  1342.             .background - $+ $img.aux($mtsh(imagequery)) $query(%i) $img.aux2($mtsh(imagequery))
  1343.             .inc %i
  1344.           }
  1345.           .var %i = 1
  1346.           .while ($chat(%i)) {
  1347.             .background - $+ $img.aux($mtsh(imagequery)) $+(=,$chat(%i)) $img.aux2($mtsh(imagequery))
  1348.             .inc %i
  1349.           }
  1350.           .writeini mirc.ini background wquery $img.aux3($mtsh(imagequery))
  1351.           .writeini mirc.ini background wchat $img.aux3($mtsh(imagequery))
  1352.         }
  1353.         .hadd mts imagemirc $mtsget(%f,imagemirc)
  1354.         if ($img.aux4($mtsh(imagemirc))) .background -m $+ $load.aux4($mtsh(imagemirc))
  1355.         if (!$dialog(toolbar)) {
  1356.           .hadd mts imagebuttons $mtsget(%f,imagebuttons)
  1357.           if ($isfile($nofile($mtsh(file)) $+ $mtsh(imagebuttons))) .background -u $img.aux2($mtsh(imagebuttons))
  1358.           .hadd mts imagetoolbar $mtsget(%f,imagetoolbar)
  1359.           if ($img.aux4($mtsh(imagetoolbar))) .background -l $+ $load.aux4($mtsh(imagetoolbar))
  1360.         }
  1361.         .hadd mts imageswitchbar $mtsget(%f,imageswitchbar)
  1362.         if ($img.aux4($mtsh(imageswitchbar))) .background -h $+ $load.aux4($mtsh(imageswitchbar))
  1363.         .inc %j
  1364.       }
  1365.     }
  1366.     .did -a preaux 2 6 0 7
  1367.     .srst
  1368.     if ($mtsget(%f,script)) {
  1369.       .did -ra preaux 1 Loading scriped events
  1370.       .hadd mts script $remove($nofile($mtsh(file)) $+ $mtsget(%f,script),$mircdir)
  1371.       if ($isfile($mtsh(script))) .load -rs " $+ $mtsh(script) $+ "
  1372.     }
  1373.  
  1374.     .hadd -m mts current $remove(%f,$mircdir)
  1375.     .did -a preaux 2 7 0 7
  1376.     if ($mts.event(load)) {
  1377.       .mtsvars echo $color(other) -s
  1378.       .theme.text
  1379.     }
  1380.     if ($dialog(mts)) .did -e mts 21
  1381.     .dialog -x preaux
  1382.     if ($mtsret(main,minimize)) .wins -r
  1383.     .hsave -o mts $mtspath(mts.ah)
  1384.   }
  1385. }
  1386.  
  1387. alias mtsunload {
  1388.   if (!$hget(mts)) return
  1389.   if ($mtsret(main,minimize)) .wins -n
  1390.   if ($mtsret(main,clear)) .clearall
  1391.   .current.unload
  1392.   .dialog -hm preaux preaux
  1393.   .did -a preaux 1 Unloading MTS Theme
  1394.   .clinerst
  1395.   .did -a preaux 2 1 0 8
  1396.   .rgbrst
  1397.   .did -a preaux 2 2 0 8
  1398.   .colorrst
  1399.   .did -a preaux 2 3 0 8
  1400.   .bgrst
  1401.   .did -a preaux 2 4 0 8
  1402.   .fontrst
  1403.   .did -a preaux 2 5 0 8
  1404.   .tsrst
  1405.   .did -a preaux 2 6 0 8
  1406.   .srst
  1407.   .did -a preaux 2 7 0 8
  1408.   .hdel -w mts *
  1409.   if ($isfile($mtspath(current.mts))) .remove $mtspath(current.mts)
  1410.   .did -a preaux 2 8 0 8
  1411.   if ($dialog(mts)) .did -b mts 21
  1412.   .dialog -x preaux
  1413.   if ($mtsret(main,minimize)) .wins -r
  1414.   .hsave -o mts $mtspath(mts.ah)
  1415.   .hfree mts
  1416. }
  1417.  
  1418. alias mtsvars {
  1419.   .set -nu %:echo $gettok($1-,1,9)
  1420.   .set -nu %::me $me
  1421.   .set -nu %::server $server
  1422.   .set -nu %::port $port
  1423.   .set -nu %::pre $pre
  1424.   .set -nu %::target $target
  1425.   .set -u %::c1 $bc(1)
  1426.   .set -u %::c2 $bc(2)
  1427.   .set -u %::c3 $bc(3)
  1428.   .set -u %::c4 $bc(4)
  1429.   .set -nu %::timestamp $time($mtsh(timestampformat))
  1430.   if ($numeric) {
  1431.     .set -nu %::numeric $numeric
  1432.     .var %t = $gettok($gettok($1-,2,9),1,32)
  1433.     .set -nu %::value %t
  1434.     .set -nu %::nick %t
  1435.     .set -nu %::chan %t
  1436.     .set -nu %::fromserver $nick
  1437.     .set -nu %::isoper is not
  1438.     .set -nu %::isregd is not
  1439.     .set -nu %::text $gettok($1-,2,9)
  1440.   }
  1441. }
  1442.  
  1443. alias -l mtsplace {
  1444.   .var %t = $readini(mirc.ini,events,default)
  1445.   if ($1 == join) %t = $gettok(%t,1,44)
  1446.   elseif ($1 == part) %t = $gettok(%t,2,44)
  1447.   elseif ($1 == quit) %t = $gettok(%t,3,44)
  1448.   elseif ($1 == mode) %t = $gettok(%t,4,44)
  1449.   elseif ($1 == topic) %t = $gettok(%t,5,44)
  1450.   elseif ($1 == ctcp) %t = $gettok(%t,6,44)
  1451.   elseif ($1 == nick) %t = $gettok(%t,7,44)
  1452.   elseif ($1 == kick) %t = $gettok(%t,8,44)
  1453.   return %t
  1454. }
  1455.  
  1456. alias -l theme.parse {
  1457.   .var %t = $replace($1,<pre>,%::pre,<timestamp>,%::timestamp,<c1>,%::c1,<c2>,%::c2,<c3>,%::c3,<c4>,%::c4)
  1458.   .var %t = $replace(%t,<me>,%::me,<server>,%::server,<port>,%::port,<nick>,%::nick,<chan>,%::chan,<address>,%::address)
  1459.   .var %t = $replace(%t,<cmode>,%::cmode,<cnick>,%::cnick,<target>,%::target,<knick>,%::knick,<kaddress>,%::kaddress,<newnick>,%::newnick)
  1460.   .var %t = $replace(%t,<modes>,%::modes,<ctcp>,%::ctcp,<numeric>,%::numeric,<value>,%::value,<fromserver>,%::fromserver,<users>,%::users)
  1461.   .var %t = $replace(%t,<away>,%::away,<realname>,%::realname,<isoper>,%::isoper,<operline>,%::operline,<isregd>,%::isregd)
  1462.   .var %t = $replace(%t,<wserver>,%::wserver,<serverinfo>,%::serverinfo,<idletime>,%::idletime,<signontime>,%::signontime,<iaddress>,%::iaddress,<naddress>,%::naddress,<raddress>,%::raddress)
  1463.   .var %t = $replace(%t,<ts>,,<lt>,<,<gt>,>,<parentext>,%::parentext,<text>,%::text)
  1464.   return %t
  1465. }
  1466.  
  1467. alias -l theme.text {
  1468.   if (%::text) .set -nu %::parentext $replace($mtsh(parentext),<text>,%::text)
  1469.   if ($1) .var %t = $mtsget($mtsh(current),$1,1)
  1470.   else .var %t = %mts.event
  1471.   if (!%t) && (raw. isin $1) .var %t = $mtsget($mtsh(current),raw.other)
  1472.   if (!%t) return
  1473.   if ($gettok(%t,1,32) != !script) %:echo $theme.parse($eval(%t,2)) %:comments
  1474.   else {
  1475.     if (!$gettok(%t,2,32)) {
  1476.       if (raw. isin $1) .halt
  1477.     }
  1478.     else {
  1479.       .var %t = $gettok(%t,2-,32)
  1480.       .var %i = 1
  1481.       .while ($gettok(%t,%i,124)) {
  1482.         $eval($theme.parse($v1),2)
  1483.         .inc %i
  1484.       }
  1485.     }
  1486.   }
  1487.   .haltdef
  1488. }
  1489.  
  1490. alias cmode {
  1491.   .var %t = $left($remove($nick($2,$1).pnick,$1),1)
  1492.   if (%t == .) && ($mtsh(clinecharowner)) .var %t = $mtsh(clinecharowner)
  1493.   elseif (%t == @) && ($mtsh(clineCharop)) .var %t = $mtsh(clineCharop)
  1494.   elseif (%t == %) && ($mtsh(clineCharhop)) .var %t = $mtsh(clineCharhop)
  1495.   elseif (%t == +) && ($mtsh(clineCharvoice)) .var %t = $mtsh(clineCharvoice)
  1496.   elseif ($mtsh(clineCharregular)) .var %t = $mtsh(clineCharregular)
  1497.   elseif (%t == +) return $+(12,%t,)
  1498.   elseif (%t == @) return $+(4,%t,)
  1499.   elseif (%t == %) return $+(11,%t,)
  1500. }
  1501.  
  1502. alias -l mts.event {
  1503.   if (!$mtsh(current)) || (!$1) return
  1504.   .set -nu %mts.event $mtsget($mtsh(current),$1,1)
  1505.   if (%mts.event) return 1
  1506. }
  1507.  
  1508. alias pre if ($mtsh(pre)) return $v1
  1509.  
  1510. alias bc if ($1 isnum) && ($mtsh(basecolors)) return  $+ $gettok($mtsh(basecolors),$1,44)
  1511.  
  1512. alias cmdchar return $readini(mirc.ini,text,commandchar)
  1513.  
  1514. alias -l img.aux return $lower($replace($left($gettok($1,1,32),1),s,r))
  1515.  
  1516. alias -l img.aux2 return " $+ $nofile($mtsh(file)) $+ $iif($gettok($1,2,32),$v1,$1) $+ "
  1517.  
  1518. alias -l img.aux3 {
  1519.   .var %t = $gettok($1,1,32)
  1520.   if (%t == center) .var %t = 0
  1521.   elseif (%t == fill) .var %t = 1
  1522.   elseif (%t == normal) .var %t = 2
  1523.   elseif (%t == stretch) .var %t = 3
  1524.   elseif (%t == tile) .var %t = 4
  1525.   elseif (%t == photo) .var %t = 5
  1526.   return $nofile($mtsh(file)) $+ $gettok($1,2,32) $+ , $+ %t
  1527. }
  1528.  
  1529. alias -l img.aux4 return $isfile($nofile($mtsh(file)) $+ $gettok($1,2,32))
  1530.  
  1531. alias describe {
  1532.   if ($2 != $null) {
  1533.     if ($show) {
  1534.       if (!$window($1)) .var %t = textmsgself
  1535.       elseif ($1 ischan) .var %t = actionchanself
  1536.       else .var %t = actionqueryself
  1537.       if ($mts.event(%t)) {
  1538.         .mtsvars echo $color(action) $iif(%t == textmsgself,-ta,-tm $1)
  1539.         .set -nu %::chan $1
  1540.         .set -nu %::target $1
  1541.         .set -nu %::text $2-
  1542.         if (%t == textmsgself) {
  1543.           .set -nu %::address $address($1,5)
  1544.           .set -nu %::nick $1
  1545.           .set -nu %::me $me
  1546.         }
  1547.         else {
  1548.           if (%t == actionchanself) .set -u %::cmode $cmode($me,$1)
  1549.           .set -nu %::nick $me
  1550.           .set -nu %::me $me
  1551.           .set -nu %::address $address($me,5)
  1552.         }
  1553.         .var %m = .describe
  1554.         .theme.text
  1555.       }
  1556.       else .var %m = describe
  1557.     }
  1558.     else .var %m = .describe
  1559.     %m $1-
  1560.   }
  1561. }
  1562.  
  1563. alias action if ($is.input($1)) describe $active  $+ $color(action) $+ $1-
  1564.  
  1565. alias me if ($is.input($1)) describe $active  $+ $color(action) $+ $1-
  1566.  
  1567. alias msg {
  1568.   if ($2 != $null) {
  1569.     if ($show) {
  1570.       if (!$window($1)) .var %t = textmsgself
  1571.       elseif ($1 ischan) .var %t = textchanself
  1572.       else .var %t = textqueryself
  1573.       if ($mts.event(%t)) {
  1574.         .mtsvars echo $color(own) $iif(%t == textmsgself,-ta,-tm $1)
  1575.         .set -nu %::chan $1
  1576.         .set -nu %::target $1
  1577.         .set -nu %::text $2-
  1578.         if (%t == textmsgself) {
  1579.           .set -nu %::address $address($1,5)
  1580.           .set -u %::cnick $ncolor($1)
  1581.           .set -nu %::nick $+(,%::cnick,$1,)
  1582.           .set -nu %::me $me
  1583.         }
  1584.         else {
  1585.           if (%t == textchanself) {
  1586.             .set -u %::cnick $ncolor($me,$1)
  1587.             .set -u %::cmode $cmode($me,$1)
  1588.           }
  1589.           else .set -u %::cnick $ncolor($me)
  1590.           .set -nu %::nick $+(,%::cnick,$me,)
  1591.           .set -nu %::me $+(,%::cnick,$me,)
  1592.           .set -nu %::address $address($me,5)
  1593.         }
  1594.         .var %m = .msg
  1595.         .theme.text
  1596.       }
  1597.       else .var %m = msg
  1598.     }
  1599.     else .var %m = .msg
  1600.     %m $1-
  1601.   }
  1602. }
  1603.  
  1604. alias amsg {
  1605.   if ($1 != $null) {
  1606.     am.aux amsg textchanself $1-
  1607.     %m $1-
  1608.   }
  1609. }
  1610.  
  1611. alias ame {
  1612.   if ($1 != $null) {
  1613.     am.aux ame actionchanself $1-
  1614.     %m $1-
  1615.   }
  1616. }
  1617.  
  1618. alias qmsg {
  1619.   if ($1 != $null) {
  1620.     qm.aux qmsg textqueryself $1-
  1621.     %m $1-
  1622.   }
  1623. }
  1624.  
  1625. alias qme {
  1626.   if ($1 != $null) {
  1627.     qm.aux qme actionqueryself $1-
  1628.     %m $1-
  1629.   }
  1630. }
  1631.  
  1632. alias say if ($is.input($1)) msg $active $1-
  1633.  
  1634. alias notice {
  1635.   if ($2 != $null) {
  1636.     if ($show) {
  1637.       if ($mts.event($iif($left($1,1) == $chr(35),noticechanself,noticeself))) {
  1638.         .mtsvars echo $color(own) -ta
  1639.         .set -nu %::me $me
  1640.         .set -nu %::target $1
  1641.         .set -nu %::address $address($me,5)
  1642.         if ($1 ischan) .set -u %::cmode $cmode($me,$1)
  1643.         .set -u %::cnick $ncolor($1)
  1644.         .set -nu %::chan $+(,%::cnick,$1,)
  1645.         .set -nu %::nick $+(,%::cnick,$1,)
  1646.         .set -nu %::text $2-
  1647.         .var %m = .notice
  1648.         .theme.text
  1649.       }
  1650.       else .var %m = notice
  1651.     }
  1652.     else .var %m = .notice
  1653.     %m $1-
  1654.   }
  1655. }
  1656.  
  1657. alias dns {
  1658.   if ($mts.event(dns)) {
  1659.     if ($left($1,1) == -) var %t = $2
  1660.     else .var %t = $1
  1661.     .mtsvars echo $color(other) -a
  1662.     .set -u %::nick %t
  1663.     .set -u %::address %t
  1664.     .dns $1-
  1665.     if ($show) .theme.text
  1666.   }
  1667.   else $iif($show,dns,.dns) $1-
  1668. }
  1669.  
  1670. alias ctcp {
  1671.   if ($2 != $null) {
  1672.     ctcp.aux ctcp $1-
  1673.     %m $iif($2 == PING,$1 $2 $ctime,$1-)
  1674.   }
  1675. }
  1676.  
  1677. alias ctcpreply {
  1678.   if ($2 != $null) {
  1679.     ctcp.aux ctcpreply $1-
  1680.     %m $1-
  1681.   }
  1682. }
  1683.  
  1684. alias mts.namergb {
  1685.   .var %t = $iif($read($mtspath(namecolors.tl),ns,$1),$v1,$1)
  1686.   .var %d = 255,255,255
  1687.   return $iif($gettok(%t,0,44) == 3,%t,%d)
  1688. }
  1689.  
  1690. alias -l mts.as return $iif($cid == $activecid,a,s)
  1691.  
  1692. alias -l mts.onnotify {
  1693.   if ($1 == window) {
  1694.     .var %n = 2
  1695.     .var %t = 16
  1696.   }
  1697.   elseif ($1 == active) {
  1698.     .var %n = 3
  1699.     .var %t = 24
  1700.   }
  1701.   return $gettok($readini(mirc.ini,options,n $+ %n),%t,44)
  1702. }
  1703.  
  1704. alias -l mts.onactive {
  1705.   if ($1 == invites) {
  1706.     .var %n = 3
  1707.     .var %t = 26
  1708.   }
  1709.   elseif ($1 == queries) {
  1710.     .var %n = 4
  1711.     .var %t = 5
  1712.   }
  1713.   elseif ($1 == notices) {
  1714.     .var %n = 5
  1715.     .var %t = 13
  1716.   }
  1717.   elseif ($1 == whois) {
  1718.     .var %n = 2
  1719.     .var %t = 26
  1720.   }
  1721.   elseif ($1 == ctcps) {
  1722.     .var %n = 4
  1723.     .var %t = 19
  1724.   }
  1725.   elseif ($1 == away) {
  1726.     .var %n = 4
  1727.     .var %t = 32
  1728.   }
  1729.   return $gettok($readini(mirc.ini,options,n $+ %n),%t,44)
  1730. }
  1731.  
  1732. alias -l mtspop {
  1733.   .mtspopups New mtspop 9 9
  1734.   .mtspop.aux Add $cr mtsadd
  1735.   .mtspop.aux Edit $cr mtsedit
  1736.   .mtspop.aux Remove $cr mtsdel
  1737.   .mtspop.aux
  1738.   .mtspop.aux Preview $cr mtspre $mpre(small)
  1739.   .mtspop.aux Load $cr mtsload $sch $read($mtspath(mts.tl),n,$calc($did(mts,1).sel - 1))
  1740.   .mtspop.aux
  1741.   .mtspop.aux Show info $cr mtsinfo $+(",$read($mtspath(mts.tl),n,$calc($did(mts,1).sel - 1)),")
  1742.   .var %t = $mtspopups(Popup,mtspop + $mouse.dx $mouse.dy)
  1743.   if ($gettok(%t,1,32) == OK) $gettok(%t,4-,32)
  1744. }
  1745.  
  1746. alias -l mtspop.aux mtspopups AddItem mtspop end + 0 0 $1-
  1747.  
  1748. alias -l setmdxpath {
  1749.   .var %t = $$sdir($scriptdir,Set MDX path,Ok)
  1750.   if ($isfile(%t $+ mdx.dll)) && ($isfile(%t $+ ctl_gen.mdx)) && ($isfile(%t $+ views.mdx)) .writeini $mtspath(mts.ini) main mdx %t
  1751.   else .var %null = $input(MDX files are missing. You need at least mdx.dll $+ $chr(44) ctl_gen.mdx and views.mdx,o,Theme loader)
  1752. }
  1753.  
  1754. alias setpoppath {
  1755.   .var %t = $$sfile($scriptdir $+ *.dll,Set Popups.dll path,Ok)
  1756.   if ($isfile(%t)) writeini $mtspath(mts.ini) .main popups %t
  1757. }
  1758.  
  1759. alias -l mtspath return $+(",$scriptdir,$1,")
  1760.  
  1761. alias -l mtsh return $hget(mts,$1)
  1762.  
  1763. alias -l mtsret return $readini($mtspath(mts.ini),$1,$2)
  1764.  
  1765. alias -l mtsinil if ($mtsret(main,$1)) .did -c mts $2
  1766.  
  1767. alias -l mpre return $1 $sch $+(",$read($mtspath(mts.tl),n,$calc($did(mts,1).sel - 1)),")
  1768.  
  1769. alias -l mtsini {
  1770.   if ($did(mts,$2).state) did -u mts $2
  1771.   else .did -c mts $2
  1772.   .writeini $mtspath(mts.ini) main $1 $did(mts,$2).state
  1773. }
  1774.  
  1775. alias -l dm {
  1776.   if ($1) {
  1777.     if ($dialog(mtsinfo)) mtsinfo $+(",$read($mtspath(mts.tl),n,$1),")
  1778.     .did -ra mts 4 Default
  1779.     .var %i = 1
  1780.     .var %t = scheme $+ 1
  1781.     .while ($mtsget($1,%t)) {
  1782.       .did -a mts 4 $mtsget($1,%t)
  1783.       .inc %i
  1784.       .var %t = scheme $+ %i
  1785.     }
  1786.     .did -c mts 4 1
  1787.     if (%i > 1) .did -e mts 4
  1788.     else .did -b mts 4
  1789.   }
  1790. }
  1791.  
  1792. alias -l sch return $iif($did(mts,4).sel == 1,mts,$+(scheme,$calc($did(mts,4).sel - 1)))
  1793.  
  1794. alias -l clearinfo {
  1795.   if ($dialog(mtsinfo)) {
  1796.     .did -ra mtsinfo 2 Info on theme: N/A
  1797.     .did -ra mtsinfo 4 Name: N/A
  1798.     .did -ra mtsinfo 5 Author: N/A
  1799.     .did -ra mtsinfo 6 N/A
  1800.     .did -ra mtsinfo 8 N/A
  1801.     .did -ra mtsinfo 9 MTS Version: N/A
  1802.     .did -ra mtsinfo 11 N/A
  1803.   }
  1804. }
  1805.  
  1806. alias -l mtsinfo.aux return $iif($mtsget($1,$2),$v1,N/A)
  1807.  
  1808. alias -l showpre {
  1809.   .writeini $mtspath(mts.ini) .main preview $1-
  1810.   .did -ra mts 12 Preview: $deltok($nopath($1-),-1,45)
  1811.   .did -h mts 22
  1812.   .did -g mts 14 $1-
  1813. }
  1814.  
  1815. alias -l showprel {
  1816.   if ($dialog(lpre)) .dialog -x lpre lpre
  1817.   .dialog -hm lpre lpre
  1818.   .did -g lpre 4 $1-
  1819.   .did -ra lpre 2 Preview: $deltok($nopath($1-),-1,45)
  1820. }
  1821.  
  1822. alias -l mtssch {
  1823.   .window -h @mtsp1
  1824.   .loadbuf -tmts @mtsp1 $shortfn($2-)
  1825.   if ($1 != mts) && ($read($2-,wn,$+($chr(91),$1,$chr(93)))) {
  1826.     .window -h @mtsp2
  1827.     .loadbuf -t $+ $1 @mtsp2 $shortfn($2-)
  1828.     .var %i = 1
  1829.     .while ($line(@mtsp2,%i)) {
  1830.       .var %w = $gettok($line(@mtsp2,%i),1,32) *
  1831.       if (%w != *) {
  1832.         if ($fline(@mtsp1,%w)) rline @mtsp1 $fline(@mtsp1,%w) $line(@mtsp2,%i)
  1833.         else .aline @mtsp1 $line(@mtsp2,%i)
  1834.       }
  1835.       .inc %i
  1836.     }
  1837.   }
  1838. }
  1839.  
  1840. alias -l mtspre.aux return $replace($1,<c1>,%::c1,<c2>,%::c2,<c3>,%::c3,<c4>,%::c4)
  1841.  
  1842. alias -l mtspre.aux2 {
  1843.   .var %t = $theme.parse($iif($mtsget($3,$2),$v1,$4-))
  1844.   .set -u %:echo aline @pretext $1
  1845.   if ($gettok(%t,1,32) == !script) {
  1846.     if ($gettok(%t,2-,32)) $v1
  1847.   }
  1848.   else .aline @pretext $1 %t
  1849. }
  1850.  
  1851. alias -l optaux if ($mtsret(options,$1)) .did -c mtsopt $2
  1852.  
  1853. alias -l optaux2 {
  1854.   .did -a mtsopt 22 $1
  1855.   .hadd -m mtsopt $1 $mtsret(options,$1)
  1856. }
  1857.  
  1858. alias -l optaux3 .mtsmdx SetColor $dname 23 background $color($hget(mtsopt,$1))
  1859.  
  1860. alias -l optaux4 .writeini $mtspath(mts.ini) options $1 $did(mtsopt,$2).state
  1861.  
  1862. alias -l optaux5 .writeini $mtspath(mts.ini) options $1 $hget(mtsopt,$1)
  1863.  
  1864. alias -l current.unload {
  1865.   if ($mts.event(unload)) {
  1866.     .mtsvars echo $color(other) -s
  1867.     .theme.text
  1868.   }
  1869. }
  1870.  
  1871. alias -l load.aux {
  1872.   if ($gettok($mtsh(colors),$1,44) != $null) .color $2- $v1
  1873.   elseif ($1 == 28) .color inactive $color(editbox)
  1874. }
  1875.  
  1876. alias -l load.aux2 return $replace($1,<c1>,$bc(1),<c2>,$bc(2),<c3>,$bc(3),<c4>,$bc(4),<pre>,$pre,<ts>,,<lt>,<,<gt>,>)
  1877.  
  1878. alias -l load.aux3 return " $+ $gettok($gettok($1,1,44),1,59) $+ " $gettok($1,2,44)
  1879.  
  1880. alias -l load.aux4 return $img.aux($1) $img.aux2($1)
  1881.  
  1882. alias -l load.aux5 return $mtsret(options,$1)
  1883.  
  1884. alias -l load.aux6 if ($mtsget($3-,$1) != $null) .cnick -m0 * $v1 $2
  1885.  
  1886. alias -l load.aux7 .cnick - $+ $1 $iif($2 == yourself,$!me,*) $mtsret(options,$2) $3
  1887.  
  1888. alias -l loadc1 {
  1889.   .var %i = 1
  1890.   .while ($gettok($1-,%i,32)) {
  1891.     .var %t = %t $+ , $+ $rgb( [ $mts.namergb($v1) ] )
  1892.     .inc %i
  1893.   }
  1894.   .writeini mirc.ini palettes n0 $remfirst(%t,1)
  1895. }
  1896.  
  1897. alias -l loadc2 {
  1898.   .var %t = $1-
  1899.   if ($numtok(%t,44) == 26) var %t = %t $+ , $+ $gettok(%t,-1,44)
  1900.   if ($numtok(%t,44) == 27) var %t = %t $+ , $+ $gettok(%t,22,44)
  1901.   .writeini mirc.ini colors n0 mIRC Classic, $+ %t
  1902.   .color -ls mIRC Classic
  1903. }
  1904.  
  1905. alias -l rgbrst {
  1906.   if ($mtsh(rgbcolors)) {
  1907.     .loadc1 $rgbdef
  1908.     .hdel mts rgbcolors
  1909.   }
  1910. }
  1911.  
  1912. alias -l colorrst {
  1913.   if ($mtsh(colors)) {
  1914.     .loadc2 $cdef
  1915.     .hdel mts colors
  1916.   }
  1917. }
  1918.  
  1919. alias -l clinerst .while ($cnick(0)) .cnick -r 1
  1920.  
  1921. alias -l tsrst {
  1922.   .timestamp on
  1923.   .timestamp -f [HH:nn]
  1924.   .hdel -w mts timestamp*
  1925. }
  1926.  
  1927. alias -l bgrst {
  1928.   .var %j = 1
  1929.   .while ($scon(%j)) {
  1930.     scon %j
  1931.     .background -xs
  1932.     .background -xm
  1933.     .background -xl
  1934.     .background -xu
  1935.     .background -xh
  1936.     .var %i = 1
  1937.     .while ($chan(%i)) {
  1938.       .background -x $chan(%i)
  1939.       .inc %i
  1940.     }
  1941.     .var %i = 1
  1942.     .while ($query(%i)) {
  1943.       .background -x $query(%i)
  1944.       .inc %i
  1945.     }
  1946.     .var %i = 1
  1947.     .while ($chat(%i)) {
  1948.       .background -x $+(=,$chat(%i))
  1949.       .inc %i
  1950.     }
  1951.     .inc %j
  1952.   }
  1953.   .remini mirc.ini background
  1954.   .writeini mirc.ini background wquery none
  1955.   .writeini mirc.ini background wchat none
  1956.   .writeini mirc.ini background wchannel none
  1957.   .hdel -w mts image*
  1958. }
  1959.  
  1960. alias -l srst {
  1961.   if ($mtsh(script)) && ($isfile($v1)) .unload -rsn " $+ $mtsh(script) $+ "
  1962.   .hdel mts script
  1963. }
  1964.  
  1965. alias -l fontrst {
  1966.   .font -z
  1967.   .hdel -w mts font*
  1968. }
  1969.  
  1970. alias -l cdef return 0,6,4,5,2,3,3,3,3,3,3,1,5,7,6,1,3,2,3,5,1,0,1,0,1,15,6,0
  1971.  
  1972. alias -l rgbdef return 255,255,255 0,0,0 0,0,128 0,144,0 255,0,0 128,0,0 160,0,160 255,128,0 255,255,0 0,255,0 0,144,144 0,255,255 0,0,255 255,0,255 128,128,128 208,208,208
  1973.  
  1974. alias -l ncolor {
  1975.   .var %t = $cnick($iif($2,$nick($2,$1).pnick,$1))
  1976.   if (%t) && ($cnick(%t).method != 2) return $cnick(%t).color
  1977. }
  1978.  
  1979. alias -l wins {
  1980.   .var %j = 1
  1981.   .while ($scon(%j)) {
  1982.     scon %j
  1983.     if ($left($1,1) == $chr(45)) {
  1984.       .var %i = 1
  1985.       .while ($window(*,%i)) {
  1986.         .var %t = $window(*,%i)
  1987.         .window $1 $iif($left(%t,1) == $chr(61),%t,$+(",%t,"))
  1988.         .inc %i
  1989.       }
  1990.     }
  1991.     .inc %j
  1992.   }
  1993. }
  1994.  
  1995. alias -l loopt {
  1996.   .var %t = $mtsplace($event)
  1997.   if ($event == quit) {
  1998.     if (%t == 1) || (%t == 2) .var %s = 1
  1999.     if (%t == 0) || (%t == 2) .var %c = 1
  2000.   }
  2001.   else {
  2002.     if (%t == 0) .var %c = 1
  2003.   }
  2004.   if (!%c) && (!%s) .halt
  2005.   if (%c) {
  2006.     .var %i = 1
  2007.     .while ($comchan($1,%i)) {
  2008.       .mtsvars echo $color($event) -t $comchan($1,%i)
  2009.       .theme.text
  2010.       .inc %i
  2011.     }
  2012.   }
  2013.   if (%s) {
  2014.     .mtsvars echo $color($event) -ts
  2015.     .theme.text
  2016.   }
  2017. }
  2018.  
  2019. alias -l tjp {
  2020.   if ($mts.event($1)) {
  2021.     if ($event == join) && ($nick == $me) {
  2022.       if ($mtsret(options,names)) .hadd -m join $+(names.,$chan,$cid) 1
  2023.       if ($mtsret(options,chaninfo)) .hadd -m join $+(topic.,$chan,$cid) 1
  2024.     }
  2025.     .var %t = $mtsplace($event)
  2026.     if (%t == 2) .halt
  2027.     elseif (%t == 1) .var %t = echo $color($event) -ts
  2028.     else .var %t = echo $color($event) -t $chan
  2029.     .mtsvars %t
  2030.     .set -nu %::nick $nick
  2031.     .set -nu %::address $iif($address,$v1,N/A)
  2032.     .set -nu %::chan $chan
  2033.     .set -nu %::text $2-
  2034.     .theme.text
  2035.   }
  2036. }
  2037.  
  2038. alias -l mts.inp {
  2039.   if ($mtsh(current)) && ($left($1,1) != $cmdchar) {
  2040.     say $1-
  2041.     .halt
  2042.   }
  2043. }
  2044.  
  2045. alias -l mts.tan {
  2046.   if ($mtsh(current)) {
  2047.     .var %t = - $+ $iif($highlight($1-),l)
  2048.     if ($chan) {
  2049.       %t = %t $+ tm $chan    
  2050.       if ($event == text) .var %e = textchan
  2051.       elseif ($event == action) .var %e = actionchan
  2052.       else .var %e = noticechan
  2053.       .set -nu %::chan $chan
  2054.       .set -u %::cmode $cmode($nick,$chan)
  2055.       if ($event == text) .set -u %::cnick $ncolor($nick,$chan)
  2056.     }
  2057.     else {
  2058.       %t = %t $+ $iif($event != notice,$iif($query($nick),tm $nick,$iif($gettok($readini(mirc.ini,options,n0),22,44),tdm,$iif($mts.onactive(queries) && $active ischan,$mts.as $+ tm,stm))),$iif($mts.onactive(notices),$mts.as $+ tm,stm))
  2059.       if ($event == text) .var %e = $iif($query($nick),textquery,textmsg)
  2060.       elseif ($event == action) .var %e = actionquery
  2061.       else .var %e = notice
  2062.       if ($event == text) .set -u %::cnick $ncolor($nick)
  2063.     }
  2064.     if ($mts.event(%e)) {
  2065.       if ($chan) && ($gettok($readini(mirc.ini,options,n0),3,44)) && (($chan != $active) || (!$appactive)) beep 1
  2066.       elseif ($gettok($readini(mirc.ini,options,n4),2,44)) && (($nick != $active) || (!$appactive)) beep 1
  2067.       if ($gettok($readini(mirc.ini,options,n7),$iif($chan,5,6),44)) flash [message waiting]
  2068.       if ($highlight($nick).nicks) && ($highlight) {
  2069.         if ($highlight($nick).sound != none) {
  2070.           .var %s = $v1
  2071.           $iif(%s == beep,%s,$iif($isfile(%s),.splay -wmp $+(",%s,")))
  2072.         }
  2073.         if ($highlight($nick).color) var %c = $v1 - 1
  2074.         if ($highlight($nick).flash) flash $+(-r,$v1) $highlight($nick).message
  2075.       }
  2076.       .set -nu %::nick $+(,%::cnick,$nick,)
  2077.       .set -nu %::address $iif($address,$v1,N/A)
  2078.       .set -nu %::text $1-
  2079.       .mtsvars echo $iif(%c != $null,%c,$color($iif($event == text,normal,$event))) %t
  2080.       .theme.text
  2081.     }
  2082.   }
  2083. }
  2084.  
  2085. alias -l uno {
  2086.   if ($mts.event($event)) && (!$mts.onnotify(window)) {
  2087.     .set -nu %::nick $nick
  2088.     .set -nu %::address $notify($nick).addr
  2089.     .set -nu %::text $notify($nick).note
  2090.     .mtsvars echo $color(notify) -st
  2091.     .theme.text
  2092.     .var %t = Status Window
  2093.     if ($mts.onnotify(active)) && ($cid == $activecid) && ($active != %t) {
  2094.       .mtsvars echo $color(notify) -at
  2095.       .theme.text
  2096.     }
  2097.     if ($notify($nick).whois) && ($event == notify) .whois $nick
  2098.   }
  2099. }
  2100.  
  2101. alias -l am.aux {
  2102.   if ($show) {
  2103.     if ($mts.event($2)) {
  2104.       .set -nu %::address $address($me,5)
  2105.       .set -nu %::text $3-
  2106.       .set -u %m . $+ $1
  2107.       .var %i = 1
  2108.       .while ($chan(%i)) {
  2109.         .var %t = $v1
  2110.         .mtsvars echo $color(own) -t %t
  2111.         .set -u %::cmode $cmode($me,%t)
  2112.         if ($1 == amsg) .set -u %::cnick $ncolor($me,%t)
  2113.         .set -nu %::chan %t
  2114.         .set -nu %::target %::chan
  2115.         .set -nu %::me $+(,%::cnick,$me,)
  2116.         .set -nu %::nick %::me
  2117.         .theme.text $2
  2118.         .inc %i
  2119.       }
  2120.     }
  2121.     else .set -u %m $1
  2122.   }
  2123.   else .set -u %m . $+ $1
  2124. }
  2125.  
  2126.  
  2127. alias -l qm.aux {
  2128.   if ($show) {
  2129.     if ($mts.event($2)) {
  2130.       .set -nu %::address $address($me,5)
  2131.       if ($1 == qmsg) .set -u %::cnick $ncolor($me)
  2132.       .set -nu %::text $3-
  2133.       .set -u %m . $+ $1
  2134.       .var %i = 1
  2135.       .while ($query(%i)) {
  2136.         .var %t = $v1
  2137.         .mtsvars echo $color(own) -t %t
  2138.         .set -nu %::target %t
  2139.         .set -nu %::me $+(,%::cnick,$me,)
  2140.         .set -nu %::nick %::me
  2141.         .theme.text $2
  2142.         .inc %i
  2143.       }
  2144.     }
  2145.     else .set -u %m $1
  2146.   }
  2147.   else .set -u %m . $+ $1
  2148. }
  2149.  
  2150. alias is.input {
  2151.   if ($1 != $null) && (($active ischan) || ($query($active)) || ($left($active,1) == $chr(61))) return 1
  2152. }
  2153.  
  2154. alias -l ctcp.aux {
  2155.   if ($show) {
  2156.     if ($mts.event($+($1,$iif($left($1,1) == $chr(35),chanself,self)))) {
  2157.       .mtsvars echo $color(own) -at
  2158.       .set -nu %::nick $2
  2159.       .set -nu %::chan $2
  2160.       .set -nu %::target $2
  2161.       .set -nu %::ctcp $upper($3)
  2162.       .set -nu %::text $4-
  2163.       .set -nu %m . $+ $1
  2164.       .theme.text
  2165.     }
  2166.     else .set -nu %m $1
  2167.   }
  2168.   else .set -nu %m . $+ $1
  2169. }
  2170.  
  2171. alias -l raw.aux {
  2172.   if ($halted) return
  2173.   if ($mtsret(options,welcome)) && ($numeric >= 001) && ($numeric <= 005) .halt
  2174.   if ($mts.event(raw. $+ $numeric)) || ($mts.event(raw.other)) {
  2175.     .mtsvars echo $color(other) $1 $+ $chr(9) $+ $2-
  2176.     .theme.text $+(raw.,$numeric)
  2177.     .halt
  2178.   }
  2179. }
  2180.  
  2181. alias -l raw.aux2 {
  2182.   if ($halted) return
  2183.   if ($hget(lusers,$cid)) {
  2184.     if ($numeric == 266) .hdel lusers $cid
  2185.     .halt
  2186.   }
  2187.   if ($mts.event(raw. $+ $numeric)) || ($mts.event(raw.other)) {
  2188.     .mtsvars echo $color(other) -s $+ $chr(9) $+ $3-
  2189.     .set -u %::users $gettok($3-,$1,32)
  2190.     .set -u %::value $gettok($3-,$2,32)
  2191.     .theme.text $+(raw.,$numeric)
  2192.     .halt
  2193.   }
  2194. }
  2195.  
  2196. alias -l raw.aux3 {
  2197.   if ($halted) return
  2198.   .var %t = $iif($hget($+(whois.,$2,$cid),311),whois,whowas)
  2199.   if ($mts.event(raw. $+ $numeric)) || ($mts.event(%t)) || ($mts.event(raw.other)) {
  2200.     .hadd -m $+(whois.,$2,$cid) $numeric $3-
  2201.     if ($mtsget($mtsh(current),$+(raw.,$numeric))) {
  2202.       .mtsvars echo $color(whois) - $+ $iif($mts.onactive(whois),$mts.as,s) $+ $chr(9) $+ $2-
  2203.       .set -u %::nick $2
  2204.       .set -u %::text $3-
  2205.       .theme.text $+(raw.,$numeric)
  2206.     }
  2207.     .halt
  2208.   }
  2209. }
  2210.  
  2211. alias -l raw.aux4 {
  2212.   if ($halted) return
  2213.   if ($mts.event(raw. $+ $numeric)) || ($mts.event(raw.other)) {
  2214.     .mtsvars echo $color(other) -s $+ $chr(9) $+ $2-
  2215.     .set -u %::nick $2
  2216.     .set -u %::chan $3
  2217.     .theme.text $+(raw.,$numeric)
  2218.     .halt
  2219.   }
  2220. }
  2221.  
  2222. alias -l raw.aux5 {
  2223.   if ($halted) return
  2224.   .var %t = $iif($numeric == 311,whois,whowas)
  2225.   if ($mts.event(raw. $+ $numeric)) || ($mts.event(%t)) || ($mts.event(raw.other)) {
  2226.     .hadd -m $+(whois.,$2,$cid) $numeric $3-
  2227.     if ($mtsget($mtsh(current),raw. $+ $numeric)) {
  2228.       .mtsvars echo $color(whois) - $+ $iif($mts.onactive(whois),$mts.as,s) $+ $chr(9) $+ $2-
  2229.       .set -u %::nick $2
  2230.       .set -u %::address $3 $+ @ $+ $4
  2231.       .set -u %::realname $6-
  2232.       .set -u %::country $country($4)
  2233.       .theme.text $+(raw.,$numeric)
  2234.     }
  2235.     .halt
  2236.   }
  2237. }
  2238.  
  2239. alias -l raw.aux6 {
  2240.   if ($hget(motd,$cid)) .halt
  2241.   .raw.aux -s $2-
  2242. }
  2243.  
  2244. alias -l aux.318.369 {
  2245.   if ($halted) return
  2246.   .var %t = $iif($numeric == 318,whois,whowas)
  2247.   if ($mts.event(raw. $+ $numeric)) || ($mts.event(%t)) || ($mts.event(raw.other)) {
  2248.     .mtsvars echo $color(whois) - $+ $iif($mts.onactive(whois),$mts.as,s) $+ $chr(9) $+ $2-
  2249.     if ($mtsget($mtsh(current),whois)) {
  2250.       .var %i = 1
  2251.       .while ($gettok($2,%i,44)) {
  2252.         .set -u %::nick $gettok($2,%i,44)
  2253.         .var %t = $hget($+(whois.,%::nick,$cid),$iif($numeric == 318,311,314))
  2254.         if (%t) {
  2255.           .set -u %::address $gettok(%t,1,32) $+ @ $+ $gettok(%t,2,32)
  2256.           .set -u %::realname $gettok(%t,4-,32)
  2257.           .set -u %::country $country($gettok(%t,2,32))
  2258.           .set -u %::away $hget($+(whois.,%::nick,$cid),301)
  2259.           .set -u %::text $hget($+(whois.,%::nick,$cid),301)
  2260.           .set -u %::isregd is $iif(!$hget($+(whois.,%::nick,$cid),307),not)
  2261.           .var %t = $hget($+(whois.,%::nick,$cid),317)
  2262.           .set -u %::idletime $gettok(%t,1,32)
  2263.           .set -u %::signontime $asctime($gettok(%t,2,32))
  2264.           .set -u %::chan $hget($+(whois.,%::nick,$cid),319)
  2265.           .var %t = $hget($+(whois.,%::nick,$cid),312)
  2266.           .set -u %::wserver $gettok(%t,1,32)
  2267.           .set -u %::serverinfo $gettok(%t,2-,32)
  2268.           .var %t = $hget($+(whois.,%::nick,$cid),313)
  2269.           .set -u %::isoper is $iif(!%t,not)
  2270.           .set -u %::operline %t
  2271.           .theme.text $iif($numeric == 318,whois,whowas)
  2272.         }
  2273.         .inc %i
  2274.       }
  2275.     }
  2276.     if $hget($+(whois.,$gettok($2,1,44),$cid),$iif($numeric == 318,311,314)) && ($mtsget($mtsh(current),$+(raw.,$numeric))) {
  2277.       .set -u %::nick $2
  2278.       .theme.text $+(raw.,$numeric)
  2279.     }
  2280.     .hfree -w $+(whois.*,$cid)
  2281.     .halt
  2282.   }
  2283. }
  2284.  
  2285. ; --------------------------------------------------------- eof ---------------------------------------------------------
Add Comment
Please, Sign In to add comment