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.

Store selected information.

Old posts that have not been replied to for several years.
Locked
L
Liteqh
Voice
Posts: 1
Joined: Mon Oct 17, 2005 8:26 am

Store selected information.

Post by Liteqh »

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.

Thankyou in advance.
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

yea this is sooooo related to eggdrop
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try

Code: Select all

# 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."
 }
}
SYNTAX:
bncadd <name> <email> <password> (depends on "set bncinfo")
bncget <name>
Locked