Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sinV = 0.6263368527348079
- // config
- antiJumpChance = .8
- actionInterval = 500
- closeAIOnReset = 0
- smoother = .5
- // on Init
- /* teaching = {} */
- function jump(n) {
- mouseIsDown = true;
- setTimeout(f=>{mouseIsDown=false; mouseWasDown=true}, n*100)
- }
- function detSinV() {
- toSum = 0;
- for (item of mainCanvasContext.getImageData(0,0,64,64).data) {
- if (item!=255) toSum += item/255;
- }
- mouseX = .5 + Math.sin(toSum/smoother+sinV*smoother)/2
- mouseY = .3 + Math.sin(toSum*sinV*2/smoother)/5
- if (Math.sin(sinV*toSum/smoother+sinV*playerSpeed/smoother)/2+.5>antiJumpChance) jump(2.5+Math.sin(sinV*sinV*sinV*toSum)*5/2)
- if (gameState == 3 && closeAIOnReset) clearInterval(botHandle)
- // if (gameState != 1) teaching[time] = sinV, sinV = Math.random(), time = 1;
- }
- function startBot(oneTime) {
- if (oneTime) closeAIOnReset = 1
- botHandle = setInterval(detSinV, actionInterval)
- }
- function stopBot() {
- clearInterval(botHandle)
- }
- startBot(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement