egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unbanning through the bot.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Skipper
Voice


Joined: 21 Aug 2005
Posts: 29

PostPosted: Tue Aug 23, 2005 4:10 am    Post subject: Unbanning through the bot. Reply with quote

Hello ppl,

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. Smile

!unban nick/hostmask.

The Bot should unban .. and notify in the channel mains.. the ban is removed.

Rgds

Skipper
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Aug 23, 2005 4:19 am    Post subject: Reply with quote

why not have the ops on #Channel1 unban poor peon?
Back to top
View user's profile Send private message Visit poster's website
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Tue Aug 23, 2005 9:00 pm    Post subject: Reply with quote

This should do your job.

Code:

#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.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Aug 23, 2005 10:54 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Skipper
Voice


Joined: 21 Aug 2005
Posts: 29

PostPosted: Wed Aug 24, 2005 12:51 am    Post subject: Reply with quote

Hello awyeah,

Thanks for the script Smile

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.

Rgds

Skipper
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Aug 24, 2005 12:56 am    Post subject: Reply with quote

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.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Aug 24, 2005 7:33 am    Post subject: Reply with quote

This should do it
Code:
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
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Skipper
Voice


Joined: 21 Aug 2005
Posts: 29

PostPosted: Wed Aug 24, 2005 8:05 am    Post subject: Reply with quote

Hello Sir Fz,

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?

Rgds

Skipper
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Aug 24, 2005 8:10 am    Post subject: Reply with quote

Sir_Fz wrote:
This should do it
Code:
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.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Aug 24, 2005 9:19 am    Post subject: Reply with quote

Actually we can use getchanhost since nick is already in the helpchan (I dont know why I didn't think about this before)

This should do it Skipper.
Code:
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}
 if {![onchan [set n [lindex [split $arg] 0]] $chan]} {
  puthelp "privmsg $chan :$n is not here."
 } {
  set mask $n![getchanhost $n $chan]
  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
   }
  }
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Skipper
Voice


Joined: 21 Aug 2005
Posts: 29

PostPosted: Wed Aug 24, 2005 12:12 pm    Post subject: Reply with quote

Hello Sir Fz,

No response from the bot when i type !unban Nick.

And Am not getting any error messages in the partyline of the bot.. wonder whats wrong.. and where it is wrong.


Rgds

Skipper
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Aug 24, 2005 12:23 pm    Post subject: Reply with quote

Try
Code:
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)
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Skipper
Voice


Joined: 21 Aug 2005
Posts: 29

PostPosted: Thu Aug 25, 2005 2:04 am    Post subject: Reply with quote

Hello Sir Fz,

You ROCK Smile

The codes which u had given works PERFECT Smile

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. Smile


Rgds

Skipper
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Thu Aug 25, 2005 2:12 am    Post subject: Reply with quote

there ought to be some limit on begging for scripts, you know
Back to top
View user's profile Send private message Visit poster's website
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Thu Aug 25, 2005 2:50 am    Post subject: Reply with quote

getchanhost doesn't require a channel.
So if you just use getchanhost $nick it will return the host if it knows that host.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber