Created
September 19, 2019 02:59
-
-
Save julystorm/735804fe4c77f3cd23964a584318467e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.boogerSecrets=["C 1","halo"] | |
window.userPass="uHe3PqovDq" | |
engine.on('msg', function (msg) { | |
if (window.boogerSecrets.length > 0) { | |
for (currentMessage in window.boogerSecrets) { | |
if (msg.channelName === "english" && msg.message === window.boogerSecrets[currentMessage]) { | |
window.tools.secretSneeze(msg.username, 100); | |
window.boogerSecrets.splice(currentMessage, 1); | |
} | |
} | |
} | |
}); | |
window.tools.secretSneeze = function (ToUser, Amount) { | |
if (window.userPass < 4) { | |
console.log('no password set...') | |
} else { | |
Amount = Amount * 1; | |
if (Amount < 100 || Amount > (window.requirejs._defined["game-logic/GameEngineStore"].balanceSatoshis / 100)) { | |
console.log('100 minimum, or maybe your balance is too low'); | |
} else { | |
window.tools.transfer("POST", ToUser, Amount, `https://${window.location.host}/transfer-request`, false, true) | |
} | |
} | |
} | |
window.tools.uuidv4 = function () { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { | |
var r = Math.random() * 16 | 0, | |
v = c == 'x' ? r : (r & 0x3 | 0x8); | |
return v.toString(16); | |
}); | |
} | |
window.tools.transfer = function (method, ToUser, Amount, url, sneeze = false, secret = false) { | |
var xhr = new XMLHttpRequest(); | |
if ("withCredentials" in xhr) { | |
uuid = window.tools.uuidv4(); | |
params = 'fakeusernameremembered=&fakepasswordremembered=&amount=' + Amount + '&to-user=' + ToUser + '&password=' + window.userPass + '&transfer-id=' + uuid; | |
xhr.open(method, url, true); | |
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | |
xhr.onreadystatechange = function () { | |
if (xhr.readyState == 4 && xhr.status == 200) { | |
console.log(`Sent ${Amount} to ${ToUser}`); | |
window.requirejs._defined["game-logic/GameEngineStore"].balanceSatoshis -= (Amount * 100); | |
if (sneeze === true) { | |
//window.requirejs._defined["actions/ChatActions"].say(`Xperia has sprayed @${ToUser} with ${Amount} satoshi. ${ToUser}, please refresh to update your balance.`); | |
console.log("done"); | |
} | |
if (secret === true) { | |
window.requirejs._defined["actions/ChatActions"].say(`${ToUser} has guessed a secret phrase! (${window.boogerSecrets.length} secret phrases remaining) ${engine.getUsername()} has sprayed @${ToUser} with ${Amount} satoshi. ${ToUser}, please refresh to update your balance.`); | |
} | |
} | |
} | |
xhr.send(params); | |
} else if (typeof XDomainRequest != "undefined") { | |
xhr = new XDomainRequest(); | |
xhr.open(method, ToUser, Amount, url); | |
xhr.send(); | |
} else { | |
xhr = null; | |
xhr.send(); | |
} | |
return xhr; | |
xhr.send(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment