HeilTec

mychans.mrc - Simple channel watcher. 2011-12-02

Dec 2nd, 2011
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.29 KB | None | 0 0
  1. /*
  2. *  mychans.mrc - Simple channel watcher by HeilTec (Γ².Γ’) 2011-12-02
  3. *  Features Dialog input and popup menu management of two lists:
  4. *  Watched Channels - Containes full names of channels to watch
  5. *  Ignored Nicks - Lists the nick names to be ignored.
  6. *
  7. *  Right-ckick in channel and Select Watch (active) to toggle chan
  8. *  Right.click in Nick list and select Ignore (nick) to toggle user
  9. */
  10.  
  11.  
  12. ; Watch channels for joins
  13.  
  14. on 1:JOIN:*: {
  15.   if (%watcher != 1 || ($nick == $me) || ($nick isin %ignick)) halt
  16.   ;echo -a $nick logged into $chan
  17.   if ($chan isin %mychans) {
  18.     notice $me Welcome $nick to $chan
  19.   }
  20. }
  21.  
  22. menu menubar {
  23.   My channels
  24.   .Watch channels: /dialog -m wcdia watchan
  25. }
  26.  
  27. menu channel {
  28.   My channels
  29.   .Watch channels ... : /dialog -m wcdia watchan
  30.   .$iif(%watcher,$style(1)) Enable: {
  31.     if (%watcher) unset %watcher
  32.     else set %watcher 1
  33.   }
  34.   .$iif($active isin %mychans,$style(1)) Watch $active: {
  35.     if ($active isin %mychans) set %mychans $replace(%mychans, $active, $null)
  36.     else set %mychans %mychans $active
  37.   }
  38. }
  39. menu nicklist {
  40.   My channels
  41.   .Watch channels ...: /dialog -m wcdia watchan
  42.   .$iif(%watcher,$style(1)) Enable:{
  43.     if (%watcher) unset %watcher
  44.     else set %watcher 1
  45.   }
  46.   .$iif($1 isin %ignick,$style(1)) Ignore $1: {
  47.     if ($1 isin %ignick) set %ignick $replace(%ignnick, $1, $null)
  48.     else set %ignick %ignick $1
  49.   }
  50. }
  51.  
  52. on 1:dialog:wcdia:*:* {
  53.   ;  echo detected devent: $devent ; did: $did
  54.   if ($devent == init) {
  55.     echo handling devent: $devent ; did: $did ;
  56.     did -ra wcdia 10 %mychans
  57.     did -ra wcdia 20 %ignick
  58.     did $iif(%watcher,-s,-c) wcdia 90
  59.   }
  60.   if (($did == 100) && ($devent == sclick)) {
  61.     ;    echo handling devent: $devent ; did: $did
  62.     set %mychans $did(10)
  63.     set %ignick $did(20)
  64.     set %watcher $iif($did(90).state,1,0)
  65.   }
  66. }
  67. dialog watchan {
  68.   title "Watched channels"
  69.   option dbu
  70.   size -1 -1 250 82
  71.   text "Enter full #Channel names to watch", 1, 6 4 240 8, nowrap
  72.   edit "", 10, 5  15 240  10, autohs
  73.  
  74.   text "Enter full Nick names to ignore", 2, 6 34 240 8, nowrap
  75.   edit "", 20, 5  45 240  10, autohs
  76.  
  77.   check "Enable Channel Watcher", 90, 10 70 150 10, left
  78.  
  79.   button "OK",    100, 170  70  25  10, ok
  80.   button "Cancel",199, 220  70  25  10, cancel
  81. }
  82.  
  83.  
Add Comment
Please, Sign In to add comment