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 

Help With Bans in TCL Script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
achilles1900
Voice


Joined: 21 Apr 2008
Posts: 30

PostPosted: Wed Jul 23, 2008 5:19 am    Post subject: Help With Bans in TCL Script Reply with quote

Hi people,

the following is the bans section in Op Commands by xTc^bLiTz
I dont know TCL so i hope some kind soul can take a look at it work it out.

1. I would like the bot to ban with : *!*user@*.host.domain which it is currently not doing.
(FYI I do the public command !ban (nick) )

2. When I try to do !unban (nick) it tells me that there is no user in the banlist, although i see the host there. Anyway to fix this?

Thanks in advance for your time and efforts Smile . Following is attached the TCL code
Code:

# Ban Process

proc proc_ban { nick uhost hand chan text } {
  global botnick
  if {[onchan $text]} {
    if {$text == $botnick} { return 0 }
    set banmask [getchanhost $text $chan]
    putquick "MODE $chan +b $banmask"
    putkick $chan $text :Requested
  } else { putserv "PRIVMSG $chan :$text Is Not In The Channel" }
}

# Unban Process

proc proc_unban { nick uhost hand chan text } {
  if {[ischanban $text $chan]} {
    pushmode $chan -b $text
  } else { putserv "PRIVMSG $chan :$text Is Not In The Ban List" }
}
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Jul 23, 2008 11:22 pm    Post subject: Reply with quote

It's the host you unban (as per the list), not the nick.

.i.e !unban *!*user@*.host.domain
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Jul 24, 2008 10:16 am    Post subject: Reply with quote

Replace
Code:
[getchanhost $text $chan]

with
Code:
[maskhost [getchanhost $text $chan]]

as for !unbaning nick, use this proc instead of yours:
Code:
# Unban Process

proc proc_unban { nick uhost hand chan text } {
 set mask $text![getchanhost $text $chan]
 set found 0
 foreach ban [chanbans $chan] {
  set ban [lindex $ban 0]
  if {[string match -nocase $ban $mask]} {
   pushmode $chan -b $ban
   set found 1
  }
 }
 if {!$found} {
  puthelp "PRIVMSG $chan :$text Is Not In The Ban List"
 }
}

_________________
Follow me on GitHub

- Opposing

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


Joined: 07 Oct 2002
Posts: 708

PostPosted: Thu Jul 24, 2008 12:32 pm    Post subject: Reply with quote

Mmmm... if the user is banned, I wouldn't suspect he's on the channel necessarily... so getchanhost will most likely fail.
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Jul 24, 2008 1:26 pm    Post subject: Reply with quote

strikelight wrote:
Mmmm... if the user is banned, I wouldn't suspect he's on the channel neccessarily... so getchanhost will most likely fail.

Good observation there, didn't think about it frankly Laughing so achilles1900, you want the bot to whois the banned nick and try to unban any bans set on it?
_________________
Follow me on GitHub

- Opposing

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


Joined: 21 Apr 2008
Posts: 30

PostPosted: Thu Jul 24, 2008 5:41 pm    Post subject: Reply with quote

Hi Sir_FZ , strikealight & alchera,

thanks for your reply and help.

Quote:
Good observation there, didn't think about it frankly so achilles1900, you want the bot to whois the banned nick and try to unban any bans set on it?


Yes that would be very helpful! Very Happy
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
Page 1 of 1

 
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