javascript:(function(d,s){s=d.createElement('script');s.src='https://cdn.rawgit.com/ba0918/60f7acb191b7560d75d1/raw/ca8e72117b4cae98065e5f4abb641c998d6d0f80/test.js';d.body.appendChild(s);})(document);
Last active
February 16, 2016 01:12
-
-
Save ba0918/60f7acb191b7560d75d1 to your computer and use it in GitHub Desktop.
クッキー焼くのちょっと楽にする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
'use strict'; | |
// ゲームの要素取得 | |
const $topBar = l('topBar'); | |
const $bigCookie = l('bigCookie'); | |
const $goldenCookie = l('goldenCookie'); | |
const $tools = document.createElement('div'); | |
// 各種チートの定義 | |
const cheats = {}; | |
// 自動連射チート | |
cheats['auto click'] = { | |
'element': document.createElement('button'), | |
'text': '連射', | |
'init': () => { | |
cheats['auto click'].element.innerHTML = cheats['auto click'].text + '[F]'; | |
cheats['auto click'].element.addEventListener('click', () => { | |
if (cheats['auto click']._timer) { | |
cheats['auto click'].off(); | |
} else { | |
cheats['auto click'].on(); | |
} | |
}); | |
}, | |
'on': () => { | |
cheats['auto click']._timer = setInterval(() => { | |
FireEvent($bigCookie, 'click'); | |
}, 1); | |
cheats['auto click'].element.innerHTML = '<span style="color: red">' + cheats['auto click'].text + '[T]</span>'; | |
}, | |
'off': () => { | |
clearInterval(cheats['auto click']._timer); | |
cheats['auto click']._timer = null; | |
cheats['auto click'].element.innerHTML = cheats['auto click'].text + '[F]'; | |
}, | |
'_timer': null | |
}; | |
// ゴールデンクッキー監視 | |
cheats['watch golden cookie'] = { | |
'element': document.createElement('button'), | |
'text': 'G監視', | |
'init': () => { | |
cheats['watch golden cookie'].element.innerHTML = cheats['watch golden cookie'].text + '[F]'; | |
cheats['watch golden cookie'].element.addEventListener('click', () => { | |
if (cheats['watch golden cookie']._timer) { | |
cheats['watch golden cookie'].off(); | |
} else { | |
cheats['watch golden cookie'].on(); | |
} | |
}); | |
}, | |
'on': () => { | |
cheats['watch golden cookie']._timer = setInterval(() => { | |
if ($goldenCookie.style.display != 'block') { | |
return false; | |
} | |
FireEvent($goldenCookie, 'click'); | |
}, 1000); | |
cheats['watch golden cookie'].element.innerHTML = '<span style="color: red">' + cheats['watch golden cookie'].text + '[T]</span>'; | |
}, | |
'off': () => { | |
clearInterval(cheats['watch golden cookie']._timer); | |
cheats['watch golden cookie']._timer = null; | |
cheats['watch golden cookie'].element.innerHTML = cheats['watch golden cookie'].text + '[F]'; | |
}, | |
'_timer': null | |
}; | |
// ゴールデンクッキーの自動リスポーン | |
cheats['auto respawn golden cookie'] = { | |
'element': document.createElement('button'), | |
'text': 'G生成', | |
'init': () => { | |
cheats['auto respawn golden cookie'].element.innerHTML = cheats['auto respawn golden cookie'].text + '[F]'; | |
cheats['auto respawn golden cookie'].element.addEventListener('click', () => { | |
if (cheats['auto respawn golden cookie']._timer) { | |
cheats['auto respawn golden cookie'].off(); | |
} else { | |
cheats['auto respawn golden cookie'].on(); | |
} | |
}); | |
}, | |
'on': () => { | |
cheats['auto respawn golden cookie']._timer = setInterval(() => { | |
if ($goldenCookie.style.display != 'block') { | |
Game.goldenCookie.minTime = 0; | |
Game.goldenCookie.life = 0; | |
Game.goldenCookie.spawn(); | |
} | |
}, 1000); | |
cheats['auto respawn golden cookie'].element.innerHTML = '<span style="color: red">' + cheats['auto respawn golden cookie'].text + '[T]</span>'; | |
}, | |
'off': () => { | |
clearInterval(cheats['auto respawn golden cookie']._timer); | |
cheats['auto respawn golden cookie']._timer = null; | |
cheats['auto respawn golden cookie'].element.innerHTML = cheats['auto respawn golden cookie'].text + '[F]'; | |
}, | |
'_timer': null | |
}; | |
// ゴールデンクッキーのボーナスをx777に固定する | |
cheats['cheat golden cookie bonus'] = { | |
'element': document.createElement('button'), | |
'text': 'Gx777', | |
'init': () => { | |
cheats['cheat golden cookie bonus'].element.innerHTML = cheats['cheat golden cookie bonus'].text + '[F]'; | |
cheats['cheat golden cookie bonus'].element.addEventListener('click', () => { | |
if (cheats['cheat golden cookie bonus']._enabled) { | |
cheats['cheat golden cookie bonus'].off(); | |
} else { | |
cheats['cheat golden cookie bonus'].on(); | |
} | |
}); | |
}, | |
'on': () => { | |
if (cheats['cheat golden cookie bonus doragon']._enabled) { | |
cheats['cheat golden cookie bonus doragon'].off(); | |
} | |
cheats['cheat golden cookie bonus']._original_method = Game.goldenCookie.choose; | |
Game.goldenCookie.choose = () => { | |
return 'click frenzy'; | |
}; | |
cheats['cheat golden cookie bonus']._enabled = true; | |
cheats['cheat golden cookie bonus'].element.innerHTML = '<span style="color: red">' + cheats['cheat golden cookie bonus'].text + '[T]</span>'; | |
}, | |
'off': () => { | |
Game.goldenCookie.choose = cheats['cheat golden cookie bonus']._original_method; | |
cheats['cheat golden cookie bonus']._enabled = false; | |
cheats['cheat golden cookie bonus'].element.innerHTML = cheats['cheat golden cookie bonus'].text + '[F]'; | |
}, | |
'_original_method': null, | |
'_enabled': false | |
}; | |
// ゴールデンクッキーのボーナスをx1111に固定する | |
cheats['cheat golden cookie bonus doragon'] = { | |
'element': document.createElement('button'), | |
'text': 'Gx1111', | |
'init': () => { | |
cheats['cheat golden cookie bonus doragon'].element.innerHTML = cheats['cheat golden cookie bonus doragon'].text + '[F]'; | |
cheats['cheat golden cookie bonus doragon'].element.addEventListener('click', () => { | |
if (cheats['cheat golden cookie bonus doragon']._enabled) { | |
cheats['cheat golden cookie bonus doragon'].off(); | |
} else { | |
cheats['cheat golden cookie bonus doragon'].on(); | |
} | |
}); | |
}, | |
'on': () => { | |
if (cheats['cheat golden cookie bonus']._enabled) { | |
cheats['cheat golden cookie bonus'].off(); | |
} | |
cheats['cheat golden cookie bonus doragon']._original_method = Game.goldenCookie.choose; | |
Game.goldenCookie.choose = () => { | |
return 'dragonflight'; | |
}; | |
cheats['cheat golden cookie bonus doragon']._enabled = true; | |
cheats['cheat golden cookie bonus doragon'].element.innerHTML = '<span style="color: red">' + cheats['cheat golden cookie bonus doragon'].text + '[T]</span>'; | |
}, | |
'off': () => { | |
Game.goldenCookie.choose = cheats['cheat golden cookie bonus doragon']._original_method; | |
cheats['cheat golden cookie bonus doragon']._enabled = false; | |
cheats['cheat golden cookie bonus doragon'].element.innerHTML = cheats['cheat golden cookie bonus doragon'].text + '[F]'; | |
}, | |
'_original_method': null, | |
'_enabled': false | |
}; | |
// アップグレードを自動で買うツール | |
cheats['auto buy upgrades'] = { | |
'element': document.createElement('button'), | |
'text': '買', | |
'init': () => { | |
cheats['auto buy upgrades'].element.innerHTML = cheats['auto buy upgrades'].text + '[F]'; | |
cheats['auto buy upgrades'].element.addEventListener('click', () => { | |
if (cheats['auto buy upgrades']._timer) { | |
cheats['auto buy upgrades'].off(); | |
} else { | |
cheats['auto buy upgrades'].on(); | |
} | |
}); | |
}, | |
'on': () => { | |
cheats['auto buy upgrades']._timer = setInterval(() => { | |
Game.UpgradesInStore.forEach((upgrade) => { | |
if (upgrade.pool !== '' && upgrade.pool !== 'cookie') { | |
return; | |
} | |
if (!upgrade.canBuy()) { | |
return; | |
} | |
upgrade.buy(); | |
}); | |
}, 1000); | |
cheats['auto buy upgrades'].element.innerHTML = '<span style="color: red">' + cheats['auto buy upgrades'].text + '[T]</span>'; | |
}, | |
'off': () => { | |
clearInterval(cheats['auto buy upgrades']._timer); | |
cheats['auto buy upgrades']._timer = null; | |
cheats['auto buy upgrades'].element.innerHTML = cheats['auto buy upgrades'].text + '[F]'; | |
}, | |
'_timer': null | |
}; | |
// 殺虫 | |
cheats['auto destroy wrinklers'] = { | |
'element': document.createElement('button'), | |
'text': '殺虫', | |
'init': () => { | |
cheats['auto destroy wrinklers'].element.innerHTML = cheats['auto destroy wrinklers'].text + '[F]'; | |
cheats['auto destroy wrinklers'].element.addEventListener('click', () => { | |
if (cheats['auto destroy wrinklers']._timer) { | |
cheats['auto destroy wrinklers'].off(); | |
} else { | |
cheats['auto destroy wrinklers'].on(); | |
} | |
}); | |
}, | |
'on': () => { | |
cheats['auto destroy wrinklers']._timer = setInterval(() => { | |
if (Game.elderWrath == 0) { | |
return; | |
} | |
Game.wrinklers.forEach((wrinkler) => { | |
if (wrinkler.close == 1) { | |
wrinkler.selected = 1; | |
} | |
}); | |
}, 50); | |
cheats['auto destroy wrinklers'].element.innerHTML = '<span style="color: red">' + cheats['auto destroy wrinklers'].text + '[T]</span>'; | |
}, | |
'off': () => { | |
clearInterval(cheats['auto destroy wrinklers']._timer); | |
cheats['auto destroy wrinklers']._timer = null; | |
cheats['auto destroy wrinklers'].element.innerHTML = cheats['auto destroy wrinklers'].text + '[F]'; | |
}, | |
'_timer': null | |
}; | |
// 虫生成 | |
cheats['spawn wrinklers'] = { | |
'element': document.createElement('button'), | |
'text': '虫+', | |
'init': () => { | |
cheats['spawn wrinklers'].element.innerHTML = cheats['spawn wrinklers'].text; | |
cheats['spawn wrinklers'].element.addEventListener('click', () => { | |
cheats['spawn wrinklers'].spawn(); | |
}); | |
}, | |
'spawn': () => { | |
if (Game.elderWrath == 0) { | |
return; | |
} | |
Game.LoadWrinklers(1,12); | |
} | |
}; | |
// チート認定対策 | |
delete Game.Achievements["Speed baking I"]; | |
delete Game.Achievements["Speed baking II"]; | |
delete Game.Achievements["Speed baking III"]; | |
// ヘッダーを綺麗にする | |
for (let i = $topBar.childNodes.length; i > 1; i--) { | |
let obj = $topBar.childNodes[i - 1]; | |
$topBar.removeChild(obj); | |
} | |
// 各種チートの準備 | |
Object.keys(cheats).forEach((name) => { | |
let cheat = cheats[name]; | |
cheat.init(); | |
$tools.appendChild(cheat.element); | |
}); | |
// チートメニュー可視化 | |
$topBar.appendChild($tools); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment