Advertisement
Guest User

Untitled

a guest
Feb 7th, 2014
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div id="Coalcounter"></div>
  2. <div id="CoalRatecounter"></div>
  3. <button id="Coalbutton" onclick="addCoal()">Mine</button>
  4. <button id="CoalClicker" onclick="addCoalClicker()">Coal Clicker</button>
  5. <button id="CoalRate" onclick="addCoalRate()">Coal Rate</button>
  6. <div id="alerts">
  7. <div id="errors"></div>
  8. </div>
  9.  
  10. var Coal=0;
  11. var CoalClicker=1;
  12. var CoalClickerPrice=50;
  13. var CoalRate=0;
  14. var CoalRatePrice=50;
  15.  
  16. <script>
  17.     function addCoal(){
  18.     Coal+=CoalClicker;
  19.     totalCoal+=CoalClicker;
  20.     document.getElementById("Coalcounter").innerHTML="Coal : " + Math.round(Coal);
  21.     document.getElementById("CoalClickercost").innerHTML="Upgrade Coal Clicker : " + Math.round(CoalClickerPrice);
  22.     document.getElementById("CoalRatecost").innerHTML="Upgrade Coal Rate : " + Math.round(CoalRatePrice);
  23.     }
  24.     document.getElementById("Coalcounter").innerHTML="Coal : " + Math.round(Coal);
  25.     document.getElementById("CoalClickercost").innerHTML="Upgrade Coal Clicker : " + Math.round(CoalClickerPrice);
  26.     document.getElementById("CoalRatecost").innerHTML="Upgrade Coal Rate : " + Math.round(CoalRatePrice);
  27. </script>
  28. <script>
  29.     var increment = setInterval(increment,1000); // gain 1 ever second // THIS IS WHAT I WANT TO CHANGE
  30.     function increment(){
  31.     Coal = Coal % 99999999999999999999 + CoalRate;
  32.     totalCoal = totalCoal % 99999999999999999999 + CoalRate;
  33.     document.getElementById("Coalcounter").innerHTML="Coal : " + Math.round(Coal);
  34.     document.getElementById("CoalClickercost").innerHTML="Upgrade Coal Clicker : " + Math.round(CoalClickerPrice);
  35.     document.getElementById("CoalRatecost").innerHTML="Upgrade Coal Rate : " + Math.round(CoalRatePrice);
  36.     }
  37. </script>
  38. <script>
  39.     var increment = setInterval(increment,5000);
  40.     function increment(){
  41.     document.getElementById("errors").innerHTML="";
  42.     }
  43. </script>
  44. <Script>
  45.     var CoalClicker=1;
  46.     function addCoalClicker(){
  47.     if(Coal>CoalClickerPrice-1){
  48.     CoalClicker+=1;
  49.     Coal-=CoalClickerPrice;
  50.     CoalClickerPrice*=1.2;
  51.     document.getElementById("Coalcounter").innerHTML="Coal : " + Math.round(Coal);
  52.     document.getElementById("CoalClickercost").innerHTML="Upgrade Coal Clicker : " + Math.round(CoalClickerPrice);
  53.     document.getElementById("CoalRatecost").innerHTML="Upgrade Coal Rate : " + Math.round(CoalRatePrice);
  54.     }
  55.     else
  56.     {
  57.     document.getElementById("errors").innerHTML="Not Enough Coal!"; // Note
  58.     }
  59.     }
  60. </script>
  61. <Script>
  62.     var CoalRate=0;
  63.     function addCoalRate(){
  64.     if(Coal>CoalRatePrice-1){
  65.     CoalRate+=1;
  66.     Coal-=CoalRatePrice;
  67.     CoalRatePrice*=1.2;
  68.     document.getElementById("Coalcounter").innerHTML="Coal : " + Math.round(Coal);
  69.     document.getElementById("CoalClickercost").innerHTML="Upgrade Coal Clicker : " + Math.round(CoalClickerPrice);
  70.     document.getElementById("CoalRatecost").innerHTML="Upgrade Coal Rate : " + Math.round(CoalRatePrice);
  71.     }
  72.     else
  73.     {
  74.     document.getElementById("errors").innerHTML="Not Enough Coal!"; // Note
  75.     }
  76.     }
  77. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement