Skip to content

Instantly share code, notes, and snippets.

@gaogao-9
Last active November 1, 2015 09:14
Show Gist options
  • Save gaogao-9/d45b13661f80bc057aeb to your computer and use it in GitHub Desktop.
Save gaogao-9/d45b13661f80bc057aeb to your computer and use it in GitHub Desktop.
Watch Usa??(ウォッチうさ??) http://watch.gochiusa.club/ 用の絶対にうさぎを取りこぼさない自動プレイスクリプトです
!function(){
// 多重実行防止
if(!window.GAO_WATCH_USA_AUTO_PLAY) window.GAO_WATCH_USA_AUTO_PLAY = {};
else return;
// Game.Processをオーバーライド
var _GameProcess = Game.Process;
window.Game.Process = function(){
// 基底メソッドの実行
_GameProcess.apply(this,arguments);
// 兎の数を確認
if(!rabbits.length) return;
// 到達時間の最も短いうさぎ情報を手に入れる
var rabbitsInfo = rabbits.reduce(function(a,b){
var time,type;
// 既に通過判定をもらっていたらそのうさぎを無視する
if(b.pass) return a;
if(b.pos<5){
type = 0;
time = (5 - b.pos);
}
else if(b.pos < 13){
type = 1;
time = (13 - b.pos);
}
else if(b.pos < 19){
type = 2;
time = (19 - b.pos);
}
else{
type = 3;
time = Number.MAX_VALUE;
}
time -= b.missTimer.now;
return (a.time>time) ? {time: time, type: type} : a;
},{time: Number.MAX_VALUE, type: -1});
// 該当するうさぎがいない(全てのうさぎのpos19が以上)の時は終了する
if(rabbitsInfo.type === -1) return;
// 最も最初に到達するであろう兎の元へ高速移動
var pos;
while(pos = (rabbitsInfo.type - playerPos)){
if(pos<0){
touchLeft();
}
else{
touchRight();
}
}
return;
};
console.log("オートプレイスタート!");
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment