更新 pokemon_cafe.js
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name pokemon
|
// @name pokemon_cafe_script
|
||||||
// @namespace http://tampermonkey.net/
|
// @namespace https://git.moonjuice.tw/moonjuice/pokemon_script
|
||||||
// @version 2024-01-25
|
// @version 2024-03-07
|
||||||
// @description try to take over the world!
|
// @description try to take over the world!
|
||||||
// @author You
|
// @author moonjuice
|
||||||
// @match https://reserve.pokemon-cafe.jp/*
|
// @match https://reserve.pokemon-cafe.jp/*
|
||||||
// @match https://osaka.pokemon-cafe.jp/*
|
// @match https://osaka.pokemon-cafe.jp/*
|
||||||
// @match file:///*
|
// @match file:///*
|
||||||
@@ -11,6 +11,8 @@
|
|||||||
// @grant GM_setValue
|
// @grant GM_setValue
|
||||||
// @grant GM_getValue
|
// @grant GM_getValue
|
||||||
// @run-at document-end
|
// @run-at document-end
|
||||||
|
// @downloadURL https://git.moonjuice.tw/moonjuice/pokemon_script/raw/branch/main/pokemon_cafe.js
|
||||||
|
// @updateURL https://git.moonjuice.tw/moonjuice/pokemon_script/raw/branch/main/pokemon_cafe.js
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
@@ -75,11 +77,14 @@
|
|||||||
|
|
||||||
function chooseSeat() {
|
function chooseSeat() {
|
||||||
var seatId = -1;
|
var seatId = -1;
|
||||||
|
GM_setValue('seat', '0');
|
||||||
|
GM_setValue('seatId', seatId);
|
||||||
if ($('.post-link').length && $('.post-link').length > 0) {
|
if ($('.post-link').length && $('.post-link').length > 0) {
|
||||||
//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 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 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'));
|
var a_seats = Array.from($('.post-link')).filter((element) => element.text.includes('A'));
|
||||||
|
if (location.hostname.startsWith('reserve')) { // tokyo => c seat first
|
||||||
|
var seats_1450 = Array.from($('.post-link')).filter((element) => element.text.includes('14:50'));
|
||||||
/*if (seats_1450.length > 0) {
|
/*if (seats_1450.length > 0) {
|
||||||
GM_setValue('seat', seats_1450[0].text);
|
GM_setValue('seat', seats_1450[0].text);
|
||||||
seatId = seats_1450[0].getAttribute('data-seat-id');
|
seatId = seats_1450[0].getAttribute('data-seat-id');
|
||||||
@@ -96,7 +101,19 @@ function chooseSeat() {
|
|||||||
GM_setValue('seat', $('.post-link')[0].text);
|
GM_setValue('seat', $('.post-link')[0].text);
|
||||||
seatId = $('.post-link')[0].getAttribute('data-seat-id');
|
seatId = $('.post-link')[0].getAttribute('data-seat-id');
|
||||||
}
|
}
|
||||||
GM_setValue('seatId', seatId);
|
} else { // osaka => A seat first
|
||||||
|
var seats_1350 = Array.from($('.post-link')).filter((element) => element.text.includes('13:50'));
|
||||||
|
/*if (seats_1350.length > 0) {
|
||||||
|
GM_setValue('seat', seats_1350[0].text);
|
||||||
|
seatId = seats_1350[0].getAttribute('data-seat-id');
|
||||||
|
} else*/ if (a_seats.length > 0) {
|
||||||
|
GM_setValue('seat', a_seats[0].text);
|
||||||
|
seatId = a_seats[0].getAttribute('data-seat-id');
|
||||||
|
} else {
|
||||||
|
GM_setValue('seat', $('.post-link')[0].text);
|
||||||
|
seatId = $('.post-link')[0].getAttribute('data-seat-id');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return seatId;
|
return seatId;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user