mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2004
Posts: 12
P
Pikka bird
OP Offline
Pikka bird
P
Joined: Dec 2004
Posts: 12
I was wondering if there is a way to kick guests out of my room after a certain amount of time, 20 minutes for example.

I was given this script but don't think it has a time option, just kicks on join.

Thanks!!

_________________________________________________

on @*:JOIN:#:{
if (guest????? iswm $nick) {
ban -u60 # $nick 11
kick # $nick Guest nicks are not allowed, /nick <New Nickname>
}
}
on *:NICK:{
if (guest????? iswm $newnick) {
var %i = 0
while (%i < $comchan($newnick,0)) {
;This while loop goes through every channel both you and the nick are on
inc %i
if ($me isop $comchan($newnick,%i)) {
;You can only kick if you are an op =)
ban -u60 $comchan($newnick,%i) $newnick 11
kick $comchan($newnick,%i) $newnick Guest nicks are not allowed, /nick <New Nickname>
}
}
}
}

_______________________________________________

Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
umm
you want to kick people named guest?
im afraid i dont understand
i might not be familiar with your network
if you just want to kick people named guest
i can do that


The Kodokan will move you, one way or another.
Joined: Dec 2004
Posts: 12
P
Pikka bird
OP Offline
Pikka bird
P
Joined: Dec 2004
Posts: 12
Network is StarChat, I have seen this on other channels.
I would like a way to warn people to change their nicknames from Guest when they arrive or they will be kicked after 20 minutes. then remind them after 10 more minutes & then kick them after the 20 minutes are up. Thanks. We get alot of Guests and it gets very confusing. I think this will cut down on the problem. Thanks.

Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
i can give you something but it wont be very air tight
so you can either use it or my suggestion wait till someone comes along with something better
on *:join:#:{
if ($nick == *guest*) {
timer 1 1200 kick # $nick
timer 1 600 msg $chan $nick use /nick to change your name please.
}
riddled with flaws but it should work on a basic level
no accounting for if they leave after the timer is triggered etc


The Kodokan will move you, one way or another.
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Won't work, unless their nick is the literal *guest*.

To use wildcards, you need iswm.


Gone.
Joined: Mar 2004
Posts: 359
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Mar 2004
Posts: 359
Code:
on 1:join:#channel: {
  if (Guest* iswm $nick) {
    notice $nick You are using a Guest nickname. To change your nick please type /nick newnick
    set %guest.nick $nick
    .timer 1 300 if %guest.nick ison $chan ban -ku300 $chan $nick 2 Please do not use guest nicknames. | unset %guest.nick
  }
}


This should wait 5 minutes (300 seconds) when a guest nick has joined, If the nickname they joined with is still on the channel after the 5 minutes it will ban them for 5 minutes. (Untested!)

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
Code:
on 1:join:#channel: {
  if (Guest* iswm $nick) {
    notice $nick You are using a Guest nickname. To change your nick please type /nick newnick
    set %guest.nick $nick
    .timer 1 300 if %guest.nick ison $chan ban -ku300 $chan $nick 2 Please do not use guest nicknames. | unset %guest.nick
  }
}



Whats the reason for putting the $nick into %guest.nick, I cant see any reason for it?

Joined: Mar 2004
Posts: 359
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Mar 2004
Posts: 359
I wasen't thinking when I wrote that, it's not needed but still works :P

Last edited by LostServ; 28/01/05 06:31 AM.
Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
so you can have a timer have a if on it?
i did not know this


The Kodokan will move you, one way or another.
Joined: Mar 2004
Posts: 359
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Mar 2004
Posts: 359
Yes, If is a command you know.
/help /if

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Quote:
.timer 1 300 if %guest.nick ison $chan ban -ku300 $chan $nick 2 Please do not use guest nicknames. | unset %guest.nick

This doesn't work as you think it does, it actually unsets %guest.nick immediately after setting the timer. That var is redundant anyway, might as well remove it smile

Btw the if statement is very ambiguous as you are not using brackets or braces to seperate the if condition from the command. Always try to use either braces or brackets, or both, but not none of them.

