autonameko

  • /*
     * @title autonameko
     * @description 無限なめこ (http://s6.ql.bz/~iqp/nameko/nameko.html) で自動収穫するブックマークレット 
     */
    
    void (function() {
      var x = Math.floor(Math.random() * arObj.length);
      var y = Math.floor(Math.random() * arObj[x].length);
      var obj = arObj[x][y];
      obj.isAnimation = true;
      var id = "#" + obj.id;
      $(id).animate({height:"+=20", top:"-=20"}, "fast");
      $(id).animate({height:"-=25", top:"+=5"}, "fast");
      $(id).animate({height:"+=5"}, "fast");
      $(id).animate({ width:"hide", height:"hide", top:0, left:0 }, "normal"); 
      $(id).animate({top:obj.y+SIZE_Y/2, left:obj.x+SIZE_X/2}, "fast", function() {
        var n = Math.floor( Math.random() * GOLDEN_PROBABILITY );
        $(id).attr("src", n == 1 ? goldenSrc : namekoSrc);
      }); 
      $(id).animate({ width:"show", height:"show",top:obj.y, left:obj.x}, "normal", function() {
        obj.isAnimation = false;
        $("#namekoNum").html(++namekoNum + "本");
      }); 
      setTimeout(arguments.callee, 10);
    })();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2012/02/24 00:40:20 - 2012-02-24
  2. 2012/02/24 00:39:01 - 2012-02-24
  3. 2012/02/24 00:38:15 - 2012-02-24