Hi guys,
Well I was having a problem with the setuserstoredvalue and getuserstoredvalue functions in that the code in parseevent would only handle ints, and you were limited to storing data for the current user only.
The supplied patch will add the code to allow a lapper sub to set or retrieve a var for any user. All vars are stored as string, but can be retirevd as nums or vars using the appropriate calls. It will store these in a new DB called LapperDB.dbs. The updated functions have the syntax:
GetStoredUserNum( userName, varKey);
GetStoredUserStr( userName, varKey);
SetStoredUserVar( userName, varKey, value);
* NOTE: The userName is OPTIONAL in all of these commands and will apply to the current user if omitted. This allows setting a var for ANY user.
The other advantage of this system is that in a command that needs to track button values (like !ctrack, or the attached replacement for !who), you can use this new DB as storage space rather than setting a global var which may get overwritten by another instance of the command while you're using it. Have a look at the code in the !who command to send a PM to see how to use it. The Pitboard code could also be modified to use this.
I have also attached a copy of my base Lapper.lpr file because there is a lot of stuff in the OnConnect and OnLapperStart that the !who command relies on.
Any suggestions or questions, please post here.
NB: This patch is for version 5.8.4.6
PS: See post #7 for an update too (http://www.lfsforum.net/showthread.php?p=1277027#post1277027)
Well I was having a problem with the setuserstoredvalue and getuserstoredvalue functions in that the code in parseevent would only handle ints, and you were limited to storing data for the current user only.
The supplied patch will add the code to allow a lapper sub to set or retrieve a var for any user. All vars are stored as string, but can be retirevd as nums or vars using the appropriate calls. It will store these in a new DB called LapperDB.dbs. The updated functions have the syntax:
GetStoredUserNum( userName, varKey);
GetStoredUserStr( userName, varKey);
SetStoredUserVar( userName, varKey, value);
* NOTE: The userName is OPTIONAL in all of these commands and will apply to the current user if omitted. This allows setting a var for ANY user.
The other advantage of this system is that in a command that needs to track button values (like !ctrack, or the attached replacement for !who), you can use this new DB as storage space rather than setting a global var which may get overwritten by another instance of the command while you're using it. Have a look at the code in the !who command to send a PM to see how to use it. The Pitboard code could also be modified to use this.
I have also attached a copy of my base Lapper.lpr file because there is a lot of stuff in the OnConnect and OnLapperStart that the !who command relies on.
Any suggestions or questions, please post here.
NB: This patch is for version 5.8.4.6
PS: See post #7 for an update too (http://www.lfsforum.net/showthread.php?p=1277027#post1277027)