Post
Topic
Board Reputation
Re: Can you still believe aTriz words? Reopened, too many open questions
by
nullius
on 09/03/2018, 02:06:36 UTC
Script
Code:
var config = {
  baseBet: { value: 100, type: 'balance', label: 'base bet' },
  payout: { value: 1.08, type: 'multiplier' },
  stop: { value: 1e2, type: 'balance', label: 'stop if bet >' },
  loss: {
    value: 'increase', type: 'radio', label: 'On Loss',
    options: {
      base: { type: 'noop', label: 'Back to base bet, noob' },
      increase: { value: 2, type: 'multiplier', label: 'Increase bet by' },
    }
  },
  win: {
    value: 'base', type: 'radio', label: 'On Win',
    options: {
      base: { type: 'noop', label: 'Return to base bet' },
      increase: { value: 1.02, type: 'multiplier', label: 'Increase bet by' },
    }
  }
};


log('Script is running..');

var currentBet = config.baseBet.value;

// Always try to bet when script is started
engine.bet(currentBet, config.payout.value);

engine.on('GAME_STARTING', onGameStarted);
engine.on('GAME_ENDED', onGameEnded);

function onGameStarted() {
  engine.bet(currentBet, config.payout.value);
}

function onGameEnded() {
  var lastGame = engine.history.first()

  // If we wagered, it means we played
  if (!lastGame.wager) {
    return;
  }

  // we won..
  if (lastGame.cashedAt) {
    if (config.win.value === 'base') {
      currentBet = config.baseBet.value;
    } else {
      console.assert(config.win.value === 'increase');
      currentBet *= config.win.options.increase.value;
    }
    log('We won, so next bet will be', currentBet/100, 'bits')
  } else {
    // damn, looks like we lost :(

    if (config.loss.value === 'base') {
      currentBet = config.baseBet.value;
    } else {
      console.assert(config.loss.value === 'increase');
      currentBet *= config.loss.options.increase.value;
    }
    log('We lost, so next bet will be', currentBet/100, 'bits')
  }

  if (currentBet > config.stop.value) {
    log('Was about to bet', currentBet, 'which triggers the stop');
    engine.removeListener('GAME_STARTING', onGameStarted);
    engine.removeListener('GAME_ENDED', onGameEnded);
  }
}

hash stuff
Code:
hex: e9474064aaeb4d07689d80952adb4d785d318fcd43947b90ec25c12450876f50
HEX: E9474064AAEB4D07689D80952ADB4D785D318FCD43947B90EC25C12450876F50
h:e:x: e9:47:40:64:aa:eb:4d:07:68:9d:80:95:2a:db:4d:78:5d:31:8f:cd:43:94:7b:90:ec:25:c1:24:50:87:6f:50
base64: 6UdAZKrrTQdonYCVKttNeF0xj81DlHuQ7CXBJFCHb1A=

Do your worst.

I gave +10 for dropping a script, but I don’t get a matching hash.  Now trying different variations with final newline, etc...

(Wait—that is the script?  LOL)



With a single '\n' on the last line, and '\n' as newline, I get sha256sum:

Code:
5d26e16eda33e8e0637bc86d0a408b7ae42f52259b346b8c142f1bee271b0fa9

(I doubt it’s significant as to evidence, since aTriz posted the script right on the heels of the hash; but I seek to be correct, and figure out what happened here.)