mIRC Home    About    Download    Register    News    Help

Print Thread
#23286 08/05/03 09:56 PM
Joined: Dec 2002
Posts: 56
W
wshs Offline OP
Babel fish
OP Offline
Babel fish
W
Joined: Dec 2002
Posts: 56
I add a ban, with an expiry, using ban -u. I want a script to set an expiry of 1 hour on bans I place, using on BAN, but only for bans without an expiry. The only problem I have is that I do not know how to make it detect if a ban has an expiry or not. Is this possible? If it is, how do I go about doing so?


Acquire. Analyze. Adapt.
#23287 08/05/03 10:31 PM
Joined: May 2003
Posts: 730
S
Hoopy frood
Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
nope, make an alias for /ban
check if (-* iswm $1) && (u isincs $1)

#23288 08/05/03 10:33 PM
Joined: Dec 2002
Posts: 56
W
wshs Offline OP
Babel fish
OP Offline
Babel fish
W
Joined: Dec 2002
Posts: 56
That would not work.
I add a ban using /ban -u60 somenick
The ban triggers an on BAN
ban being an alias is utterly useless when the on BAN is triggered. on BAN needs to know if the ban is timed or not.


Acquire. Analyze. Adapt.
#23289 08/05/03 10:43 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
How can ON BAN know that? It can't, mIRC only knows if the bans _you_ set are timed, it has no idea whether someone else in the channel set the ban as timed. An ON BAN triggers for _all_ bans, not just when you set a ban. So how do you propose mIRC should find out if a ban set by someone else is timed?

#23290 09/05/03 12:08 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
-u is in seconds. if you want to make it last for an hour, you need to make it -u3600


*edit*

I just also re-read the script.


The simply fact is that an on BAN even only triggers on a ban. It doesn't know how long it lasts for, because all it is receiving, is that a client was banned at a particular address.

If you want the ban to only last for an hour, either script a method that allows your ops to create a ban that lasts for that long, or tell them to set -u for an hour, which is what i have shown in this thread.

Code:
on *:TEXT:!ban*:#:{
  if ($nick isop $chan) {
    if (($2 ison $chan) && ($3 != $null)) {
      ban -u3600 $chan $2 2
      kick $chan $2 $3-
      halt
    }
  }
}



The above code is a very simple way to automate banning for ops that can't be stuffed banning with /ban
It will ban the nick if it exists on the channel, and as long as there is a reason for the ban ($3-)

use is this:

!ban nickname reason you have banned the nick

it will then proceed to ban the nick for 1hour using the *!*@address.com mask

the if ($nick isop $chan) makes it so only an nick with @ in front of their name can use the command.

Last edited by neophyte; 09/05/03 12:18 AM.

--------
mIRC - fun for all the family (except grandma and grandpa)
#23291 09/05/03 12:11 AM
Joined: Dec 2002
Posts: 56
W
wshs Offline OP
Babel fish
OP Offline
Babel fish
W
Joined: Dec 2002
Posts: 56
codemastr, exactly. I wanna know if bans *I* set are timed or not.
on 1:BAN:#:if ($nick == $me) { .... }
For the others, I already know how to add timed bans, so don't bother explaining how. I want to know if a ban I place is timed.


Acquire. Analyze. Adapt.
#23292 09/05/03 01:20 AM
Joined: May 2003
Posts: 3
B
Self-satisified door
Offline
Self-satisified door
B
Joined: May 2003
Posts: 3
i guess you could set the ban to set a temporary variable that the on ban reads...

#23293 09/05/03 02:22 AM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Which is why you were told to make an alias for /ban that records that information, but you said that wasn't a good way to do it. Well it might not be the best way, I agree, but at least for now, it is the only way.

#23294 09/05/03 02:45 AM
Joined: Dec 2002
Posts: 56
W
wshs Offline OP
Babel fish
OP Offline
Babel fish
W
Joined: Dec 2002
Posts: 56
The reason I wrote the script to force an expire is because I usually don't place bans using /ban. I use /mode #chan b mask. That's why making an alias for /ban would prove fruitless. I will make a note in the suggestion forum for $ibl to have a .expiry property.


Acquire. Analyze. Adapt.
#23295 09/05/03 02:56 AM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
If you use /mode to set the ban, then the ban does not expire, so I'm not really sure what that has to do with anything.

#23296 09/05/03 03:44 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
So write an alias for /ban that takes the hassle out of specifying what channel etc.


I myself have made an alias that has all the switches that the ban alias has and then kicks the user.

Ie, i can do this:

/kb -u60 nickname mask reason

and it instantly kicks them and bans that address.

I can also do this:

/kb nickname reason

/kb nickname

/kb nickname mask

So why not write an alias that does a similar thing?


ie

Code:
alias kb {
  ban -u3600 $chan $$1
  if (($2 != $null) && ($1 ison $chan)) { kick $chan $$1 $$2- }
  if (($2 == $null) && ($1 ison $chan)) { kick $chan $$1 }
  set %ban.time. [ $+ [ $nick ] ] 3600
}



Then you can easily check to see if the ban you've made is an hour long one, because it's set a var with %ban.nickname 3600.

how much harder could it be?


--------
mIRC - fun for all the family (except grandma and grandpa)
#23297 09/05/03 04:13 AM
Joined: Dec 2002
Posts: 56
W
wshs Offline OP
Babel fish
OP Offline
Babel fish
W
Joined: Dec 2002
Posts: 56
Code:
;triggers when a ban is placed
on 1:BAN:#:{
  ;does the ban lack an expiry and is it set by me?
  if (!$ibl(#,$banmask).expiry && $nick == $me) {
    ;no? then set an expiry
    ban -u3600 # $banmask
  }
}


Acquire. Analyze. Adapt.
#23298 09/05/03 11:51 AM
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
Quote:
I will make a note in the suggestion forum for $ibl to have a .expiry property


Good idea


Link Copied to Clipboard