Facebook
From Paltry Peccary, 6 Years ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 260
  1. var move = {
  2.     left: 'a',
  3.     right: 'd',
  4.     mine: 'c',
  5.     duration: 3000
  6. };
  7. var cmd = {
  8. list: ['x/napraw kilof','x/repair'],
  9. duration: 8000
  10. }
  11.  
  12. var eat = {
  13. hotkey: 2,
  14. hotkeyPickAxe: 1,
  15. key: 'v',
  16. time: 2000,
  17. duration: 4000,
  18. }
  19.  
  20. var status = false
  21. var countCommand = 0;
  22. var countEat = 0;
  23. var power = true
  24.  
  25.  
  26. function mine() {
  27. if(status) {
  28.  
  29.     execute(move.left + '.down.w' + move.duration + ' ' + move.left+'.up')
  30.     execute(move.mine + '.down.w' + move.duration + ' ' + move.mine+'.up')
  31. }
  32. else {1
  33.     execute(move.right + '.down.w' + move.duration + ' ' + move.right+'.up')
  34.     execute(move.mine + '.down.w' + move.duration + ' ' + move.mine+'.up')
  35. }
  36. status = !status;
  37. countCommand++
  38. countEat++
  39. if(power) {
  40.     setTimeout(commanding,move.duration)
  41. }
  42.  
  43. }
  44. function commanding() {
  45. if(countCommand == Number(cmd.duration / move.duration).toFixed()) {1
  46.     countCommand = 0
  47.     cmd.list.forEach((el,i)=>{
  48.         setTimeout(()=>{
  49.             execute('t.w150 ' + el.split('').join(' ').replace('/','SLASH') + '.w250 ENTER.w150')
  50.         },(i+1) * 550)
  51.     })
  52.  
  53.     setTimeout(eating,cmd.list.length*800);
  54. }
  55. else {
  56.     eating()
  57. }
  58. }
  59.  
  60. function eating() {
  61. if(countEat == Number(eat.duration / move.duration).toFixed()) {
  62.     countEat = 0;
  63.     let template = eat.hotkey + '.w150 ' + eat.key+'.down.w' + eat.time + ' ' + eat.key+'.up.w150 '+eat.hotkeyPickAxe+'.w150'
  64.     execute(template)
  65.     setTimeout(mine,eat.time+1500);
  66. }
  67. else {
  68.     mine()
  69. }
  70. }
  71.  
  72. function execute(temp) {
  73. console.log(temp)
  74. exec('java  -jar '+currentPath+'\\resources\\app\\app\\key-sender.jar '+temp)
  75. }
  76. setTimeout(()=>{
  77.   mainWindow.minimize();
  78.   mine()
  79. },2000)