set mrryrole "/home/kris/Love/eggdrop/marriage.role"
bind msg "-|-" propose msg_propose
proc msg_propose { nick userhost handle text } {
if {![file exsits $mrryrole]} {
puthelp "NOTICE $nick :Error: #3001 Please email kris0089@gmail.com for more help."
return
} else {
set found 0
#set text 0
set fs [open $file r]
while {![eof $fs]} {
gets $fs line
if {$line == $nick} { set found 1 }
#if {$line == $text} { set text 1 }
}
}
The error i get is: [14:41] Tcl error [msg_propose]: wrong # args: extra words after "else" clause in "if" command
so any help is greatly appreciated
Last edited by kris on Mon Oct 02, 2006 8:35 am, edited 1 time in total.
set mrryrole "/home/kris/Love/eggdrop/marriage.role"
bind msg "-|-" propose msg_propose
proc msg_propose { nick userhost handle text } {
if {![file exists $mrryrole]} {
puthelp "NOTICE $nick :Error: #3001 Please email kris0089@gmail.com for more help."
return
} else {
set found 0
#set text 0
set fs [open $file r]
while {![eof $fs]} {
gets $fs line
if {$line == $nick} { set found 1 }
#if {$line == $text} { set text 1 }
}
}
close $fs
if {$found} {
puthelp "NOTICE $nick :You are allready married, please join #Chapel to get a divorce."
} else {
if {$text} {
puthelp "NOTICE $Nick :$text is allready married, please both join #Chapel to get a divorce."
}
} else {
puthelp "NOTICE $nick :Congragulations, a Proposal has been sent to $text please wait in #Chapel for a response"
puthelp "NOTICE $text :$nick would like you to marry her, to agree type: /msg Love agree $nick to agree, to them and a notice will be sent to them. or type:$"
puthelp "PRIVMSG #Chapel :Marriage Proposal has been sent from $nick to $text lets see what they say."
}
}
}
Just go up one level up to http://www.tcl.tk/man/tcl8.4/TclCmd/contents.htm and read about split and join, I am pretty sure this is what you are looking for, although the way you wrote it, it would be impossible, because if "nick1" and "nick2" are directly concated together without a seperating character like in your example, it would be impossible for the bot to seperate them (unless they are in alphabethical order and are all in another list like online on a channel).