大连东软校园网自动连接2

校园网自动连接脚本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         大连东软校园网自动连接2
// @description  校园网自动连接脚本
// @author       BuKe, Class 19005, Department of Software Engineering, DNUI
// @email        [email protected] 
// @namespace    http://tampermonkey.net/
// @version      0.0.2
// @require      https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js
// @match        https://aaa.neusoft.edu.cn/
// @grant        window.close
// ==/UserScript==
$(function() {
   setTimeout(function(){   while(document.querySelector('#root > div > section:nth-child(3) > div > div:nth-child(2) > div > div.card-body > form > div:nth-child(2) > div:nth-child(1) > label')==null &&
                                  document.querySelector('#root > div > section:nth-child(3) > div > div:nth-child(2) > div > div.card-body > form > button') == null) {
   location.reload();
  }
  if(document.querySelector('#root > div > section:nth-child(3) > div > div:nth-child(2) > div > div.card-body > form > div:nth-child(2) > div:nth-child(1) > label')==null) {
      document.querySelector('#root > div > section:nth-child(3) > div > div:nth-child(2) > div > div.card-body > form > button').click();
    }else{
    document.getElementById(document.querySelector('#root > div > section:nth-child(3) > div > div:nth-child(2) > div > div.card-body > form > div:nth-child(2) > div:nth-child(1) > label').attributes["for"].value).checked=true; 
      document.querySelector('#root > div > section:nth-child(3) > div > div:nth-child(2) > div > div.card-body > form > button').click();
  } }, 500);
   setTimeout(function() {window.close();},1000);
})