mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
You can't name the timers? From the mIRC help:
Quote:

/timer[N/name] [-ceomhipr] [time] <repetitions> <interval> <command>
Activates the specified timer to perform the specified command at a specified interval, and optionally at a specified time


The previous timer shouldn't be destroyed if you use timer $+ $nick. For example, if I join, there will be a timer called timerBlake, and if you join after me, there will still be a timerBlake, as well as a timerDaveC. Let me know if I'm misunderstanding something. Thanks.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Im sure i just explained this, but anyhow.
You cant name the timers, becuase you named them a set thing and thus any new anon nick would replace the old timer with a new one, thus destroying the old one.
I never ment you cant physically name a timer, that would have been ilogical of me to say since i just said you had named them.

The fact u go on to then say "shouldn't be destroyed if you use timer $+ $nick" isnt relevant becuase you didnt use that did ya.

And honestly, using a timer named just the nick is as bad as anything else, you would be the 10th person or more I have seen thinking of nameing there timer simply $nick, so all these scripts are gonna start destroying each others timers becuase they cant think of using unque names like TIMER.anon.nick.1st.warning.to. $+ $nick etc etc, but really i ask one simple thing..... WHATS THE POINT OF NAMING THE TIMER??????

Do you actually need to name it, do you access the timer using $timer($nick) or better $timer(.anon.nick.1st.warning.to. $+ $nick) ? Do you turn the timer off using /TIMER.anon.nick.1st.warning.to. $+ $nick OFF ? No, they simply are created and allowed to expire on there own, so why not just let them be what they are unnamed unique timers destined to exist and function on there own in there moment and no more. Why name something that needs no name.

Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
because in the script, if you want 3 timers for the 3 warning you have to it would seem

if you just name all 3 "timer"

then in practice you only get one timer and all 3 warning are given at once... no time between them..

the scripts would go like this

Anon joins
1st warning
2nd warning
3rd warning
all given immedietly as anon enters chat
than after 2 minutes they get kicked!!

so to have the timers working independant of each other, they need names

thats the way i see it, and its also the way the script worked for me when i tested it

you know more about scripts than me, i realise this... but i am talking about this actual scipt.... i originally used "timer" and it didnt work.
the only way therfor is for the script to be completely re written using your method.

Last edited by RedDevilUK; 10/05/06 01:52 PM.
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Actually, if you use the /timer command without specifying a name, mIRC automatically gives the new timer a numerical name to avoid conflicts.

To test this, do something like this:
Code:
/timer 1 30 echo -s this is the first timer
/timer 1 30 echo -s this is the second timer
/timer 1 30 echo -s this is the third timer

/timer

The first three lines will create timers (note no names are given to the timers), and the last line will list all active timers. You should get a display similar to this:

* Timer 1 30s delay echo -s ....
* Timer 2 30s delay echo -s ....
* Timer 3 30s delay echo -s ....

The "1 2 3" part is the automatically assigned name for that timer.

-genius_at_work

Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
i can confirm this works.....

Code:
on @*:JOIN:#channel: { 
  if (Anon* iswm $nick) { 
    .notice $nick This is an Automated msg: Please change your nick within 2 minutes, or you will be kicked. type 12/nick newnick to change 
    .timer 1 8 if ( $nick ison $chan ) { /notice $nick This is an Automated msg: This is your second warning change your nick or be kicked 12type /nick newnick to change 1 minute remaining!! 
      .timer 1 16 if ( $nick ison $chan ) { /notice $nick This is an Automated msg: This is your LAST warning change your nick or be kicked type 12/nick newnick to change 30 seconds remaining!! 
        .timer 1 24 if ( $nick ison $chan ) kick $chan $nick This is an Automated msg: Please change your nick and rejoin, sorry
      } 
    } 
  } 
}


just tested it.. works great
anyone who takes this script, just put your own channel in

thanks guys wink

Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
Just a thought... does anyone know how to use the above script that tells anon nicks to change there names

to also ask people with general bad nicks such as swear words etc

all in one scripts would be great
it seems to me that the 3 warning could also apply to a swear word nick too

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You'd need a list of bad words in a text file and read from that.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
thats the way i see it, and its also the way the script worked for me when i tested it


Thats becuase you wrote something else wrong in the script that caused that, but as i dont think u ever showed that particualr script we cant point it out.


