Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Dikhoofd's BR heal speed calculator</title>
- </head>
- <body>
- Criminals in BR: <input id="c" value="0" onkeypress="handleEnter(this, event)"/>
- <br>
- Cops in BR: <input id="d" value="0" onkeypress="handleEnter(this, event)"/>
- <button onclick="myFunction()">Calculate</button>
- <p id="demo"></p>
- <script>
- function myFunction()
- {
- d1=document.getElementById("d").value;
- c1=document.getElementById("c").value;
- e1=document.getElementById("e").value;
- f1=document.getElementById("f").value;
- var a;
- var e1=e2;
- var f1=f2;
- var c2=c1;
- var d2=d1;
- var c=c2/10*10;
- var d=d2/10*10;
- var e=e2/10*10
- var f=f2/10*10
- var a=c+d;
- var e=c/a*30
- var f=d/a*30
- var demoP=document.getElementById("demo")
- if (c<=999999999999999999 && c>=0 && d<=9999999999999999999 && d>=0)
- {
- demoP.innerHTML="Hp healed per second cop= " + e + "hp/s. for criminal" + f + "hp/s";
- }
- else if (d>=)10000000000000000000
- {
- alert("Why would you want to know a number that high")
- }
- else if (c>=0)
- {
- alert("Please enter two numbers greater than 0.")
- }
- else if (c>=1000000000000000000 || c<=-1 || d>=100000000000000000000 || d<=-1)
- {
- alert("Why do you want to know that?")
- }
- else
- {
- alert("You can only enter a number.")
- }
- }
- function handleEnter(inField, e) {
- var charCode;
- if(e && e.which){
- charCode = e.which;
- }else if(window.event){
- e = window.event;
- charCode = e.keyCode;
- }
- if(charCode == 13) {
- myFunction()
- }
- }
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment