Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * mychans.mrc - Simple channel watcher by HeilTec (Γ².Γ) 2011-12-02
- * Features Dialog input and popup menu management of two lists:
- * Watched Channels - Containes full names of channels to watch
- * Ignored Nicks - Lists the nick names to be ignored.
- *
- * Right-ckick in channel and Select Watch (active) to toggle chan
- * Right.click in Nick list and select Ignore (nick) to toggle user
- */
- ; Watch channels for joins
- on 1:JOIN:*: {
- if (%watcher != 1 || ($nick == $me) || ($nick isin %ignick)) halt
- ;echo -a $nick logged into $chan
- if ($chan isin %mychans) {
- notice $me Welcome $nick to $chan
- }
- }
- menu menubar {
- My channels
- .Watch channels: /dialog -m wcdia watchan
- }
- menu channel {
- My channels
- .Watch channels ... : /dialog -m wcdia watchan
- .$iif(%watcher,$style(1)) Enable: {
- if (%watcher) unset %watcher
- else set %watcher 1
- }
- .$iif($active isin %mychans,$style(1)) Watch $active: {
- if ($active isin %mychans) set %mychans $replace(%mychans, $active, $null)
- else set %mychans %mychans $active
- }
- }
- menu nicklist {
- My channels
- .Watch channels ...: /dialog -m wcdia watchan
- .$iif(%watcher,$style(1)) Enable:{
- if (%watcher) unset %watcher
- else set %watcher 1
- }
- .$iif($1 isin %ignick,$style(1)) Ignore $1: {
- if ($1 isin %ignick) set %ignick $replace(%ignnick, $1, $null)
- else set %ignick %ignick $1
- }
- }
- on 1:dialog:wcdia:*:* {
- ; echo detected devent: $devent ; did: $did
- if ($devent == init) {
- echo handling devent: $devent ; did: $did ;
- did -ra wcdia 10 %mychans
- did -ra wcdia 20 %ignick
- did $iif(%watcher,-s,-c) wcdia 90
- }
- if (($did == 100) && ($devent == sclick)) {
- ; echo handling devent: $devent ; did: $did
- set %mychans $did(10)
- set %ignick $did(20)
- set %watcher $iif($did(90).state,1,0)
- }
- }
- dialog watchan {
- title "Watched channels"
- option dbu
- size -1 -1 250 82
- text "Enter full #Channel names to watch", 1, 6 4 240 8, nowrap
- edit "", 10, 5 15 240 10, autohs
- text "Enter full Nick names to ignore", 2, 6 34 240 8, nowrap
- edit "", 20, 5 45 240 10, autohs
- check "Enable Channel Watcher", 90, 10 70 150 10, left
- button "OK", 100, 170 70 25 10, ok
- button "Cancel",199, 220 70 25 10, cancel
- }
Add Comment
Please, Sign In to add comment