mIRC Home    About    Download    Register    News    Help

Print Thread
#260667 02/06/17 11:48 AM
Joined: Dec 2015
Posts: 14
S
shaf12 Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2015
Posts: 14
Hi,
How can I create a script that will send a msg to the channel containing all nicks in the channel?
Thx smile

shaf12 #260670 03/06/17 03:53 AM
Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
Try this.
Code:
ON *:TEXT:!nicks:#: {
  VAR %x 1
  WHILE ($nick(#,%x)) {
    VAR %nicks %nicks $v1 $+ $chr(44)
    INC %x
  }
  MSG $chan $left(%nicks,-1)
}

Blas #260681 05/06/17 01:52 PM
Joined: Dec 2015
Posts: 14
S
shaf12 Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2015
Posts: 14
How can I do that I will can write after the command and it will work just if the command will be at the start.
like
Me: !nicks hello guys whats up
It: *All Nicks*
Me: !nicks who wanna play?
It: *All Nicks*

There is a command to check if the on text :"gsfg" is at the start?

shaf12 #260691 06/06/17 03:32 AM
Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
There are a few ways. Without using regex, you can just add a * after !nicks. This will have the bot reply to any message that starts with !nicks. I don't like this personally because then the bot command will reply to things that it shouldn't.

Will work:
!nicks
!nickserv
!nicksasdf blah sdlie
!nicks are stupid
Code:
ON *:TEXT:!nicks*:#: {


You could add a space between !nicks and the *. But then you need something after the !nicks. You will not be able to type !nicks by itself.

Will work:
!nicks anything here

Won't work:
!nicks
!nickserv
Code:
ON *:TEXT:!nicks *:#: {


I would use a simple regex. The following will tell the bot to reply to both "!nicks" by itself or "!nicks" followed by a space and then anything else.

Will work:
!nicks
!nicks who wanna play?

Won't work:
!nickserv
!nickasdf adf waak
Code:
ON $*:TEXT:/^!nicks(\s|$)/i:#: {

The $ after ON means that it's using regex. ^ means start of the message. (\s|$) means either a space \s or end of line $. the i after / means that it's case insensitive.

Blas #260693 06/06/17 12:52 PM
Joined: Dec 2015
Posts: 14
S
shaf12 Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2015
Posts: 14
Thx so much, I got the regex, will help me in a lot of things.


Link Copied to Clipboard