| View previous topic :: View next topic |
| Author |
Message |
Ni0 Voice
Joined: 12 Dec 2005 Posts: 13
|
Posted: Mon Dec 12, 2005 11:20 am Post subject: Can anyone help |
|
|
i have a script ban.tcl this little script adds($handle%d/%m/%y)
to your bans' reason, so banned person can see who set a ban on him.
the script is :
> unbind dcc o|o +ban *dcc:+ban;
> bind dcc o|o +ban ban:+ban
>
> proc ban:+ban {handle idx arg} {
> if {$arg == ""} {
> *dcc:+ban $handle $idx $arg
> return 0
> }
> set date [strftime %d/%m/%y]
> *dcc:+ban $handle $idx "$arg ($handle@$date)"
> }
>
> but when i do +ban bla bla i get (banned : reason (Handle))
> and i want to change it to (banned : hanlde : reason)
> but when i am trying to change it my egg does down |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Dec 12, 2005 1:27 pm Post subject: |
|
|
Replace
| Code: | | *dcc:+ban $handle $idx "$arg ($handle@$date)" |
with
| Code: | | *dcc:+ban $handle $idx "$handle@$date : $arg" |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Ni0 Voice
Joined: 12 Dec 2005 Posts: 13
|
Posted: Mon Dec 12, 2005 2:54 pm Post subject: |
|
|
i can`t understant y but the code that u give me to replace it it`s not working. It`s banning my handle and it`s puts at reason the host that i want to ban...(i`ve try that one before i post here)
Let me explain u again what i want.
First i want that i said to the previous post. Then i want also at command .kickban nick to be public the oper who did it. And a last one i want the bots have a default reason if someone adds a ban without a reason.
let me give some examples
@ Bot (i`m User1)
.kickban Ni0 I hate u
@Channel
* Ni0 was kicked by Bot (Banned: User1: I hate u)
@ Bot
.+ban Ni0!*@* I Hate u also
@channel
* Ni0 was kicked by Bot (Banned: User1: I hate u also)
@ Bot
.+ban Ni0!*@*
@channel
* Ni0 was kicked by Bot (Banned: User1: Without Reason)
That`s all. Thx:) |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Dec 13, 2005 7:38 pm Post subject: |
|
|
| Code: | unbind dcc o|o +ban *dcc:+ban;
bind dcc o|o +ban ban:+ban
proc ban:+ban {handle idx arg} {
if {$arg == ""} {
*dcc:+ban $handle $idx $arg
return 0
}
set date [strftime %d/%m/%y]
set defr "Banned by $handle@$date"
set host [lindex [split $arg] 0]
if {[string first # [set c [lindex [split $arg] 1]]] == 0} {
if {[string first % [set t [lindex [split $arg] 2]]] == 0} {
if {[set r [join [lrange [split $arg] 3 end]]] == ""} {
set r $defr
}
*dcc:+ban $handle $idx "$host $c $t $handle@$date: $r"
}
} {
if {[string first % [set t [lindex [split $arg] 1]]] == 0} {
if {[set r [join [lrange [split $arg] 2 end]]] == ""} {
set r $defr
}
*dcc:+ban $handle $idx "$host $t $handle@$date: $r"
} {
if {[set r [join [lrange [split $arg] 1 end]]] == ""} {
set r $defr
}
*dcc:+ban $handle $idx "$host $handle@$date: $r"
}
}
} |
| Quote: | | set defr "Banned by $handle@$date" |
This is the default reason.
Edit:
- Changed $hand to $handle
- Changed the code. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts
Last edited by Sir_Fz on Tue Dec 13, 2005 8:49 pm; edited 1 time in total |
|
| Back to top |
|
 |
Ni0 Voice
Joined: 12 Dec 2005 Posts: 13
|
Posted: Tue Dec 13, 2005 8:08 pm Post subject: |
|
|
Sir_Fz also the first code that u wrote was working perfect.
Here is the 1st code that u give:)
| Code: | unbind dcc o|o +ban *dcc:+ban
bind dcc o|o +ban ban:+ban
proc ban:+ban {handle idx arg} {
if {$arg == ""} {
putlog "SYNTAX: .+ban <hostmask> [channel] [time] [comment]"
return 0
}
set host [lindex [set arg [split $arg]] 0]
if {[string first # [lindex $arg 1]] == 0} {
set chan [lindex $arg 1]
}
if {![info exists chan]} {
if {[string is integer [lindex $arg 1]]} {
set time [lindex $arg 1]
set comment "$handle: [join [lrange $arg 2 end]]"
} {
set time 0
set comment "$handle: [join [lrange $arg 1 end]]"
}
} {
if {[string is integer [lindex $arg 2]]} {
set time [lindex $arg 2]
set comment "$handle: [join [lrange $arg 3 end]]"
} {
set time 0
set comment "$handle: [join [lrange $arg 2 end]]"
}
}
if {![string match *!*@* $host]} {
putlog "Invalid hostmask, please enter one in format nick!ident@host."
return 0
}
if {$comment == ""} {
set comment "Banned by $handle"
}
if {[info exists chan]} {
newchanban $chan $host $handle $comment $time
putlog "Added $host on $chan."
} {
newban $host $handle $comment $time
putlog "Added $host on global banlist"
}
} |
|
|
| Back to top |
|
 |
|