Revolveing Door Kick/ban
Please Register to submit score.
| Average Score | 7.2 |
| Scores Submitted | 6 |
| Date Added | Oct 02, 2007 |
| Last Updated | May 14, 2008 |
| Tags | ban bot door kick revolveing |
Introduction
mIRC Snippet:
Revolveing Door Kick/ban
Posted on Oct 3, 2007 10:18 pm
Posted on Oct 3, 2007 10:18 pm
Couple of things I noticed upfront from just glancing at the code:
if (($nick != %botking) && ($2 == on)) {
Ban -ku60 $chan $nick How Dare You Try And Use Commands You Don't Have Access To
}
elseif (($nick != %botking) && ($2 == off)) {
Ban -ku60 $chan $nick How Dare You Try And Use Commands You Don't Have Access To
}
That is a waste of code and can simply be shortened to:
if ($nick != %botking) ban -ku60 $chan $nick How Dare You Try And Use Commands You Don't Have Access To
elseif () { }
Also, $3 is really important to the process so you should check to see if it is specified before setting the variable:
elseif (($nick == %botking) && ($2 == on)) {
set %door [ $+ [ $3 ] ] on
should be.. elseif (($nick == %botking) && ($2 == on) && ($3) {
set %door [ $+ [ $3 ] ] on
if (($nick != %botking) && ($2 == on)) {
Ban -ku60 $chan $nick How Dare You Try And Use Commands You Don't Have Access To
}
elseif (($nick != %botking) && ($2 == off)) {
Ban -ku60 $chan $nick How Dare You Try And Use Commands You Don't Have Access To
}
That is a waste of code and can simply be shortened to:
if ($nick != %botking) ban -ku60 $chan $nick How Dare You Try And Use Commands You Don't Have Access To
elseif () { }
Also, $3 is really important to the process so you should check to see if it is specified before setting the variable:
elseif (($nick == %botking) && ($2 == on)) {
set %door [ $+ [ $3 ] ] on
should be.. elseif (($nick == %botking) && ($2 == on) && ($3) {
set %door [ $+ [ $3 ] ] on
mIRC Snippet:
Revolveing Door Kick/ban
Posted on Oct 3, 2007 10:27 pm
Posted on Oct 3, 2007 10:27 pm
on *:join:%revolve: {
if ($nick isreg #) {
inc -u60 %revolvingdoor. [ $+ [ $nick ] ]
if (%revolvingdoor. [ $+ [ $nick ] ] = %setrevolve) {
Ban -ku600 $chan $nick This Room Has No Revolving Door
}
}
}
The above code won't work if you have more than one channel set. Here's how you do it to allow more:
on *:JOIN:#: {
if (!$istok(%revolve,$chan,44)) halt
if ($nick isreg #) {
inc -u60 %revolvingdoor. [ $+ [ $nick ] ]
if (%revolvingdoor. [ $+ [ $nick ] ] = %setrevolve) {
Ban -ku600 $chan $nick This Room Has No Revolving Door
}
}
}
if ($nick isreg #) {
inc -u60 %revolvingdoor. [ $+ [ $nick ] ]
if (%revolvingdoor. [ $+ [ $nick ] ] = %setrevolve) {
Ban -ku600 $chan $nick This Room Has No Revolving Door
}
}
}
The above code won't work if you have more than one channel set. Here's how you do it to allow more:
on *:JOIN:#: {
if (!$istok(%revolve,$chan,44)) halt
if ($nick isreg #) {
inc -u60 %revolvingdoor. [ $+ [ $nick ] ]
if (%revolvingdoor. [ $+ [ $nick ] ] = %setrevolve) {
Ban -ku600 $chan $nick This Room Has No Revolving Door
}
}
}
mIRC Snippet:
Revolveing Door Kick/ban
Posted on Oct 3, 2007 10:52 pm
Posted on Oct 3, 2007 10:52 pm
It's not bad. But why not just generalize the if ($nick (!)= %botking) events? It's rather pointless to constantly use an if ($nick (!)= %botking in each if statement.
mIRC Snippet:
Revolveing Door Kick/ban
Posted on Oct 4, 2007 12:23 am
Posted on Oct 4, 2007 12:23 am
| Quote: |
| The above code won't work if you have more than one channel |
hmm seems to work for me like that =/
mIRC Snippet:
Revolveing Door Kick/ban
Posted on Oct 5, 2007 4:33 pm
Posted on Oct 5, 2007 4:33 pm
KuTsuM, use
to show the code box :P
| Code: |
| [code]on *:event:*:#channel:{[/code] |
to show the code box :P
mIRC Snippet:
Revolveing Door Kick/ban
Posted on May 14, 2008 8:40 pm
Posted on May 14, 2008 8:40 pm
:D works well






