|
Joined: Apr 2005
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2005
Posts: 31 |
i need script like this... when someone joins with nick "nick1242" (i count all numbers) i want that in publick chat i write "please change your nick, write /nick YOURNICK" can you help me guys? plz? i really need this script
|
|
|
|
Joined: Oct 2004
Posts: 31
Ameglian cow
|
Ameglian cow
Joined: Oct 2004
Posts: 31 |
on *:join:#YOURCHANNEL: {
if ($left($nick,4) == nick) && ($len($nick) > 4) {
/msg # Please change your name $nick $+ . Type /nick YOURNICK
}
}
The reason I used $left and $len is I dont want someone with the name "mynameisnick" or just "nick" to be bugged Bear
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
on !*:JOIN:[color:red]#[/color]:{
if $regex($nick,/^nick\d+$/i) {
msg # $nick $+ : please change your nickname, write /nick YOURNICK
}
} I'd suggest you change the red # to the channels where you want this to trigger, because if you msg this on channels where you are not allowed to do that, you can get in trouble. Right now the regex matches on any nickname that starts with "nick" (case insensitive) followed by 1 or more digits. If you want it to be 4 or more digits then change the regex to: $regex($nick,/^nick(?:\d{4,})$/i)
Gone.
|
|
|
|
Joined: Apr 2005
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2005
Posts: 31 |
and how exactly should i write if i want that this msg shows 3 secs after the guy with that nick joined? 
|
|
|
|
Joined: Feb 2005
Posts: 194
Vogon poet
|
Vogon poet
Joined: Feb 2005
Posts: 194 |
on !*:JOIN:#your_channel:{
if $regex($nick,/^nick\d+$/i) {
[color:blue]timer 1 3[/color] msg # $nick $+ : please change your nickname, write /nick YOURNICK
}
}
I used FiberOPtics' code. By the way, you could avoid using the specific channel in the code (#your_channel) by adding a @ which will make the command only trigger if you are an op at the time the user joins. For example: on [color:blue]@[/color]!*:JOIN:#:{
if $regex($nick,/^nick\d+$/i) {
timer 1 3 msg # $nick $+ : please change your nickname, write /nick YOURNICK
}
}

Last edited by alhammer; 05/04/05 05:49 AM.
"God sometimes puts us in the dark for us to see the light"
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
That's good, just three little things: 1. In an on join event, if you specify the @ event prefix that requires you to be oped, the ! becomes obsolete. That's because you cannot be an op and a joining nick at the same time, therefore @ replaces ! with an extra condition: being opped. 2. I'd silence the timer by prefixing it with a . so that you're not annoyed with the display of the starting/halting of the timer. 3. I'd put in an if check to see if you are still on that channel before trying to message to it. Yes, I know it's only 3 seconds, but it doesn't hurt trying to cover all cases. It is possible that sometimes when you leave one of the channels that is being monitored by this script, one of the timers is running. The result would be an error saying you're not on the channel. on [color:red]@[/color]*:JOIN:#:{
if $regex($nick,/^nick\d+$/i) {
[color:red].[/color]timer 1 3 [color:red]if ( # ischan)[/color] msg # $nick $+ : please change your nickname, write /nick YOURNICK
}
} The space in the if condition is intended, and should not be altered. It is there to let the # evaluate now. (# wouldn't evaluate to the channel name.
Gone.
|
|
|
|
Joined: Apr 2005
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2005
Posts: 31 |
thx guys 
|
|
|
|
Joined: Apr 2005
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2005
Posts: 31 |
1 more stupid question from me  what i should write when someone joins i say /msg nick : hi well to say hello to guy who just joined?
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
With the code Dieter posted above your post. Just put .msg $nick Hi $nick welcome above the if ($regex(..)) statement. So..
on @*:JOIN:#:{
.msg $nick Welcome to $chan ...
if $regex($nick,/^nick\d+$/i) {
.timer 1 3 if ( # ischan) msg # $nick $+ : please change your nickname, write /nick YOURNICK
}
}
Last edited by SladeKraven; 05/04/05 11:39 AM.
|
|
|
|
Joined: Apr 2005
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2005
Posts: 31 |
it looks like this now
on !*:JOIN:#popular:{ timer 1 1 msg # 9,1 $nick hi:)
if $regex($nick,/^nick\d+$/i) {
timer 2 3 msg # $nick $+ : change your nick, write /nick YOURNICK }
but the second msg sends 2 messeges and i dont know why
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
on !*:JOIN:#popular:{
timer 1 1 msg # 9,1 $nick hi:)
if $regex($nick,/^nick\d+$/i) {
timer [color:red]1[/color] 3 msg # $nick $+ : change your nick, write /nick YOURNICK
}
[color:red]}[/color]
You had timer 2 3 which would repeat 2 times every 3 seconds. So change it to 1.  Also, I've added a close } brace as you missed it at the bottom. -Andy
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
Ah, I forgot to add an if check to see if the $nick is still on the channel after the timer triggers, otherwise it's useless to msg anyways.
The result would be: if ( # ischan) && ( $nick ison # ) msg # $nick $+ : ...
Greets
Gone.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
* Andy slaps himself for not noticing you didn't put that check.
Notice what?
* Andy slaps again.
|
|
|
|
Joined: Apr 2005
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2005
Posts: 31 |
thx guys  im not that smart at scripts just started to use them 
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
I'm not smart either. 
|
|
|
|
Joined: Apr 2005
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2005
Posts: 31 |
oh btw is it possible that if im using away, then the first msg (text that greets) wont send but other would send, and if im not away it send both texts?
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
on !*:JOIN:#popular: {
if (!$away) .timer 1 1 msg # 9,1 $nick hi
if $regex($nick,/^nick\d+$/i) {
.timer 1 3 msg # $nick $+ : change your nick, write /nick YOURNICK
}
}
|
|
|
|
Joined: Apr 2005
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2005
Posts: 31 |
script looks like this now
on @*:JOIN:#popular:{ .timer 1 2 /.notice # my text if $regex($nick,/^nick\d+$/i) { .timer 1 5 if ( # ischan) /.notice # $nick $+ : change nick write /nick yournick } }
what should i change if i want that it shows only to that guy who comes in not to all in chat??
|
|
|
|
|