更新 pokemon_cafe.js
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
// @description try to take over the world!
|
||||
// @author You
|
||||
// @match https://reserve.pokemon-cafe.jp/*
|
||||
// @match https://osaka.pokemon-cafe.jp/*
|
||||
// @match file:///*
|
||||
// @icon https://reserve.pokemon-cafe.jp/assets/favicon-fa237093863d556ccbcc35094a79472be555cd11f4a1a7e16dc7a0a5cd71675c.ico
|
||||
// @grant GM_setValue
|
||||
@@ -16,7 +17,7 @@
|
||||
'use strict';
|
||||
const guest = 4;
|
||||
// Your code here...
|
||||
if ($('.button.arrow-down') != null && $('.button.arrow-down').length != 0) {
|
||||
/*if ($('.button.arrow-down') != null && $('.button.arrow-down').length != 0) {
|
||||
if (Array.isArray($('.button.arrow-down'))) {
|
||||
if ($('.button.arrow-down')[0].text.includes('Reloading')) {
|
||||
$('.button.arrow-down')[0].click();
|
||||
@@ -26,6 +27,11 @@
|
||||
$('.button.arrow-down').click();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
if (document.getElementsByClassName('button arrow-down').length == 1) {
|
||||
if (document.getElementsByClassName('button arrow-down')[0].text.includes('Reloading')) {
|
||||
document.getElementsByClassName('button arrow-down')[0].click();
|
||||
}
|
||||
}
|
||||
|
||||
if('/' == location.pathname) {
|
||||
@@ -41,6 +47,8 @@
|
||||
} else {
|
||||
let dt = new Date();
|
||||
dt.setDate(dt.getDate() + 31);
|
||||
//dt.setMonth(2);
|
||||
//dt.setDate(1);
|
||||
dt.setHours(17);
|
||||
dt.setMinutes(0);
|
||||
$('input[name=date]')[0].value = dt;
|
||||
@@ -54,35 +62,41 @@
|
||||
$('#hidden-form')[0].submit();
|
||||
} else {
|
||||
console.log('no seat');
|
||||
$('.button.button-secondary')[0].click();
|
||||
}
|
||||
} else {
|
||||
/*if (GM_getValue('seatId') != -1) {
|
||||
alert('快!!');
|
||||
}*/
|
||||
console.log(GM_getValue('seat'));
|
||||
console.log(GM_getValue('seatId'));
|
||||
}
|
||||
})();
|
||||
|
||||
function chooseSeat() {
|
||||
var seatId = -1;
|
||||
if ($('.post-link').length && $('.post-link').length > 0) {
|
||||
var seatId = -1;
|
||||
//var seats_1450 = Array.from($('.post-link')).filter((element) => element.text.includes('14:50'));
|
||||
var c_seats = Array.from($('.post-link')).filter((element) => element.text.includes('C'));
|
||||
var d_seats = Array.from($('.post-link')).filter((element) => element.text.includes('D'));
|
||||
var a_seats = Array.from($('.post-link')).filter((element) => element.text.includes('A'));
|
||||
if (c_seats.length > 0) {
|
||||
GM_setValue('seat', c_seats[0]);
|
||||
/*if (seats_1450.length > 0) {
|
||||
GM_setValue('seat', seats_1450[0].text);
|
||||
seatId = seats_1450[0].getAttribute('data-seat-id');
|
||||
} else*/ if (c_seats.length > 0) {
|
||||
GM_setValue('seat', c_seats[0].text);
|
||||
seatId = c_seats[0].getAttribute('data-seat-id');
|
||||
} else if (d_seats.length > 0) {
|
||||
GM_setValue('seat', d_seats[0]);
|
||||
GM_setValue('seat', d_seats[0].text);
|
||||
seatId = d_seats[0].getAttribute('data-seat-id');
|
||||
} else if (a_seats.length > 0) {
|
||||
GM_setValue('seat', a_seats[0]);
|
||||
GM_setValue('seat', a_seats[0].text);
|
||||
seatId = a_seats[0].getAttribute('data-seat-id');
|
||||
} else {
|
||||
GM_setValue('seat', $('.post-link')[0]);
|
||||
GM_setValue('seat', $('.post-link')[0].text);
|
||||
seatId = $('.post-link')[0].getAttribute('data-seat-id');
|
||||
}
|
||||
GM_setValue('seatId', seatId);
|
||||
return seatId;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
return seatId;
|
||||
}
|
||||
Reference in New Issue
Block a user