MagicDuel

Storing temporary data in MD Script

Announcement 1496 · · Stage 10
a new set of functions was added to allow fast storage of temporary data for your quests and items. These are the properties of these functions:

- stored data can be at most 200 chars long
- it is valid only until the user logs out
- its much faster and less intenstive on the server because it is not using database
- can be read/set only be the same user that opens the item (it is not shared among users)
- it is shared across all items edited by the same editor

Syntax and sample code

@va = 'apple';
echo @va; //will print 'apple'
storetmp(@va);
@va = 'tree';
echo @va; //will print 'tree'
retrievetmp(@va);
echo @va; //will print 'apple'

retrievetmp(@va); placed on an other item by the same editor, will load 'apple' value into @va variable. storetmp(@va) placed on any item by the same editor will overwrite the temporary value with the value set in @va. You can push values directly to it without variables, like storetmp('test vale 123');. One single value can be stored at a time for one user by one editor. Multiple editors will store independent values for same user. Value gets reset/null when login session ends.