mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2014
Posts: 3
C
Chang Offline OP
Self-satisified door
OP Offline
Self-satisified door
C
Joined: Jul 2014
Posts: 3
Does anyone know how to make a command that shows all the commands created in a .ini file. For example: I have these commands !addcom, !editcom, !delcom. They practically a command to create another command. I wanna know if there's a way to show the data stored in the commands.ini instead of a text file.
Or is there a way to have separate commands for separate channels.
Quote:
on *:TEXT:!commands:#: {
if ((%floodcom) || ($($+(%,floodcom.,$2),2))) { return }
set -u10 %floodcom On
set -u30 %floodcom. $+ $nick On
msg # Commands are: $read(commands.txt)
}


Last edited by Chang; 08/07/14 10:36 PM.
Joined: Apr 2014
Posts: 170
Vogon poet
Offline
Vogon poet
Joined: Apr 2014
Posts: 170
What is your add/remove script?

Joined: Jul 2014
Posts: 3
C
Chang Offline OP
Self-satisified door
OP Offline
Self-satisified door
C
Joined: Jul 2014
Posts: 3
I currently have it set up for the txt file. But here it is.
Quote:
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
}

Joined: Apr 2014
Posts: 170
Vogon poet
Offline
Vogon poet
Joined: Apr 2014
Posts: 170
edit: nvm. I mis-read the original post. Sorry.

Last edited by Bramzee; 09/07/14 05:21 AM.
Joined: Jul 2014
Posts: 3
C
Chang Offline OP
Self-satisified door
OP Offline
Self-satisified door
C
Joined: Jul 2014
Posts: 3
All this code works, I just want to make it so it separates the !commands (list of commands) from other channels so it doesn't show every single channels commands together.


Link Copied to Clipboard