var move = {
left: 'a',
right: 'd',
mine: 'c',
duration: 3000
};
var cmd = {
list: ['x/napraw kilof','x/repair'],
duration: 8000
}
var eat = {
hotkey: 2,
hotkeyPickAxe: 1,
key: 'v',
time: 2000,
duration: 4000,
}
var status = false
var countCommand = 0;
var countEat = 0;
var power = true
function mine() {
if(status) {
execute(move.left + '.down.w' + move.duration + ' ' + move.left+'.up')
execute(move.mine + '.down.w' + move.duration + ' ' + move.mine+'.up')
}
else {1
execute(move.right + '.down.w' + move.duration + ' ' + move.right+'.up')
execute(move.mine + '.down.w' + move.duration + ' ' + move.mine+'.up')
}
status = !status;
countCommand++
countEat++
if(power) {
setTimeout(commanding,move.duration)
}
}
function commanding() {
if(countCommand == Number(cmd.duration / move.duration).toFixed()) {1
countCommand = 0
cmd.list.forEach((el,i)=>{
setTimeout(()=>{
execute('t.w150 ' + el.split('').join(' ').replace('/','SLASH') + '.w250 ENTER.w150')
},(i+1) * 550)
})
setTimeout(eating,cmd.list.length*800);
}
else {
eating()
}
}
function eating() {
if(countEat == Number(eat.duration / move.duration).toFixed()) {
countEat = 0;
let template = eat.hotkey + '.w150 ' + eat.key+'.down.w' + eat.time + ' ' + eat.key+'.up.w150 '+eat.hotkeyPickAxe+'.w150'
execute(template)
setTimeout(mine,eat.time+1500);
}
else {
mine()
}
}
function execute(temp) {
console.log(temp)
exec('java -jar '+currentPath+'\\resources\\app\\app\\key-sender.jar '+temp)
}
setTimeout(()=>{
mainWindow.minimize();
mine()
},2000)
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}