ibon抢票

一个帮助在ibon上抢票的小脚本

  1. // ==UserScript==
  2. // @name ibon抢票
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.5
  5. // @description 一个帮助在ibon上抢票的小脚本
  6. // @author 小鱼
  7. // @include https://*.ibon.com.tw/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. // 买票张数,默认1张
  12. // 买多张就把这个数字改成2,3或者4
  13. const ticketNumber = 1;
  14.  
  15. // 是否接受不连起来的的座位,默认是接受
  16. // 接受就把false改成true
  17. const sitTogether = false;
  18.  
  19. (function() {
  20. 'use strict';
  21.  
  22. // 尝试绕过流量限制
  23. if (typeof currentsecond != 'undefined' && currentsecond) {
  24. currentsecond = 1;
  25. }
  26.  
  27. if (typeof targetURL != 'undefined' && targetURL) {
  28. window.location = targetURL;
  29. }
  30.  
  31. // 第一步:购票方式强制选择“电脑配位”
  32. var buyTypeCheckbox = document.querySelector("#ctl00_ContentPlaceHolder1_BUY_TYPE_2");
  33. if (buyTypeCheckbox) buyTypeCheckbox.checked = true;
  34.  
  35. // 第二步:手动点击你想买的有票的区
  36. // 只有显示为“热卖中”和显示余数量的可以点
  37.  
  38. // 第三步:自动设置购买数量,默认为1
  39. var buyAmount = document.querySelector("#ctl00_ContentPlaceHolder1_DataGrid_ctl02_AMOUNT_DDL");
  40. if (buyAmount) buyAmount.value = ticketNumber;
  41.  
  42. // 第四步:设置不连位座位
  43. var sitTogetherCheckBox = document.querySelector("#ctl00_ContentPlaceHolder1_ATYPE");
  44. if (sitTogetherCheckBox) sitTogetherCheckBox.checked = !sitTogether;
  45.  
  46. // 第五步:自动把光标聚焦到验证码输入框
  47. var captchaBox = document.querySelector("#ctl00_ContentPlaceHolder1_CHK");
  48. if (captchaBox) captchaBox.focus();
  49.  
  50. // 第六步:手动输入验证码
  51.  
  52. // 第七步:回车,效果为自动点击“下一步”
  53. // 也就是提交订单
  54. document.onkeydown = function() {
  55. if (window.event.keyCode == "13") {
  56. document.querySelector("#ctl00_ContentPlaceHolder1_AddShopingCart").click();
  57. }
  58. };
  59.  
  60.  
  61. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址