Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.85 KB | None | 0 0
  1. // ==UserScript==
  2. // @name howrse
  3. // @namespace http://nl.howrse.com
  4. // @version 1
  5. // @author bierosaurus
  6. // @grant none
  7. // ==/UserScript==
  8. //allow pasting
  9.  
  10. var sRace = $("#characteristics-body-content").find("a").eq(0).html() ; // Fries, shetlander etc.
  11. var sTmpt = $("#characteristics-body-content").find("td").eq(2).html() ; // Paard, Eenhoorn, Pegasus, Gevleugelde eenhoorn
  12. var sType = sTmpt.substr(24, sTmpt.length)
  13. var sTmps = $("#characteristics-body-content").find("td").eq(4).html() ; // mannelijk, vrouwelijk, ruin
  14. var sSex = sTmps.substr(27, sTmps.length)
  15.  
  16. var full_url = $("#nav-previous").attr("href")
  17. var url_array = full_url.split('id=')
  18. var last_segment = url_array[url_array.length-1];
  19. var horseId = last_segment.substr(0,7)
  20.  
  21. var aCreationids = [
  22. ["100144885","#161211", "new"]
  23. ,["100163151","#505A7E", "new"]
  24. ,["100153636","#454B1D", "new"]
  25. ,["100141252","#1D0F04", "new"]
  26. ,["100173576", "#1C261E", "new"]
  27. ,["100154660", "#462713", "new"]
  28. ,["100139406", "#060C02", "new"]
  29. ,["100175320", "#280B03", "new"]
  30. ,["100133372", "#D8E2EC", "new"]
  31. ,["100131209", "#160F05", "new"]
  32. ,["100161195", "#675D3A", "new"]
  33. ,["100168369", "#080800", "new"]
  34. ,["100147589", "#353013", "new"]
  35. ,["100141252", "#1D0F04", "new"]
  36. ,["100154093", "#C6C1AB", "new"]
  37. ,["100133374", "#10270D", "new"]
  38. ,["100144873", "#353533", "new"]
  39. ,["100141262", "#C1893E", "new"]
  40. ,["100131901", "#100F14", "new"]
  41. ,["100146527", "#A97732", "new"]
  42. ,["100170252", "#2A78F6", "new"]
  43. ,["100133979", "#A9C4D5", "new"]
  44. ,["100129284", "#2A2D22", "new"]
  45. ,["100007559", "#0D1C07", "old"]
  46. ,["100154206", "#043517", "new"]
  47. ,["100138938", "#0861B5", "new"]
  48. ,["100139875", "#070B0E", "new"]
  49. ,["100127810", "#120705", "new"]
  50. ,["100120918", "#A5AEB5", "old"]
  51. ,["100084276", "#4E3940", "old"]
  52. ,["100149755", "#A2B7F8", "new"]
  53. ,["100128059", "#4F7B94", "new"]
  54. ,["100011175", "#414256", "old"]
  55. ,["100056037", "#18130F", "old"]
  56. ,["100024646", "#231C12", "old"]
  57. ]
  58.  
  59. // mares
  60. var aVHorses = ["100058842","100116843","100051931","100132677","10013459","100035074","100041717","100051555","100174399","100077191","100013686","100169528","100116843","100011491","100041662","100001910","100037600","100028951","100052798","100132538"]
  61. // stallions
  62. var aMHorses = ["100143217","100106514","100042466","100143032","100004144","100039556","100030347","100173047","100058660","100141944","100133917","100002339","100074755","100070769","100141839","100070589","100041053","100073366","100129800"]
  63. var aVFriesians = ["100018138"]
  64. var aMFriesians = ["100030901","100099055"]
  65. var aPonies = ["100109889","100150823","100161413"]
  66. var aPegasus = ["100056137","100008559","100128376","100140819","100059702","100143223","100034858","100019027","100125079","100018440","100041531","100139221"]
  67. var aUnicorn = ["100040178","100160635","100050994","100104464","100006162"]
  68. var aSpecials = ["midas"]
  69.  
  70. var aCreation = aCreationids[Math.floor(Math.random()*aCreationids.length)];
  71.  
  72. // backgrounds
  73. var ChangeBack = function( creationId, bgColor, bOld)
  74. {
  75. sOld = (bOld=="old") ? 'old-replaced' : 'nouveau' ;
  76. $(".body-background").css("background-image", "url(http://creation.howrse.com.s3.amazonaws.com/" + sOld + "/" + creationId + "-console.jpg)");
  77. $(".body-background-left").css("background-image", "url(http://creation.howrse.com.s3.amazonaws.com/" + sOld + "/" + creationId + "-console-left.jpg)");
  78. $(".body-background-right").css("background-image", "url(http://creation.howrse.com.s3.amazonaws.com/" + sOld + "/" + creationId + "-console-right.jpg)");
  79. $("#global").css("background-color", bgColor);
  80. }
  81.  
  82. // horses
  83. var ChangeHorse = function( horseId, horseCreationId )
  84. {
  85. // specials
  86. //http://nl.howrse.com/media/equideo/image/chevaux/special/300/adulte/midas.png
  87.  
  88. $( "#cheval-robe-" + horseId ).css("background-image", "url(http://creation.howrse.com.s3.amazonaws.com/" + horseCreationId + "-normal.png)");
  89. }
  90.  
  91. ChangeBack( aCreation[0], aCreation[1], aCreation[2])
  92.  
  93. switch( sType )
  94. {
  95. case "Paard" :
  96. if(sRace=='Fries')
  97. {
  98. nHorse = ( sSex == 'vrouwelijk' ) ? aVFriesians[Math.floor(Math.random()*aVFriesians.length)] : aMFriesians[Math.floor(Math.random()*aMFriesians.length)];
  99. }
  100. else
  101. {
  102. nHorse = ( sSex == 'vrouwelijk' ) ? aVHorses[Math.floor(Math.random()*aVHorses.length)] : aMHorses[Math.floor(Math.random()*aMHorses.length)] ;
  103. }
  104. ChangeHorse( horseId, nHorse)
  105. break ;
  106. case "Eenhoorn" :
  107. nHorse = aUnicorn[Math.floor(Math.random()*aUnicorn.length)];
  108. ChangeHorse( horseId, nHorse)
  109. break ;
  110. case "Pegasus" :
  111. nHorse = aPegasus[Math.floor(Math.random()*aPegasus.length)];
  112. ChangeHorse( horseId, nHorse)
  113. break ;
  114. case "Pony" :
  115. nHorse = aPonies[Math.floor(Math.random()*aPonies.length)];
  116. ChangeHorse( horseId, nHorse)
  117. break ;
  118. default :
  119. alert( sType )
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement