AoA:GE

Age of Aincrad: Guild Edition

当前为 2014-04-23 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name AoA:GE
  3. // @description Age of Aincrad: Guild Edition
  4. // @namespace https://greasyfork.org/scripts/492-aoa-ge
  5. // @include http://age-of-aincrad.com/game/?GameUI*
  6. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
  7. // @version 1.1
  8. // @author Haranobu
  9. // @grant GM_addStyle
  10. // ==/UserScript==
  11.  
  12. GM_addStyle ( " \
  13. body {\
  14. margin: 0px;\
  15. background: url('http://img4.wikia.nocookie.net/__cb20121223021437/swordartonline/images/4/40/Aincard_in_ALO.png') top center / 100% auto transparent !important;\
  16. height: 100% !important;\
  17. }\
  18. span{\
  19. font-family:aoaui;\
  20. color:#FFF !important;\
  21. font-size:30px;\
  22. }\
  23. p{\
  24. padding-top:2px;\
  25. font-family:aoaui;\
  26. color:#FFF !important;\
  27. }\
  28. #Profile_Container{\
  29. position:fixed;\
  30. padding-top:74px;\
  31. font-family:aoaiu;\
  32. display: inline-block;\
  33. padding-left:30px;\
  34. height:64px;\
  35. width:1000px !important;\
  36. border-radius:50px;\
  37. }\
  38. #Name_Container{\
  39. font-family:aoaiu;\
  40. color:#333;\
  41. height:94px;\
  42. width:450px;\
  43. display: inline-block;\
  44. vertical-align: middle;\
  45. border-radius:0px;\
  46. background:url('http://i.imgur.com/ZbX4E1E.png') no-repeat !important;\
  47. background-position:0px -20px !important;\
  48. }\
  49. #Name_Container>p{\
  50. margin: 5px -284px 10px 290px !important;\
  51. display: inline-block !important;\
  52. font-size:9px !important;\
  53. }\
  54. #Name_Container>span{\
  55. margin-top:11px !important;\
  56. margin-left:38px !important;\
  57. right:20px !important;\
  58. display:block !important;\
  59. font-size:21px !important;\
  60. }\
  61. #Profile_Container{\
  62. position:fixed !important;\
  63. padding-top:20px !important;\
  64. font-family:aoaiu !important;\
  65. display: inline-block !important;\
  66. padding-left:20px !important;\
  67. height:64px !important;\
  68. width:1000px !important;\
  69. border-radius:50px !important;\
  70. }\
  71. .Player_Icon{\
  72. font-family:aoaiu !important;\
  73. border:1px solid #e2e2e2 !important;\
  74. border-radius:50px !important;\
  75. height:50px !important;\
  76. width:50px !important;\
  77. box-shadow: 0px 0px 10px #000;\
  78. -webkit-transition: all 0.5s ease-out;\
  79. -moz-transition: all 0.5s ease-out;\
  80. -o-transition: all 0.5s ease-out;\
  81. }\
  82. .Player_Icon:hover{\
  83. font-family:aoaiu !important;\
  84. border:1px solid #ffb31f !important;\
  85. border-radius:50px !important;\
  86. height:50px !important;\
  87. width:50px !important;\
  88. box-shadow: 0px 0px 10px #000;\
  89. }\
  90. .window {\
  91. background: none repeat scroll 0% 0% #FFF;\
  92. display: none;\
  93. font-size: 16px;\
  94. box-shadow: 0px 0px 10px 2px #616161;\
  95. opacity: 0.75;\
  96. }\
  97. #Version_Container {\
  98. color: #FFF\
  99. }\
  100. #haranobu {\
  101. position: fixed;\
  102. bottom: 0px;\
  103. right: 5px;\
  104. font-family: sans-serif;\
  105. font-size: 10px;\
  106. color: #FFF\
  107. }\
  108. a {\
  109. color: #286fff;\
  110. text-decoration:none;\
  111. }\
  112. " );
  113.  
  114. $("body").append ( '\
  115. <div id="haranobu">\
  116. GM © <a href="http://age-of-aincrad.com/forum/members/haranobu.4401/">Haranobu</a>\
  117. </div>\
  118. ' );
  119.  
  120.  
  121. var SUC_script_num = 492-aoa-ge;
  122.  
  123. try
  124. {
  125. function updateCheck(forced)
  126. {
  127. if ((forced) || (parseInt(GM_getValue('SUC_last_update', '0')) + 86400000 <= (new Date().getTime()))) // Checks once a day (24 h * 60 m * 60 s * 1000 ms)
  128. {
  129. try
  130. {
  131. GM_xmlhttpRequest(
  132. {
  133. method: 'GET',
  134. url: 'https://greasyfork.org/scripts/'+SUC_script_num+'/code/AoA:GE.user.js'+new Date().getTime(),
  135. headers: {'Cache-Control': 'no-cache'},
  136. onload: function(resp)
  137. {
  138. var local_version, remote_version, rt, script_name;
  139. rt=resp.responseText;
  140. GM_setValue('SUC_last_update', new Date().getTime()+'');
  141. remote_version=parseInt(/@uso:version\s*(.*?)\s*$/m.exec(rt)[1]);
  142. local_version=parseInt(GM_getValue('SUC_current_version', '-1'));
  143. if(local_version!=-1)
  144. {
  145. script_name = (/@name\s*(.*?)\s*$/m.exec(rt))[1];
  146. GM_setValue('SUC_target_script_name', script_name);
  147. if (remote_version > local_version)
  148. {
  149. if(confirm('There is an update available for the Greasemonkey script "'+script_name+'."\nWould you like to go to the install page now?'))
  150. {
  151. GM_openInTab('https://greasyfork.org/scripts/'+SUC_script_num);
  152. GM_setValue('SUC_current_version', remote_version);
  153. }
  154. }
  155. else if (forced)
  156. alert('No update is available for "'+script_name+'."');
  157. }
  158. else
  159. GM_setValue('SUC_current_version', remote_version+'');
  160. }
  161. });
  162. }
  163. catch (err)
  164. {
  165. if (forced)
  166. alert('An error occurred while checking for updates:\n'+err);
  167. }
  168. }
  169. }
  170. GM_registerMenuCommand(GM_getValue('SUC_target_script_name', '???') + ' - Manual Update Check', function()
  171. {
  172. updateCheck(true);
  173. });
  174. updateCheck(false);
  175. }
  176. catch(err)
  177. {}