Size
1.2 KB
Version
1.0.1
Created
Mar 19, 2026
Updated
2 days ago
1// ==UserScript==
2// @name Auto Pegar Vaga Módulo 18h
3// @description A new extension
4// @version 1.0.1
5// @match *://www.proeis.rj.gov.br/FrmEventoAssociar.aspx*
6// @grant none
7// ==/UserScript==
8(function() {
9 'use strict';
10
11 function normalizar(texto) {
12 return texto
13 .toUpperCase()
14 .normalize("NFD")
15 .replace(/[\u0300-\u036f]/g, "");
16 }
17
18 function tentarPegarVaga() {
19 let linhas = document.querySelectorAll("tr");
20
21 linhas.forEach(linha => {
22 let texto = normalizar(linha.innerText);
23
24 let ehModulo = texto.includes("MODULO");
25 let eh18h = texto.includes("18:00:00");
26 let temReserva = texto.includes("RESERVA");
27
28 // verifica se tem número (vaga disponível)
29 let temVaga = /\d+\s*-/.test(texto);
30
31 if (ehModulo && eh18h && !temReserva && temVaga) {
32
33 let botao = linha.querySelector("a, button, input");
34
35 if (botao) {
36 console.log("🔥 Vaga encontrada! Clicando...");
37 botao.click();
38 }
39 }
40 });
41 }
42
43 // roda várias vezes (tipo radar)
44 setInterval(tentarPegarVaga, 3000);
45
46})();