Hi, im running a bnc company and im getting tired of users asking to change their passwords as they forget them. Is there a possibility that i can get a script that would store the information i tell it to, like i start a task with the bot lik $startstore and then type $email blah@blah.com and so on untill i have added the the information i need then close it with $endstore. I have also toy'd with the idea of having it in one big file rather than a file per client, just add perhaps a $search feature that would go through the file and show me the results of the matching details.
# File
set bncinfofile "scripts/bncinfo.txt"
# Information
set bncinfo {name email password}
bind msg n bncadd bnc:info:add
bind msg n bncget bnc:info:get
proc bnc:info:add {nick uhost hand arg} {
global bncinfofile bncinfo
set c 0
foreach i $bncinfo {
append info "$i: [lindex [split $arg] $c] "
incr c
}
puts [set f [open $bncinfofile a]] $info
close $f
}
proc bnc:info:get {nick uhost hand arg} {
global bncinfofile
foreach i [split [read [set f [open $bncinfofile]]] \n][close $f] {
if {[string equal -nocase [lindex $i 1] [lindex [split $arg] 0]]} {
puthelp "notice $nick :$i" ; set found 1
break
}
}
if {![info exists found]} {
puthelp "notice $nick :[lindex [split $arg] 0] was not found in the DB."
}
}