|
Joined: Oct 2005
Posts: 91
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 91 |
I am trying to figure out the proper way to do an idle kick. I was thinking at first about setting up a timer but started going in the wrong direction with that. I am using this in a learning room so if i am teaching someone i dont want them to get kick. Not sure how to make this happen i was thinking on teacher:text:!add:#learning: { /write -ds $2 teach.txt } but after looking at that i dont think that is the best way. Can someone help please. I appreciate all the help.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
when you are teaching someone, is there a change to their status/ (eg; students are voiced, while teachers are opped or half-opped) or something like that/ If so, then let me know how you determine who is a student, versus who is a teacher, and I can probably come up with something easily
|
|
|
|
Joined: Oct 2005
Posts: 91
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 91 |
I give the teachers the user level of teacher. Also every teacher is opped. As for student they dont get a voice. Was wondering if I can add them to list while training. A txt file or a token. Thanks alot for the help
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
why not the user level of "student"?
then whatever you have to check the idle time looks to see if the nick is a teacher,elseif a student, else kick for being idle.
|
|
|
|
Joined: Oct 2005
Posts: 91
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 91 |
Thanks mikechat for the info. That does make more scence. But can someone help with the coding? I cant figure it out. I know after seeing how it is done i will be able to pick it up. Thanks
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
on !@*:join:#:{
$+(.timer,$nick) 0 30 idlecheck $nick $chan
}
alias idlecheck {
if $nick($2,$1).idle > 300 {
.ban -ku30 $2 $1 No idleing
}
}
on teacher:text:!student*:*:{
$iif(student !isin $level($2),.auser -a,.ruser) student $2
$+(.timer,$nick) $iif(student !isin $level($2),0 30 idlecheck $nick $chan,off)
}
You'll have to add coding so that teachers don't get kicked for idleing. Hopefully what I've given you above is sufficient for you to figure out how to handle the coding for the teachers. If not, provide the code that you're currently using to establish the teacher level, and I'll modify it. If you have any questions about the code, ask and I'll do my best to answer them.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Maybe something like:
On Teacher:Text:!add *:#learning: {
var %x = 1
while (%x <= $numtok($2-,32)) {
var %pupil = $gettok($2-,%x,32)
if (%pupil ison #learning) {
write teach.txt %pupil
msg $chan added pupil to list
}
inc %x
}
}
-Andy
|
|
|
|
Joined: Oct 2005
Posts: 91
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 91 |
thanks for the help russelb. All teachers have same type of nick so i added this on !@*:join:#:{
if (teacher* iswm $nick) halt
$+(.timer,$nick) 0 30 idlecheck $nick $chan
}
alias idlecheck {
if $nick($2,$1).idle > 62 {
.ban -ku30 $2 $1 No idleing
}
}
on teacher:text:!student*:*:{
$iif(student !isin $level($2),.auser -a,.ruser) student $2
$+(.timer,$nick) $iif(student !isin $level($2),0 30 idlecheck $nick $chan,off)
}
I did notice that after the people got kicked for idleing or when they just left the room the timer was still going for them. Is there a way to check if they are in the room the halt the timer if they are not? One more thing can the timer get updated if they change there nick, possibly with $newnick ? Thanks for the help.
Last edited by truguce; 09/12/05 09:47 AM.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
on !@*:join:#:{
if (teacher* !iswm $nick) {
$+(.timer,$address) 0 30 idlecheck $nick $chan
}
}
alias idlecheck {
if $nick($2,$1).idle > 62 {
.ban -ku $2 $1 No idleing
}
on teacher:text:!student*:#:{
$iif(student !isin $level($2),.auser -a,.ruser) student $2
var %address = $right($address($2,0),-2)
$+(.timer,%address) $iif(student !isin $level($2),0 30 idlecheck $2 $chan,off)
}
on *:quit:{ pkq $address $nick }
on *:part:#:{ pkq $address $nick }
on *:kick:#:{ pkq $address $knick }
alias pkq {
$+(.timer,$1) off
.ruser $2
}
Changed the timer so that it tracks by address rather than nick, that way you only need one timer per person, and don't have to worry about stopping & starting timers when someone changes their nick.
|
|
|
|
Joined: Oct 2005
Posts: 91
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 91 |
Thanks for the help. Works great!
|
|
|
|
|