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.

Can anyone help

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
N
Ni0
Voice
Posts: 13
Joined: Mon Dec 12, 2005 11:17 am

Can anyone help

Post by Ni0 »

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

Post by Sir_Fz »

Replace

Code: Select all

*dcc:+ban $handle $idx "$arg ($handle@$date)"
with

Code: Select all

*dcc:+ban $handle $idx "$handle@$date : $arg"
N
Ni0
Voice
Posts: 13
Joined: Mon Dec 12, 2005 11:17 am

Post by Ni0 »

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

Post by Sir_Fz »

Code: Select all

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"
  }
 }
}
set defr "Banned by $handle@$date"
This is the default reason.

Edit:
- Changed $hand to $handle
- Changed the code.
Last edited by Sir_Fz on Tue Dec 13, 2005 8:49 pm, edited 1 time in total.
N
Ni0
Voice
Posts: 13
Joined: Mon Dec 12, 2005 11:17 am

Post by Ni0 »

Sir_Fz also the first code that u wrote was working perfect.
Here is the 1st code that u give:)

Code: Select all

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"
 }
}
Post Reply