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.

delete raison

Help for those learning Tcl or writing their own scripts.
Post Reply
p
pilouuu
Halfop
Posts: 82
Joined: Mon Dec 26, 2005 8:03 pm

delete raison

Post by pilouuu »

Code: Select all

### Public command channel join/part script ### 

bind pub n !part pub:-chan 
bind pub n .-chan pub:-chan 

proc pub:-chan {nick uhost hand chan text} { 
        set args [split [cleanarg $text]] 
        if {[llength $text]<1} { 
                putserv "NOTICE $nick :Usage: .-chan <#channel>" 
                return 0 
        } 
        channel remove $text 
        save 
   putserv "NOTICE $nick :I have removed $text from my channel list." 
  return 0 
} 


proc cleanarg {arg} { 
  set response "" 
  for {set i 0} {$i < [string length $arg]} {incr i} { 
    set char [string index $arg $i] 
    if {($char != "\12") && ($char != "\15")} { 
      append response $char 
    } 
  } 
  return $response 
}

hi
Possible add arg for raison?

Expl: !part #chan Bla Bla Bla

<bot> Chan has been deleted by $nickname for raison: Bla Bla Bla
<bot> leave chan.

Thx for all help.

Code: Select all

### Public command channel join/part script ### 

bind pub n !part pub:-chan 
bind pub n .-chan pub:-chan 

proc pub:-chan {nick uhost hand chan text} { 
        set args [split [cleanarg $text]] 
        if {[llength $text]<1} { 
                putserv "NOTICE $nick :Usage: .-chan <#channel> <raison>" 
                return 0 
        }
   putserv "PRIVMSG $test :Chan has been deleted By $nick .Raison: [u]???$arg???[/u]
        channel remove $text 
        save 
   putserv "NOTICE $nick :I have removed $text from my channel list." 
  return 0 
} 


proc cleanarg {arg} { 
  set response "" 
  for {set i 0} {$i < [string length $arg]} {incr i} { 
    set char [string index $arg $i] 
    if {($char != "\12") && ($char != "\15")} { 
      append response $char 
    } 
  } 
  return $response 
}
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

bind pub n !part part:chan

proc part:chan {nick uhost hand chan arg} {
 set c [lindex [split $arg] 0]
 set reason [join [lrange [split $arg] 1 end]]
 if {![validchan $c]} {
  puthelp "privmsg $chan :$c is an invalid channel."
 } {
  putserv "privmsg $chan :$c has been deleted by $nick for reason: $reason"
  channel remove $c
 }
}
PS: It's reason, not raison.
Last edited by Sir_Fz on Sun Feb 12, 2006 10:27 pm, edited 1 time in total.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Sir_Fz wrote:PS: It's reason, not raison.
LOL He's French Sir_Fz and "reason" IS "raison" in French. :D
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
p
pilouuu
Halfop
Posts: 82
Joined: Mon Dec 26, 2005 8:03 pm

Post by pilouuu »

lol thx for help :)

Tcl error [part:chan]: can't read "#chantest": no such variable
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Oups, I forgot the 'c'. Fixed now, I edited my post.
Post Reply