-
Notifications
You must be signed in to change notification settings - Fork 5
/
auto.js
25 lines (22 loc) · 965 Bytes
/
auto.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function BuyAutoPrinter() {
if (money >= AutoPrinterCost) {
money = money - AutoPrinterCost;
AutoPrinters++;
AutoPrinterCost = Math.round(AutoPrinterCost * 1.2);
document.getElementById('TotalMoney').innerHTML = money;
document.getElementById('TotalAutoPrinters').innerHTML = AutoPrinters;
document.getElementById('AutoPrinterCost').innerHTML = AutoPrinterCost;
}
}
//making the auto printers automatically print money.
var autoPrinting = setInterval(function() {money = money + AutoPrinters, document.getElementById('TotalMoney').innerHTML = money} , 1000)
//1000ms = 1 second
//finding offline progress
var playerData = {
money: money,
AutoPrinters: AutoPrinters,
AutoPrinterCost: AutoPrinterCost,
}
document.getElementById('TotalMoney').innerHTML = money;
document.getElementById('AutoPrinterCost').innerHTML = AutoPrinterCost;
document.getElementById('TotalAutoPrinters').innerHTML = AutoPrinters;