Can anyone tell me if there is a script that will give the eggdrops users credit for doing certain things... winning games, chan-idling, most words spoken.. etc.... I am really looking for something to protect certain public triggers from being used unless the user is willing to spend the required amount of credit to use the trigger. I imagine some of these attributes are probably used in rpg bots, but I am personally unfamiliar with them, so any help would be greatly appreciated!
you're right when you break it down like that it does seem easier. I guess the only real questions i have left is where would be the ideal place to store the credit that the users accrue, and how would i access that data from all of the scripts?
i.e: if i create a function to control the running of a script via public trigger (how would i access the users credit)? and if i were to create a function to reward users for winning games, chan-idel... etc... (where would be the best place to store the credit? userfile perhaps???)
userfile is the obvious and convenient choice (if you don't expect to have too many users to maintain credit of; otherwise, you may need to resort to external files or database)
thanks for all your help thus far is there a way to add a new entry-type to a user record in the userfile? I have looked a reference on how to manipulate user records, but have been only able to find a short list of commands, are there any better (more in depth) resources on this?
exactly what i was looking for... i have been looking at that document for the last 3 hours and somehow missed it. if it was a snake it would have bit me.
okay, i have most of my script done .. i just have one more question. i would like to initialize the credit variable in the userfile when a new user signs up... just to give them a base amount of credit to start out with.. what would be the best way to go about this?
i see what your saying... however my eggy is currently set up to learn users only when they register with it via the hello command. I can check if they are a valid user on join, but would not be able to change a variable in the user record until they actually went thru the process. Is there a way i can call a procedure upon creation of the user record?
bind msg - hello msg:hello
proc msg:hello {n u h a} {
*msg:hello $n $u $h $a
if {![validuser $h]&&[validuser [finduser $n!$u]]} {
# created...do what ever you need to do
}
}