Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name howrse
- // @namespace http://nl.howrse.com
- // @version 1
- // @author bierosaurus
- // @grant none
- // ==/UserScript==
- //allow pasting
- var sRace = $("#characteristics-body-content").find("a").eq(0).html() ; // Fries, shetlander etc.
- var sTmpt = $("#characteristics-body-content").find("td").eq(2).html() ; // Paard, Eenhoorn, Pegasus, Gevleugelde eenhoorn
- var sType = sTmpt.substr(24, sTmpt.length)
- var sTmps = $("#characteristics-body-content").find("td").eq(4).html() ; // mannelijk, vrouwelijk, ruin
- var sSex = sTmps.substr(27, sTmps.length)
- var full_url = $("#nav-previous").attr("href")
- var url_array = full_url.split('id=')
- var last_segment = url_array[url_array.length-1];
- var horseId = last_segment.substr(0,7)
- var aCreationids = [
- ["100144885","#161211", "new"]
- ,["100163151","#505A7E", "new"]
- ,["100153636","#454B1D", "new"]
- ,["100141252","#1D0F04", "new"]
- ,["100173576", "#1C261E", "new"]
- ,["100154660", "#462713", "new"]
- ,["100139406", "#060C02", "new"]
- ,["100175320", "#280B03", "new"]
- ,["100133372", "#D8E2EC", "new"]
- ,["100131209", "#160F05", "new"]
- ,["100161195", "#675D3A", "new"]
- ,["100168369", "#080800", "new"]
- ,["100147589", "#353013", "new"]
- ,["100141252", "#1D0F04", "new"]
- ,["100154093", "#C6C1AB", "new"]
- ,["100133374", "#10270D", "new"]
- ,["100144873", "#353533", "new"]
- ,["100141262", "#C1893E", "new"]
- ,["100131901", "#100F14", "new"]
- ,["100146527", "#A97732", "new"]
- ,["100170252", "#2A78F6", "new"]
- ,["100133979", "#A9C4D5", "new"]
- ,["100129284", "#2A2D22", "new"]
- ,["100007559", "#0D1C07", "old"]
- ,["100154206", "#043517", "new"]
- ,["100138938", "#0861B5", "new"]
- ,["100139875", "#070B0E", "new"]
- ,["100127810", "#120705", "new"]
- ,["100120918", "#A5AEB5", "old"]
- ,["100084276", "#4E3940", "old"]
- ,["100149755", "#A2B7F8", "new"]
- ,["100128059", "#4F7B94", "new"]
- ,["100011175", "#414256", "old"]
- ,["100056037", "#18130F", "old"]
- ,["100024646", "#231C12", "old"]
- ]
- // mares
- var aVHorses = ["100058842","100116843","100051931","100132677","10013459","100035074","100041717","100051555","100174399","100077191","100013686","100169528","100116843","100011491","100041662","100001910","100037600","100028951","100052798","100132538"]
- // stallions
- var aMHorses = ["100143217","100106514","100042466","100143032","100004144","100039556","100030347","100173047","100058660","100141944","100133917","100002339","100074755","100070769","100141839","100070589","100041053","100073366","100129800"]
- var aVFriesians = ["100018138"]
- var aMFriesians = ["100030901","100099055"]
- var aPonies = ["100109889","100150823","100161413"]
- var aPegasus = ["100056137","100008559","100128376","100140819","100059702","100143223","100034858","100019027","100125079","100018440","100041531","100139221"]
- var aUnicorn = ["100040178","100160635","100050994","100104464","100006162"]
- var aSpecials = ["midas"]
- var aCreation = aCreationids[Math.floor(Math.random()*aCreationids.length)];
- // backgrounds
- var ChangeBack = function( creationId, bgColor, bOld)
- {
- sOld = (bOld=="old") ? 'old-replaced' : 'nouveau' ;
- $(".body-background").css("background-image", "url(http://creation.howrse.com.s3.amazonaws.com/" + sOld + "/" + creationId + "-console.jpg)");
- $(".body-background-left").css("background-image", "url(http://creation.howrse.com.s3.amazonaws.com/" + sOld + "/" + creationId + "-console-left.jpg)");
- $(".body-background-right").css("background-image", "url(http://creation.howrse.com.s3.amazonaws.com/" + sOld + "/" + creationId + "-console-right.jpg)");
- $("#global").css("background-color", bgColor);
- }
- // horses
- var ChangeHorse = function( horseId, horseCreationId )
- {
- // specials
- //http://nl.howrse.com/media/equideo/image/chevaux/special/300/adulte/midas.png
- $( "#cheval-robe-" + horseId ).css("background-image", "url(http://creation.howrse.com.s3.amazonaws.com/" + horseCreationId + "-normal.png)");
- }
- ChangeBack( aCreation[0], aCreation[1], aCreation[2])
- switch( sType )
- {
- case "Paard" :
- if(sRace=='Fries')
- {
- nHorse = ( sSex == 'vrouwelijk' ) ? aVFriesians[Math.floor(Math.random()*aVFriesians.length)] : aMFriesians[Math.floor(Math.random()*aMFriesians.length)];
- }
- else
- {
- nHorse = ( sSex == 'vrouwelijk' ) ? aVHorses[Math.floor(Math.random()*aVHorses.length)] : aMHorses[Math.floor(Math.random()*aMHorses.length)] ;
- }
- ChangeHorse( horseId, nHorse)
- break ;
- case "Eenhoorn" :
- nHorse = aUnicorn[Math.floor(Math.random()*aUnicorn.length)];
- ChangeHorse( horseId, nHorse)
- break ;
- case "Pegasus" :
- nHorse = aPegasus[Math.floor(Math.random()*aPegasus.length)];
- ChangeHorse( horseId, nHorse)
- break ;
- case "Pony" :
- nHorse = aPonies[Math.floor(Math.random()*aPonies.length)];
- ChangeHorse( horseId, nHorse)
- break ;
- default :
- alert( sType )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement