|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
This code seems to work properly, but I'd appreciate feedback about possible problems and/or improvements to it. The code cycles through a list of channels so that I'm only in channels that are dead (no conversation), for a period of 5 minutes before parting and going to the next channel in the list. This was written due to the fact that an online radio station that I DJ on is requested to be in 15 channels, yet the network restricts a person to a maximum of 10 simultaneous channels. alias room_test {
set %room_test #Mystic_Radio,#Dark_Desires,#spank_inn_steins,#Cross_Worlds_Tavern,#girlsontop,#subgirls&olderMasters,#Roleplayofallkinds,#MystkRulers_court,#bratsplayroom,#Pleasure&Pain,#leglovers,#Dommes,#MidnightConfessions,#Indiana_Kink,#sluts-r-us
set %room_count 1
.j $gettok(%room_test,%room_count,44)
}
on me:*:join:#:{
$+(.timer,$network,$chan) 1 300 .p2 $chan
while ($me ison $gettok(%room_test,%room_count,44)) && ($comchan($me,0) < 10) {
inc %room_count
if %room_count >= $numtok(%room_test,44) {
set %room_count 1
}
}
.j $gettok(%room_test,%room_count,44)
}
alias -l p2 {
.part $1
while ($me ison $gettok(%room_test,%room_count,44)) && ($comchan($me,0) < 10) {
inc %room_count
if %room_count >= $numtok(%room_test,44) {
set %room_count 1
}
}
.j $gettok(%room_test,%room_count,44)
}
on me:*:part:#:{
$+(.timer,$network,$chan) off
}
on *:text:#:{
reset $network $chan $nick
}
on *:action:#:{
reset $network $chan $nick
}
on *:notice:#:{
reset $network $chan $nick
}
menu nicklist {
Add Botnick : set $+(%,bot_nicks,$network,$chan) $addtok($($+(%,bot_nicks,$network,$chan),2),$$1,32)
Remove Botnick : set $+(%,bot_nicks,$network,$chan) $remtok($($+(%,bot_nicks,$network,$chan),2),$$1,1,32)
}
alias -l reset {
if !$istok($($+(%,bot_nicks,$1,$2),2),$3,32) {
$+(.timer,$1,$2) 1 300 .p2 $2
}
}
|
|
|
|
Joined: Jul 2006
Posts: 4,156
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,156 |
alias room_test {
set %room_test #Mystic_Radio,#Dark_Desires,#spank_inn_steins,#Cross_Worlds_Tavern,#girlsontop,#subgirls&olderMasters,#Roleplayofallkinds,#MystkRulers_court,#bratsplayroom,#Pleasure&Pain,#leglovers,#Dommes,#MidnightConfessions,#Indiana_Kink,#sluts-r-us
set %room_count 1
.j #Mystic_Radio
}
on me:*:join:$(%room_test):{
$+(.timer,$network,$chan) 1 300 .p2 $chan
if ($chan(0) < 10) inc %room_count
.j $gettok(%room_test,%room_count,44)
}
alias -l p2 {
.part $1
set %room_test $addtok($remtok(%room_test,$1,44),$1,44)
.j $gettok(%room_test,%room_count,44)
}
on me:*:part:#: $+(.timer,$network,$chan) off
on *:text:*:#:reset $network $chan $nick
on *:action:*:#:reset $network $chan $nick
on *:notice:*:#:reset $network $chan $nick
menu nicklist {
Add Botnick : set $+(%,bot_nicks,$network,$chan) $addtok($($+(%,bot_nicks,$network,$chan),2),$$1,32)
Remove Botnick : set $+(%,bot_nicks,$network,$chan) $remtok($($+(%,bot_nicks,$network,$chan),2),$$1,1,32)
}
alias -l reset {
if !$istok($($+(%,bot_nicks,$1,$2),2),$3,32) {
$+(.timer,$1,$2) 1 300 .p2 $2
}
} Your code was a little strange, btw I hope it will help you, i've corrected some syntax error and change your weird while
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Your $remtok in the p2 alias, is missing a parameter.
As to syntax errors, would you mind pointing them out in my original code, as I can't see any, and mIRC didn't generate any errors while I was testing the code.
Also, could you provide a detailed explanation of your ON JOIN event? Mainly explain how the $(%room_test) works.
|
|
|
|
Joined: Jul 2006
Posts: 4,156
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,156 |
Nope, my $remtok isn't missing a parameter, the N parameter is 1 if you don't use it...You don't even try the code or ? Syntax error : on *:text:*:#:{ same error for on action and on notice.
The $() in the on join event isn't necessary, i've just put it as a reflex like for the on text event, but should not be used
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
|