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 

unban public command with security code.

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


Joined: 05 Aug 2008
Posts: 7

PostPosted: Tue Aug 05, 2008 7:43 pm    Post subject: unban public command with security code. Reply with quote

Hi.

can helpme pls, is a unban public msg unban command from internalbanlist.

need a little source, if user1 is banned from #channel.

* Eggdrupy set mode: +b *!*@francesca.clubeuropa.ro
* un-tip` was kicked by Eggdrupy (if u want be unbanned pls: /msg Eggdrupy unban)

so, when user1 put:
/msg Eggdrupy unban

my eggdrop respond and generate a code.
Hi User1, Your $host have ban in #channel, pls put: /msg Eggdrupy unban 235672

if user1 put wrong code, bot don't unban, if user1 write correct code, eggdrop put unban in #Channel.

* Eggdrupy set mode: -b *!*@francesca.clubeuropa.ro

so, if an other user don't have ban in #channel and this user put /msg myeggdrop unban; bot ignore this privmsg.

thanks Embarassed & sorry for my baaaaaad english ;****
Back to top
View user's profile Send private message
Sh3ny
Voice


Joined: 05 Aug 2008
Posts: 7

PostPosted: Fri Aug 08, 2008 5:05 pm    Post subject: Reply with quote

someone can helpme? Crying or Very sad
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Aug 09, 2008 11:50 am    Post subject: Reply with quote

Code:
bind join - * check:ban
bind msg - unban unban:nick

proc check:ban {nick uhost hand chan} {
 global unbanc
 set banned 0
 set hostmask [string tolower $nick!$uhost]
 foreach ban [banlist $chan] {
  set b [lindex $ban 0]
  if {[string match -nocase $b $hostmask]} {
   set banned 1
   break
  }
 }
 if {$banned} {
  set unbanc($hostmask) [randstring 5]:$chan:$b
  puthelp "privmsg $nick :/msg Eggdrupy unban [lindex [split $unbanc($hostmask) :] 0]"
 }
}

proc unban:nick {nick uhost hand arg} {
 global unbanc
 set code [lindex [split $arg] 0]
 set hostmask [string tolower $nick!$uhost]
 if {[info exists unbanc($hostmask)]} {
  foreach {c chan b} [split $unbanc($hostmask) :] {break}
  if {[string equal $code $c]} {
   killchanban $chan $b
   unset $unbanc($hostmask)
  } {
   puthelp "privmsg $nick :Invalid code: $code"
  }
 }
}

Edit: Modified code to remove the ban from the bot's internal banlist instead of channel banlist.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts


Last edited by Sir_Fz on Sat Aug 09, 2008 12:09 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Aug 09, 2008 12:04 pm    Post subject: Reply with quote

Make sure alltools.tcl is loaded before running this script, as it provides the "randstring" function used to generate the random key.

Sir_Fz: Don't you need to remove the ban from the internal banlist aswell? Otherwise, wouldn't it just be restored by the bot when the user returns (depending on channel settings)..
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Aug 09, 2008 12:10 pm    Post subject: Reply with quote

nml375 wrote:
Sir_Fz: Don't you need to remove the ban from the internal banlist aswell? Otherwise, wouldn't it just be restored by the bot when the user returns (depending on channel settings)..

Yes indeed, skipped that one. I fixed it, thanks for pointing that out Smile
_________________
Follow me on GitHub

- Opposing

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


Joined: 05 Aug 2008
Posts: 7

PostPosted: Sat Aug 09, 2008 6:29 pm    Post subject: Reply with quote

Sir_Fz wrote:
Code:
bind join - * check:ban
bind msg - unban unban:nick

proc check:ban {nick uhost hand chan} {
 global unbanc
 set banned 0
 set hostmask [string tolower $nick!$uhost]
 foreach ban [banlist $chan] {
  set b [lindex $ban 0]
  if {[string match -nocase $b $hostmask]} {
   set banned 1
   break
  }
 }
 if {$banned} {
  set unbanc($hostmask) [randstring 5]:$chan:$b
  puthelp "privmsg $nick :/msg Eggdrupy unban [lindex [split $unbanc($hostmask) :] 0]"
 }
}

proc unban:nick {nick uhost hand arg} {
 global unbanc
 set code [lindex [split $arg] 0]
 set hostmask [string tolower $nick!$uhost]
 if {[info exists unbanc($hostmask)]} {
  foreach {c chan b} [split $unbanc($hostmask) :] {break}
  if {[string equal $code $c]} {
   killchanban $chan $b
   unset $unbanc($hostmask)
  } {
   puthelp "privmsg $nick :Invalid code: $code"
  }
 }
}

Edit: Modified code to remove the ban from the bot's internal banlist instead of channel banlist.


Hi Sir_Fz.

u can insert this code in your blacklist.1.3? so i like ur tcl blacklist Rolling Eyes

b coz, want now remove bans puts it a bd (blacklist.txt).
and add to blackist with a public command, without reason (only ex: %badd nick) so my eggdrop add this host in blacklist *!*@host.domain.

so, when a user have ban in bd, my egg put kick:

* Testuser2 was KICKED by myeggdrop (you're in a blacklist, if this an error put: /msg Chasse unban)

so, when this user put: /msg Chasse unban
eggdrop response in privmsg with a code generate:
"hi $nick, if u want unbanned put now: /msg Chasse unban $code.

(if other user don't have ban, and put command unban, my eggdrop ignore this user.)

if user is kicked and don't put /msg Chasse unban.
my eggdrop DON'T send privmsg to user.

aaaaaaaaaaahh and u can add this type to enable script? Embarassed

.chanset #mychan +/-blacklist
and
.chanset #mychan +/-lockban

ex:
If
.chanset #mychan +lockban
only flags +n or +m can remove bans via dcc or pub command.

.chanset #mychan -lockban
flags +n or +m AND ONLY user banned can remove ur own ban.

sorry for disturb you. Crying or Very sadCrying or Very sadCrying or Very sadCrying or Very sadCrying or Very sad
Back to top
View user's profile Send private message
Sh3ny
Voice


Joined: 05 Aug 2008
Posts: 7

PostPosted: Wed Aug 13, 2008 1:25 pm    Post subject: Reply with quote

some help? Crying or Very sad
Back to top
View user's profile Send private message
Sh3ny
Voice


Joined: 05 Aug 2008
Posts: 7

PostPosted: Wed Aug 20, 2008 3:39 pm    Post subject: Reply with quote

it solved, thanks nor7on.

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