daily pastebin goal
79%
SHARE
TWEET

Quiets dialog (/channel's missing tab)

Seb Dec 31st, 2015 (edited) 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ##############################
  2. #     Quiets dialog (+q)     #
  3. # by PlasmaStar @ freenode   #
  4. # Plasmastar510@hotmail.com  #
  5. #  use /quiets or top menu   #
  6. ##############################
  7.  
  8. menu menubar {
  9.   Quiets:quiets
  10. }
  11.  
  12. dialog -l QuietsDialog {
  13.   size -1 -1 212 127
  14.   title "mIRC Channel Quiets"
  15.   option dbu
  16.   list              1, 5   5   202 100, vsbar hsbar extsel
  17.   button "&Edit",   2, 5   110 60  12
  18.   button "&Remove", 3, 70  110 60  12
  19.   button "&Ok",     4, 135 110 60  12,  ok
  20. }
  21.  
  22. alias quiets {
  23.   if ($status = connected) {
  24.     echo -cn info $chan * Retrieving $chan quiets...
  25.     mode $chan +q
  26.   }
  27.   else {
  28.     echo -acn info * /quiets: not connected to server
  29.   }
  30. }
  31.  
  32. raw 728:*: {
  33.   haltdef
  34.   if (!$dialog(qDialog)) {
  35.     dialog -m qDialog QuietsDialog
  36.   }
  37.   if (!%RetrievingQuiets) {
  38.     %RetrievingQuiets = $true
  39.     dialog -t qDialog mIRC Channel Quiets - Retrieving...
  40.     did -r qDialog 1
  41.   }
  42.   did -az qDialog 1 $4 ( $+ $5 $+ ) $asctime($6)
  43. }
  44.  
  45. raw 344:*: {
  46.   ; Quiets on Hybrid (OFTC uses this)
  47.   haltdef
  48.   if (!$dialog(qDialog)) {
  49.     dialog -m qDialog QuietsDialog
  50.   }
  51.   if (!%RetrievingQuiets) {
  52.     %RetrievingQuiets = $true
  53.     dialog -t qDialog mIRC Channel Quiets - Retrieving...
  54.     did -r qDialog 1
  55.   }
  56.   did -az qDialog 1 $3 ( $+ $4 $+ ) $asctime($5)
  57. }
  58.  
  59. raw 729:*: {
  60.   haltdef
  61.   if ($dialog(qDialog)) {
  62.     dialog -t qDialog mIRC Channel Quiets $2
  63.     if (%RetrievingQuiets) {
  64.       unset %RetrievingQuiets
  65.     }
  66.     else {
  67.       did -r qDialog 1
  68.     }
  69.     did -b qDialog 2
  70.     did -b qDialog 3
  71.   }
  72.   else {
  73.     echo -cn info $2 * No channel quiets
  74.   }
  75. }
  76.  
  77. raw 345:*: {
  78.   ; Quiets on Hybrid (OFTC uses this)
  79.   haltdef
  80.   if ($dialog(qDialog)) {
  81.     dialog -t qDialog mIRC Channel Quiets $2
  82.     if (%RetrievingQuiets) {
  83.       unset %RetrievingQuiets
  84.     }
  85.     else {
  86.       did -r qDialog 1
  87.     }
  88.     did -b qDialog 2
  89.     did -b qDialog 3
  90.   }
  91.   else {
  92.     echo -cn info $2 * No channel quiets
  93.   }
  94. }
  95.  
  96. on *:DIALOG:qDialog:*:*: {
  97.   var %chan = $gettok($dialog(qDialog).title, 4, 32)
  98.   if ($devent != mouse) {
  99.     if ($devent == init) {
  100.       did -b qDialog 2
  101.       did -b qDialog 3
  102.     }
  103.     if ($devent == sclick) {
  104.       if ($did == 1) {
  105.         if ($me isop %chan) {
  106.           if ($did(qDialog, 1, 0).sel == 1) {
  107.             did -e qDialog 2
  108.           }
  109.           else {
  110.             did -b qDialog 2
  111.           }
  112.           did -e qDialog 3
  113.         }
  114.         else {
  115.           did -b qDialog 2
  116.           did -b qDialog 3
  117.         }
  118.       }
  119.       if ($did == 3) {
  120.         if (%chan != -) {
  121.           var %line = $did(qDialog, 1, 1).sel
  122.           var %mask
  123.           var %modes
  124.           var %numselect = $did(qDialog, 1, 0).sel
  125.           var %select = 0
  126.           while (%select < %numselect) {
  127.             inc %select
  128.             %mask = $gettok($did(qDialog, 1, %line), 1, 32)
  129.             %modes = $addtok(%modes, %mask, 32)
  130.             did -d qDialog 1 $did(qDialog, 1, 1).sel
  131.             if ($numtok(%modes, 32) == $modespl) {
  132.               mode %chan - $+ $str(q, $numtok(%modes, 32)) %modes
  133.               %modes = $null
  134.             }
  135.           }
  136.           if ($numtok(%modes, 32)) {
  137.             mode %chan - $+ $str(q, $numtok(%modes, 32)) %modes
  138.           }
  139.           did -b qDialog 2
  140.           did -b qDialog 3
  141.         }
  142.       }
  143.     }
  144.     if ($devent == dclick) {
  145.       if ($did == 1) {
  146.         clipboard $did(qDialog, 1).seltext
  147.         echo -acn info * $did(qDialog, 1).seltext copied to clipboard
  148.       }
  149.     }
  150.   }
  151. }
RAW Paste Data
Top