Picagem Automática do tiptip

Faz a picagem automática do tiptip, a partir das 8 faz picagem assim que abrir o tiptip, faz picagem para sair às 13, para voltar a entrar às 14 e saída novamente às 18

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Picagem Automática do tiptip
// @namespace   www.tiptip.pt
// @match       https://www.tiptip.pt/*
// @grant       none
// @version     1.2
// @license     MIT
// @author      Samuel Araújo
// @icon        https://www.tiptip.pt/public/img/iconTiptip.png
// @description Faz a picagem automática do tiptip, a partir das 8 faz picagem assim que abrir o tiptip, faz picagem para sair às 13, para voltar a entrar às 14 e saída novamente às 18
// ==/UserScript==

function fecharAlerta() {
  var alertaAberto = document.querySelector(".bootbox-alert");
  if (alertaAberto) {
    bootbox.hideAll();
  }
}

function isWeekend() {
  var hoje = new Date();
  var diaSemana = hoje.getDay(); 
  return (diaSemana === 0 || diaSemana === 6); 
}

function verificarHora() {
  var agora = new Date();
  var horas = agora.getHours();
  var minutos = agora.getMinutes();

  if (isWeekend() == false) {
    if ((horas >= 8 && horas < 12 || horas >= 14 && horas < 16) && picking_type === 0) {
      document.getElementById("play").click();
      console.log("Picagem de entrada");
      fecharAlerta();
    }
    else if ((horas >= 13 && horas < 14 || horas >= 18 && minutos > 5 ) && picking_type === 1) {
      document.getElementById("stop").click();
      console.log("Picagem de saída");
    }
  }
}

setInterval(verificarHora, 60000);