Quote:
i can confirm this works.....
Code:
on @*:JOIN:#channel: { 
  if (Anon* iswm $nick) { 
    .notice $nick This is an Automated msg: Please change your nick within 2 minutes, or you will be kicked. type 12/nick newnick to change 
    .timer 1 8 if ( $nick ison $chan ) { /notice $nick This is an Automated msg: This is your second warning change your nick or be kicked 12type /nick newnick to change 1 minute remaining!! 
      .timer 1 16 if ( $nick ison $chan ) { /notice $nick This is an Automated msg: This is your LAST warning change your nick or be kicked type 12/nick newnick to change 30 seconds remaining!! 
        .timer 1 24 if ( $nick ison $chan ) kick $chan $nick This is an Automated msg: Please change your nick and rejoin, sorry
      } 
    } 
  } 
}


Sorry but it doesnt.
One thing you have done wrong is, you have Opening { where you dont need them, I told you a timer command wont use them, its just luck that this hasnt caused the script to totally bomb out. Notice how each of your timer commands is identied to the one above, thats not right, for a start, but as i said, it does by chance not effect it.
The second and most glaring error is the timers go off 8 , 16 and 24 seconds later, when they should have been 60,90,120

Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
the 8, 16 and 24 was not a mistake...

thats the times i put in to test it... waiting 2 mins is a long time when testing smile

so i shortened the time smile

then forgot to change it before posting here...
its ok on my Mirc smile

Joined: May 2022
Posts: 72
F
Babel fish
Offline
Babel fish
F
Joined: May 2022
Posts: 72
Originally Posted by RedDevilUK
ive made a modified version with 3 warnings... are you telling me that if two anon nicks joined close together it wouldnt work?

on @*:JOIN:#channel: {
if (Anon* iswm $nick) {
.notice $nick Please change your nick within 2 minutes, or you will be kicked.
.timera 1 30 if ( $nick ison $chan ) { /notice $nick This is your second warning change your nick or be kicked 1 minute remaining!!
.timerb 1 90 if ( $nick ison $chan ) { /notice $nick This is your LAST warning change your nick or be kicked 30 seconds remaining!!
.timerc 1 120 if ( $nick ison $chan ) kick $chan $nick Please change your nick
}
}
}
}

This one perfectly work for me and is almost what I need, thanks only to Mr.DaveC
And what if I wish also to work "ON NICK CHANGE" ? i.e.: An user join with a registered nick, but he's not the owner, so the net change it in "Anon" . I wish my script to check nick list if there's any "Anon" nick and kick them.
Is it possible?
Thanks in advance

Last edited by Fernet; 04/03/23 02:18 PM.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
It is slightly more complicated with a nick change, because that event does not define $chan, but instead triggers 1 time for all channels you share with that nick. Also, :NICK: uses $nick for the old nick and $newnick for the new nick.

I am going to assume that you are wanting to deal with this only with 1 channel, and am going to alter the code so you can have the shared code be used by both :JOIN: and :NICK:

These events would call the alias having the 1st parameter is the channelname and the 2nd is the nick, and the 3rd is either blank or the number of seconds. I am also going to put some of the code inside the alias to avoid the hassle of having the timer evaluating the channel name in the unlikely event that you use this with a channel named '#' or #$version

I am also removing the names assigned to the timers, to allow it to create a unique name instead. The existing code does not work correctly if 2 matching nicks are being handled at the same time, because the timers for the 2nd nick were replacing the timers for the 1st nick

