Script needed :- To unban a channel ban where the bot is opped.
The ops should be able to get the channel ban removed when they type
!Unban nick/hostmask.
For example:
If the user joined is banned in #Channel1. When he joins the #Channel2{Helpchannel) Seeking for help.. The ops should be able to unban the ban through bot.. by typing !Unban nick/hostmask.
But the ops cannot be added to bots access list.
A simple public command will do.
!unban nick/hostmask.
The Bot should unban .. and notify in the channel mains.. the ban is removed.
#Set the channel for this script to unban on.
set channel1 "#channel1"
#Set the channel for this script to trigger on.
set channel2 "#channel2"
bind pub - "!unban" unban:mask
proc unban:mask {nick uhost hand chan text} {
global channel1 channel2
if {![botonchan $channel1] || ![botonchan $channel2]} {return 0}
if {[string equal "" [lindex $text 0]]} {
putquick "PRIVMSG $channel2 :Usage: !unban <nick!ident@host.domain.com> -- wilcards are accepted."; return 0
}
if {![ischanban [lindex $text 0] $channel1]} {
putquick "PRIVMSG $channel2 :The ban [lindex $text 0] does not exist or is placed on channel $channel1."; return 0
}
if {[botisop $channel1] && [isop $nick $channel2] && [string equal -nocase $chan $channel2]} {
putquick "MODE $channel1 -b [lindex $text 0]"
putquick "PRIVMSG $channel2 :The ban [lindex $text 0] has been successfully removed from channel $channel1."; return 0
}
}
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
so goober joins the help chan and cries "help! I'm banned on main chan", then some op types !unban *!goober@* but guess what? there is no such ban on the main chan, goober is banned as goober!*@foo.bar.com
delegating channel handling from one place to another is, IMO, pointless
But i guess as demond pointed out.. this script wont unban the matching ones..
example :- a nick called x` got banned.. with his ip. this script will unban
if we type !unban *!*@ip .. then only it will unban.. But how to alter .. it like.. !unban x` .. then the bans matching to x` should be unbanned.
That script was only a simple demonstration of a public command for !unban. For that we need a bit advanced script. First you put the users nickname: !unban <nickname>
The script will /whois or /who that user and get his nick!ident@host.domain.com. Then it will search through #channel1's ban list searching for any bans matching that mask: ident@host.domain.com. When one is found it will be unbanned and removed. Alternatively if that nick is not online, then the script will halt.
However if a banmask like *!*@* or *!*@*.* is placed in the banmask list of #channel1, i.e. masks affecting very large ranges, then they would match anything and they would be removed. If no matching mask is found the script will give a reply, saying that no match was found. I don't have time to implement this script at the moment, but you can try the scripts request section on this forum -- maybe someone can assist you.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Will this script unbans if we type just !unban nick ? I mean wil it unban the matching bans with respect to the nick.. whatever the ban it is.. like either nick ban or ident ban or ip ban or subnet ban.. will it match the bans with respect to the nick?
set helpchan #chan1
set mainchan #chan2
bind pub - !unban remove:ban
proc remove:ban {nick uhost hand chan arg} {
global mainchan helpchan
if {![string equal -nocase $helpchan $chan] && ![isop $nick $chan]} {return 0}
set mask [lindex [split $arg] 0]
foreach ban [chanbans $mainchan] {
if {[string match -nocase $mask [lindex $ban 0]]} {
pushmode $mainchan -b [lindex $ban 0]
puthelp "privmsg $chan :Removed [lindex $ban 0] from the banlist of $mainchan."
break
}
}
}
syntax: !unban nick!identd@host
Actually Sir_Fz I don't think you fully understood what he mean't. He said that !unban <nickname> would look up a users host somehow (WHOIS most probobaly for which you need a definate bind raw) since we cannot use getchanhost or any other command as that nick won't be in the channel since he/she is banned and most likely kicked too. Upon getting the users host, try matching it with the channels banlist and remove all bans which affect that user. So if you read the explanation of my idea, maybe you will know how to implement it -- or maybe you have a different way
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
set helpchan #chan1
set mainchan #chan2
bind pub - !unban remove:ban
proc remove:ban {nick uhost hand chan arg} {
global mainchan helpchan
if {![string equal -nocase $helpchan $chan]} {return 0}
if {[isop $nick $chan] && [onchan [set n [lindex [split $arg] 0]] $chan]} {
set mask $n![getchanhost $n $chan]
foreach ban [chanbans $mainchan] {
if {[string match -nocase [lindex $ban 0] $mask]} {
set fb [lindex $ban 0]
break
}
}
if {[info exists fb]} {
if {[botisop $mainchan]} {
pushmode $mainchan -b $fb
puthelp "privmsg $chan :Removed $fb from $mainchan."
} else {
puthelp "privmsg $chan :I'm not oped on $mainchan."
}
} else {
puthelp "privmsg $chan :$n is not banned on $mainchan."
}
}
}
Note that you have to be oped in the helpchan when issuing the !unban command, and nick should be in it as well (also !unban only works in the helpchan to remove bans from mainchan)
Is it possible to record the kicks and bans happening in the channel.. and save it in a file.. and get the infos later on .. when we type !banfind nick.. so that the bot can get the info from that file.. as to who kicked or who banned and for what reason.. just like how seenbot works.. when we type !seen nick.. it will gives the info abt the nick when last joined or last quit.. etc etc. Likewise i would like to get the infos abt who kicked the nick .. or who banned and for what reason.
It will be a helpful script if it is possible to make one.