Greets


Gone.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
just watch what you put in the timer with the if

examples type in....

//timer 1 10 if ( $time == $time ) echo -at I think time is $time , but its not is it.
^ (note the two // so its like if it was in a script)

[12:34:56] I think time is 12:34:46 , but its not is it.


now try
//timer 1 10 if ( $time == $time ) echo -at I think time is $time , but its not is it.
/timer

* Timer 1 1 time(s) 10s delay if ( 12:34:46 == 12:34:46 ) echo -at I think time is 12:34:46 , but its not is it.
[12:34:56] I think time is 12:34:46 , but its not is it.

It becomes clear whats happened, the $time all get evaluated, to stop this you would need it like this.


//timer 1 10 if ( $!time == $!time ) echo -at I think time is $!time , and it is!, But its not $time which was when this was started.
/timer

* Timer 1 1 time(s) 10s delay if ( $time == $time ) echo -at I think time is $time , and it is!, But its not 12:36:46 which was when this was started.
[12:34:56] I think time is 12:34:56 , and it is!, But its not 12:36:46 which was when this was started.


The reason there were no $!nick or $!chan in the above was because they werent wanted, when the timer executes the command, those values are not known anymore, so they were ment to be evaluated at the timer creation time.



Hehe now last just to through a spanner in the works, the following line well be a bust...
//timer 1 10 if ($!time == $!time) echo -at I think time is $!time , and it is!, But its not $time which was when this was started.
/timer
* Timer 1 1 time(s) 10s delay if ($!time == $time ) echo -at I think time is $time , and it is!, But its not 12:36:46 which was when this was started.
* timer 1 halted

if the $identifier you dont want evaluated does not have a clear leading space then it isnt seen to be an identifier to evaluate at the timer creation moment, this doesnt hold for trailing data such as a closing bracket.

IMO this gets tricky for everyone as u need to watch what your typing and how it well be seen.

Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
i brushed paths with $! as i had to use it in read
$!read since i have a script that reads a random line froma txt every 30 minutes smile
thanks for the quick little tutorial though
good stuff


The Kodokan will move you, one way or another.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I mentioned it becuase for ages i was using $ $+ time, and also had to do some double evaluation delays so had $ $ $+ + time , and felt like a complete noob when i found out i could have used $!time and $!!time respectively

Joined: Dec 2004
Posts: 12
P
Pikka bird
OP Offline
Pikka bird
P
Joined: Dec 2004
Posts: 12
Quote:
on 1:join:#channel: { if (Guest* iswm $nick) { notice $nick You are using a Guest nickname. To change your nick please type /nick newnick set %guest.nick $nick .timer 1 300 if %guest.nick ison $chan ban -ku300 $chan $nick 2 Please do not use guest nicknames. | unset %guest.nick }}


I tried this without any luck. Also I want to kick not ban. laugh

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
Quote:
on 1:join:#channel: { if (Guest* iswm $nick) { notice $nick You are using a Guest nickname. To change your nick please type /nick newnick set %guest.nick $nick .timer 1 300 if %guest.nick ison $chan ban -ku300 $chan $nick 2 Please do not use guest nicknames. | unset %guest.nick }}


I tried this without any luck. Also I want to kick not ban. laugh


I didnt write that! In fact no body here wrote THAT, you have junked it onto 2 lines, and in doing so caused it to fail, there is no | between the notice and the set nor the timer and the ending two } are not ment to be connected } } not }}

Code:
on 1:join:#channel: {
  if (Guest* iswm $nick) {
    notice $nick You are using a Guest nickname. To change your nick please type /nick newnick
    .timer 1 1200 if ( $nick ison $chan ) &amp;&amp; ( $!me isop $chan ) kick $chan $nick
  }
}

Joined: Dec 2004
Posts: 12
P
Pikka bird
OP Offline
Pikka bird
P
Joined: Dec 2004
Posts: 12
my bad, it messed up when I copied it. It's working great now!! Thanks very much!!!! cool cool cool


Link Copied to Clipboard