Advertisement
Teh_Bucket

HAM

Apr 29th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //HAM
  2. //ham model by valve (Team Fortress 2), using 360 image from: TF2 Wiki: http://wiki.teamfortress.com/w/images/5/5a/Ham_Shank_3D.jpg
  3. /*
  4. To add to a webpage:
  5. Either add this script to the html:
  6.  
  7. <script language="http://pastebin.com/raw.php?i=y5jddGdR"></script>
  8.  
  9. Or add to any webpage with the javascript console line by line:
  10.  
  11. var HAM = document.createElement('script')
  12. HAM.language="javascript"
  13. HAM.src="http://pastebin.com/raw.php?i=y5jddGdR"
  14. document.head.appendChild(HAM)
  15.  
  16. */
  17. var ham = new Image();
  18. ham.source = 'http://i.imgur.com/8Rngbqb.png' //cloud for easy access or change to local dir
  19. var hamwall = {l:0,t:0,r:window.innerWidth-140,b:window.innerHeight-280}
  20. //hampoo is an alternative hair-greasing product for manlier men, liberally stolen from the tf2 wiki
  21. var hampoo = [{l: 93, w: 93, fx: 0}, {l: 82, w: 94, fx: -296}, {l: 74, w: 97, fx: -588}, {l: 66, w: 105, fx: -885} , {l: 57, w: 117, fx: -1202} , {l: 51, w: 125, fx: -1549} , {l: 50, w: 126, fx: -1909} , {l: 50, w: 125, fx: -2271} , {l: 51, w: 120, fx: -2626} , {l: 57, w: 109, fx: -2971} , {l: 66, w: 105, fx: -3292} , {l: 78, w: 102, fx: -3604} , {l: 90, w: 101, fx: -3906} , {l: 100, w: 102, fx: -4198} , {l: 106, w: 103, fx: -4487} , {l: 110, w: 110, fx: -4782} , {l: 106, w: 122, fx: -5100} , {l: 104, w: 125, fx: -5447} , {l: 103, w: 126, fx: -5804} , {l: 104, w: 125, fx: -6163} , {l: 107, w: 118, fx: -6519} , {l: 112, w: 103, fx: -6864} , {l: 110, w: 96, fx: -7182} , {l: 102, w: 92, fx: -7496}, ];
  22. //hamshoes increase crit rate from 100% to 110%
  23. var hamshoe = {x:0,y:0,f:0,xD:3, yD:3}
  24.  
  25. //Ham-Foo is a rare martial arts form indistinguishible from magic or sufficiently advanced technology
  26. var hamfoo = document.createElement('div');
  27. hamfoo.setAttribute('style',"height:280px; width:93px; left:0px; top:0px; position:fixed; z-index:9000; background-image:url('"+ham.source+"'); pointer-events:none;");
  28. hamfoo.setAttribute('id','OneHamToRuleThemAll');
  29. document.getElementsByTagName('body')[0].appendChild(hamfoo);
  30.  
  31. var hamtoo = document.getElementById('OneHamToRuleThemAll');
  32.  
  33. //a hambush is the act of moving slowly towards your opponent in wide open, holding ham in a threatening fashion (and hopefully spinning)
  34. var hambush = self.setInterval(function(){with(hamshoe){
  35.     (f >= hampoo.length-1) ? f = 0 : f += 1;
  36.     hamwall = {l:0,t:0,r:window.innerWidth-140,b:window.innerHeight-280}
  37.     x += xD;
  38.     y += yD;
  39.     if(x >= hamwall.r || x  <= hamwall.l){xD *= -1}
  40.     if(y >= hamwall.b || y <= hamwall.t){yD *= -1}
  41.    
  42.     hamtoo.style.backgroundPosition = hampoo[f].fx +'px 0px';
  43.     hamtoo.style.width = hampoo[f].w + 'px';
  44.     hamtoo.style.left = x+  hampoo[f].l +'px';
  45.     hamtoo.style.top = y+'px';
  46. }},50);
  47.  
  48. console.log("HAMMIFIED!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement