Untitled
unknown
plain_text
3 months ago
8.0 kB
6
Indexable
<!DOCTYPE html>
<html lang="hi">
<head>
<meta charset="UTF-8">
<title>Sim Companies Helper - Mahfooz Edition 🚀</title>
<style>
body {font-family: Arial; background: #0f172a; color: #e2e8f0; margin:0; padding:10px;}
h1 {text-align:center; color:#60a5fa;}
tab {display:none;}
.tabactive {display:block;}
button {background:#3b82f6; color:white; border:none; padding:10px; margin:5px; border-radius:8px;}
input, select {padding:8px; width:90%; margin:5px; border-radius:6px;}
table {width:100%; border-collapse:collapse; margin:10px 0;}
th, td {padding:8px; border:1px solid #334155; text-align:left;}
.green {color:#34d399;}
</style>
</head>
<body>
<h1>Sim Companies Helper - Mahfooz Edition</h1>
<!-- Tabs -->
<button onclick="showTab(1)">Dashboard</button>
<button onclick="showTab(2)">Warehouse</button>
<button onclick="showTab(3)">Buildings</button>
<button onclick="showTab(4)">Calculators</button>
<button onclick="showTab(5)">Log</button>
<!-- Dashboard -->
<div id="tab1" class="tab tabactive">
<h2>Dashboard</h2>
<p>Cash: <input id="cash" type="number" value="29186538" onchange="saveAll()"> $</p>
<p>Company Value: <span id="cv">201577384</span> $</p>
<p>Inventory Value: <span id="invValue">0</span> $</p>
<p>Daily Profit Estimate: <span id="dailyProfit">0</span> $</p>
</div>
<!-- Warehouse -->
<div id="tab2" class="tab">
<h2>Warehouse</h2>
<select id="item">
<option>BFR Q5</option><option>Sub-orbital Rocket Q6</option><option>Luxury Jet Q4</option>
<option>Hamburger Q10</option><option>Bricks Q3</option><option>Rocket Engine Q4</option>
</select>
<input id="qty" type="number" placeholder="Quantity">
<input id="unitPrice" type="number" placeholder="Unit Price $">
<button onclick="addItem()">Add Item</button>
<table id="warehouseTable"><tr><th>Item</th><th>Qty</th><th>Value</th><th>Action</th></tr></table>
</div>
<!-- Buildings -->
<div id="tab3" class="tab">
<h2>Buildings (BFR Setup)</h2>
<input id="bname" placeholder="Building Name (e.g. VIF LVL 12)">
<input id="blevel" type="number" placeholder="Level">
<button onclick="addBuilding()">Add Building</button>
<table id="buildingTable"><tr><th>Building</th><th>Level</th><th>Action</th></tr></table>
</div>
<!-- Calculators -->
<div id="tab4" class="tab">
<h2>BFR Profit Calculator</h2>
<input id="bfrCost" type="number" placeholder="Total Input Cost per BFR">
<input id="bfrSell" type="number" placeholder="Sell Price per BFR">
<input id="bfrQty" type="number" value="10" placeholder="Daily Production">
<button onclick="calcBFR()">Calculate Profit</button>
<p id="bfrResult" style="color:#34d399; font-weight:bold;"></p>
<h2>Research Calculator</h2>
<input id="units" type="number" placeholder="Research Units">
<button onclick="calcResearch()">Calculate Patents & CV</button>
<p id="researchResult"></p>
</div>
<!-- Log -->
<div id="tab5" class="tab">
<h2>Daily Profit Log</h2>
<input id="logDate" type="date">
<input id="logProfit" type="number" placeholder="Today's Profit $">
<button onclick="addLog()">Add Entry</button>
<table id="logTable"><tr><th>Date</th><th>Profit</th></tr></table>
</div>
<script>
// Data storage
let warehouse = [];
let buildings = [];
let logs = [];
function saveAll() {
localStorage.setItem('simCash', document.getElementById('cash').value);
localStorage.setItem('warehouse', JSON.stringify(warehouse));
localStorage.setItem('buildings', JSON.stringify(buildings));
localStorage.setItem('logs', JSON.stringify(logs));
updateDashboard();
}
function loadAll() {
document.getElementById('cash').value = localStorage.getItem('simCash') || 29186538;
warehouse = JSON.parse(localStorage.getItem('warehouse') || '[]');
buildings = JSON.parse(localStorage.getItem('buildings') || '[]');
logs = JSON.parse(localStorage.getItem('logs') || '[]');
renderWarehouse();
renderBuildings();
renderLogs();
updateDashboard();
}
// Add item
function addItem() {
const item = document.getElementById('item').value;
const qty = parseFloat(document.getElementById('qty').value);
const price = parseFloat(document.getElementById('unitPrice').value);
warehouse.push({item, qty, price});
renderWarehouse();
saveAll();
}
// Render warehouse
function renderWarehouse() {
let html = '<tr><th>Item</th><th>Qty</th><th>Value</th><th>Action</th></tr>';
let total = 0;
warehouse.forEach((w,i) => {
const val = w.qty * w.price;
total += val;
html += `<tr><td>\( {w.item}</td><td> \){w.qty}</td><td>\[ {val.toLocaleString()}</td><td><button onclick="removeItem(${i})">Delete</button></td></tr>`;
});
document.getElementById('warehouseTable').innerHTML = html;
document.getElementById('invValue').textContent = total.toLocaleString();
}
// Remove item
function removeItem(i) { warehouse.splice(i,1); renderWarehouse(); saveAll(); }
// Buildings
function addBuilding() {
const name = document.getElementById('bname').value;
const level = document.getElementById('blevel').value;
buildings.push({name, level});
renderBuildings();
saveAll();
}
function renderBuildings() {
let html = '<tr><th>Building</th><th>Level</th><th>Action</th></tr>';
buildings.forEach((b,i) => {
html += `<tr><td>\( {b.name}</td><td> \){b.level}</td><td><button onclick="removeBuilding(${i})">Delete</button></td></tr>`;
});
document.getElementById('buildingTable').innerHTML = html;
}
function removeBuilding(i) { buildings.splice(i,1); renderBuildings(); saveAll(); }
// BFR Calculator
function calcBFR() {
const cost = parseFloat(document.getElementById('bfrCost').value);
const sell = parseFloat(document.getElementById('bfrSell').value);
const qty = parseFloat(document.getElementById('bfrQty').value);
const profit = (sell - cost) * qty;
const margin = cost ? ((sell-cost)/cost*100).toFixed(1) : 0;
document.getElementById('bfrResult').innerHTML =
`Daily Profit: <span class="green"> \]{profit.toLocaleString()}</span><br>Margin: ${margin}%`;
saveAll();
}
// Research Calculator (exact game value)
function calcResearch() {
const units = parseFloat(document.getElementById('units').value);
const patents = (units * 0.0625).toFixed(0);
const cvGain = (patents * 2440.80).toFixed(0);
document.getElementById('researchResult').innerHTML =
`Expected Patents: <b>${patents}</b><br>CV Increase: <span class="green">\[ {parseFloat(cvGain).toLocaleString()}</span>`;
}
// Log
function addLog() {
const date = document.getElementById('logDate').value;
const profit = document.getElementById('logProfit').value;
logs.push({date, profit});
renderLogs();
saveAll();
}
function renderLogs() {
let html = '<tr><th>Date</th><th>Profit</th></tr>';
logs.forEach(l => html += `<tr><td>${l.date}</td><td> \]{parseFloat(l.profit).toLocaleString()}</td></tr>`);
document.getElementById('logTable').innerHTML = html;
}
function updateDashboard() {
const cash = parseFloat(document.getElementById('cash').value) || 0;
const inv = parseFloat(document.getElementById('invValue').textContent.replace(/,/g,'')) || 0;
document.getElementById('cv').textContent = (cash + inv + 201577384).toLocaleString(); // rough estimate
}
// Tab switch
function showTab(n) {
document.querySelectorAll('.tab').forEach(t => t.classList.remove('tabactive'));
document.getElementById('tab'+n).classList.add('tabactive');
}
// Load on start
window.onload = loadAll;
</script>
</body>
</html>
}
}
}
}]
}
}
})
}
}]
})
}
}
}
}Editor is loading...
Leave a Comment