aIRC — File Browser
aIRCv0.8.69 / aIRCv0.8.69 / script / rc.mrc
rc.mrc — 21.01 KB — Download this file
;/**********************************************************************
; *
; * aIRC
; * Remote Commands
; *
; **********************************************************************/
#_rctext off
ON *:TEXT:*:?:{ _eggdrop.parse.rc $1- }
#_rctext end
#_rcctcp off
CTCP *:*:?:{ _eggdrop.parse.rc $1- }
#_rcctcp end
; addhost
; addhost <password> <hostmask>
alias _msg.addhost {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject))
if (%++handle == $null) || (b isincs %++flags) || ($1 == $null) { return }
if (c isincs %++flags) {
if (%reject) { %reply You're at a common site; you can't IDENT. }
return
}
tokenize 32 $iif($1 != $null,$1,$null) $_fixmask($2)
if ($2 == $null) {
if (%reject) { %reply You must supply a hostmask }
}
elseif ($_userpass(%++handle) == $null) {
if (%reject) { %reply You don't have a password set. }
}
elseif ($_not($_passwdok(%++handle,$1))) {
if (%reject) { %reply Access denied. }
}
elseif ($_finduser($2)) {
if (%reject) { %reply That hostmask clashes with another already in use. }
}
else {
_putcmdlog ( $+ $fulladdress $+ ) !*! ADDHOST $2
%reply Added hostmask: $2
__cmd.+host $null %++handle $2
return
}
_putcmdlog ( $+ $fulladdress $+ ) !*! failed ADDHOST $2
}
; die +n
; die <password> [message]
alias _msg.die {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject))
if (%++handle == $null) || (n !isincs %++flags) || ($1 == $null) { return }
if ($_userpass(%++handle) == $null) {
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! failed DIE
if (%reject) { %reply You don't have a password set. }
}
elseif ($_not($_passwdok(%++handle,$1))) { _putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! failed DIE }
else {
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! DIE
%reply Bot shut down beginning....
_partyline.display * * * $null * *** SCRIPT SHUTDOWN (authorized by %++handle $+ )
if ($_not($_getsetup(script,quiet-save))) {
_putcmdlog Writing user file...
_putcmdlog Writing channel file ...
}
_putcmdlog * DEAD BY REQUEST OF $fulladdress
exit $iif($3- != $null,$3-,$nick)
}
}
; go +o|o
; go <channel>
alias _msg.go {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject))
if (%++handle == $null) { return }
if ($1 == $null) {
var %i = $chan(0),%chan,%z = 0
while (%i) {
%chan = $chan(%i)
if (o isincs $_nickflags(%++handle,%chan)) {
if (%z < 2) { %z = 1 }
if ($me !isop %chan) {
%z = 2
rejoin %chan
}
}
dec %i
}
if (%z == 2) { _putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! GO }
elseif (%z == 1) { _putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! failed GO (i'm chop) }
else { _putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! failed GO (not op) }
}
elseif ($_ischan($1)) {
var %flags = $_nickflags(%handle,$1)
if ($me !ison $1) { _putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! failed GO $1 (i'm blind) }
elseif (o !isincs %flags) { _putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! failed GO $1 (not op) }
elseif ($me isop $1) { _putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! failed GO $1 (i'm chop) }
else {
rejoin $1
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! GO $1
}
}
}
; help
; help <password> [nickname]
alias _msg.help {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject))
if (%++handle == $null) {
_putcmdlog ( $+ $fulladdress $+ ) !*! HELP $1-
if (%reject) {
%reply I don't know you; please introduce yourself first.
%reply $iif($event == text,/MSG,/CTCP) $me hello
}
return
}
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! HELP $1-
var %file = etc\help\pl_msg.help,%win = @__help,%filet = $_tmpdir(msghelp.tmp),%initopic = $1
if ($_not($_isfile(%file))) {
%reply No help.
return
}
if ($1 == $null) { %initopic = help }
if ($istok($_getsetup(script,_rc.commands),%initopic,32) == $false) {
%reply No help available on that.
return
}
if ($ini(%file,%initopic)) {
close -@ %win
window -h %win
loadbuf -t $+ %initopic %win $"(%file)
_eggtext.parse %++handle 1 %win %filet
if ($file(%filet).size) {
window -h %win
loadbuf %win " $+ %filet $+ "
_remove %filet
var %i = 1,%n = $line(%win,0)
while (%i <= %n) {
%reply $replacecs($line(%win,%i),<MSG|CTCP>,$iif($event == text,MSG,CTCP),<msg|ctcp>,$iif($event == text,msg,ctcp))
inc %i
}
close -@ %win
return
}
}
_remove %filet
%reply No help available on that.
}
; ident
; ident <password> [nickname]
alias _msg.ident {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject))
if ((%++handle != $null) && (b isincs %++flags)) || ($1 == $null) { return }
if (%++handle != $null) && (c isincs %++flags) {
if (%reject) { %reply You're at a common site; you can't IDENT. }
return
}
tokenize 32 $1 $iif($2 != $null,$2,$nick)
if ($_isuser($2)) {
var %flags2 = $_nickflags($2)
if (b isincs %flags2) { }
elseif ($_userpass($2) == $null) {
if (%reject) { %reply You don't have a password set. }
}
elseif ($_not($_passwdok($2,$1))) {
if (%reject) { %reply Access denied. }
}
elseif (%++handle == $2) {
if (%reject) { %reply I recognize you there. }
return
}
elseif (%++handle) {
if (%reject) { %reply You're not $2 $+ , you're %++handle $+ . }
return
}
else {
var %hostmask = $_mask($fulladdress,%_maskuser)
_putcmdlog ( $+ $fulladdress $+ ) !*! IDENT $2
%reply Added hostmask: %hostmask
__cmd.+host $null $2 %hostmask
return
}
}
else {
if (%++handle) && (%reject) { %reply You're not $2 $+ , you're %++handle $+ . }
}
_putcmdlog ( $+ $fulladdress $+ ) !*! failed IDENT $2
}
; info
; info [password] [channel] [an info line]
alias _msg.info {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject)),%parms,%pass,%chan,%line,%oldline,%locked = 0
if ($_not($_getsetup(script,use-info))) || (%++handle == $null) || (b isincs %++flags) || (c isincs %++flags) { return }
%parms = $1-
if ($_userpass(%++handle) != $null) {
var %pass = $1,%parms = $2-
if ($_not($_passwdok(%++handle,%pass))) {
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! failed INFO
return
}
}
if ($_ischan($gettok(%parms,1,32))) { var %chan = $gettok(%parms,1,32),%line = $gettok(%parms,2-,32),%oldline = $_getuserfield(%++handle,$_nospaces(infoline.,%chan)) }
else { var %line = %parms,%oldline = $_getuserfield(%++handle,infoline.default) }
if (@* iswm %oldline) { var %locked = 1,%oldline = $_inputcom(@,%oldline) }
if (@* iswm %line) { %line = $_inputcom(@,%line) }
if ($_ismaster(%++handle,%chan,mn)) { %locked = 0 }
if (%line != $null) {
if (%locked) {
%reply Your info line is locked
return
}
__cmd.chinfo $null %++handle %chan %line
if (%line == none) {
if (%chan) { %reply Removed your info line on %chan }
else { %reply Removed your info line. }
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! INFO %chan NONE
return
}
else {
%reply Now: %line
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! INFO %chan ...
}
}
else {
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! INFO? %chan
if (%oldline != $null) {
%reply Currently: %oldline
%reply To remove it: $iif($event == text,/msg,/ctcp) $me info <pass> %chan none
}
else {
if (%chan) { %reply You have no info set on %chan }
else { %reply You have no info set. }
}
}
}
; invite +o|o
; invite <password> <channel>
alias _msg.invite {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject))
if (%++handle == $null) || ($1 == $null) || ($_userpass(%++handle) == $null) || ($_not($_ismaster(%++handle,1,omn))) { return }
if ($_passwdok(%++handle,$1)) {
if ($2 == *) {
var %i = $chan(0),%chan
while (%i) {
%chan = $chan(%i)
if (o isincs $_nickflags(%++handle,%chan)) && ($_ischanmode(%chan,i)) { _putserv $nick & .quote invite $nick %chan }
dec %i
}
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! INVITE ALL
return
}
elseif ($_not($_ischan($2))) {
%reply Usage: $iif($event == text,/msg,/ctcp) $me invite <pass> <channel>
return
}
elseif ($me !ison $2) {
%reply $2 $+ : Not on that channel right now.
return
}
elseif (o isincs $_nickflags(%++handle,$2)) {
_putserv $nick & .quote invite $nick $2
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! INVITE $2
return
}
}
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! failed INVITE $2
}
; jump +m
; jump <password> [server [port [server password]]]
alias _msg.jump {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject))
if (%++handle == $null) || ($_not($_ismaster(%++handle,0,mn))) { return }
if ($_userpass(%++handle) == $null) {
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! failed JUMP
if (%reject) { %reply You don't have a password set. }
return
}
elseif ($_passwdok(%++handle,$1)) {
if ($2- != $null) {
if ($_not($_ishost($2))) { tokenize 32 $1 $gettok($_mini(mirc,host),2,58) $iif($_isint($2),$2-,$3-) }
if ($_not($_isint($3))) { tokenize 32 $1 $2 $_minio(5,11) $3- }
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! JUMP $2-
}
else { _putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! JUMP }
%reply Jumping servers...
if ($_connected) { quit changing servers }
server $iif($2- != $null,$2-)
}
else { _putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! failed JUMP }
}
; key +o|o
; key <password> <channel>
alias _msg.key {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject))
if (%++handle == $null) || ($1 == $null) || ($_not($_ismaster(%++handle,1,omn))) { return }
if ($_userpass(%++handle) != $null) && ($_passwdok(%++handle,$1)) {
if ($_not($_ischan($2))) { %reply Usage: $iif($event == text,/msg,/ctcp) $me key <pass> <channel> }
elseif ($me !ison $2) { %reply $2 $+ : Not on that channel right now. }
elseif (o isincs $_nickflags(%++handle,$2)) {
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! KEY $2
if ($chan($2).key != $null) {
%reply $2 $+ : key is $ifmatch
if ($nick !ison $2) && ($_ischanmode($2,i)) && ($_getsetup(script,invite-key)) { _putserv $nick & .quote invite $nick $2 }
}
else { %reply $2 $+ : no key set for this channel} }
}
}
else { _putcmdlog ( $+ $fulladdress $+ ) !*! failed KEY }
}
;_
; memory +m
; memory <password>
; op +o|o
; op <password> [channel]
alias _msg.op {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject))
if (%++handle == $null) || ($1 == $null) || ($_not($_ismaster(%++handle,1,omn))) { return }
if ($_userpass(%++handle) != $null) && ($_passwdok(%++handle,$1)) {
if ($2 == $null) {
var %i = $chan(0),%chan
while (%i) {
%chan = $chan(%i)
if ($me isop %chan) && ($nick ison %chan) && (o isincs $_nickflags(%++handle,%chan)) { op %chan $nick }
dec %i
}
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! OP
return
}
elseif ($_ischan($2)) && ($me isop $2) {
if ($nick ison $2) && (o isincs $_nickflags(%++handle,$2)) { op $2 $nick }
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! OP $2
return
}
}
_putcmdlog ( $+ $fulladdress $+ ) !*! failed OP
}
; pass
; pass <password>
; pass <oldpass> <newpass>
alias _msg.pass {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject)),%pass = $_userpass(%++handle)
if (%++handle == $null) || (b isincs %++flags) || (c isincs %++flags) { return }
if ($1 == $null) {
%reply You $iif($_userpass(%++handle) == $null,don't) have a password set.
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! PASS?
return
}
if (%pass != $null) && ($2 == $null) {
%reply You already have a password set.
return
}
if ($2 != $null) {
if ($_not($_passwdok(%++handle,$1))) {
%reply Incorrect password.
return
}
}
else { tokenize 32 $1 $1 }
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! PASS...
if ($len($2) < 6) { %reply Please use at least 6 characters. }
else {
__cmd.chpass $null %++handle $2
%reply Password $iif($1 == $2,set,changed) to: $2
}
}
; status +m|m
; status <password>
alias _msg.jump {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject))
if (%++handle == $null) || ($_not($_ismaster(%++handle,0,mn))) || ($1 == $null) { return }
if ($_userpass(%++handle) != $null) && ($_not($_passwdok(%++handle,$1))) {
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! failed STATUS
return
}
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! STATUS
%reply I am $me $+ , running aIRC v $+ $_vers $+ +win $+ $bits (c)1997-2001 tabo.
%reply Running on mIRC $+ $bits $version
if ($_getsetup(script,admin) != $null) { %reply Admin: $ifmatch }
%reply Channels: $replace($_mychans,$chr(32),$chr(44))
%reply $_nsingoplur($_countusers,user,users)
if ($_connected) {
%reply Connected for $_duratio($online)
%reply Online as: %.myaddress
}
}
; voice +o|o
; voice <password> [channel]
alias _msg.voice {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject))
if (%++handle == $null) || ($1 == $null) || ($_not($_ismaster(%++handle,1,omn))) { return }
if ($_userpass(%++handle) != $null) && ($_passwdok(%++handle,$1)) {
if ($2 == $null) {
var %i = $chan(0),%chan
while (%i) {
%chan = $chan(%i)
if ($me isop %chan) && ($nick ison %chan) && (v isincs $_nickflags(%++handle,%chan)) { voice %chan $nick }
dec %i
}
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! VOICE
return
}
elseif ($_ischan($2)) && ($me isop $2) {
if ($nick ison $2) && (v isincs $_nickflags(%++handle,$2)) { voice $2 $nick }
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! VOICE $2
return
}
}
_putcmdlog ( $+ $fulladdress $+ ) !*! failed VOICE
}
; whois
; whois <nick>
alias _msg.whois {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject)),%handle = $1,%flags,%msg,%chanflags,%laston = 0,%lastonchan
if (%++handle == $null) { return }
if ($1 == $null) {
if (%reject) { %reply Usage: $iif($event == text,/MSG,/CTCP) $me whois <nick> }
return
}
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! WHOIS $1
if ($_not($_isuser($1))) {
if ($comchan($1,0)) && ($_nick2hand($1)) {
%handle = $ifmatch
%reply [ $+ $1 $+ ] AKA ' $+ %handle $+ ':
}
else {
%reply [ $+ $1 $+ ] No user record.
return
}
}
var %flags = $_nickflags(%handle)
if (b !isincs %flags) && ($_inputcom(@,$_getuserfield(%handle,infoline.default)) != $null) { %reply [ $+ $1 $+ ] $ifmatch }
if ($_getuserfieldp(%handle,email) != $null) { %reply [ $+ $1 $+ ] email: $ifmatch }
%msg = [ $+ $1 $+ ]
if ($comchan($_hand2nick(%handle,*,1),1) != $null) { %msg = %msg Now on channel $ifmatch }
else {
var %chans = $_ruini(%handle,channels),%chan,%i = $numtok(%chans,32)
while (%i) {
var %chan = $gettok(%chans,%i,32),%chanflags = $_nickflags(%handle,%chan)
if ($_getuserfield(%handle,$_nospaces(laston.,%chan)) > %laston) && (($nick ison %chan) || (o isincs %chanflags) || (f isincs %chanflags)) {
%laston = $_getuserfield(%handle,$_nospaces(laston.,%chan))
%lastonchan = %chan
}
dec %i
}
if (%laston) { %msg = %msg Last seen at $asctime(%laston,mmm dd HH:nn) on %lastonchan }
else { %msg = %msg Never joined one of my channels. }
}
if (o isincs %flags) { %msg = %msg (is a global op) }
if (b isincs %flags) { %msg = %msg (is a bot) }
if (m isincs %flags) || (n isincs %flags) { %msg = %msg (is a master) }
%reply %msg
}
; notes
; notes <password> <index>
; notes <password> <read> <# or ALL>
; notes <password> <erase> <# or ALL>
; notes <password> <to> <nickname> <message...>
alias _msg.notes {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject)),%com = $2,%parms = $3-
if (%++handle == $null) || (c isincs %++flags) { return }
if ($1 == $null) {
if (%reject) {
%reply Usage: NOTES [pass] INDEX
%reply NOTES [pass] TO <nick> <msg>
%reply NOTES [pass] READ <# or ALL>
%reply NOTES [pass] ERASE <# or ALL>
%reply # may be numbers and/or intervals separated by ;
%reply ex: NOTES mypass ERASE 2-4;8;16-
}
return
}
var %pass = $_userpass(%++handle)
if (%pass == $null) || ($1 !=== %pass) { return }
if ($2 == to) {
set -u %c.note.nodisplay
_cmd.note %++handle $3-
unset %c.note.nodisplay
tokenize 32 $result
if ($1 == 555) { %reply Usage: NOTES [pass] TO <nick> <message> }
elseif ($1 == 410) { %reply Invalid handle: $2 }
elseif ($1 == 430) { %reply I don't know anyone by that name. }
elseif ($1 == 607) { %reply That's a bot. You can't leave notes for a bot. }
elseif ($1 == 614) { %reply $2 rejected your note. }
elseif ($1 == 244) { %reply Note delivered. }
elseif ($1 == 262) { %reply Sorry, that user has too many notes already. }
elseif ($1 == 245) { %reply Note delivered. }
}
elseif ($istok(index read erase,$2,32)) {
__cmd.notes %++handle $2-
tokenize 32 $result
if ($1 == 576) { %reply You have no messages. }
elseif ($1 == 577) { %reply You don't have that many messages. }
elseif ($1 == 260) { %reply Erased $_nsingoplur($2,note,notes) $+ ; $3 left. }
elseif ($1 == 261) { %reply Erased all notes. }
elseif ($1 == 222) {
if (%com == index) {
dline @__notes 1
dline @__notes $line(@__notes,0)
aline @__notes ( $+ $line(@__notes,0) total)
}
_playwin @__notes %reply
close -@ @__loadnotes @__notes
}
}
elseif (%reject) { %reply Use '.notes read' to read them. INDEX, READ, ERASE, TO }
_putcmdlog ( $+ $fulladdress $+ ) ! $+ %++handle $+ ! NOTES $upper(%com) $iif(%parms != $null,...)
}
alias _msg.hello {
var %reply = _puthelp $nick & _qnotice $nick,%reject = $_not($_getsetup(script,quiet-reject)),%hostmask
if ($_not($_getsetup(script,learn-users))) { return }
if ($_matchban($fulladdress,$null)) {
if (%reject) { %reply You're banned, goober. }
return
}
if (%++handle != $null) && (c !isincs %++flags) {
%reply Hi, %++handle
return
}
if ($_isuser($nick)) {
%reply I don't recognize you from that host.
%reply Either you are using someone else's nickname or you need to type: $iif($event == text,/MSG,/CTCP) $me IDENT (password)
return
}
if ($_not($_isvalidhandle($nick))) {
if (%reject) { %reply Your nick has invalid characters. }
return
}
if (c isincs %++flags) { %hostmask = $nick $+ ! $+ $gettok($_mask($fulladdress,%_maskuser),2,33) }
else { %hostmask = $_mask($fulladdress,%_maskuser) }
_putlog Introduced to $nick ( $+ %hostmask $+ ) $iif(c isincs %++flags,-- common site)
%reply Hi $nick $+ ! I'm $me
%reply I'll recognize you by hostmask ' $+ %hostmask $+ ' from now on.
if (c isincs %++flags) {
%reply Since you come from a common irc site, this means you should
%reply always use this nickname when talking to me.
}
%reply All commands are done via $iif($event == text,/MSG,/CTCP) $+ . For the complete list, $iif($event == text,/MSG,/CTCP) $me help Cya!
_dummy $_creatinguser($nick,%hostmask,$_getsetup(script,default-flags),$null)
if ($_getsetup(script,notify-newusers) != $null) {
var %i = 1,%notify = $replace($ifmatch,$chr(32),$chr(44)),%n = $numtok(%notify,44)
while (%i <= %n) {
_cmd.note $null $gettok(%notify,%i,44) introduced to $nick from %hostmask $iif(c isincs %++flags,-- common site)
inc %i
}
}
}
alias _eggdrop.parse.rc {
if ($nick == $me) || ($1 == $null) || ($istok($_getsetup(script,_rc.commands),$1,32) == $false) { return }
var %alias = _msg. $+ $1
if ($isalias(%alias)) { %alias $2- }
elseif ($istok($_getsetup(script,userinfo-fields),$1,32)) { __msg.userinfo $1- }
}