| View previous topic :: View next topic |
| Author |
Message |
pilouuu Halfop
Joined: 26 Dec 2005 Posts: 82
|
Posted: Sun Feb 12, 2006 2:49 am Post subject: delete raison |
|
|
| Code: | ### 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: | ### 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
} |
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Feb 12, 2006 10:51 am Post subject: |
|
|
| Code: | 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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts
Last edited by Sir_Fz on Sun Feb 12, 2006 10:27 pm; edited 1 time in total |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sun Feb 12, 2006 7:56 pm Post subject: |
|
|
| Sir_Fz wrote: | | PS: It's reason, not raison. |
LOL He's French Sir_Fz and "reason" IS "raison" in French.  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
pilouuu Halfop
Joined: 26 Dec 2005 Posts: 82
|
Posted: Sun Feb 12, 2006 10:14 pm Post subject: |
|
|
lol thx for help
Tcl error [part:chan]: can't read "#chantest": no such variable |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Feb 12, 2006 10:28 pm Post subject: |
|
|
Oups, I forgot the 'c'. Fixed now, I edited my post. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|