mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
as part of the website people have the option to join the IRC using a java webchat, the default nick was Guest???
so i though i would change the default setting to a blank box, hoping they would now be forced to put in a nick??? but now frown the server just gives the nick anon142, anon234 etc

i want a script to warn them to change the nick on joining, and give them 2 minutes to do so... or a nick we be forced on them... a girls name for instance, as they are mainly men they will hopefully change it.

i did a search on here and found this scripts

on *:JOIN:#: {
if (Guest* iswm $nick) && ($network == BlakeNET) {
operserv set superadmin on
.timernick 1 120 operserv svsnick $nick $gettok($remove($read(phobia.txt),-),1,32)
}
}

but its doesnt work for me, im on Quakenet and i get the error
OPERSERV Unknown command

any ideas guys?

Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
Glad to see someone else finding a use for my script, lol. Operserv might not work for you, depending on what IRCd your network uses. I'm only familiar with Unreal. Look in the help for your channel and nick services and see if you can find the commands needed to change someone's nick.

Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
nice scripts mate... shame it doesnt work on Quakenet

it seems im not able to change a nick ...so
i will have to have a script that just gives a warning in the channel, straight away.. then 2 more notice to nick warnings in 30 seconds intervals
then after 2 mins auto kicks with the message to change nickname

Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
on *:JOIN:#:{
if ($nick != Anon*) goto done
if ($nick == Anon*)
/msg úchan $nick please change your nick to something other than Anon please
:done
}

please excuse my feeble attempt at this script, but i am trying to learn from you guys

ive not added the timer for the second and third final warning yet...because this part doesnt even work lol

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Would not the simplest solution be to ban anon*!*@* from the channel?

Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
i did think about that..but

no offence to the people joining my IRC channel but i presume if i ban anon, they will try and join and not get in then think.. oh it mustnt be working then leave ... that my fear frown

Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
If you or a bot are always in the channel, then you could put something like this in the remotes.
Code:
on *:JOIN*: {
if (Anon* iswm $nick) {
.notice $nick Please change your nick within 2 minutes, or you will be kicked.
.timernick 1 120 kick $nick Please change your nick
}
}


I realize that's a pretty basic way to handle it. You could build in a counter for if the person has been kicked once so you could ban them if they don't change their nick the second time, although that might not be practical to hold all the variables for counting people.

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
1. You are missing a colon in the event.
2. You also should check to see if you're an operator in the room.

Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
Thanks for the correction. I did the same thing last night...posting when I'm tired. That should be
Code:
on @*:JOIN:*: {
................

Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
OK i join channel and get the warning.. but dont get kicked?

note: i changed the setting of the timer from 120 to 10
to speed the test up... is there a minimum setting?

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Seems Blake is overly tired he didn't add the channel in the kick command. Easy mistake, easily fixed:

Code:
on @*:JOIN:*: {
  if (Anon* iswm $nick) { 
    .notice $nick Please change your nick within 2 minutes, or you will be kicked.
    .timernick 1 120 kick $chan $nick Please change your nick
  }
}

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Code:
on @*:JOIN:#channel:{
  [color:blue]; I opted to use a regex match for checking the nicks
  ; It will match nicks in the form anon### (anon, followed by exactly 3 digits) [/color]
  if ($regex($nick,/^anon[\d]{3}$/i)) {
    .notice $nick Please change your nick or you will be kicked after 2 minutes.
    [color:blue]; Call an additional alias to check if the anon nick is still on the channel
    ; and kick if so[/color]
    .timeranonkick 1 120 anon.nick.check $nick $chan
  }
}

alias anon.nick.check $iif($1 ison $2,kick $2 $1 Please change your nick,)

Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
Works like a dream... another day another lesson
im learning still

thanks to both of ya

PS even tired Blake runs circles round me cool

Cheers
i can go to bed now smile

Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
LOL, thank you very much for that. And schaefer31 and SladeKraven run circles around me. smile We all start somewhere. New rule for me. No more scripting at night! wink

Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
maybe i handed out praise too soon lol

the script still kicks you when you change your nick

so you join as Anon243
you get the warning
change nick to fred
2 minutes is up and kick?

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
on @*:JOIN:#channel:{
  ; I opted to use a regex match for checking the nicks
  ; It will match nicks in the form anon### (anon, followed by exactly 3 digits)
  if ($regex($nick,/^anon[\d]{3}$/i)) {
    .notice $nick Please change your nick or you will be kicked after 2 minutes.
    ; Call an additional alias to check if the anon nick is still on the channel
    ; and kick if so
    .timer 1 120 anon.nick.check $nick $chan
  }
}
alias anon.nick.check { if ($1 ison $2) { kick $2 $1 Please change your nick } }


The above code even unedited should have worked most of the time, i have however removed the timername, as this would have caused problems should two nicks mathcing the anon joined, now each join gets a sperate timer to kick them, also I changed the alias to use IF instead of $iif, basicly becuase while it worked the use of $iif in this format is slower and less clear as too what is being done, than using a simple IF, im not saying however personal prefence should be ignored, as its not a task intensive script, so im just showing another option.

alternatively if u were using the below code

Code:
on @*:JOIN:*: {
  if (Anon* iswm $nick) {
     .notice $nick Please change your nick within 2 minutes, or you will be kicked.
    .timer 1 120 if ( $nick ison $chan ) kick $chan $nick Please change your nick
  }
}


