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 

delete raison

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
pilouuu
Halfop


Joined: 26 Dec 2005
Posts: 82

PostPosted: Sun Feb 12, 2006 2:49 am    Post subject: delete raison Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Feb 12, 2006 10:51 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sun Feb 12, 2006 7:56 pm    Post subject: Reply with quote

Sir_Fz wrote:
PS: It's reason, not raison.

LOL He's French Sir_Fz and "reason" IS "raison" in French. Very Happy
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
pilouuu
Halfop


Joined: 26 Dec 2005
Posts: 82

PostPosted: Sun Feb 12, 2006 10:14 pm    Post subject: Reply with quote

lol thx for help Smile

Tcl error [part:chan]: can't read "#chantest": no such variable
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Feb 12, 2006 10:28 pm    Post subject: Reply with quote

Oups, I forgot the 'c'. Fixed now, I edited my post.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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