Skip to content

Commit

Permalink
Add cars stolen by Noodles to total value
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivdbroek85 committed Sep 18, 2014
1 parent abe55ea commit e21a2fe
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ob.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2738,7 +2738,10 @@ if (document.getElementById('game_container') !== null) {
var money = $('td[data-info="money"]').text().replace(/,/g, '');
// Noodles
if (on_page('type=2') && nn == 'div') {
// Loop cars
var carSuccess = parseInt(getV('carSuccess', 0));
var carMoney = parseInt(getV('carMoney', 0));

// Loop cars to grab values
var x = 0;
var totalCarval = 0;
$(itemspath).each(function () {
Expand All @@ -2747,9 +2750,17 @@ if (document.getElementById('game_container') !== null) {
totalCarval += carVal;
++x;
});

// Show total value of nicked cars
$('div.oheader:eq(2)').text($(itemspath).length + $('div.oheader:eq(2)').text()).append(
$('<span>').text('total value: $' + commafy(totalCarval))
);

// Save cars and value
$('table[data-info="items"] > tbody > tr > td > input[type="submit"]').click(function() {
setV('carSuccess', (x + carSuccess));
setV('carMoney', (totalCarval + carMoney));
});
}
// Sluggs
if (on_page('type=6') && nn == 'div') {
Expand Down

0 comments on commit e21a2fe

Please sign in to comment.