I have removed the timername for the same reason here, and added a check to see if $nick (at the time of joining) is still in the channel, if so kick em.

Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
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
}
}
}
}

Last edited by RedDevilUK; 09/05/06 12:59 PM.
Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
ok just tested it.... this is what happens

first anon user enter gets first and second warning..

second anon user enters... gets all 3 warnings and kicked

1st user still in, no kick?

any ideas

Joined: May 2006
Posts: 32
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2006
Posts: 32
sorted it kind of... i added it to the nick menu instead
add to popups..

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


select from drop down menu and hey presto you can single nicks out by clicking on them

not perfect, but gets round the timer issue smile

ive even added two options to the menu
English and Portuguese
(i have many portuguese users)
so i can tell people in there own language smile

a quick DNS check reveals .co.uk or .pt
smile

Last edited by RedDevilUK; 09/05/06 01:38 PM.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
As i said before, you cant NAME the timers (a,b,c in your case) and expect it to work for two joining nicks that overlap each others times, the timers are named so as the second nick enters your essentially assigning new info to timers named a,b & c so the original a,b, & c timers are destroyed. This is the reason I took the names off so they simply get assigned the next free timer number, thus it doesnt care if 10 people joined with anon nicks.

However on top of this you dont understand how timers function for a start, you can not block code into a timer using { and }, the opening one well pretty much be ignored and the end of line or a | (command seperator) well be seen as the end of the timer, ie
if you ran this timer >> //timerEXAMPLE 1 1 { echo one | echo two } the results would be as follows.
two
one

the cause is simple there are two commands there //timeEXAMPLE1 1 echo one and echo two first the timer is started, then the echo two occurs then the timer goes off and echos one. aka two, one.

here is the relevent code snipit for a On join event, replacing the $nick with $1 well allow it to be used in a popup
Code:
if (Anon* iswm $nick) {
  .notice $1 Please change your nick within 2 minutes, or you will be kicked.
  .timer 1 30 if ( $nick ison $chan ) notice $nick This is your second warning change your nick or be kicked 1 minute remaining!!
  .timer 1 90 if ( $nick ison $chan ) notice $nick This is your LAST warning change your nick or be kicked 30 seconds remaining!!
  .timer 1 120 if ( $nick ison $chan ) kick $chan $nick Please change your nick
}


Simply put 3 timers are started, in each one when it goes off the nick well be checked for being in the channel, if he is the messge or action is performed, if not then nothing occurs.

* I feel it important at this point to explain something about the behavour of timers and $identifiers to you, when the timer is created $identifiers that are sepearted by a leading space well be evaluated to there contents, while $identifiers with leading characters well not be. I use none of these above but below i show the effect of leading characters also trailing ones
Secondly when the timer goes off the line is then also evaluated and any $identifiers then located are treated just as any other line of code.

here are 4 examples and folloing them the line of code that is generated for the timer, assume these are in a on join event, and DaveC is the nick joining setting the timer off, the channel name is #examples

//timer 1 10 if ( $nick ison $chan ) echo $chan $nick is still in channel he joined at $time - The time is now $!time
timer code is... if ( DaveC ison #examples ) echo #examples DaveC is still in channel he joined at 12:00:01 - The time is now $!time

//timer 1 10 if ($nick ison $chan ) echo $chan $nick is still in channel he joined at $time - The time is now $!time
timer code is... if ($nick ison #examples ) echo #examples DaveC is still in channel he joined at 12:00:01 - The time is now $!time

//timer 1 10 if ( $nick ison $chan) echo $chan $nick is still in channel he joined at $time - The time is now $!time
timer code is... if ( DaveC ison echo #examples DaveC is still in channel he joined at 12:00:01 - The time is now $!time

//timer 1 10 if ($nick ison $chan) echo $chan $nick is still in channel he joined at $time - The time is now $!time
timer code is... if ($nick ison echo #examples DaveC is still in channel he joined at 12:00:01 - The time is now $!time

Example 1 is the correct method, as when the timer goes off $nick well have no value or it has your nick in it, i think $chan well have no value (cant remember for sure), but as all $idetifiers have been spaced out they have been evaluated

Example2, becuase the 1st $nick has a ( on it, it doesnt get evaluated, so the line well compare your nick to being on the channel not mine

Example3, becuase $chan) has no value as an $identifier becuase mirc does not see this as $chan with a ) following it, so it have been evaluated to $null and isnt there, this well cause the line to error with invalid IF

Example4, this is just a combination of ex2 and ex3

** please note the $!time at the end, this is a special function of mirc to delay evaluation, essetially if mirc see any $!identifier it evaluates it to being the same thing minus 1 !
example
//echo $!!time $!time $time
$!time $time 12:00:01

this cane be used to delay evaluation of an identifier to inside the timer, rather than at its creation.

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: 27
F
Ameglian cow
Offline
Ameglian cow
F
Joined: May 2022
Posts: 27
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,075
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,075
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: 27
F
Ameglian cow
Offline
Ameglian cow
F
Joined: May 2022
Posts: 27
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,075
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,075
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: 27
F
Ameglian cow
Offline
Ameglian cow
F
Joined: May 2022
Posts: 27
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,075
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,075
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: 27
F
Ameglian cow
Offline
Ameglian cow
F
Joined: May 2022
Posts: 27
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,075
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,075
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: 27
F
Ameglian cow
Offline
Ameglian cow
F
Joined: May 2022
Posts: 27
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 1 of 2 1 2

Link Copied to Clipboard