Dyskusje » Tworzenie skryptów
// ==UserScript==// @name 知苗抢票// @namespace http://tampermonkey.net/// @version 0.1// @description 一个在知苗上抢票的小助手// @author sfdye// @match #小程序://知苗易约/首页/KNeKNPsfxPd3vyF// @grant none// ==/UserScript==// 设置抢票张数const ticAmount = 8;// 设置抢票区域const section = "B";(function() { 'use strict'; var areaObj = getAreaBySec(section); if (areaObj) { // 设置区域 jQuery('div#section-sel').html('YOUR PREFERRED SECTION IS '+ areaObj.description.replace(/ *\<[^)]*\> */g, "") + ''); assignPrice(areaObj); } var ticQuantity = document.getElementById("qty_0"); // 设置张数 if (ticQuantity) ticQuantity.value = ticAmount; var capKey = document.getElementById("capKey"); if (capKey) capKey.focus(); var addtocart = document.getElementById("addtocart-btn"); if (addtocart) { // 提交 addtocart.click(); }})();
Zaloguj się, by odpowiedzieć.
// ==UserScript==
// @name 知苗抢票
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 一个在知苗上抢票的小助手
// @author sfdye
// @match #小程序://知苗易约/首页/KNeKNPsfxPd3vyF
// @grant none
// ==/UserScript==
// 设置抢票张数
const ticAmount = 8;
// 设置抢票区域
const section = "B";
(function() {
'use strict';
var areaObj = getAreaBySec(section);
if (areaObj) {
// 设置区域
jQuery('div#section-sel').html('YOUR PREFERRED SECTION IS '+ areaObj.description.replace(/ *\<[^)]*\> */g, "") + '');
assignPrice(areaObj);
}
var ticQuantity = document.getElementById("qty_0");
// 设置张数
if (ticQuantity) ticQuantity.value = ticAmount;
var capKey = document.getElementById("capKey");
if (capKey) capKey.focus();
var addtocart = document.getElementById("addtocart-btn");
if (addtocart) {
// 提交
addtocart.click();
}
})();