| View previous topic :: View next topic |
| Author |
Message |
MMDollar Voice
Joined: 04 Mar 2006 Posts: 8 Location: Bulgaria/Bourgas
|
Posted: Wed Dec 27, 2006 1:37 am Post subject: no services tcl help |
|
|
| Code: |
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: | | Tcl error [csdostup]: invalid idx |
|
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Wed Dec 27, 2006 6:01 am Post subject: |
|
|
From tcl-commands.doc:
| Quote: | 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 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Dec 27, 2006 10:50 am Post subject: |
|
|
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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|