艦これ Script

艦これ 自動修改 cookie / 自動直連

  1. // ==UserScript==
  2. // @name 艦これ Script
  3. // @namespace KancolleZenta
  4. // @version 0.1
  5. // @description 艦これ 自動修改 cookie / 自動直連
  6. // @author ZENTA
  7. // @include http://www.dmm.com/netgame/social/-/gadgets/=/app_id=854854/
  8. // @include http://osapi.dmm.com/gadgets/*
  9. // @include http://*/kcs/*
  10. // @grant none
  11. // @icon http://otiai10.github.io/kanColleWidget/src/img/icon.png
  12. // ==/UserScript==
  13.  
  14. // alert("艦これ Script")
  15.  
  16. var loopfunc;
  17. var iNodeList, iNode;
  18.  
  19. loopfunc = function() {
  20. if (location.host == "www.dmm.com") {
  21. // 烤餅乾
  22. document.cookie="ckcy=1;expires=Sun, 09 Feb 2019 09:00:09 GMT;domain=osapi.dmm.com;path=/";
  23. document.cookie="ckcy=1;expires=Sun, 09 Feb 2019 09:00:09 GMT;domain=203.104.209.7;path=/";
  24. document.cookie="ckcy=1;expires=Sun, 09 Feb 2019 09:00:09 GMT;domain=www.dmm.com;path=/netgame/";
  25. document.cookie="ckcy=1;expires=Sun, 09 Feb 2019 09:00:09 GMT;domain=log-netgame.dmm.com;path=/";
  26. // 直連詢問
  27. var game_frame = document.getElementById('game_frame');
  28. if (game_frame === null)
  29. window.setTimeout(loopfunc, 100);
  30. else {
  31. var conf = confirm("要轉換到直連視窗嗎?");
  32. if (conf) {
  33. window.location.href = game_frame.getAttribute("src");
  34. }
  35. }
  36. } else if (location.host == "osapi.dmm.com") {
  37. var externalswf = document.getElementById('externalswf');
  38. if (externalswf === null) {
  39. var maintenanceswf = document.getElementById('maintenanceswf');
  40. if (maintenanceswf === null)
  41. window.setTimeout(loopfunc, 100);
  42. else
  43. alert("維修中!");
  44. }
  45. else
  46. {
  47. window.location.href = externalswf.getAttribute("src");
  48. }
  49. }
  50. };
  51.  
  52.  
  53.  
  54. if ((location.host == "www.dmm.com") ||
  55. (location.host == "osapi.dmm.com")) {
  56. window.setTimeout(loopfunc, 100);
  57. } else {
  58. iNodeList = document.querySelectorAll("embed");
  59. iNode = iNodeList.item(0);
  60. iNode.style.width = "800";
  61. iNode.style.height = "480";
  62. var line = document.createElement("br"); // hr
  63. iNode.parentNode.insertBefore(line, Node.nextSibling);
  64. var button_1 = document.createElement('input');
  65. button_1.type ="button"
  66. button_1.value = "50%";
  67. button_1.onclick = function onclick(event){changeSize(50);};
  68. var button_2 = document.createElement('input');
  69. button_2.type ="button"
  70. button_2.value = "75%";
  71. button_2.onclick = function onclick(event){changeSize(75);};
  72. var button_3 = document.createElement('input');
  73. button_3.type ="button"
  74. button_3.value = "100%";
  75. button_3.onclick = function onclick(event){changeSize(100);};
  76. line.parentNode.insertBefore(button_3, line.nextSibling);
  77. button_3.parentNode.insertBefore(button_2, button_3);
  78. button_2.parentNode.insertBefore(button_1, button_2);
  79. var button_Reload = document.createElement('input');
  80. button_Reload.type ="button"
  81. button_Reload.value = "Reload";
  82. button_Reload.onclick = function onclick(event){location.reload();};
  83. button_3.parentNode.insertBefore(button_Reload, button_3.nextSibling);
  84.  
  85. }
  86.  
  87. function changeSize(size) {
  88. iNode.style.width = 8*size;
  89. iNode.style.height = 4.8*size;
  90. }