Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="Coalcounter"></div>
- <div id="CoalRatecounter"></div>
- <button id="Coalbutton" onclick="addCoal()">Mine</button>
- <button id="CoalClicker" onclick="addCoalClicker()">Coal Clicker</button>
- <button id="CoalRate" onclick="addCoalRate()">Coal Rate</button>
- <div id="alerts">
- <div id="errors"></div>
- </div>
- var Coal=0;
- var CoalClicker=1;
- var CoalClickerPrice=50;
- var CoalRate=0;
- var CoalRatePrice=50;
- <script>
- function addCoal(){
- Coal+=CoalClicker;
- totalCoal+=CoalClicker;
- document.getElementById("Coalcounter").innerHTML="Coal : " + Math.round(Coal);
- document.getElementById("CoalClickercost").innerHTML="Upgrade Coal Clicker : " + Math.round(CoalClickerPrice);
- document.getElementById("CoalRatecost").innerHTML="Upgrade Coal Rate : " + Math.round(CoalRatePrice);
- }
- document.getElementById("Coalcounter").innerHTML="Coal : " + Math.round(Coal);
- document.getElementById("CoalClickercost").innerHTML="Upgrade Coal Clicker : " + Math.round(CoalClickerPrice);
- document.getElementById("CoalRatecost").innerHTML="Upgrade Coal Rate : " + Math.round(CoalRatePrice);
- </script>
- <script>
- var increment = setInterval(increment,1000); // gain 1 ever second // THIS IS WHAT I WANT TO CHANGE
- function increment(){
- Coal = Coal % 99999999999999999999 + CoalRate;
- totalCoal = totalCoal % 99999999999999999999 + CoalRate;
- document.getElementById("Coalcounter").innerHTML="Coal : " + Math.round(Coal);
- document.getElementById("CoalClickercost").innerHTML="Upgrade Coal Clicker : " + Math.round(CoalClickerPrice);
- document.getElementById("CoalRatecost").innerHTML="Upgrade Coal Rate : " + Math.round(CoalRatePrice);
- }
- </script>
- <script>
- var increment = setInterval(increment,5000);
- function increment(){
- document.getElementById("errors").innerHTML="";
- }
- </script>
- <Script>
- var CoalClicker=1;
- function addCoalClicker(){
- if(Coal>CoalClickerPrice-1){
- CoalClicker+=1;
- Coal-=CoalClickerPrice;
- CoalClickerPrice*=1.2;
- document.getElementById("Coalcounter").innerHTML="Coal : " + Math.round(Coal);
- document.getElementById("CoalClickercost").innerHTML="Upgrade Coal Clicker : " + Math.round(CoalClickerPrice);
- document.getElementById("CoalRatecost").innerHTML="Upgrade Coal Rate : " + Math.round(CoalRatePrice);
- }
- else
- {
- document.getElementById("errors").innerHTML="Not Enough Coal!"; // Note
- }
- }
- </script>
- <Script>
- var CoalRate=0;
- function addCoalRate(){
- if(Coal>CoalRatePrice-1){
- CoalRate+=1;
- Coal-=CoalRatePrice;
- CoalRatePrice*=1.2;
- document.getElementById("Coalcounter").innerHTML="Coal : " + Math.round(Coal);
- document.getElementById("CoalClickercost").innerHTML="Upgrade Coal Clicker : " + Math.round(CoalClickerPrice);
- document.getElementById("CoalRatecost").innerHTML="Upgrade Coal Rate : " + Math.round(CoalRatePrice);
- }
- else
- {
- document.getElementById("errors").innerHTML="Not Enough Coal!"; // Note
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement