New cookie clicker autoplay

try to take over the world!

// ==UserScript==
// @name         New cookie clicker autoplay
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://cookieclicker.io/
// @grant        none
// ==/UserScript==
cookie=document.getElementsByClassName('cookies-img')[0];
click=function(e){return e.click()};
var items=document.getElementsByClassName('container-store')[0].children;
items.forEach=[].forEach
item=''
obj=[];
i=0;
items.forEach(e=>{
    item+=e.className.split('-')[1].split(' ')[0]+`=document.getElementsByClassName('${e.className}')[0];`+
        e.className.split('-')[1].split(' ')[0]+`.buy=function(){click(${e.className.split('-')[1].split(' ')[0]});};
obj.push(${e.className.split('-')[1].split(' ')[0]})
`
})
eval(item);
var a;
clearInterval(a);
a=setInterval(function(){click(cookie)},0);
var b
clearInterval(b);
b=setInterval(function(){
    obj.forEach(e=>{
        e.buy()
    })},1000)