mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
changing anon or Guest nick? #148586 08/05/06 07:22 PM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
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?

Re: changing anon or Guest nick? #148587 08/05/06 08:04 PM
Joined: May 2005
Posts: 449
bwr30060 Offline
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.

Re: changing anon or Guest nick? #148588 08/05/06 08:49 PM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
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

Re: changing anon or Guest nick? #148589 09/05/06 01:38 AM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
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

Re: changing anon or Guest nick? #148590 09/05/06 02:00 AM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Would not the simplest solution be to ban anon*!*@* from the channel?

Re: changing anon or Guest nick? #148591 09/05/06 02:09 AM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
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

Re: changing anon or Guest nick? #148592 09/05/06 02:41 AM
Joined: May 2005
Posts: 449
bwr30060 Offline
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.

Re: changing anon or Guest nick? #148593 09/05/06 02:55 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
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.

Re: changing anon or Guest nick? #148594 09/05/06 03:16 AM
Joined: May 2005
Posts: 449
bwr30060 Offline
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:*: {
................

Re: changing anon or Guest nick? #148595 09/05/06 03:20 AM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
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?

Re: changing anon or Guest nick? #148596 09/05/06 03:27 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
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
  }
}

Re: changing anon or Guest nick? #148597 09/05/06 03:30 AM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
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,)

Re: changing anon or Guest nick? #148598 09/05/06 03:32 AM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
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

Re: changing anon or Guest nick? #148599 09/05/06 03:41 AM
Joined: May 2005
Posts: 449
bwr30060 Offline
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

Re: changing anon or Guest nick? #148600 09/05/06 10:05 AM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
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?

Re: changing anon or Guest nick? #148601 09/05/06 11:02 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
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.

Re: changing anon or Guest nick? #148602 09/05/06 12:01 PM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
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.
Re: changing anon or Guest nick? #148603 09/05/06 12:10 PM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
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

Re: changing anon or Guest nick? #148604 09/05/06 01:35 PM
Joined: May 2006
Posts: 32
R
RedDevilUK Offline OP
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.
Re: changing anon or Guest nick? #148605 09/05/06 10:41 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
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.

Page 1 of 2 1 2