what your script is meant to do and what it WOULD do are 2 very different things:
Code: Select all
set mrryrole "/home/kris/Love/eggdrop/marriage.role"
bind msg "-|-" divorce msg_divorce
proc msg_divorce { nick userhost handle text } {
set file "/home/kris/Love/eggdrop/marriage.role"
set delete 0
set lines 0
set lines [lreplace $nick end end]
set fp [open $file "w"]
puts $fp [join $lines "\n"]
close $fp
set del [lreplace $text end end]
set combine [open $file "w"]
puts combine [join $del "\n"]
close $file
putquick "NOTICE $nick :You and $text have been divorced"
putquick "PRIVMSG #PIRCS :$nick and $text have gotten a divorce"
}
Let's start with telling you the very wrong parts.
1: You define your file twice, you seem to have just pasted it outside the proc but you don't actually use it.
2: You make useless variables that you don't even use in the end.
3:
Code: Select all
set lines [lreplace $nick end end]
What is this supposed to do?
Trust me when i say, it does not.
You use lreplace on a STRING, furthermore, what is there to replace in a 1 "word" variable, it will only contain your nick, no other words.
You open your file, and you put "$lines" in it, which probably has nothing in it. Then you make a variable called del, and you again use lreplace on a STRING, so like before, nothing exciting will happen except for the problem with special characters, then you open your file again and you again put something in it.
So like i said before, your piece of text encased in code tags makes no sense. It wouldn't do much of anything.