aboutsummaryrefslogtreecommitdiffstats
path: root/data/defscript
diff options
context:
space:
mode:
authorGravatar Elvio Basello2007-04-03 17:14:07 +0000
committerGravatar Elvio Basello2007-04-03 17:14:07 +0000
commit12158aae444510b695d9afbe24e44ec958d11f7a (patch)
tree417947ca376dbf2995c57a746a242c7ffdd165a1 /data/defscript
parent*AUTOMATICALLY* updated KVI_SOURCES_DATE variable (diff)
downloadKVIrc-12158aae444510b695d9afbe24e44ec958d11f7a.tar.gz
KVIrc-12158aae444510b695d9afbe24e44ec958d11f7a.tar.bz2
KVIrc-12158aae444510b695d9afbe24e44ec958d11f7a.zip
added gmsg command
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@458 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'data/defscript')
-rw-r--r--data/defscript/default.kvs45
1 files changed, 45 insertions, 0 deletions
diff --git a/data/defscript/default.kvs b/data/defscript/default.kvs
index dd0450b11..e1e6e0ee8 100644
--- a/data/defscript/default.kvs
+++ b/data/defscript/default.kvs
@@ -99,6 +99,51 @@ alias(ms)
raw -q memoserv $0-
}
+alias(gmsg)
+{
+ # Global message
+
+ #Check null message
+ if(!$0){
+ echo $tr("Usage"): /gmsg [-waohvq] <$tr("message")>
+ echo $tr("-w: send message to all channel owners")
+ echo $tr("-a: send message to all channel admins")
+ echo $tr("-o: send message to all channel ops")
+ echo $tr("-h: send message to all channel halfops")
+ echo $tr("-v: send message to all channel voices")
+ echo $tr("-q: quiet mode")
+ halt
+ }
+
+ # Check for quiet message
+ if($sw(q))
+ %cmd="message -q"
+ else
+ %cmd="message"
+
+ # Check null switches
+ if((!$sw(w))&&(!$sw(a))&&(!$sw(o))&&(!$sw(h))&&(!$sw(v))){
+ eval %cmd $chan.name($active) $0-
+ halt
+ }
+
+ # Check switches passed
+ if($sw(w))
+ eval %cmd \~$chan.name($active) $0-
+
+ if($sw(a))
+ eval %cmd \!$chan.name($active) $0-
+
+ if($sw(o))
+ eval %cmd \@$chan.name($active) $0-
+
+ if($sw(h))
+ eval %cmd \%$chan.name($active) $0-
+
+ if($sw(v))
+ eval %cmd \+$chan.name($active) $0-
+}
+
alias(gnotice)
{
# Global notice