| View previous topic :: View next topic |
| Author |
Message |
Sh3ny Voice

Joined: 05 Aug 2008 Posts: 7
|
Posted: Tue Aug 05, 2008 7:43 pm Post subject: unban public command with security code. |
|
|
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 & sorry for my baaaaaad english ;**** |
|
| Back to top |
|
 |
Sh3ny Voice

Joined: 05 Aug 2008 Posts: 7
|
Posted: Fri Aug 08, 2008 5:05 pm Post subject: |
|
|
someone can helpme?  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Aug 09, 2008 11:50 am Post subject: |
|
|
| 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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Aug 09, 2008 12:04 pm Post subject: |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Aug 09, 2008 12:10 pm Post subject: |
|
|
| 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  _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Sh3ny Voice

Joined: 05 Aug 2008 Posts: 7
|
Posted: Sat Aug 09, 2008 6:29 pm Post subject: |
|
|
| 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
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?
.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.      |
|
| Back to top |
|
 |
Sh3ny Voice

Joined: 05 Aug 2008 Posts: 7
|
Posted: Wed Aug 13, 2008 1:25 pm Post subject: |
|
|
some help?  |
|
| Back to top |
|
 |
Sh3ny Voice

Joined: 05 Aug 2008 Posts: 7
|
Posted: Wed Aug 20, 2008 3:39 pm Post subject: |
|
|
it solved, thanks nor7on.
 |
|
| Back to top |
|
 |
|