mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2014
Posts: 46
S
Spike Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
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
Offline
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

Code:
ON !*:TEXT:!commands:#: { msg $chan [ $+ $nick $+ ]: Available commands are: !commands }


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Sep 2014
Posts: 46
S
Spike Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2014
Posts: 46
Originally Posted By: westor
Try using this code and add in the msg fields next to !commands and your other commands.

Help details: /help on text

Code:
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
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Try using this code:

NOTE: rename the "commands.txt" with your own file!

Code:
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 $+ )
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Sep 2014
Posts: 46
S
Spike Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2014
Posts: 46
Originally Posted By: westor
Try using this code:

NOTE: rename the "commands.txt" with your own file!

Code:
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
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Try replace all msg $nick to notice $nick on the code.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Sep 2014
Posts: 46
S
Spike Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2014
Posts: 46
Originally Posted By: westor
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
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Sorry, i mean msg $chan to notice $nick


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Sep 2014
Posts: 46
S
Spike Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2014
Posts: 46
Originally Posted By: westor
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
Offline
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.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Sep 2014
Posts: 46
S
Spike Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2014
Posts: 46
Originally Posted By: westor
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
Offline
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.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Sep 2014
Posts: 46
S
Spike Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2014
Posts: 46
Originally Posted By: westor
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
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Try using this code maybe is that you want:

Code:
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) $+ )
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Sep 2014
Posts: 46
S
Spike Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2014
Posts: 46
Originally Posted By: westor
Try using this code maybe is that you want:

Code:
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 smile


Link Copied to Clipboard