Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name New Userscript
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match http://*/*
- // @match https://*/*
- // @grant none
- // @require http://code.jquery.com/jquery-2.4.1.min.js
- // ==/UserScript==
- (function() {
- 'use strict';
- const cat = 1;
- const amount_wanted = 4;
- const accessToken = 'o.2rEB38gYHOlEY4IN3MN8xaAI6S8gbImz';
- const refreshTime = 1000; // In milliseconds //
- const maxTime = 20000 // This should be kept to a high-ish number as this is when the bot assumes its at the checkout //
- // DO NOT EDIT BELOW THIS LINE //
- const timer = window.setInterval(function(){
- const $pricingTable = jQuery('#price-table');
- if($pricingTable.length){
- // if we're on the correct page, run the script //
- $pricingTable.find('select').each(function(index,value){
- console.log(index)
- // If its not the correct cat, ignore it //
- if(!index + 1 === cat){return false}
- // Set the val of the select box //
- jQuery(this).val(amount_wanted);
- jQuery('#submitGrilleTarifs').trigger('click');
- })
- }
- },refreshTime);
- const sendAlert = window.setTimeout(function(){
- var url = window.location.href;
- if (url.search("billetterie.accorhotelsarena.com") >= 0) {
- // For some reason Jquery post didn't wanna do this, so horrible xmlhttp it is :( //
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.open("POST", "https://api.pushbullet.com/v2/pushes", false);
- xmlhttp.setRequestHeader("Content-Type", "application/json");
- xmlhttp.setRequestHeader("Access-Token", accessToken);
- xmlhttp.send('{"body":"The Bot Stopped Working, So its either shit or you\'r on the checkout! Go!","title":"Accord Bot","type":"note"}');
- }else{
- // Do nothing //
- }
- },maxTime)
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement