Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Value: <input type='text' placeholder="Value" id="value" oninput="dosth();"> Type:
- <select id="type" oninput="dosth();">
- <option>Weapon</option>
- <option>Icon</option>
- <option>Armor</option>
- <option>Hat</option>
- <option>Boots</option>
- <option>Shield</option>
- </select><br>
- <p id='res'>Item gfx: </p>
- <script>
- function dosth(){
- type = document.getElementById("type").selectedIndex;
- res = document.getElementById("res");
- value = parseInt(document.getElementById("value").value);
- if(type==0){
- res.innerHTML = "Item gfx: " + Math.floor((value - 101) / 100 + 1);
- }
- if(type==1){
- res.innerHTML = "Item gfx: " + Math.floor((value - 101) / 2 + 1);
- }
- if(type==2){
- res.innerHTML = "Item gfx: " + Math.floor((value - 101) / 50 + 1);
- }
- if(type==3){
- res.innerHTML = "Item gfx: " + Math.floor((value - 101) / 10 + 1);
- }
- if(type==4){
- res.innerHTML = "Item gfx: " + Math.floor((value - 101) / 40 + 1);
- }
- if(type==5){
- res.innerHTML = "Item gfx: " + Math.floor((value - 101) / 50 + 1);
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement