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.

no services tcl help

Help for those learning Tcl or writing their own scripts.
Post Reply
M
MMDollar
Voice
Posts: 8
Joined: Sat Mar 04, 2006 8:37 pm
Location: Bulgaria/Bourgas
Contact:

no services tcl help

Post by MMDollar »

Code: Select all

set services "1"
unbind dcc o|o msg *dcc:msg
bind dcc o|o msg csdostup
bind dcc n putserv putsrv
bind msg - ident identche


proc csdostup {hand idx arg} {
global services
       set tonick [string tolower [lindex $arg 0]]
       set mschan [string tolower [lindex $arg 2]]
       set text [lrange $arg 1 end]
          if {[matchattr $hand n|n $mschan]} {
             putlog "PRIVMSG from $hand to $tonick :$text"
             putserv "PRIVMSG $tonick :$text "
             putdcc $idx "msg to $tonick: $text"
             return 0
        }
         if {[matchattr $hand m]} {
          if {($tonick == "cs") || ($tonick== "ns") } {
              putdcc $idx "$hand, trqbva da bydesh moj owner za da ima dostyp"
              chattr $hand -afop+dk
              setuser $hand comment "Opital se da prati syobshtenie na $tonick s text: $text"
              putlog "$hand se opita da prati syobshtenie kym $tonick s text: $text"
              boot $hand "Opitva se da prati syobshtenie na $tonick s text: $text"
              putlog "$hand e mahnat ot bota"
              newban $hand!*@* $::botnick "Opitva se da prati syobshtenie na $tonick s text: $text"
              putlog "Dobawen e ban na $hand poradi ne spazvane na pravilata"
              dcc_flagnote $botnick 666 "$idx +n pedal" 
              putlog "Izprashtat se notes do owners...."              
             
         } else {
              putlog "PRIVMSG from $hand to $tonick :$text"
              putserv "PRIVMSG $tonick :$text "
              putdcc $idx "msg to $tonick: $text"
         }
         return 0
         }
         putdcc $idx "$hand, trqbva da bydesh moj owner ili master za da imash dostyp"
         chattr $hand -afop+dk
         setuser $hand comment "Opital se da prati syobshtenie na $tonick s text: $text"
         putlog "$hand se opita da prati syobshtenie kym $tonick s text: $text"
         boot $hand "Opitva se da prati syobshtenie na $tonick s text: $text"
         putlog "$hand e mahnat ot bota"
         newban $hand!*@* $::botnick "Opitva se da prati syobshtenie na $tonick s text: $text"
         putlog "Dobawen e ban na $hand poradi ne spazvane na pravilata"
         dcc_flagnote $::botnick 666 "$idx +n pedal"
         putlog "Izprashtat se notes do owners...."              
         
 }
Ok now this tcl has to do this things:
Only master and owners can use .msg cs/ns <text>
If someone else do this they will be: there flags will be changed to +dk
they will be booted from the partyline and they will be banned and the bot have to send a note to all the owners
the only thing that don't works is the sendnote
here is the error that appears:

Code: Select all

Tcl error [csdostup]: invalid idx
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

From tcl-commands.doc:
sendnote <from> <to[@bot]> <message>
Description: simulates what happens when one user sends a note to another
Returns:
0 - the send failed
1 - the note was delivered locally or sent to another bot
2 - the note was stored locally
3 - the user's notebox is too full to store a note
4 - a Tcl binding caught the note
5 - the note was stored because the user is away
Module: core
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

That error has nothing to do with the [sendnote] command; You're probably using the idx after booting the user which makes the idx not valid anymore.

Show us complete errorInfo.
Post Reply