mIRC Home    About    Download    Register    News    Help

Print Thread
#114630 16/03/05 02:53 AM
Joined: Feb 2005
Posts: 193
A
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 193
Hello, this may be a long code, but I was just wondering. What I need, is a command that will:

By typing /cban, it will give me a list of all of the banned users. I need it to list them numbered or with leters. For example:

A. *!*alhammer@*hawkcommunications.com
B. *!*hammertime@*hawkcommunications.com
C. *!*HAMM3R@*hawkcommunications.com
D. ect...

*Or using 1,2,3 etc. Then, if I type "A", it will delete:

A. *!*alhammer@*hawkcommunications.com

Do you see what I am getting at here. I would like to save time so that insted of having to find, and paste the entire address, it will echo them all, and I can delete them using their symbol. (A,B,C-1,2,3)

Please let me know if you come up with anything. TIA!!! grin

#114631 16/03/05 03:24 AM
Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
Excuse this mess. It's rather late. frown

I didn't use letters, A-Z instead I used numbers to unban.

I thought it'd make sense.

Say it with me now.

I want to unban ban number 1.
I want to unban ban letter A.

Hehehehe.. grin

/cban N unbans the Nth address in the Internal Ban List.

/cban without N specifified, will list all bans.

Code:
alias cban {
  if ($ibl($chan,0))  {
    if ($1 isnum) { 
      if ($ibl($chan,$1) && ($me isop $chan)) { 
        mode $chan -b $ibl($chan,$1)
        echo 4 -a Removed ban: $ibl($chan,$1)
      }
      halt
    }
    var %i = 1
    echo -a -
    while (%i <= $ibl($chan,0)) {
      echo 2 -a %i $ibl($chan,%i)
      inc %i
    }
    echo -a -
  }
}



[03:13] * Andy sets mode: +b *!andy@=XMoarj.mysticirc.co.uk
[03:13] * Andy sets mode: +b *!*andy@=XMoarj.mysticirc.co.uk
[03:13] * Andy sets mode: +b *!*@=XMoarj.mysticirc.co.uk
[03:13] * Andy sets mode: +b *!*andy@*.mysticirc.co.uk
[03:13] * Andy sets mode: +b *!*@*.mysticirc.co.uk
[03:13] * Andy sets mode: +b Andy!andy@=XMoarj.mysticirc.co.uk
[03:13] * Andy sets mode: +b Andy!*andy@=XMoarj.mysticirc.co.uk
[03:13] * Andy sets mode: +b Andy!*@=XMoarj.mysticirc.co.uk
[03:13] * Andy sets mode: +b Andy!*andy@*.mysticirc.co.uk
[03:13] * Andy sets mode: +b Andy!*@*.mysticirc.co.uk


/cban returns the following below.


-
1 Andy!*@*.mysticirc.co.uk
2 Andy!*andy@*.mysticirc.co.uk
3 Andy!*@=XMoarj.mysticirc.co.uk
4 Andy!*andy@=XMoarj.mysticirc.co.uk
5 Andy!andy@=XMoarj.mysticirc.co.uk
6 *!*@*.mysticirc.co.uk
7 *!*andy@*.mysticirc.co.uk
8 *!*@=XMoarj.mysticirc.co.uk
9 *!*andy@=XMoarj.mysticirc.co.uk
10 *!andy@=XMoarj.mysticirc.co.uk
-

/cban 1 removes the first ban.

Removed ban: *!*@*.mysticirc.co.uk


[03:14] * Andy sets mode: -b *!*@*.mysticirc.co.uk

/cban 3 removes the third ban.

Removed ban: *!*andy@=XMoarj.mysticirc.co.uk


[03:14] * Andy sets mode: -b *!*andy@=XMoarj.mysticirc.co.uk


-
1 Andy!*@*.mysticirc.co.uk
2 Andy!*andy@*.mysticirc.co.uk
3 Andy!*@=XMoarj.mysticirc.co.uk
4 Andy!*andy@=XMoarj.mysticirc.co.uk
5 Andy!andy@=XMoarj.mysticirc.co.uk
6 *!*andy@*.mysticirc.co.uk
7 *!*@=XMoarj.mysticirc.co.uk
8 *!andy@=XMoarj.mysticirc.co.uk
-


Hope this helps.

All the best,

Andy.

#114632 16/03/05 03:27 AM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
laugh This time you beat me, SladeKraven

#114633 16/03/05 03:33 AM
Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
Which is most perculiar considering it's half past 3 in the morning for me. shocked

I must sleep soon though otherwise I'll be knackered for my day out tomorrow to watch a soccer game in Charlton. smile

#114634 16/03/05 01:14 PM
Joined: Feb 2005
Posts: 193
A
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 193
Awsome dude! That works just has I thought it would. How hard would it be to add a /cban all which will obiously delete all bans, and /cban last, which will delete the last ban added? Just a thought, it's not important at all. I just really happy this one worked. I thought it the code would have been more complex than that. You do good work SladeKraven! Thanks!!! grin

P.S. I appreciate you trying RusselB! I've been beaten many times. :tongue:

Last edited by alhammer; 16/03/05 01:17 PM.
#114635 17/03/05 02:28 AM
Joined: Feb 2005
Posts: 193
A
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 193
Hey. I just realized, that if someone else does a ban, it wont show up in the list. I'm sure this has something to do with the fact that it is the "Internal Ban List". Is there a way to have an "on BAN" command that will update the IBL? Also, will someone see if they can answer my question about the: /cban all, and /cban last commands? The IBL propblem is of a higher priority to me. THANKS! grin

P.S. I'm not addressing this to just SladeKraven. Infact, I know he will be away for a while, so anyone's comments/answers are appreciated!

Last edited by alhammer; 17/03/05 02:31 AM.
#114636 17/03/05 01:38 PM
Joined: Mar 2004
Posts: 540
A
Fjord artisan
Offline
Fjord artisan
A
Joined: Mar 2004
Posts: 540
Code:
 
alias cban { .enable #numbanlist | mode $1 +b | set %cbna_num 1 }
#numbanlist
raw 367:*: {
  haltdef
  echo -s %cbna_num $+ ) $3
  inc %cbna_num
}
raw 368:*: { haltdef | .disable #numbanlist | unset %cbna_num }
#numbanlist off
  

Id just use the raw server responces, and with deleting Id add them to a hash table or something
Edit:
Code Typo

Last edited by Armada; 17/03/05 01:48 PM.

Link Copied to Clipboard