Advertisement
Guest User

Userscript v0.1

a guest
Sep 18th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. // ==UserScript==
  2. // @name New Userscript
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @match http://*/*
  8. // @match https://*/*
  9. // @grant none
  10. // @require http://code.jquery.com/jquery-2.4.1.min.js
  11.  
  12. // ==/UserScript==
  13.  
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. const cat = 1;
  19. const amount_wanted = 4;
  20. const accessToken = 'o.2rEB38gYHOlEY4IN3MN8xaAI6S8gbImz';
  21. const refreshTime = 1000; // In milliseconds //
  22. const maxTime = 20000 // This should be kept to a high-ish number as this is when the bot assumes its at the checkout //
  23.  
  24. // DO NOT EDIT BELOW THIS LINE //
  25.  
  26. const timer = window.setInterval(function(){
  27. const $pricingTable = jQuery('#price-table');
  28.  
  29. if($pricingTable.length){
  30. // if we're on the correct page, run the script //
  31. $pricingTable.find('select').each(function(index,value){
  32. console.log(index)
  33. // If its not the correct cat, ignore it //
  34. if(!index + 1 === cat){return false}
  35.  
  36. // Set the val of the select box //
  37. jQuery(this).val(amount_wanted);
  38. jQuery('#submitGrilleTarifs').trigger('click');
  39. })
  40. }
  41.  
  42. },refreshTime);
  43. const sendAlert = window.setTimeout(function(){
  44. var url = window.location.href;
  45.  
  46. if (url.search("billetterie.accorhotelsarena.com") >= 0) {
  47. // For some reason Jquery post didn't wanna do this, so horrible xmlhttp it is :( //
  48. var xmlhttp = new XMLHttpRequest();
  49. xmlhttp.open("POST", "https://api.pushbullet.com/v2/pushes", false);
  50. xmlhttp.setRequestHeader("Content-Type", "application/json");
  51. xmlhttp.setRequestHeader("Access-Token", accessToken);
  52. xmlhttp.send('{"body":"The Bot Stopped Working, So its either shit or you\'r on the checkout! Go!","title":"Accord Bot","type":"note"}');
  53. }else{
  54. // Do nothing //
  55. }
  56. },maxTime)
  57. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement