/usr/share/kvirc/4.2/defscript/aliases.kvs is in kvirc-data 4:4.2.0-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 | # Default aliases file
#
# TODO:
# ignore, notify and unignore should go in the core
#
# If possible, get rid of $str.* from the default popups
# avoiding to load the module at every channel popup open action...
# (Find a core function that retrieves the number of nicknames passed ?)
# Another solution would be to increase the str.module core lock-time ?
#
#
# Backward compatibility stuff
#
alias(avatar)
{
# avatar target file
if(!$0)
{
echo $tr("Missing target, no action taken","defscript")
return
}
if($1)
{
avatar.set $1
}
avatar.notify $0
}
alias(clear)
{
window.clearOutput
}
alias(connect)
{
objects.connect $0 $1 $2 $3
}
alias(disconnect)
{
objects.disconnect $0 $1 $2 $3
}
alias(killclass)
{
objects.killclass $0
}
alias(clearobjects)
{
objects.clear $0
}
alias(nickserv)
{
# Silent
raw -q NickServ $0-
}
alias(chanserv)
{
# Silent
raw -q ChanServ $0-
}
alias(memoserv)
{
# Silent
raw -q MemoServ $0-
}
alias(ns)
{
# Silent
raw -q nickserv $0-
}
alias(cs)
{
# Silent
raw -q chanserv $0-
}
alias(ms)
{
# Silent
raw -q memoserv $0-
}
alias(gnotice)
{
# Global notice
# Check channel validity
%szChan = $0
if(!%szChan)
{
echo $tr("Usage","defscript"): /gnotice [-mwaohvq] <$tr("channel","defscript")> <$tr("message","defscript")>
echo $tr("-m: send a message instead of a notice","defscript")
echo $tr("-w: send notice to all channel owners","defscript")
echo $tr("-a: send notice to all channel admins","defscript")
echo $tr("-o: send notice to all channel ops","defscript")
echo $tr("-h: send notice to all channel halfops","defscript")
echo $tr("-v: send notice to all channel voices","defscript")
echo $tr("-q: quiet mode")
halt
}
# Check the message validity
%szMsg = $1-
if($str.length(%szMsg) == 0)
{
echo $tr("Parameter message missing","defscript")
echo $tr("Type /gnotice for help","defscript")
halt
}
# Detect message type
if($sw(m,message)) %szCmd = "msg"
else %szCmd = "notice"
# Check for quiet message
if($sw(q,quiet)) %szCmd = $str.append(%szCmd," -q")
# Check null switches
if((!$sw(w,owners)) && (!$sw(a,admins)) && (!$sw(o,ops)) && (!$sw(h,halfops)) && (!$sw(v,voices)))
{
eval %szCmd %szChan %szMsg
halt
}
# Check switches passed
if($sw(w,owners)) eval %szCmd \~%szChan %szMsg
if($sw(a,admins)) eval %szCmd \!%szChan %szMsg
if($sw(o,ops)) eval %szCmd \@%szChan %szMsg
if($sw(h,halfops)) eval %szCmd \%%szChan %szMsg
if($sw(v,voices)) eval %szCmd \+%szChan %szMsg
}
alias(wallop)
{
if(!$0){
echo $tr("Usage","defscript"): /wallop <$tr("message","defscript")>
halt
}
# Due to server flood, timing may be very high
echo -w=$active $tr("Sending wallop to","defscript") $chan.name($active)
timer(wallop,5000,$chan.users(,,o),$0-)
{
if(%:localOps == ""){ %:localOps = $chan.users(,,o); %:curIndex = 0; }
if(%:curIndex == %:localOps[]#){ killtimer wallop; return; }
for(%i=0;%i<1;%i++)
{
if(%:localOps[%:curIndex] != $my.nick)
{
if(%:curIndex == %:localOps[]#){ killtimer wallop; return; }
msg -q %:localOps[%:curIndex] $1-
%:curIndex++
}
}
}
}
alias(kill)
{
raw -q kill $0 :$1-
}
alias(ms)
{
# Silent
quote ms $0-
}
# j: This is a really common one
alias(j)
{
#first we do a test if a chan is given as parameter
if(!$0)
{
echo $tr("Usage:","defscript")
echo " /j <chan>"
} else {
join $0-
}
}
# s: This too
alias(s)
{
if(!$0)
{
echo $tr("Usage:","defscript")
echo " /s <server>"
} else {
server $0-
}
}
# q: Ok, I am lazy :P
alias(q)
{
if(!$0)
{
echo $tr("Usage:","defscript")
echo " /q <nicklist> [message]"
} else {
query $0 $1-
}
}
# names: maybe this should be implemented on the core?
alias(names)
{
if(!$0)
{
if($window.type($active)!="channel")
{
echo $tr("Usage:","defscript") "/names <channel>"
} else {
raw names $chan.name($active)
}
} else {
raw names $0-
}
}
# kickban
alias(kb)
{
if(!$0)
{
echo $tr("Usage:","defscript")
echo " /kb <nick_list> [" $tr("reason","defscript") "]"
halt;
}
if(!$channel)
{
echo "[KB]: " $tr("This is not a channel window","defscript")
halt;
}
foreach(%nick,$str.split(",",$0))
{
if(%nick)
{
#if we don't know the user ident/host (yet), we can only ban his nick
if($isWellKnown(%nick)) %mask = $mask(%nick,$option(uintDefaultBanType));
else %mask = %nick;
if(!%mask)%mask = %nick; # plain ban
%reason = $1-
#if(!%reason)%reason = $tr("You're not welcome here!","defscript")
# This is tricky : we send everything
# as a single raw message just because
# we do not want delays between kick and ban
# if anti-server-flood is enabled
%raw = "kick $target %nick :%reason"
# kick %nick %reason
if($chan.isOp(%nick))%raw2 = "mode $target -o+b %nick %mask"
else %raw2 = "mode $target +b %mask"
raw -q %raw2$cr$lf%raw
}
}
}
# ame and amsg
alias(ame)
{
foreach(%i,$window.list(channel))if(%i!="") me -r=%i $0-
}
alias(amsg)
{
foreach(%i,$window.list(channel))msg $target(%i) $0-
}
alias(amsgall)
{
foreach(%i,$window.list(channel),$window.list(query))msg $target(%i) $0-
}
alias(ameall)
{
foreach(%i,$window.list(channel),$window.list(query))
{
if(%i!="") me -r=%i $0-
}
}
alias(awayall)
{
foreach(%w,$window.list(console,all))away -r=%w $0-;
}
# notify: this is a bit more complex
# We want to add an user to the notify list with a single command
# The notify lists are handled thru the registered users database
alias(notify)
{
# This one adds a registered users database entry
# For the specified nick and uses the specified mask
# If no mask is specified , a default one is constructed
# Then the "notify" property is set for the user
if(!$0)
{
echo $tr("Usage:","defscript")
echo " /notify <nick> [mask]"
halt
}
# Get the mask
%mask = $1
# no mask specified ? build it
if(!%mask)%mask = $0!*@*
# Now add the user (but do not replace old entries)
reguser.add -f -q $0 %mask
# Merge the notify property part with the old one (if any)
%oldNicks = $reguser.property($0,notify)
# It would be a good idea to check if the nikckname is already in the %oldNicks list
# but this is left as exercise for the reader.
%oldNicks << $0
# And finally set the property (use -n so the notify lists will be restarted)
reguser.setproperty -n $0 notify $0
# done...the notify list should be restarted now
}
alias(ignore)
{
# This one adds a registered users database entry
# For the specified nick and uses the specified mask
# If no mask is specified, a default one is constructed
# Then the "ignore" property is set for the user to 1
if(!$0)
{
echo $tr("Usage:","defscript")
echo " /ignore [-m|--remove] [-p|--query] [-c|--channel] [-n|--notice] [-t|--ctcp] [-i|--invite] [-d|--dcc] <nick>"
halt
}
# Now add the user (but do not replace old entries)
reguser.add -f -q $0 $mask($0,15);
# And finally set the property
# Check if ignore or unignore the user
if($sw(m,remove))
{
reguser.setIgnoreEnabled $0 0
} else {
reguser.setIgnoreEnabled $0 1
%flags="";
if($sw(p, query)) %flags = $str.append(%flags," -p")
if($sw(c, channel)) %flags = $str.append(%flags," -c")
if($sw(n, notice)) %flags = $str.append(%flags," -n")
if($sw(t, ctcp)) %flags = $str.append(%flags," -t")
if($sw(i, invite)) %flags = $str.append(%flags," -i")
if($sw(d, dcc)) %flags = $str.append(%flags," -d")
# if no flag has been passed, enable them all
if($isEmpty(%flags)) %flags = " -p -c -n -t -i -d"
eval reguser.setIgnoreFlags %flags $escape($0)
}
}
# Dcc...people commonly use "dcc send" instead of "dcc.send"
alias(dcc)
{
switch($0)
{
case(send):
{
dcc.send $1-
break
}
case(chat):
{
dcc.chat $1-
break
}
case(voice):
{
dcc.voice $1-
break
}
case(allow):
{
dccallow $1-
break
}
default:
{
echo "[DCC]: " $tr("Unsupported type:","defscript") $0
}
}
}
#
# return a string with the name of the curerent usermode
#
alias(usermodename)
{
if(!$0)
{
echo $tr("Usage:","defscript")
echo " /usermodename <nick>"
halt;
}
if(!$channel)
{
echo "[USERMODENAME]: " $tr("This is not a channel window","defscript")
halt;
}
if($chan.isOwner($0,$channel)){
return $tr("Channel Owner","defscript")
} elseif($chan.isAdmin($0,$channel)){
return $tr("Channel Administrator","defscript")
} elseif($chan.isOp($0,$channel)){
return $tr("Channel Operator","defscript")
} elseif($chan.isHalfOp($0,$channel)){
return $tr("Half Operator","defscript")
} elseif($chan.isVoice($0,$channel)){
return $tr("Voice","defscript")
} elseif($chan.isUserOp($0,$channel)){
return $tr("User Operator","defscript")
} else {
return $tr("Normal User","defscript")
}
}
#shortcut for commonly called algorithm
alias(md5)
{
return $str.digest($0-,md5)
}
alias(sha1)
{
return $str.digest($0-,sha1)
}
# DNS : people like it
alias(dns)
{
if(!$context)
{
echo "[DNS]: " $tr("You must use DNS in an IRC context","defscript")
halt
}
if(!$server)
{
echo "[DNS]: " $tr("You must be connected to a server","defscript")
halt
}
if(!$0)
{
echo $tr("Usage:","defscript")
echo " /dns <nickname>"
halt
}
if($isWellKnown($0))host -a $hostname($0)
else {
awhois($0)
{
if(!$2)
{
echo "[DNS]: " $tr("No such user:","defscript") $0
} else {
host -a $2
}
}
}
}
alias(ss)
{
# Silent
msg -q SeenServ $0-
}
alias(seenserv)
{
# Silent
msg -q SeenServ $0-
}
alias(hs)
{
# Silent
msg -q HostServ $0-
}
alias(hop)
{
// Retrieve channel
%chan=$0
if(!%chan) %chan=$chan.name
// Retrieve channel key
if($channel(%chan)!=0)
%key=$chan.key($channel(%chan))
else %key=0
// Exit channel
if($window.type($channel(%chan))=="channel")
eval "part --keep $escape(%chan) $option(stringPartMessage)"
// Rejoin channel
if(!%key) join %chan
else join %chan %key
}
|