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.

i need small thing witch do -o user before ban...

Old posts that have not been replied to for several years.
Locked
T
Taxi[USA]

i need small thing witch do -o user before ban...

Post by Taxi[USA] »

Probably everyone know what is this, yeah part of lol.tcl script, so what i need, if somebody can explain me, : Bot should do -o+b user before ban, becose some of the users got protect on themself...
Looks like :

CAXAP sets mode: -o+b CnuT *!*@159.148.13.146
CnuT was kicked by the CAXAP (Banned)


pretty simple , but i cant figured ,
there is the whole !ban script

### !BAN <nick|mask> [time] [reason]

proc pub_lol_ban {nick host hand chan arg} {
set arg [charfilter $arg]
global lol botnick
if {![check $hand $nick $host]} {
if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
return 0
}
if {[llength $arg] < 1} {
puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]ban <nick|mask> \[time\] \[reason\]"
return 0
}
set who [lindex $arg 0]
set ti [lindex $arg 1]
if {[number $ti]} {
set reason [lrange $arg 2 end]
} {
set ti ""
set reason [lrange $arg 1 end]
}
if {$reason == ""} {set reason "Visit our Website to see the rules at www.taxi-irc.times.lv"}
if {[string first "*" $who] != -1 || [string first "?" $who] != -1} {
if {$reason == "requested"} {set reason "MaskBan: $who"}
set who [strlwr $who]
set bancount 0
set flags "-$lol(no_ban_flags)&-$lol(no_ban_flags)"
if {$lol(no_ban_flags) == ""} {
set list [strlwr [chanlist $chan]]
} {
set list [strlwr [chanlist $chan $flags]]
}
foreach chanuser $list {
set banmask ""
if {[string match [strlwr $who] [strlwr $chanuser]] && $chanuser != [strlwr $botnick] && $chanuser != [strlwr $nick] && ![isop $chanuser $chan] && ![isvoice $chanuser $chan]} {
incr bancount
set ipmask [lindex [split [maskhost $chanuser![getchanhost $chanuser $chan]] "@"] 1]
set userm [lindex [split [getchanhost $chanuser $chan] "@"] 0]
set banmask *!*$userm@$ipmask
newchanban $chan $banmask $nick $reason
if {[botisop $chan]} {
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $chanuser :$nick: $reason"
}
}
}
if {$bancount == 0} {
puthelp "NOTICE $nick :Sorry but no one matches this mask."
}
} {
if {![onchan $who $chan]} {
puthelp "NOTICE $nick :Sorry, but I don't see $who in $chan."
return 0
}
if {[strlwr $who] == [strlwr $botnick]} {
puthelp "NOTICE $nick :Yeah right, like I'm going to let you ban ME!"
return 0
}
if {[nick2hand $who $chan] != "*"} {
if {$hand != [nick2hand $who $chan]} {
if {[matchattr [nick2hand $who $chan] o|o $chan] && ![matchattr $hand o|o $chan]} {
puthelp "NOTICE $nick :Sorry, you must be an operator to ban an operator."
return 0
}
if {([matchattr [nick2hand $who $chan] m|m $chan] || [matchattr [nick2hand $who $chan] b]) && ![matchattr $hand m|m $chan]} {
puthelp "NOTICE $nick :Sorry, you must be a master to ban a master or a bot."
return 0
}
}
}
set ipmask [lindex [split [maskhost $who![getchanhost $who $chan]] "@"] 1]
set userm [lindex [split [getchanhost $who $chan] "@"] 0]
set banmask *!*$userm@$ipmask
if {[botisop $chan]} {
if {[isop $who $chan]} {pushmode $chan -o $who}
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $who :$reason"
}
switch $ti {
""
{
newchanban $chan $banmask $nick $reason
puthelp "NOTICE $nick :New mask added: $mask"
}
0
{
newchanban $chan $banmask $nick $reason $ti
puthelp "NOTICE $nick :New mask added permanently: $mask"
}
default
{
newchanban $chan $banmask $nick $reason $ti
puthelp "NOTICE $nick :New mask added for $ti minutes: $mask"
}
}
}
return 0
}
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

putserv "MODE $chan +b $banmask"
putserv "KICK $chan $chanuser :$nick: $reason

Before this put:

Code: Select all

putserv "MODE $chan -o $nick"
and script would be also little fast, if you would out like this:

Code: Select all

putquick "MODE $chan -o $nick"
putquick "MODE $chan +b $banmask" 
putquick "KICK $chan $chanuser :$nick: $reason
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

you can use putquick "MODE $chan +b-o $banmask $nick"
T
Taxi[USA]

:)

Post by Taxi[USA] »

Txh again guys, all works very good.....

:)
T
Taxi[USA]

hmm

Post by Taxi[USA] »

hmm when i start use it , i thought its ok when we were 2 on channel me and bot but look at tshis :) on other channel:

[16:01:25] <Taxi[USA]> !ban Rhythm
[16:01:25] * Reject sets mode: -o+b Taxi[USA] *!*~Romka@159.148.154.*
[16:01:26] * Rhythm was kicked by Reject (Banned)

Bot remove op mode not from victim but from me... isnt it wrong?
and
if {$reason == ""} {set reason "Banned becose of rules violations"}

doesnt show this trigger, just show banned....

and by the way, the bot ban this person, but doent see this ban after that when i use command .bans all

???
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

Code: Select all

putquick "MODE $chan +b-o $banmask $who" 
or

Code: Select all

putquick "MODE $chan -o $who" 
putquick "MODE $chan +b $banmask" 
putquick "KICK $chan $chanuser :$nick: $reason
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

]Kami[ wrote:[snip]

Code: Select all

[snip] 
putquick "KICK $chan $chanuser :$nick: $reason
use putquick "KICK $chan $who :$reason"
Locked