nostalgia
nostalgia copied to clipboard
Refactor "Spam"-Method and GUI-Text to execute it
Currently the api command "postattachToTangle" is mapped to a button which says "Start Spam". This could be greatly improved by
- using a useful text so people actually know what happens if they click the button
- add a timer users can configure, instead of just looping like this
shouldSpam = true;
var spamCount = 0;
console.log("STARTED SPAMMING");
var transfers = [{
'address': '999999999999999999999999999999999999999999999999999999999999999999999999999999999',
'value': 0,
'message': 'DOMISWAYTOOFUCKINGCOOL',
'tag': 'TOTALLY'
}]
async.doWhilst(function(callback) {
iotajs.api.sendTransfer('999999999999999999999999999999999999999999999999999999999999999999999999999999999', 9, 18, transfers, function(e,s) {
console.log(s);
console.log("Spam Count: ", spamCount);
spamCount += 1;
callback(null);
})
}, function() {
return shouldSpam === true;
}, function() {
console.log("STOPPED SPAMMING")
})
}```
Looks pretty nasty to me ;)