mIRC Homepage
Posted By: truguce Need help for Unban Script - 24/10/05 12:53 PM
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
Posted By: XGamerAMD Re: Need help for Unban Script - 24/10/05 02:08 PM
what kind of irc you use,unreal , ircx?
Posted By: truguce Re: Need help for Unban Script - 24/10/05 09:25 PM
im using mIRC for now, till i get linux up
Posted By: schaefer31 Re: Need help for Unban Script - 24/10/05 10:02 PM
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.
Posted By: truguce Re: Need help for Unban Script - 26/10/05 07:00 AM
thanks for the help. That worked great.
Posted By: truguce Re: Need help for Unban Script - 26/10/05 07:22 AM
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
Posted By: schaefer31 Re: Need help for Unban Script - 26/10/05 04:39 PM
Edit: see next post
Posted By: schaefer31 Re: Need help for Unban Script - 26/10/05 05:20 PM
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
Posted By: truguce Re: Need help for Unban Script - 26/10/05 10:19 PM
thank you much schaefer31. everything works great
Posted By: schaefer31 Re: Need help for Unban Script - 26/10/05 10:31 PM
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 
    }
  }
© mIRC Discussion Forums