Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. // ==UserScript==
  2. // @name MA - auto-login
  3. // @version 1.8
  4. // @description utility
  5. // @grant none
  6. // @require http://code.jquery.com/jquery-1.10.2.min.js
  7. // @require https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.bundle.min.js
  8. // @include http://www.meliorannis.com/*
  9. // ==/UserScript==
  10.  
  11. var username = 'xxx'
  12. var password = 'xxx'
  13.  
  14. function isLogged()
  15. {
  16. return $('#player_detail').length > 0
  17. }
  18.  
  19. if (!isLogged())
  20. {
  21. var loginForm = $("form[name='login']")
  22. var interval = Number(localStorage.autoLoginInterval) * 1000;
  23.  
  24. if (loginForm && localStorage.autoLogin === "true" && interval)
  25. {
  26. setTimeout(function()
  27. {
  28. $("input[name='loginname']").val(username);
  29. $("input[name='heslo']").val(password);
  30. $("form[name='login']").submit();
  31. }, interval);
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement