Common Framework

Framework to be used by most DF requesters/scripts

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/34464/227137/Common%20Framework.js

  1. // ==UserScript==
  2. // @name Common Framework
  3. // @version 0.6
  4. // @description Framework to be used by most DF requesters/scripts
  5. // @author A Meaty Alt
  6. // @grant none
  7. // ==/UserScript==
  8. var params = $("#flashAlt1")[0].children[0].value;
  9. var sc = params.match(/sc=(.*?)\&/)[1];
  10. var userId = params.match(/userID=(.*?)\&/)[1];
  11. var hashedPassword = params.match(/password=(.*?)\&/)[1];
  12. var pageTime = 0;
  13. getPagetime();
  14. function getPagetime(){
  15. $.get("https://fairview.deadfrontier.com/onlinezombiemmo/index.php?page=35",
  16. (response) => {
  17. pageTime = response.match(/pagetime=(.*?)\&/)[1];
  18. }
  19. );
  20. }
  21.  
  22. setInterval(getPagetime, 60000);
  23.  
  24. function buildSecureBody(){
  25. return {
  26. pagetime: pageTime,
  27. userID: userId,
  28. sc: sc,
  29. password: hashedPassword
  30. };
  31. }
  32.  
  33. function isOldFirefox(){
  34. var match = navigator.userAgent.match(/Firefox\/(.*?)\./);
  35. if(match){
  36. var version = match[1];
  37. return version <= 40;
  38. }
  39. return false;
  40. }
  41.  
  42. function isOldishFirefox(){
  43. var match = navigator.userAgent.match(/Firefox\/(.*?)\./);
  44. if(match){
  45. var version = match[1];
  46. return 40 < version && version <= 50;
  47. }
  48. return false;
  49. }