Code
ON @*:JOIN:#channel: { if (anon* iswm $nick) badnick_alias $unsafe($chan $nick) }
ON *:NICK: { if ((anon* iswm $newnick) && ($me isop #mychannel) && ($newnick ison #mychannel)) badnick_alias $unsafe(#mychannel $newnick) }

alias badnick_alias {
  var %chan $1 , %nick $2
  if ((Anon* !iswm %nick) || (%nick !ison %chan)) return
  if (!$3) {
    .notice %nick Please change your nick within 2 minutes, or you will be kicked.
    .timer 1  30 badnick_alias $unsafe($1-2  30)
    .timer 1  90 badnick_alias $unsafe($1-2  90)
    .timer 1 120 badnick_alias $unsafe($1-2 120)
    return
  }
  elseif ($3 == 30) /notice %nick This is your second warning change your nick or be kicked 1 minute remaining!!
  elseif ($3 == 90) /notice %nick This is your LAST warning change your nick or be kicked 30 seconds remaining!!
  elseif ($3 == 120) kick %chan %nick Please change your nick
}

Joined: May 2022
Posts: 72
F
Babel fish
Offline
Babel fish
F
Joined: May 2022
Posts: 72
I guess I'll have to change anon with MindUser and #mychannel with #Alessandra . Right?

on *:JOIN:#Alessandra: {
if (MindUser* iswm $nick) {
.timerb 1 5 if ( $nick ison $chan ) { /bs SAY #Alessandra $nick Please change your nick or you will be banned in 60 seconds !
.timerc 1 35 if ( $nick ison $chan ) { /bs SAY #Alessandra $nick This is your second warning: change your nick or You'll be banned in 30 sec !!
.timerd 1 50 if ( $nick ison $chan ) { /bs SAY #Alessandra $nick This is your LAST warning change your nick or be banned in 15 sec !!!
.timere 1 65 if ( $nick ison $chan ) ban $chan $nick NICK NOT ALLOWED !!!
.timerf 1 67 if ( $nick ison $chan ) kick $chan $nick YOU BEEN WARNED: ByE-ByE !!!!
}
}
}
}

ON *:NICK: { if ((MindUser* iswm $newnick) && ($me isop #Alessandra) && ($newnick ison #Alessandra)) badnick_alias $unsafe(#Alessandra $newnick) }

alias badnick_alias {
var %chan $1 , %nick $2
if ((MindUser* !iswm %nick) || (%nick !ison %chan)) return
if (!$3) {
.notice %nick Please change your nick within 2 minutes, or you will be kicked.
.timer 1 30 badnick_alias $unsafe($1-2 30)
.timer 1 90 badnick_alias $unsafe($1-2 90)
.timer 1 120 badnick_alias $unsafe($1-2 120)
return
}
elseif ($3 == 30) /notice %nick This is your second warning change your nick or be kicked 1 minute remaining!!
elseif ($3 == 90) /notice %nick This is your LAST warning change your nick or be kicked 30 seconds remaining!!
elseif ($3 == 120) kick %chan %nick Please change your nick
}

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Yes you would make those 2 changes, but would do it in the code I posted, not in the new code you just posted. Your new code continues to have some of the problems I mentioned last time, plus your new code adds more things that fail. My code had BOTH the JOIN and NICK events calling the same badnick_alias, so if you wanted to make changes to the timer message or actions, then they would always be the same messages for both events. You are going back to the same code for the JOIN event which won't always work. If you have 2 bad nicks joining near the same time, your fixed name timers means that the timerb timerc timerd timere timerf will all be re-used for the 2nd nick, and nothing will be enforced against the 1st nick.

Your new code uses a /BS that is either a bad command error, or is using an alias that you didn't post, so I have no idea whether it works or not. Hopefully the /BS is not an alias that tries to use /say to send the message to the channel. If you use the /say in a script, it will work only if that channel is the active window. You can test this by going to the channel window and use the command:

/timer 1 5 say test

which will send the message 5 seconds later. If that channel is the active window, then that works. But if your cursor is in the status window or somewhere else, then this either fails, or goes to the wrong window.

Joined: May 2022
Posts: 72
F
Babel fish
Offline
Babel fish
F
Joined: May 2022
Posts: 72
Originally Posted by maroon
Yes you would make those 2 changes, but would do it in the code I posted, not in the new code you just posted. Your new code continues to have some of the problems I mentioned last time, plus your new code adds more things that fail. My code had BOTH the JOIN and NICK events calling the same badnick_alias, so if you wanted to make changes to the timer message or actions, then they would always be the same messages for both events. You are going back to the same code for the JOIN event which won't always work. If you have 2 bad nicks joining near the same time, your fixed name timers means that the timerb timerc timerd timere timerf will all be re-used for the 2nd nick, and nothing will be enforced against the 1st nick.

Your new code uses a /BS that is either a bad command error, or is using an alias that you didn't post, so I have no idea whether it works or not. Hopefully the /BS is not an alias that tries to use /say to send the message to the channel. If you use the /say in a script, it will work only if that channel is the active window. You can test this by going to the channel window and use the command:

/timer 1 5 say test

which will send the message 5 seconds later. If that channel is the active window, then that works. But if your cursor is in the status window or somewhere else, then this either fails, or goes to the wrong window.

In the one I posted, the first part about ON JOIN, perfectly work. Second part about nick changed by NickServ, doesn't work.
If i.e. I join with a registered nick, but I'm not the owner, so NickServ changeit in a guest nick (MindUser*****).
And I also tried to enter with a random free nick, then I manually changed it in MindUser12345, and nothing happened.
So it perfectly works on join, not on newnick
The one You posted, doesn't work at all to me. Tested on Mirc 7.65 / 6.35 and tried to join and change nick with eMuleIRC

Last edited by Fernet; 05/03/23 02:10 PM. Reason: Wrote more informations
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Sorry, a last second edit messed it up. Since I was not calling the alias using a timer, I should not have called the alias using $unsafe(). Here's the updated alias, where I removed that $unsafe() and changed the #channelname, and changed the anon* to minduser*

Also, you will need to test this against a different nick, because it will fail to detect when you change to a minduser* nick, because ($me isop #Alessandra) is seeing $me as the old nick, but sees your $newnick as being @op

Code
ON @*:JOIN:#Alessandra: { if (MindUser* iswm $nick) badnick_alias $unsafe($chan $nick) }
ON *:NICK: { if ((MindUser* iswm $newnick) && ($me isop #Alessandra) && ($newnick ison #Alessandra)) badnick_alias #Alessandra $newnick }

alias badnick_alias {
  var %chan $1 , %nick $2
  if ((MindUser* !iswm %nick) || (%nick !ison %chan)) return
  if (!$3) {
    .notice %nick Please change your nick within 2 minutes, or you will be kicked.
    .timer 1  30 badnick_alias $unsafe($1-2  30)
    .timer 1  90 badnick_alias $unsafe($1-2  90)
    .timer 1 120 badnick_alias $unsafe($1-2 120)
    return
  }
  elseif ($3 == 30) /notice %nick This is your second warning change your nick or be kicked 1 minute remaining!!
  elseif ($3 == 90) /notice %nick This is your LAST warning change your nick or be kicked 30 seconds remaining!!
  elseif ($3 == 120) kick %chan %nick Please change your nick
}

Joined: May 2022
Posts: 72
F
Babel fish
Offline
Babel fish
F
Joined: May 2022
Posts: 72
Originally Posted by maroon
Sorry, a last second edit messed it up. Since I was not calling the alias using a timer, I should not have called the alias using $unsafe(). Here's the updated alias, where I removed that $unsafe() and changed the #channelname, and changed the anon* to minduser*

Also, you will need to test this against a different nick, because it will fail to detect when you change to a minduser* nick, because ($me isop #Alessandra) is seeing $me as the old nick, but sees your $newnick as being @op

Code
ON @*:JOIN:#Alessandra: { if (MindUser* iswm $nick) badnick_alias $unsafe($chan $nick) }
ON *:NICK: { if ((MindUser* iswm $newnick) && ($me isop #Alessandra) && ($newnick ison #Alessandra)) badnick_alias #Alessandra $newnick }

alias badnick_alias {
  var %chan $1 , %nick $2
  if ((MindUser* !iswm %nick) || (%nick !ison %chan)) return
  if (!$3) {
    .notice %nick Please change your nick within 2 minutes, or you will be kicked.
    .timer 1  30 badnick_alias $unsafe($1-2  30)
    .timer 1  90 badnick_alias $unsafe($1-2  90)
    .timer 1 120 badnick_alias $unsafe($1-2 120)
    return
  }
  elseif ($3 == 30) /notice %nick This is your second warning change your nick or be kicked 1 minute remaining!!
  elseif ($3 == 90) /notice %nick This is your LAST warning change your nick or be kicked 30 seconds remaining!!
  elseif ($3 == 120) kick %chan %nick Please change your nick
}
You great Mr. maroon wink . This work almost perfectly. Just I edited timers because 2 minutes are too much :-P
I really thanks You a lot for Your creation.

Last edited by Fernet; 05/03/23 06:48 PM. Reason: Better if I keep /notice than /say in channel
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Great. Though as I mentioned earlier, you should not use /say because that only works if the cursor is in the editbox for the correct channel.

You should instead replace

/notice %nick message
with
/msg %chan %nick message

You can hide the message from cluttering your own window by using .msg instead of msg

Joined: May 2022
Posts: 72
F
Babel fish
Offline
Babel fish
F
Joined: May 2022
Posts: 72
Originally Posted by maroon
Great. Though as I mentioned earlier, you should not use /say because that only works if the cursor is in the editbox for the correct channel.

You should instead replace

/notice %nick message
with
/msg %chan %nick message

You can hide the message from cluttering your own window by using .msg instead of msg

Is ok /notice,no boring in chan. Thanks again sir wink

Last edited by Fernet; 07/03/23 12:45 PM.
Page 2 of 2 1 2

Link Copied to Clipboard