Advertisement
Guest User

DresdenAutoBooking

a guest
Jul 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name DresdenAutoBooking
  3. // @namespace Violentmonkey Scripts
  4. // @grant none
  5. // ==/UserScript==
  6. //
  7.  
  8. let arrayForPlaces =
  9.     [{
  10.         idPlace: 14,
  11.         timeTOPlay: 69
  12.     },
  13.     {
  14.         idPlace: 15,
  15.         timeTOPlay: 72
  16.     },
  17.     {
  18.         idPlace: 16,
  19.         timeTOPlay: 75
  20.     }, {
  21.         idPlace: 28,
  22.         timeTOPlay: 66
  23.     }];
  24.  
  25.  
  26. function takingPlace() {
  27.  
  28.   let currentPlace = document.getElementsByName('freeTimeContainer:free_time.place')[0];
  29.  
  30.   if (typeof(currentPlace) !== 'undefined') {
  31.    
  32.     currentPlace = currentPlace.selectedIndex;
  33.        
  34.     for (let obj in arrayForPlaces) {
  35.        if (currentPlace === arrayForPlaces[obj].idPlace) {
  36.                    
  37.        let x;
  38.            x = document.getElementsByClassName('content')[arrayForPlaces[obj].timeTOPlay];
  39.            if (typeof(x) !== 'undefined') {
  40.               x = x.firstElementChild;
  41.               x.click();
  42.               x.form.submit();
  43.            }
  44.          }
  45.       }
  46.    }  
  47. }
  48.  
  49. takingPlace();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement