Sleazy Fork is available in English.

Trophy Value Calculator

Calculate the total value of trophies based on jenga201's buying prices

  1. // ==UserScript==
  2. // @name Trophy Value Calculator
  3. // @description Calculate the total value of trophies based on jenga201's buying prices
  4. // @include http://hentaiverse.org/?s=Character&ss=in
  5. // @include http://hentaiverse.org/?s=Bazaar&ss=is
  6. // @include http://hentaiverse.org/?s=Bazaar&ss=is&*
  7. // @version 0.0.1.20160110102520
  8. // @namespace https://greasyfork.org/users/2233
  9. // ==/UserScript==
  10.  
  11. /*** Settings ***/
  12. var d = {
  13. 'ManBearPig Tail': 600,
  14. 'Holy Hand Grenade of Antioch': 600,
  15. 'Mithra\'s Flower': 600,
  16. 'Dalek Voicebox': 600,
  17. 'Lock of Blue Hair': 850,
  18. 'Bunny-Girl Costume': 1250,
  19. 'Hinamatsuri Doll': 1250,
  20. 'Broken Glasses': 1250,
  21. 'Black T-Shirt': 3400,
  22. 'Sapling': 3400,
  23. 'Unicorn Horn': 6000,
  24. 'Noodly Appendage': 26000,
  25. 'Bronze Coupon': 600,
  26. 'Silver Coupon': 1100,
  27. 'Golden Coupon': 30000,
  28. 'Platinum Coupon': 100000,
  29. }
  30. /*** End of Settings ***/
  31.  
  32. var wnd = window
  33. var doc = wnd.document
  34. var loc = location
  35. var href = loc.href
  36.  
  37. var $ = function(e, css) { if(!css) { css=e; e=doc }; return e.querySelector(css) }
  38. var $$ = function(e, css) { if(!css) { css=e; e=doc }; return e.querySelectorAll(css) }
  39.  
  40. if(!$('#togpane_log') && !$('#riddlemaster')) {
  41. var display_total_value = function(sum) {
  42. var out = 'Total value of trophies: ' + sum.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + ' credits'
  43. console.log(out)
  44.  
  45. var div = doc.createElement('DIV')
  46. div.appendChild(doc.createElement('BR'))
  47. div.appendChild(doc.createTextNode(out))
  48.  
  49. var left = $('.clb')
  50. div.style.cssText = $(left, '.cit .fd4 > div').style.cssText + 'margin-right: 8px;'
  51. left.appendChild(div)
  52. }
  53.  
  54. // Character -> Inventory
  55. var inv_item = $('#inv_item')
  56. if(inv_item) {
  57. var items = $$(inv_item, '.id')
  58. for(var i=items.length-1, sum=0; i>=0; i--) {
  59. var k = items[i].textContent
  60. var v = parseInt(d[k])
  61. var supply = parseInt($(items[i].parentNode.parentNode, '.ii').textContent)
  62. if( (!isNaN(v)) && (!isNaN(supply)) ) {
  63. sum += (v*supply)
  64. }
  65. }
  66. display_total_value(sum)
  67. }
  68.  
  69. // Bazaar -> Item Shop -> All/Special
  70. var item_pane = $('#item_pane')
  71. if(item_pane) {
  72. var items = $$(item_pane, '.idp')
  73. var supplies = $$(item_pane, '.ii')
  74. for(var i=items.length-1, sum=0; i>=0; i--) {
  75. var k = items[i].textContent
  76. var v = parseInt(d[k])
  77. var supply = parseInt(supplies[i].textContent)
  78. if( (!isNaN(v)) && (!isNaN(supply)) ) {
  79. sum += (v*supply)
  80. }
  81. }
  82. display_total_value(sum)
  83. }
  84. }