home *** CD-ROM | disk | FTP | other *** search
/ isnet Internet / Isnet Internet CD.iso / prog / chat / 12 / 12.exe / SYSTEM / ucentral.mrc < prev    next >
Encoding:
Text File  |  2000-02-16  |  11.3 KB  |  355 lines

  1. ;%%%%%%%%%%%%%%%%%%%%%%%%
  2. ;script ircN User Central
  3. ;version 7.20
  4. ;author Quietust, Sarek
  5. ;email quietust@ircN.org
  6. ;url http://www.ircN.org
  7. ;%%%%%%%%%%%%%%%%%%%%%%%%
  8. dialog ircN.ucentral {
  9.   title "ircN Userlist Central"
  10.   option dbu
  11.   size -1 -1 214 222
  12.   button "&Close", 1, 161 200 32 12, cancel
  13.   button "&Stats + Close", 2, 101 200 48 12
  14.   box "", 10, 4 4 76 36
  15.   text "User:", 11, 8 13 12 8, right
  16.   combo  12, 22 12 54 64, drop edit sort
  17.   button "Create", 13, 8 26 20 10
  18.   button "Edit", 14, 32 26 20 10
  19.   button "Delete", 15, 56 26 20 10
  20.   box "Flags", 20, 84 4 126 138
  21.   radio "Global Flags", 21, 92 12 38 8, group
  22.   radio "Channel Flags", 22, 152 12 44 8
  23.   text "Channel:", 23, 88 23 22 8
  24.   combo 24, 112 22 44 64, drop edit
  25.   button "Add", 25, 160 22 16 10
  26.   button "Remove", 26, 180 22 26 10
  27.   check "+a: Auto-Op", 27, 92 34 54 8
  28.   check "+b: Bot", 28, 92 44 54 8
  29.   check "+c: Accept Chats", 29, 92 54 54 8
  30.   check "+d: Auto-Deop", 30, 92 64 54 8
  31.   check "+f: Protect", 31, 92 74 54 8
  32.   check "+g: Get Ops", 32, 92 84 54 8
  33.   check "+i: ircN 7 bot", 33, 92 94 54 8
  34.   check "+j: File Area Janitor", 34, 92 104 54 8
  35.   check "+k: Auto-Kick", 35, 92 114 54 8
  36.   check "+m: Master", 36, 152 34 54 8
  37.   check "+n: Owner", 37, 152 44 54 8
  38.   check "+o: Op", 38, 152 54 54 8
  39.   check "+p: Partyline", 39, 152 64 54 8
  40.   check "+r: Remote Control", 40, 152 74 54 8
  41.   check "+s: Accept Sends", 41, 152 84 54 8
  42.   check "+v: Auto-Voice", 42, 152 94 54 8
  43.   check "+x: File Area", 43, 152 104 54 8
  44.   text "Other:", 44, 152 115 16 8
  45.   edit "", 45, 170 114 36 11, autohs
  46.   button "Update Flags", 46, 152 128 54 10
  47.   box "Hostmasks", 50, 4 42 76 36
  48.   combo 51, 8 50 68 64, drop edit
  49.   button "Add", 52, 8 64 32 10
  50.   button "Remove", 53, 44 64 32 10
  51.   box "Passwords", 60, 4 80 76 62
  52.   text "User Password:", 61, 8 89 38 8
  53.   edit "", 62, 48 88 28 11, autohs pass
  54.   button "Update User Password", 63, 8 102 68 10
  55.   text "Bot Password:", 64, 8 115 38 8
  56.   edit "", 65, 48 114 28 11, autohs pass
  57.   button "Update Bot Password", 66, 8 128 68 10
  58.   box "Info-Lines", 70, 4 144 76 72
  59.   radio "Global", 71, 8 152 26 8, group
  60.   radio "Channel", 72, 44 152 30 8
  61.   text "Channel:", 73, 8 163 22 8
  62.   combo 74, 32 162 44 64, drop edit
  63.   button "Add", 75, 8 176 32 10
  64.   button "Remove", 76, 44 176 32 10
  65.   text "Infoline:", 77, 8 189 20 8
  66.   edit "", 78, 32 188 44 11, autohs
  67.   button "Update Info-line", 79, 32 202 44 10
  68.   box "", 80, 84 144 126 72
  69.   text "", 81, 88 152 118 46, center
  70. }
  71. on 1:DIALOG:ircN.ucentral:*:* {
  72.   if ($devent == init) {
  73.     did -a $dname 81 Userlist Central for ircN 7.20 + mIRC 5.7 $+ $crlf $+ Dialog written by The Quietust $+ $crlf $+ Dialog handler written by Sarek $+ $crlf $+ $crlf $+ Send suggestions or comments $+ $crlf $+ to quietust@ircN.org
  74.     did -b $dname 13,14,15,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,51,52,53,61,62,63,64,65,66,71,72,73,74,75,76,77,78,79
  75.     if ($script(usersum.mrc) == $null) did -b $dname 2
  76.     ucentral.getusers
  77.   }
  78.   elseif ($devent == sclick) {
  79.     if ($did == 2) {
  80.       dialog -x $dname
  81.       usersum
  82.     }
  83.     elseif (($did == 12) && ($did(12,$did(12).sel) != $null)) { 
  84.       did -b $dname 13
  85.       did -e $dname 14,15
  86.       did -br $dname 51
  87.     }
  88.     elseif ($did == 13) {
  89.       .adduser $did(12) $did(51)
  90.       did -a $dname 12 $did(12)
  91.       ucentral.usercheck
  92.     }
  93.     elseif (($did == 14) && ($did(14).text == Edit)) {
  94.       did -b $dname 12,13,15,74,75,76
  95.       did -ra $dname 14 Exit
  96.       did -c $dname 21,71
  97.       did -e $dname 21,22,23,44,45,51,61,62,64,65,71,72,73,77,78
  98.       ucentral.updatechannels
  99.       if ($flags($did(12)) != $chr(45)) did -ra $dname 45 $flags($did(12))
  100.       ucentral.updateflags
  101.       ucentral.updatehosts
  102.       did -ra $dname 62 $password($did(12))
  103.       did -ra $dname 65 $botpass($did(12))
  104.       did -ra $dname 78 $infoline($did(12))
  105.     }
  106.     elseif (($did == 14) && ($did(14).text == Exit)) {
  107.       did -ra $dname 14 Edit
  108.       did -b $dname 13,14,15,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,51,52,53,62,63,65,66,71,72,74,75,76,78,79
  109.       did -u $dname 21,22,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,71,72
  110.       did -r $dname 24,45,51,62,65
  111.       did -e $dname 12
  112.       ucentral.usercheck
  113.     }
  114.     elseif ($did == 15) {
  115.       .remuser $did(12)
  116.       ucentral.getusers
  117.       ucentral.usercheck
  118.     }
  119.     elseif ($did == 21) {
  120.       did -r $dname 45
  121.       did -e $dname 44,45
  122.       did -b $dname 24,25,26,46
  123.       did -u $dname 27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43
  124.       if ($did(72).state) did -b $dname 78
  125.       if ($flags($did(12)) != $chr(45)) did -ra $dname 45 $flags($did(12))
  126.       else did -r $dname 45
  127.       ucentral.updateflags
  128.       ucentral.updatechannels
  129.     }
  130.     elseif ($did == 22) { 
  131.       did -e $dname 24
  132.       did -b $dname 25,26,44,45,46
  133.       did -u $dname 27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43
  134.       if ($did(72).state) did -b $dname 78
  135.       did -bu $dname 27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43
  136.       ucentral.updatechannels
  137.       did -r $dname 45
  138.     }
  139.     elseif (($did == 24) && ($did(24,$did(24).sel) != $null)) {
  140.       did -e $dname 26,44,45
  141.       did -b $dname 25
  142.       if ($cflags($did(12),$did(24,$did(24).sel)) != $chr(45)) did -ra $dname 45 $ifmatch
  143.       else did -r $dname 45
  144.       ucentral.updateflags
  145.     }
  146.     elseif ($did == 25) {
  147.       .addchan $did(12) $did(24).text
  148.       ucentral.updatechannels
  149.       did -bu $dname 27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43
  150.       did -b $dname 25,26,44,45,46
  151.     }
  152.     elseif ($did == 26) { 
  153.       .remchan $did(12) $did(24).text
  154.       ucentral.updatechannels
  155.       did -bu $dname 27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43
  156.       did -b $dname 25,26,44,45,46
  157.     }
  158.     elseif ((27 <= $did) && ($did <= 43)) did -e $dname 46
  159.     elseif ($did == 46) {
  160.       var %a, %z
  161.       did -b $dname 46
  162.       set %a 1
  163.       while ($mid(abcdfgijkmnoprsvx,%a,1) != $null) {
  164.         set %z $ifmatch
  165.         if ($did($pls(%a,26)).state) did -a $dname 45 %z
  166.         inc %a
  167.       }
  168.       .chattr $did(12) $did(45) $did(24).text
  169.       ucentral.updateflags
  170.     }
  171.     elseif ($did == 51) did -e $dname 53
  172.     elseif ($did == 52) {
  173.       if ($did(51).text) {
  174.         .addhost $did(12) $did(51).text 
  175.         ucentral.updatehosts
  176.       }
  177.     }
  178.     elseif ($did == 53) {
  179.       .remhost $did(12) $did(51).text
  180.       ucentral.updatehosts
  181.     }
  182.     elseif ($did == 63) {
  183.       .chpass $did(12) $did(62).text
  184.       did -b $dname 63
  185.     }
  186.     elseif ($did == 66) {
  187.       .chbotpass $did(12) $did(65).text
  188.       did -b $dname 66
  189.     }
  190.     elseif ($did == 71) {
  191.       did -b $dname 74,75,76,79
  192.       if ($did(22).state) did -ub $dname 25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46
  193.       did -rae $dname 78 $infoline($did(12))
  194.       ucentral.updatechannels
  195.     }
  196.     elseif ($did == 72) {
  197.       did -r $dname 78
  198.       did -b $dname 78,79
  199.       if ($did(22).state) did -ub $dname 25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46
  200.       ucentral.updatechannels
  201.       did -e $dname 74
  202.     }
  203.     if (($did == 74) && ($did(74,$did(74).sel) != $null)) {
  204.       did -e $dname 76
  205.       did -b $dname 75,79
  206.       did -era $dname 78 $infoline($did(12),$did(74,$did(74).sel))
  207.     }
  208.     elseif ($did == 75) { 
  209.       .addchan $did(12) $did(74).text
  210.       ucentral.updatechannels
  211.       did -r $dname 78
  212.       did -b $dname 78,79
  213.     }
  214.     elseif ($did == 76) { 
  215.       .remchan $did(12) $did(74,$did(74).sel).text
  216.       did -r $dname 78
  217.       did -b $dname 78,79
  218.       ucentral.updatechannels
  219.     }
  220.     elseif ($did == 79) {
  221.       .chinfo $did(12) $did(74).text $iif($did(78).text,$did(78).text,none)
  222.       did -b $dname 79
  223.     }
  224.   }
  225.   elseif ($devent == edit) {
  226.     if ($did == 12) ucentral.usercheck
  227.     elseif ($did == 24) {
  228.       did -bu $dname 27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43
  229.       did -b $dname 46
  230.       if (($did(24) != $null) && ($#($did(24)) == $did(24))) {
  231.         if ($cflags($did(12),$did(24)) != $null) {
  232.           did -e $dname 26,44,45
  233.           did -b $dname 25
  234.           if ($cflags($did(12),$did(24)) != $chr(45)) did -ra $dname 45 $ifmatch
  235.           else did -r $dname 45
  236.           ucentral.updateflags
  237.         }
  238.         else {
  239.           did -e $dname 25
  240.           did -b $dname 26,44,45
  241.         }
  242.       }
  243.       else did -b $dname 25,26,44,45,46
  244.     }
  245.     elseif ($did == 45) {
  246.       did -e $dname 46
  247.       ucentral.updateflags
  248.     }
  249.     elseif ($did == 51) {
  250.       if ($did(14) == Edit) ucentral.usercheck
  251.       else {
  252.         if ((*!*@* iswm $did(51)) && ($ulist($did(51),40,0) == 0)) did -e $dname 52
  253.         else did -b $dname 52
  254.         var %a, %b, %z
  255.         set %z $usrhost($did(12))
  256.         set %a 1
  257.         while ($gettok(%z,%a,32) != $null) {
  258.           if ($gettok(%z,%a,32) == $did(51)) set %b $true
  259.           inc %a
  260.         }
  261.         if (%b) did -e $dname 53
  262.         else did -b $dname 53
  263.       }
  264.     }
  265.     elseif ($did == 62) did -e $dname 63
  266.     elseif ($did == 65) did -e $dname 66
  267.     elseif ($did == 74) {
  268.       did -r $dname 78
  269.       did -b $dname 79
  270.       if (($did(74) != $null) && ($#($did(74)) == $did(74))) {
  271.         if ($cflags($did(12),$did(74)) != $null) {
  272.           did -e $dname 76,78
  273.           did -b $dname 75
  274.         }
  275.         else { 
  276.           did -e $dname 75
  277.           did -b $dname 76,78
  278.         }
  279.       }
  280.       else did -b $dname 75,76,78
  281.     }
  282.     elseif ($did == 78) did -e $dname 79
  283.   }
  284. }
  285. alias ucentral dialog -m ircN.ucentral ircN.ucentral
  286. alias -l # return #$1
  287. alias -l ucentral.getusers {
  288.   unset %_ucentral.name.*
  289.   did -r $dname 12
  290.   var %a, %z
  291.   set %a 1
  292.   while ($ulist(*,40,%a)) {
  293.     set %z $usrh($ifmatch)
  294.     if (%_ucentral.name. [ $+ [ %z ] ] == $null) {
  295.       set %_ucentral.name. [ $+ [ %z ] ] 1
  296.       did -a $dname 12 %z
  297.     }
  298.     inc %a
  299.   }
  300.   unset %_ucentral.name.*
  301. }
  302. alias -l ucentral.usercheck {
  303.   if ($did(12) != $null) {
  304.     if ($usrhost($did(12)) != $null) {
  305.       did -b $dname 13
  306.       did -e $dname 14,15
  307.       did -br $dname 51
  308.     }
  309.     else {
  310.       did -b $dname 14,15
  311.       did -e $dname 51
  312.       if ((*!*@* iswm $did(51)) && ($ulist($did(51),40,0) == 0)) did -e $dname 13
  313.       else did -b $dname 13
  314.     }
  315.   }
  316.   else did -b $dname 13,14,15,51
  317. }
  318. alias -l ucentral.updatechannels {
  319.   var %a, %z
  320.   did -r $dname 24,74
  321.   if ($usrchans($did(12)) != $null) {
  322.     set %z $ifmatch
  323.     set %a 1
  324.     while ($gettok(%z,%a,44) != $null) {
  325.       did -a $dname 24,74 $ifmatch
  326.       inc %a
  327.     }
  328.   }
  329.   did -b $dname 25,26,75,76
  330. }
  331. alias -l ucentral.updateflags {
  332.   var %a, %z
  333.   set %a 1
  334.   while ($mid(abcdfgijkmnoprsvxehlqtuwyz,%a,1) != $null) {
  335.     set %z $ifmatch
  336.     if (((%z isincs abcdfgijkmnoprsvx) && ($did(21).state)) || (%z isincs adfgkov)) did -e $dname $pls(%a,26)
  337.     if (%z isincs $did(45)) {
  338.       if (((%z isincs abcdfgijkmnoprsvx) && ($did(21).state)) || (%z isincs adfgkov)) did -c $dname $pls(%a,26)
  339.       did -ra $dname 45 $removecs($did(45),%z)
  340.     }
  341.     inc %a
  342.   }
  343. }
  344. alias -l ucentral.updatehosts {
  345.   var %a, %z
  346.   did -b $dname 52,53
  347.   did -r $dname 51
  348.   set %z $usrhost($did(12))
  349.   set %a 1
  350.   while ($gettok(%z,%a,32) != $null) {
  351.     did -a $dname 51 $ifmatch
  352.     inc %a
  353.   }
  354. }
  355.