This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

unban public command with security code.

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
Sh3ny
Voice
Posts: 7
Joined: Tue Aug 05, 2008 6:15 pm

unban public command with security code.

Post by Sh3ny »

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 :oops: & sorry for my baaaaaad english ;****
User avatar
Sh3ny
Voice
Posts: 7
Joined: Tue Aug 05, 2008 6:15 pm

Post by Sh3ny »

someone can helpme? :cry:
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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.
Last edited by Sir_Fz on Sat Aug 09, 2008 12:09 pm, edited 1 time in total.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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 :)
User avatar
Sh3ny
Voice
Posts: 7
Joined: Tue Aug 05, 2008 6:15 pm

Post by Sh3ny »

Sir_Fz wrote:

Code: Select all

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 :roll:

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? :oops:

.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. :cry::cry::cry::cry::cry:
User avatar
Sh3ny
Voice
Posts: 7
Joined: Tue Aug 05, 2008 6:15 pm

Post by Sh3ny »

some help? :cry:
User avatar
Sh3ny
Voice
Posts: 7
Joined: Tue Aug 05, 2008 6:15 pm

Post by Sh3ny »

it solved, thanks nor7on.

:D
Post Reply