mIRC Home    About    Download    Register    News    Help

Print Thread
#247435 02/08/14 03:10 PM
Joined: Aug 2014
Posts: 32
S
Sparkz Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2014
Posts: 32
on $*:text:/^!addcom !?(\S+)/iS:#:{
if ($nick !isop #) { msg # Sorry $nick - You don't have permission to do that. | return }
writeini commands.ini # $regml(1) $3-
var %text $read(commands.txt,1)
if %text == $null {
var %line Commands List: ! $+ $regml(1) $+ ,
}
else {
var %line %text ! $+ $regml(1)
}

write -l1 commandsresonse.txt %line
msg # $nick - The command $$2 has been added.
}

on $*:text:/^!delcom !?(\S+)/iS:#:{
if ($nick !isop #) { msg # Sorry $nick - You don't have permission to do that. | return }
remini commands.ini # $regml(1)
var %text $read(commands.txt,1)
if %text != $null {
var %line $remove(%text,! $+ $regml(1))
}
write -l1 commandsresonse.txt %line
msg # $nick - The command $$2 has been removed.
}

on $*:text:/^!editcom !?(\S+)/iS:#:{
if ($nick !isop #) { msg # Sorry $nick - You don't have permission to do that. | return }
elseif ($readini(commands.ini,n,#,$regml(1))) {
writeini commands.ini # $regml(1) $$3-
msg $chan $nick -> The command $2 has been updated.
}
Else msg # Sorry, that command does not exist.
}
on $*:text:/^!(\S+)/:#:{
if ((%floodcom) || ($($+(%,floodcom.,$2),2))) { return }
set -u10 %floodcom On
set -u30 %floodcom. $+ $nick On
if ($readini(commands.ini,n,#,$regml(1))) msg # $v1
}


This is what I am using for mods in chat to be able to add, edit and delete commands. Is there a way to make the commands they add have a flood so it takes a while for the command to be posted again. If someone could help, that would be really appreciated.

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
if ((%floodcom) || ($($+(%,floodcom.,$2),2))) { return }

Kinda looks like it already prevents commands from being used globally per 10 seconds, and 30 seconds per chat user.

I guess maybe that should be
Code:
if ((%floodcom) || ($($+(%,floodcom.,$chan),2))) { return }

I don't generally work with that style of on text event soo I'm not 100% sure whats right and wrong..but it kinda seemed to me like this would be the right way to do it.

Last edited by Belhifet; 02/08/14 04:45 PM.

Link Copied to Clipboard