Skip to content

Instantly share code, notes, and snippets.

@csf30816
Last active July 17, 2016 00:07
Show Gist options
  • Save csf30816/85fde17f09fa0c755dbd110d0e94357d to your computer and use it in GitHub Desktop.
Save csf30816/85fde17f09fa0c755dbd110d0e94357d to your computer and use it in GitHub Desktop.
(function(ext) {
ext._shutdown = function() {};
ext._getStatus = function() {
return {
status: 2,
msg: 'Ready to use :)'
}
};
var vars = {
};
var descriptor = {
blocks: [
[' ', 'Create var %s', 'create', 'var'],
[' ', 'Set Var %s to %s', 'set', 'var', '0'],
[' ', 'Change %s by %n', 'change', '', 1],
['r', 'Read Var %s', 'read', ''],
['r', 'Who made this?', 'author']
],
menus: {
}
};
ext.set = function(v, value) {
vars[v] = value;
};
ext.create = function(v)
{ varHold[v] = "0"
};
ext.change = function(v, value) {
vars[v] += value;
};
ext.read = function(v) {
return vars[v];
};
ext.author = function(a) {
return '@Csf30816 made this project :)';
};
ScratchExtensions.register('Variable Scripts', descriptor, ext);
})({});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment