关于-油猴插件(违规紫衫)
  • 板块灌水区
  • 楼主封禁用户
  • 当前回复2
  • 已保存回复2
  • 发布时间2023/12/30 16:46
  • 上次更新2024/6/2 19:07:45
查看原帖
关于-油猴插件(违规紫衫)
937773
封禁用户楼主2023/12/30 16:46

本人自己写了几个油猴代码,无病毒,看看能否帮助你,如果有错请指出,谢谢!!!(如有病毒可将我封号)

  1. 洛谷自动注册
// ==UserScript==  
// @name        洛谷自动注册  
// @namespace   http://example.com/  
// @description 自动完成洛谷网站的注册  
// @include     http://www.luogu.com.cn/*  
// @version     1  
// @grant       none  
// ==/UserScript==  
  
function register() {  
    var email = document.querySelector('.form-item:nth-child(2) input'); // 邮箱输入框  
    var name = document.querySelector('.form-item:nth-child(3) input'); // 用户名输入框  
    var pass = document.querySelector('.form-item:nth-child(4) input'); // 密码输入框  
    var pass2 = document.querySelector('.form-item:nth-child(5) input'); // 确认密码输入框  
    var captcha = document.querySelector('.form-item:nth-child(6) img'); // 验证码图片  
    var submitBtn = document.querySelector('.btn-submit'); // 提交按钮  
  
    email.value = '你的邮箱'; // 替换为你自己的邮箱  
    name.value = '你的用户名'; // 替换为你自己的用户名  
    pass.value = '你的密码'; // 替换为你自己的密码  
    pass2.value = '你的密码'; // 确认密码与密码相同,可保持一致  
  
    // 如果需要自动点击验证码,请取消注释以下代码,并确保在页面加载时执行。  
    // captcha.click();  
    // setTimeout(function() {  
    //     var captchaText = document.querySelector('.captcha-text'); // 验证码文本框  
    //     captchaText.value = '自动填写'; // 替换为你自己的验证码  
    // }, 1000);  
  
    submitBtn.click(); // 提交按钮点击事件  
}  
  
register(); // 执行注册函数

2.洛谷自动登录

// ==UserScript==  
// @name        洛谷自动登录  
// @namespace   http://example.com/  
// @description 自动完成洛谷网站的登录  
// @include     http://www.luogu.com.cn/*  
// @version     1  
// @grant       none  
// ==/UserScript==  
  
function login() {  
    var emailInput = document.querySelector('.form-item:nth-child(1) input'); // 邮箱输入框  
    var passInput = document.querySelector('.form-item:nth-child(3) input'); // 密码输入框  
    var loginBtn = document.querySelector('.btn-login'); // 登录按钮  
  
    emailInput.value = '你的邮箱'; // 替换为你自己的邮箱  
    passInput.value = '你的密码'; // 替换为你自己的密码  
  
    loginBtn.click(); // 登录按钮点击事件  
}  
  
login(); // 执行登录函数

3.美化插件

// ==UserScript==  
// @name        洛谷美化  
// @namespace   http://example.com/  
// @description 美化洛谷网站  
// @include     http://www.luogu.com.cn/*  
// @version     1  
// @grant       none  
// ==/UserScript==  
  
function beautify() {  
    // 添加背景图片  
    var body = document.querySelector('body');  
    body.style.backgroundImage = 'url(https://example.com/background.jpg)'; // 替换为你自己的背景图片链接  
    body.style.backgroundSize = 'cover'; // 背景图片覆盖整个页面  
    body.style.backgroundPosition = 'center'; // 背景图片居中  
  
    // 添加自定义CSS样式  
    var css = `  
        body {  
            font-family: Arial, sans-serif; // 字体设置为Arial或无衬线字体  
            color: #333; // 文本颜色设置为深灰色  
            padding: 20px; // 页面内边距设置为20像素  
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); // 页面添加阴影效果  
        }  
        h1, h2, h3 {  
            color: #ff0000; // 标题文本颜色设置为红色  
            text-transform: uppercase; // 标题文本转换为大写字母  
            font-weight: bold; // 标题文本加粗显示  
        }  
        p {  
            color: #666; // 段落文本颜色设置为中灰色  
            line-height: 1.5; // 行高设置为1.5倍,使文本更易读  
        }  
        a {  
            color: #007bff; // 链接文本颜色设置为蓝色  
            text-decoration: none; // 链接文本无下划线  
        }  
        /* 添加导航栏样式 */  
        nav {  
            background-color: #f8f9fa; // 导航栏背景颜色设置为浅灰色  
            padding: 10px; // 导航栏内边距设置为10像素  
        }  
        nav ul {  
            list-style-type: none; // 无列表符号  
            margin: 0; // 无外边距  
            padding: 0; // 无内边距  
        }  
        nav ul li {  
            display: inline-block; // 内联块元素显示,使其水平排列  
            margin-right: 10px; // 每项右侧外边距为10像素  
        }  
        nav ul li a {  
            color: #333; // 链接文本颜色设置为深灰色  
            text-decoration: none; // 链接文本无下划线  
        }
/* 添加侧边栏样式 */  
        aside {  
            background-color: #f2f2f2; // 侧边栏背景颜色设置为浅灰色  
            padding: 10px; // 侧边栏内边距设置为10像素  
        }  
        /* 添加弹出框样式 */  
        .modal {  
            display: none; // 默认隐藏弹出框  
            position: fixed; // 弹出框固定位置显示  
            z-index: 1; // 在页面顶部显示弹出框,覆盖其他元素  
            padding-top: 100px; // 上边距为100像素,根据需要调整位置  
            left: 0; // 对齐左边框位置居中  
            top: 0; // 对齐上边框位置居中  
            width: 100%; // 全屏宽度显示弹出框内容  
            height: 100%; // 全屏高度显示弹出框内容  
            overflow: auto; // 如果弹出框内容超出可见区域,允许滚动条出现(可选)  
            background-color: rgba(0, 0, 0, 0.4); // 设置弹出框背景颜色为半透明黑色,可根据需要调整透明度(可选)  
        }
    `;  
    var style = document.createElement('style');  
    style.type = 'text/css';  
    style.innerHTML = css;  
    document.head.appendChild(style);  
}  
  
beautify(); // 执行美化函数

最后,问下大家有没有好的油猴插件,谢谢

2023/12/30 16:46
加载中...