0

I have a website (not my own) to earn bitcoins every 60 min. So i have to click on roll button every 60 min. So i made a Siri shortcut to do it without opening Safari with scriptable. I have the code but when I put the code on Google Chrome Console its work perfectly and when I put it on Siri Shortcut I get this error:

ReferenceError can't find variable $

The code i have used :

(function() {
  'use strict';
  $('.roll-button').click(function() {
    window.onload = timedRefresh(4000);
    document.onkeydown = function() {
      if (event.keyCode == 116) {
        event.keyCode = 0;
        event.returnValue = false;
      }
    }
  });
  // set time out 5 sec
  setTimeout(function(e){
    $('.roll-button').trigger('click');
  }, 4000);
  e.stop();
  function timedRefresh(timeoutPeriod) {
    setTimeout("location.reload(true);",timeoutPeriod);
  }
})();
Alessio Cantarella
  • 5,077
  • 3
  • 27
  • 34
  • Not exactly related, but `window.onload` has most likely fired before `.roll-button` can be clicked. That means the timed function will never be executed. Also, `event` is read-only object, you can't set its properties, and `returnValue` does nothing in modern browsers. Related, have you linked jQuery to the file, and loaded it before trying to use the library? – Teemu Feb 12 '21 at 21:52
  • i don't have any files + i did not linked jquery becouse idk how to do it with sirishortcuts or scriptable. it will be awsome to help me with it – Fadi Nather Feb 12 '21 at 23:09

0 Answers0