Advertisement
Guest User

Untitled

a guest
Jul 6th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. Value: <input type='text' placeholder="Value" id="value" oninput="dosth();"> &nbsp; &nbsp; Type:
  2. <select id="type" oninput="dosth();">
  3. <option>Weapon</option>
  4. <option>Icon</option>
  5. <option>Armor</option>
  6. <option>Hat</option>
  7. <option>Boots</option>
  8. <option>Shield</option>
  9. </select><br>
  10. <p id='res'>Item gfx: </p>
  11. <script>
  12.  
  13. function dosth(){
  14. type = document.getElementById("type").selectedIndex;
  15. res = document.getElementById("res");
  16. value = parseInt(document.getElementById("value").value);
  17. if(type==0){
  18. res.innerHTML = "Item gfx: " + Math.floor((value - 101) / 100 + 1);
  19. }
  20. if(type==1){
  21. res.innerHTML = "Item gfx: " + Math.floor((value - 101) / 2 + 1);
  22. }
  23. if(type==2){
  24. res.innerHTML = "Item gfx: " + Math.floor((value - 101) / 50 + 1);
  25. }
  26. if(type==3){
  27. res.innerHTML = "Item gfx: " + Math.floor((value - 101) / 10 + 1);
  28. }
  29. if(type==4){
  30. res.innerHTML = "Item gfx: " + Math.floor((value - 101) / 40 + 1);
  31. }
  32. if(type==5){
  33. res.innerHTML = "Item gfx: " + Math.floor((value - 101) / 50 + 1);
  34. }
  35. }
  36. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement