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.

please help!

Old posts that have not been replied to for several years.
Locked
A
AW

Post by AW »

hi, i will really apprecite if someone can help me, here is the problem, i was trying to add a "handle, and a Date) to the kick message, so user will know who kicked, and date, for example
Eggdrop sets mode: +b *!*Russ@*.aol.com
Russ was kicked by Eggdrop( June 07 Aw: get out), so it worked fine, but the problem is when i ban someone let say default time is 2 hour, n somehow someone else had unban "Russ" now when Russ will join, bot will kickban him again, cos its in bots banlist, but this time bot kicks like this

Russ was kicked by Eggdrop(banned:get out)<-- now date n handle is not showing

i will really really apprecite for ur help, here are the codes.

proc ban_command {nick host handle channel args1 flag} {
global bannick
if {[test_real $nick]} {
return 0
}
set args [split $args1 " "]
set bnick [lindex $args 0]
set knick $bnick
set btime "90"

if {[matchattr $handle m] || [matchattr $handle n]} {set btime "180"}

set reason [lrange $args 1 end]
if {$reason==""} {
puthelp "NOTICE $nick :Ban will not be set without a reason, provide a reason for banning $bnick!"
return 0
}

if {[string match "*@*" $bnick]==0} {
putserv "WHOIS $bnick"
set reason [lrange $args 1 end]
lappend bannick [list [string tolower $bnick] $handle $reason $btime $flag $channel $knick $nick 1]
return 1
}

if {$bnick==""} {
puthelp "NOTICE $nick :Usage: .b <nick|host> <reason>"
return 0
}

set badd [getchanhost $bnick $channel]
if {$badd!={}} {
set bhnick [maskhost $badd]
set bnick "*!*"
append bnick [string range $bhnick 2 end]
}
set date [clock format [clock seconds] -format "%b %d"]
if {[onchan $knick $channel]} {
putserv "MODE $channel +b $bnick"
putserv "KICK $channel $knick :$date $nick: $reason"

}

if {$flag} {
newchanban $channel $bnick $handle $reason $btime
} else {
newban $bnick $handle $reason 0
}
return 1
}

advance thanks
best regards
AW
t
tainted
Master
Posts: 239
Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:

Post by tainted »

Well, the bot still has the ban active, just not in the channel's _real_ banlist. When the user rejoins, it will kick and reban the user until the ban is removed or expires on the bot. It is like this I believe to avoid problems with dynamic bans and full ban lists. In order to make it say the date and such each time, you would need to either A) make the ban sticky (thus the user would STAY banned, and the bot would reset the ban when another bot or user removes it). B) edit the eggdrop source (maybe not?)
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

The problem is you didn't edit the $reason variable, you just added the date/nick to the kick message.

The solution is to add the date/nick to the $reason variable, before the call to newchanban or whatever.
A
AW

Post by AW »

stdrgan:thank you so much, but can you please tell which line i should change, i am still confuse..sorry to be a pain.

advance thanks
regards
AW
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Move your date/nick code near the top, right after the if $reason == ""

Add this:

set reason "$date, $nick $reason"

(or whatever format you want it in)
A
AW

Post by AW »

stdragon: thank you so much, God bless ya
regards
AW
A
AW

Post by AW »

Hi again, that work for that pub proc. but i am calling that for my dcc proc as well, so when i try that in my dcc its doesn't work, i have try to set that set reason "$date $nick: $reason" for a dcc proc, but it gives me an error
dcc codes are the following

proc dcc_b_command {handle idx arg} {
set channel [lindex [console $idx] 0]
set nick [hand2nick $handle]
set host [getchanhost $nick]
return [ban_command $nick $host $handle $channel $arg 1]
}

i will apprecite for the help
advance thanks
regards
aw
Locked