wsmud_plugins_extends

武神传说 MUD

  1. // ==UserScript==
  2. // @name wsmud_plugins_extends
  3. // @namespace cqv
  4. // @version 0.0.3.10
  5. // @date 09/04/2021
  6. // @modified 20/10/2022
  7. // @homepage 网站链接
  8. // @description 武神传说 MUD
  9. // @author sasamila
  10. // @match http://game.wsmud.com/*
  11. // @match http://www.wsmud.com/*
  12. // @match http://wsmud.com/*
  13. // @match http://game.wamud.com/*
  14. // @match http://www.wamud.com/*
  15. // @match http://wamud.com/*
  16. // @run-at document-end
  17. // @grant unsafeWindow
  18. // @grant GM_getValue
  19. // @grant GM_setValue
  20. // @grant GM_addStyle
  21. // @license MIT
  22.  
  23.  
  24. // ==/UserScript==
  25.  
  26. (function () {
  27. 'use strict';
  28.  
  29. var WG = undefined;
  30. var T = undefined;
  31. var G = undefined;
  32. var messageAppend = undefined;
  33. var messageClear = undefined;
  34. $(document).ready(function () {
  35. var css = `.ext-item{
  36. display: inline-block;border: solid 1px gray;color: gray;background-color: black;
  37. text-align: center;cursor: pointer;border-radius: 0.25em;min-width: 2.5em;margin-right: 0em;
  38. margin-left: 0.4em;position: relative;padding-left: 0.4em;padding-right: 0.4em;line-height: 24px;}
  39. .WG_log{flex: 1;overflow-y: auto;border: 1px solid #404000;max-height: 15em;width: calc(100% - 40px);}
  40. .WG_log > pre{margin: 0px; white-space: pre-line;}
  41. .WG_button { width: calc(100% - 40px); overflow-x: auto;display: block;line-height:2em;}
  42. .WG_button > .ext-item:active {background-color: gray;color:black;}
  43. .item-plushp{display: inline-block;float: right;width: 100px;}
  44. .item-dps{display: inline-block;float: right;width: 100px;}
  45. .settingbox {margin-left: 0.625 em;border: 1px solid gray;background-color: transparent;color: unset;resize: none;width: 80% ;height: 3rem;}
  46. .runtest textarea{display:block;width:300px;height:160px;border:10px solid #F8F8F8;border-top-width:0;padding:10px;line-height:20px;overflow:auto;background-color:#3F3F3F;color:#eee;font-size:12px;font-family:Courier New}
  47. .layui-btn,.layui-input,.layui-select,.layui-textarea,.layui-upload-button{outline:0;-webkit-appearance:none;transition:all .3s;-webkit-transition:all .3s;box-sizing:border-box}
  48. .layui-btn{display:inline-block;height:38px;line-height:38px;padding:0 18px;background-color:#009688;color:#fff;white-space:nowrap;text-align:center;font-size:14px;border:none;border-radius:2px;cursor:pointer}
  49. .layui-btn-normal{background-color:#1E9FFF}
  50. .layui-layer-moves{background-color:transparent}
  51. .switch2 {display: inline-block;position: relative;height: 1.25em;width: 3.125em;line-height: 1.25em;
  52. border-radius: 0.875em;background: #dedede;cursor: pointer;-ms-user-select: none;-moz-user-select: none;
  53. -webkit-user-select: none;user-select: none;vertical-align: middle;text-align: center;}
  54. .switch2 > .switch-button {position: absolute;left: 0px;height: 1.25em;width: 1.25em;
  55. border-radius: 0.875em;background: #fff;box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  56. transition: 0.3s;-webkit-transition: 0.3s;left: 0px;}
  57. .switch2 > .switch-text {color:#898989;margin-left: 0.625em;}
  58. .on>.switch-button {right:0px;left:auto;}
  59. .on>.switch-text {color:#ffffff;margin-right: 0.625em; margin-left: 0px;}
  60. .on {background-color:#008000;}
  61. .crit{
  62. height:24px;
  63. position:relative;
  64. animation:myfirst 1s;
  65. -webkit-animation:myfirst 0.4s; /* Safari and Chrome */
  66. }
  67. @keyframes myfirst
  68. {
  69. 0% {background:red; left:0px; top:0px;}
  70. 33% {background:red; left:0px; top:-14px;}
  71. 66% {background:red; left:0px; top:14px;}
  72. 100% {background:red; left:0px; top:0px;}
  73. }
  74.  
  75. @-webkit-keyframes myfirst /* Safari and Chrome */
  76. {
  77. 0% {background:red; left:0px; top:0px;}
  78. 33% {background:red; left:0px; top:-30px;}
  79. 100% {background:red; left:0px; top:0px;}
  80. }
  81. .rainbow-text{
  82. color:red;
  83. background-image: repeating-linear-gradient(45deg, violet, indigo, blue, green, yellow, orange, red, violet);
  84. background-size:800% 800%;
  85. -webkit-background-clip: text;
  86. -webkit-text-fill-color: transparent;
  87. animation: rainbow 8s ease infinite;
  88. -webkit-animation: rainbow 8s ease infinite;
  89. }
  90. @keyframes rainbow
  91. {
  92. 0%{background-position:0% 50%}
  93. 50%{background-position:100% 25%}
  94. 100%{background-position:0% 50%}
  95. }`;
  96. GM_addStyle(css);
  97. setTimeout(function(){
  98. WG = unsafeWindow.WG;
  99. T = unsafeWindow.T;
  100. G = unsafeWindow.G;
  101.  
  102. G.SKILL={"unarmed":"none","force":"none","parry":"none","dodge":"none","sword":"none","throwing":"none","blade":"none","whip":"none","club":"none","staff":"none"};
  103. G.XLStatus = false;
  104. G.performSkills=[];
  105. WG.add_hook("status", function (data) {
  106. if (data.id == G.id && data.action == "add" && data.sid=='food' && data.name=="玄灵丹") {
  107. G.XLStatus=true;
  108. }else if (data.id == G.id && data.action == "remove"&& data.sid=='food'){
  109. G.XLStatus=false;
  110. }
  111. });
  112. WG.add_hook("perform", function (data) {
  113. G.performSkills=[];
  114. for (var skill of G.skills){
  115. G.performSkills.push(skill.id);
  116. }
  117. });
  118. WG.add_hook("dialog", function (data) {
  119. if (data.dialog == "skills") {
  120. if (data.items) {
  121. console.log(data.items)
  122. for (let item of data.items) {
  123. if (item.name.indexOf("基本") >= 0) {
  124. G.SKILL[item.id]=item.enable_skill
  125. }
  126. }
  127. }
  128. if (data.enable != undefined) {
  129. for (let item of G.enable_skills) {
  130. if (item.type == data.id) {
  131. item.name = data.enable
  132. break;
  133. }
  134. }
  135. }
  136. }
  137.  
  138.  
  139. });
  140. messageAppend = unsafeWindow.messageAppend;
  141. messageClear = unsafeWindow.messageClear;
  142. T.perform=async function (idx = 0, n, cmds) {
  143. if(G.in_fight){
  144. cmds = T.recmd(idx, cmds);
  145. WG.SendCmd("perform "+n+";"+cmds);
  146. }
  147. };
  148. T.skillPerform=async function (idx = 0, n, cmds) {
  149. if(G.in_fight){
  150. var sksp=n.split(".")
  151. cmds = T.recmd(idx, cmds);
  152. if (sksp[0]==G.SKILL[sksp[1]]){
  153. WG.SendCmd("perform "+sksp[1]+"."+sksp[2]+";"+cmds);
  154. }else{
  155. WG.SendCmd(cmds);
  156. }
  157. }
  158. };
  159. T.xperform=async function (idx = 0, n, cmds) {
  160. if(G.in_fight){
  161. cmds = T.recmd(idx, cmds);
  162. var inde=G.performSkills.indexOf(n);
  163. if (inde>=0){
  164. WG.SendCmd("perform "+n+";"+cmds);
  165. }else{
  166. WG.SendCmd(cmds);
  167. }
  168. }
  169. };
  170. T.cdpfm=async function (idx = 0, n, cmds) {
  171. if(G.in_fight){
  172. cmds = T.recmd(idx, cmds);
  173. var inde=G.performSkills.indexOf(n);
  174. if ( inde>=0 && ((!G.cds.has(n)) || (!G.cds.get(n))) ){
  175. WG.SendCmd("perform "+n+";"+cmds);
  176. }else{
  177. WG.SendCmd(cmds);
  178. }
  179. }
  180. };
  181. T.xuanling=async function (idx = 0, n, cmds) {
  182. while (!G.XLStatus){
  183. WG.SendCmd("use "+ n);
  184. await WG.sleep(2*G.wsdelay);
  185. }
  186. };
  187. $('.content-bottom').after(`<div class="ext-func"><span class="ext-item act-item-ext act-item">I</span><span class="ext-item act-item-ext act-item">II</span><span class="ext-item act-item-ext act-item">III</span><span class="ext-item act-item-ext act-item">IV</span><span class="ext-item act-item-ext act-item">V</span><span class="ext-item act-item-ext act-item">VI</span><span class="ext-item act-item-ext act-item">VII</span></div>`);
  188. $(".act-item-ext").on('click', function () {
  189. WG.SendCmd("$usezml "+this.textContent);
  190. });
  191. },200);
  192. });
  193. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址