Skip to content

Instantly share code, notes, and snippets.

@cacciatc
Last active December 11, 2015 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cacciatc/4639031 to your computer and use it in GitHub Desktop.
Save cacciatc/4639031 to your computer and use it in GitHub Desktop.
Simple ScriptCraft plugin.
load(__folder + "../core/scriptcraft.js");
/*
definition
*/
var simple = simple || plugin("simple",{
setString: function(str){
this.store.str = str;
},
getString: function(){
return this.store.str;
}
},true);
/*
storage
*/
simple.store.str = simple.store.str || "";
/*
initialization
*/
ready(function(){
command("set",function(params) { simple.setString(params[0]); });
command("get",function() { return simple.getString(); });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment