mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2014
Posts: 18
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Dec 2014
Posts: 18
Ok, so what I am wanting to do is have an !addcom !delcom !editcom script that puts a delay in between uses of the command. For example,
MOD: !addcom !Hello Hey
NOOB: !Hello
BOT: Hey
NOOB:!Hello
(it takes 15 seconds before the command works again for normal users, but for a mod it works instantly)
This is what I have so far

Code:
 on *:text:!addcom *:#: {
if ($nick isop #) {
var %r = $read(commands.txt,ns,$2)
if (%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) is already exist into the database! | return }
write commands.txt $2-
msg $chan /me + Command $2 has been added to the database!
}
}
on *:text:!delcom *:#: {
if ($nick isop #) {
var %r = $read(commands.txt,ns,$2)
if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist into the database! | return }
write -dl $+ $readn commands.txt
msg $chan /me - Command $2- has been deleted from the database!
}
}
on *:text:!editcom & *:#: {
if ($nick isop #) {
var %r = $read(commands.txt,ns,$2)
if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist into the database! | return }
write -l $+ $readn commands.txt $2-
msg $chan /me -> Command $2 has been updated!
}
}
ON *:TEXT:*:#: { tokenize 32 $strip($1-,burci)
if ($read(commands.txt, nts, $1)) {
var %com = $v1
var %com = $replace(%com,@user@,$iif($2,$2,?),@nick@,$nick,@target@,$target)
if (-ul=mod == $gettok(%com,1,32)) && ($nick !isop $chan) { msg $chan | return }
msg $chan $iif(-ul=mod == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
}

Last edited by dailyproblem; 10/05/15 03:29 AM.
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Code:
on *:text:!addcom *:#: {
  if ($nick isop #) {

This part tell your script that if the nick isop on a channel, then it should go on, if not it will stop.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Link Copied to Clipboard