Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name phpschool
- // @namespace phpschool
- // @description phpschool automate
- // @author shj@xenosi.de
- // @include http://phpschool.com/*
- // @include http://www.phpschool.com/*
- // @include https://phpschool.com/*
- // @include https://www.phpschool.com/*
- // @version 1
- // @grant GM_getValue
- // @grant GM_setValue
- // @require https://code.jquery.com/jquery-3.1.1.min.js
- // ==/UserScript==
- $(function() {
- var userid = '******', passwd = '******', today = (new Date()).getDay();
- if($('form[name=fmblogin]').each(function() {
- this.mb_id.value = userid;
- this.mb_password.value = passwd;
- this.auto_login = 1;
- this.action = 'https://phpschool.com/gnuboard4/bbs/login_check.php';
- this.target = '_self';
- this.submit();
- }).length != 0) return;
- function goNotYet() {
- if(GM_getValue('usercheck', -1) != today) {
- location.href = 'http://phpschool.com/guild_new/guild_attend.php';
- return;
- }
- if(GM_getValue('guildcheck', -1) != today) {
- location.href = 'http://phpschool.com/guild_new/guild_attend_cmt.php';
- return;
- }
- if(GM_getValue('gbbcheck', -1) != today) {
- location.href = 'http://phpschool.com/community/rock_paper_scissors.php';
- return;
- }
- }
- setTimeout(function() {
- switch(location.href) {
- case 'https://www.phpschool.com/gnuboard4/bbs/member_confirm.php?url=register_form.php':
- case 'https://phpschool.com/gnuboard4/bbs/member_confirm.php?url=register_form.php':
- $('[name=mb_password]').val(passwd).closest('form').attr('action', 'register_form.php').trigger('submit');
- break;
- case 'http://phpschool.com/gnuboard4/bbs/write.php?bo_table=talkbox2':
- case 'http://www.phpschool.com/gnuboard4/bbs/write.php?bo_table=talkbox2':
- $('[name=wr_subject]').attr('autocomplete', 'off');
- break;
- case 'http://phpschool.com/guild_new/guild_attend.php':
- case 'http://www.phpschool.com/guild_new/guild_attend.php':
- var ret = true;
- $('td.today.btn_link').each(function() {
- if(GM_getValue('usercheck', -1) != today) {
- GM_setValue('usercheck', today);
- $(this).trigger('click');
- ret = false;
- }
- });
- if(ret) goNotYet();
- break;
- case 'http://phpschool.com/guild_new/guild_attend_cmt.php':
- case 'http://www.phpschool.com/guild_new/guild_attend_cmt.php':
- var ret = true;
- $('[name=fregisterform]').each(function() {
- if(GM_getValue('guildcheck', -1) != today) {
- GM_setValue('guildcheck', today);
- var c = ['ㅊ', 'c'], ch = c[Math.round(Math.random() * 1)], text = '';
- for(var i = 0; i < Math.ceil(Math.random() * 20 + 10); i++) {
- text += ch;
- }
- this.ga_memo.value = text;
- this.action = '/guild_new/guild_attend_cmt.php';
- ret = false;
- this.submit();
- }
- });
- if(ret) goNotYet();
- break;
- case 'http://phpschool.com/community/rock_paper_scissors.php':
- case 'http://www.phpschool.com/community/rock_paper_scissors.php':
- GM_setValue('gbbcheck', today);
- var rsps = ['rock', 'scissors', 'paper'];
- function clickOk() {
- var $ok = $('div.ui-dialog-buttonset button:first');
- if(!$ok.length) {
- setTimeout(clickOk, 600);
- return;
- }
- $ok.trigger('click');
- setTimeout(gameClickingStart, 1000);
- }
- function clickRSP() {
- var $rsp = $('#human input[name=' + rsps[Math.floor(Math.random() * 3)] + ']');
- if(!$rsp.length) {
- setTimeout(clickRSP, 600);
- return;
- }
- $rsp.trigger('click');
- clickOk();
- }
- function gameClickingStart() {
- var cnt = $('span.game_count').html() * 1;
- if(!cnt) return;
- $('#game_point').val('50');
- $('#gameStart').trigger('click');
- clickRSP();
- }
- gameClickingStart();
- break;
- case 'https://phpschool.com/gnuboard4/bbs/login_check.php':
- break;
- default:
- goNotYet();
- break;
- }
- }, 1000);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement