|
Joined: Sep 2014
Posts: 46
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2014
Posts: 46 |
How would i make a !commands or !cmd command which will list the commands the bot has.
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
Try using this code and add in the msg fields next to !commands and your other commands. Help details: /help on text
ON !*:TEXT:!commands:#: { msg $chan [ $+ $nick $+ ]: Available commands are: !commands }
|
|
|
|
Joined: Sep 2014
Posts: 46
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2014
Posts: 46 |
Try using this code and add in the msg fields next to !commands and your other commands. Help details: /help on text
ON !*:TEXT:!commands:#: { msg $chan [ $+ $nick $+ ]: Available commands are: !commands } Thats kinda what i wanted, But i have a !addcom type of command which adds the commands to a file, So what it should be doing is reading that file with all the commands in it, But thats the problem, I don't know how to do that.
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
Try using this code: NOTE: rename the "commands.txt" with your own file!
ON !*:TEXT:!commands:#: {
var %f = commands.txt
if (!$isfile(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command available since now, file is NOT exist! | return }
if (!$lines(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command avaialable since now, file is EMPTY! | return }
msg $chan [ $+ $nick $+ ]: Starting now the list with all the commands that are available on the channel, Please wait...
var %t = $lines(%f)
var %i = 1
while (%i <= %t) {
var %r = $read(%f,nt,%i)
msg $chan [# $+ %i $+ ]: Command: $+ %r $+
inc %i
}
msg $chan [ $+ $nick $+ ]: End of command list. - (Total Commands: $+ %t $+ )
}
|
|
|
|
Joined: Sep 2014
Posts: 46
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2014
Posts: 46 |
Try using this code: NOTE: rename the "commands.txt" with your own file!
ON !*:TEXT:!commands:#: {
var %f = commands.txt
if (!$isfile(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command available since now, file is NOT exist! | return }
if (!$lines(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command avaialable since now, file is EMPTY! | return }
msg $chan [ $+ $nick $+ ]: Starting now the list with all the commands that are available on the channel, Please wait...
var %t = $lines(%f)
var %i = 1
while (%i <= %t) {
var %r = $read(%f,nt,%i)
msg $chan [# $+ %i $+ ]: Command: $+ %r $+
inc %i
}
msg $chan [ $+ $nick $+ ]: End of command list. - (Total Commands: $+ %t $+ )
}
Thats what i want thanks, But do you know how to make it so it dosent spam, Cause i want it to be in like one text, Cause it kinda spams.
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
Try replace all msg $nick to notice $nick on the code.
|
|
|
|
Joined: Sep 2014
Posts: 46
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2014
Posts: 46 |
Try replace all msg $nick to notice $nick on the code. I don't see any msg $nick's in that code.
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
Sorry, i mean msg $chan to notice $nick
|
|
|
|
Joined: Sep 2014
Posts: 46
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2014
Posts: 46 |
Sorry, i mean msg $chan to notice $nick That still spams, It might be cause i'm doing this on twitch and there IRC is diff, Idk
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
What do you mean spam, tell me what exactly you want i give you to notice the nick and not message the channel with the results.
|
|
|
|
Joined: Sep 2014
Posts: 46
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2014
Posts: 46 |
What do you mean spam, tell me what exactly you want i give you to notice the nick and not message the channel with the results. This is what it looks like when i do the command: http://gyazo.com/116d94401a06b4384f804001b5659b4f
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
YEs and where is the problem? that's the way the !commands working. you wanted a list of all commands to the channel here you are.
|
|
|
|
Joined: Sep 2014
Posts: 46
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2014
Posts: 46 |
YEs and where is the problem? that's the way the !commands working. you wanted a list of all commands to the channel here you are. But it dosent say it in like just one text like one chat message, It spams a lot of them heres the full chat. http://gyazo.com/8e00af3034b0f496e1f4b28ed35acffa
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
Try using this code maybe is that you want:
ON !*:TEXT:!commands:#: {
var %f = commands.txt
if (!$isfile(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command available since now, file is NOT exist! | return }
if (!$lines(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command avaialable since now, file is EMPTY! | return }
msg $chan [ $+ $nick $+ ]: Starting now the list with all the commands that are available on the channel, Please wait...
var %t = $lines(%f)
var %i = 1
while (%i <= %t) {
var %r = $read(%f,nt,%i)
var %g = $gettok(%r,1,32)
var %com = $addtok(%com,%g,32)
inc %i
}
if (%com) { msg $chan [ $+ $nick $+ ]: All the available commands are: $+ %com $+ }
elseif (!%com) { msg $chan [ $+ $nick $+ ]: There is NOT any command available on the file! | return }
msg $chan [ $+ $nick $+ ]: End of command list. - (Total Commands: $+ $numtok(%com,32) $+ )
}
|
|
|
|
Joined: Sep 2014
Posts: 46
Ameglian cow
|
OP
Ameglian cow
Joined: Sep 2014
Posts: 46 |
Try using this code maybe is that you want:
ON !*:TEXT:!commands:#: {
var %f = commands.txt
if (!$isfile(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command available since now, file is NOT exist! | return }
if (!$lines(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command avaialable since now, file is EMPTY! | return }
msg $chan [ $+ $nick $+ ]: Starting now the list with all the commands that are available on the channel, Please wait...
var %t = $lines(%f)
var %i = 1
while (%i <= %t) {
var %r = $read(%f,nt,%i)
var %g = $gettok(%r,1,32)
var %com = $addtok(%com,%g,32)
inc %i
}
if (%com) { msg $chan [ $+ $nick $+ ]: All the available commands are: $+ %com $+ }
elseif (!%com) { msg $chan [ $+ $nick $+ ]: There is NOT any command available on the file! | return }
msg $chan [ $+ $nick $+ ]: End of command list. - (Total Commands: $+ $numtok(%com,32) $+ )
}
Yup thats what i want, Thank you
|
|
|
|
|