mIRC Home    About    Download    Register    News    Help

Print Thread
#133728 24/10/05 12:53 PM
Joined: Oct 2005
Posts: 91
T
truguce Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
Not sure how to say this. Im trying to make a script that can unban someone from a room. As in nick1 got banned from chan1 so he goes to chan2 where bot is and types command so as to get him self unbanned from chan1. Every nick has a vhost vhost.com that can acces this.
I have tried to make something to do this but i am still new and cant figeur it out. Any help would be appreciated.
Thanks

Joined: Apr 2005
Posts: 111
X
Vogon poet
Offline
Vogon poet
X
Joined: Apr 2005
Posts: 111
what kind of irc you use,unreal , ircx?

Joined: Oct 2005
Posts: 91
T
truguce Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
im using mIRC for now, till i get linux up

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Code:
on @*:text:!unban *:[color:red]#Channel2[/color]:{
  if ($2 isban [color:red]#Channel1[/color]) {
    msg # Removing ban for $2 on [color:blue]#Channel1[/color]
    mode [color:red]#Channel1[/color] -b $2
  }
  else {
    msg # $2 was not found on [color:blue]#Channel1's[/color] ban list.
  }
}


The red text needs to be changed. The blue text can be changed if you want to, or you can remove it. It does not affect the script at all.

Useage: !unban <hostmask>

Example
John123 (john@vhost.com) gets banned from #Channel1 with mask *!john@vhost.com
John123 joins #Channel2 and types !unban *!john@vhost.com
Bot checks if *!john@vhost.com is on #Channel1's ban list and if so, unbans it. If it's not, then it says the mask was not found on the ban list.

Last edited by schaefer31; 24/10/05 10:04 PM.
Joined: Oct 2005
Posts: 91
T
truguce Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
thanks for the help. That worked great.

Joined: Oct 2005
Posts: 91
T
truguce Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
is there a way that if they on a certian user level, they could type "!unban list" and it would tell them who is on the ban list?
I did change the script to this
Code:
 on +unban:text:!unban *:?:{
  if ($3 isban $2) {
    .notice $nick Removing ban for $3 on $2
    mode $2 -b $3
  }
  else {
    .notice $nick $3 was not found on $2 ban list.
  }
}
 

sometimes the ban is different so i need a way to find what the ban is. thanks alot

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Edit: see next post

Last edited by schaefer31; 26/10/05 05:25 PM.
Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Here is everything in one script. Change it to suit your needs.

Code:
on 1:text:!unban *:[color:red]#Channel2[/color]:{
  if ($2 == list) {
    if ($ibl([color:red]#Channel1[/color],0) != 0) {
      msg # Ban list for [color:blue]#Channel1[/color]:
      var %i = 1
      while (%i &lt;= $ibl([color:red]#Channel1[/color],0)) {
        msg # %i $+ : $ibl([color:red]#Channel1[/color],%i)
        inc %i 
      }
    }
    else { msg # [color:blue]#Channel1[/color] has no bans! }
  }
  else if ( ! isin $2 &amp;&amp; @ isin $2) {
    if ($2 isban [color:red]#Channel1[/color]) {
      mode [color:red]#Channel1[/color] -b $2
    }
    else {
      msg # $2 was not found on [color:blue]#Channel1[/color]  ban list.
    }
  }
  else { msg # $2 is not a valid banmask. }
}


If you want to show who made the ban then

Change this line
Code:
      msg # %i $+ : $ibl([color:red]#Channel1[/color],%i)


To this
Code:
      msg # %i $+ : $ibl([color:red]#Channel1[/color],%i) set by $ibl([color:red]#Channel1[/color],%i).by


You can also do:

$ibl(#Channel1,%i).date - This will show the date and time of the ban

Joined: Oct 2005
Posts: 91
T
truguce Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
thank you much schaefer31. everything works great

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
You're welcome. smile

I thought of something else that maybe you want to use. An '!unban all'
command. If you want to do this then do the following:

Find this line
Code:
  else { msg # $2 is not a valid banmask. }


Insert before this line, the following code
Code:
  else if ($2 == all) {
    msg # Removing all bans on [color:blue]#Channel1[/color]
    var %i = 1
    while (%i &lt;= $ibl([color:red]#Channel1[/color],0)) {
      mode [color:red]#Channel1[/color] -b $ibl([color:red]#Channel1[/color],%i)
      inc %i 
    }
  }


Link Copied to Clipboard