egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can anyone help

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Ni0
Voice


Joined: 12 Dec 2005
Posts: 13

PostPosted: Mon Dec 12, 2005 11:20 am    Post subject: Can anyone help Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Dec 12, 2005 1:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Ni0
Voice


Joined: 12 Dec 2005
Posts: 13

PostPosted: Mon Dec 12, 2005 2:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Dec 13, 2005 7:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Ni0
Voice


Joined: 12 Dec 2005
Posts: 13

PostPosted: Tue Dec 13, 2005 8:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber