wsmud_pluginss

武神传说 MUD

当前为 2018-11-29 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name wsmud_pluginss
  3. // @namespace cqv1
  4. // @version 0.0.26.16
  5. // @date 01/07/2018
  6. // @modified 23/10/2018
  7. // @homepage https://greasyfork.org/zh-CN/scripts/374933
  8. // @description 武神传说 MUD
  9. // @author fjcqv(源程序) & zhzhwcn(提供websocket监听)& knva(做了一些微小的贡献)
  10. // @match http://game.wsmud.com/*
  11. // @run-at document-start
  12. // @require https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js
  13. // @require https://cdn.bootcss.com/jquery-contextmenu/3.0.0-beta.2/jquery.contextMenu.min.js
  14. // @grant unsafeWindow
  15. // @grant GM_addStyle
  16. // @grant GM_getValue
  17. // @grant GM_setValue
  18. // @grant GM_setClipboard
  19.  
  20. // ==/UserScript==
  21.  
  22. (function () {
  23. 'use strict';
  24. var updateinfo = "增加自动施法开关设置";
  25.  
  26. Array.prototype.baoremove = function (dx) {
  27. if (isNaN(dx) || dx > this.length) {
  28. return false;
  29. }
  30. this.splice(dx, 1);
  31. }
  32.  
  33. if (WebSocket) {
  34. console.log('插件可正常运行,Plugins can run normally');
  35. var _ws = WebSocket,
  36. ws, ws_on_message;
  37. unsafeWindow.WebSocket = function (uri) {
  38. ws = new _ws(uri);
  39. };
  40. unsafeWindow.WebSocket.prototype = {
  41. CONNECTING: _ws.CONNECTING,
  42. OPEN: _ws.OPEN,
  43. CLOSING: _ws.CLOSING,
  44. CLOSED: _ws.CLOSED,
  45. get url() {
  46. return ws.url;
  47. },
  48. get protocol() {
  49. return ws.protocol;
  50. },
  51. get readyState() {
  52. return ws.readyState;
  53. },
  54. get bufferedAmount() {
  55. return ws.bufferedAmount;
  56. },
  57. get extensions() {
  58. return ws.extensions;
  59. },
  60. get binaryType() {
  61. return ws.binaryType;
  62. },
  63. set binaryType(t) {
  64. ws.binaryType = t;
  65. },
  66. get onopen() {
  67. return ws.onopen;
  68. },
  69. set onopen(fn) {
  70. ws.onopen = fn;
  71. },
  72. get onmessage() {
  73. return ws.onmessage;
  74. },
  75. set onmessage(fn) {
  76. ws_on_message = fn;
  77. ws.onmessage = WG.receive_message;
  78. },
  79. get onclose() {
  80. return ws.onclose;
  81. },
  82. set onclose(fn) {
  83. ws.onclose = fn;
  84. },
  85. get onerror() {
  86. return ws.onerror;
  87. },
  88. set onerror(fn) {
  89. ws.onerror = fn;
  90. },
  91. send: function (text) {
  92.  
  93. ws.send(text);
  94. },
  95. close: function () {
  96. ws.close();
  97. }
  98. };
  99. } else {
  100. console.log("插件不可运行,请打开'https://greasyfork.org/zh-CN/forum/discussion/41547/x',按照操作步骤进行操作,Plugins are not functioning properly.plase open https://greasyfork.org/zh-CN/forum/discussion/41547/x");
  101. }
  102. var roomItemSelectIndex = -1;
  103. var timer = 0;
  104. var cnt = 0;
  105. var zb_npc;
  106. var zb_place;
  107. var next = 0;
  108. var roomData = [];
  109.  
  110. var blacklist = ['张无忌', '天山童姥', '枯荣大师', '赵三拳', '洪安通','何红药', '何铁手'];
  111. var blackpfm = ['unarmed.duo'];
  112. var needfind = {
  113. "武当派-林间小径": ["go south"],
  114. "峨眉派-走廊": ["go north", "go south;go south", "go north;go east;go east"],
  115. "丐帮-暗道": ["go east", "go east;go east", "go east"],
  116. "逍遥派-林间小道": ["go west;go north", "go south;go south", "go north;go west"],
  117. "少林派-竹林": ["go north"],
  118. "逍遥派-地下石室": ["go up"],
  119. "逍遥派-木屋": ["go south;go south;go south;go south"]
  120. };
  121. var store_list = [
  122. "<hic>红宝石</hic>",
  123. "<hic>黄宝石</hic>",
  124. "<hic>蓝宝石</hic>",
  125. "<hic>绿宝石</hic>",
  126. "<hiy>精致的红宝石</hiy>",
  127. "<hiy>精致的黄宝石</hiy>",
  128. "<hiy>精致的蓝宝石</hiy>",
  129. "<hiy>精致的绿宝石</hiy>",
  130. "<hiz>完美的红宝石</hiz>",
  131. "<hiz>完美的黄宝石</hiz>",
  132. "<hiz>完美的蓝宝石</hiz>",
  133. "<hiz>完美的绿宝石</hiz>",
  134. "<wht>基本内功秘籍</wht>",
  135. "<wht>基本轻功秘籍</wht>",
  136. "<wht>基本招架秘籍</wht>",
  137. "<wht>基本剑法秘籍</wht>",
  138. "<wht>基本刀法秘籍</wht>",
  139. "<wht>基本拳脚秘籍</wht>",
  140. "<wht>基本暗器秘籍</wht>",
  141. "<wht>基本棍法秘籍</wht>",
  142. "<wht>基本鞭法秘籍</wht>",
  143. "<wht>基本杖法秘籍</wht>",
  144. "<wht>动物皮毛</wht>",
  145. "<wht>家丁服</wht>",
  146. "<wht>家丁鞋</wht>",
  147. "<hig>五虎断门刀残页</hig>",
  148. "<hig>太祖长拳残页</hig>",
  149. "<hig>流氓巾</hig>",
  150. "<hig>流氓衣</hig>",
  151. "<hig>流氓鞋</hig>",
  152. "<hig>流氓护腕</hig>",
  153. "<hig>流氓短剑</hig>",
  154. "<hig>流氓闷棍</hig>",
  155. "<hig>军服</hig>",
  156. "<hig>官服</hig>",
  157. "<hic>崔莺莺的手镯</hic>",
  158. "<hig>崔员外的戒指</hig>",
  159. "<hig>黑虎单刀</hig>",
  160. "<hig>员外披肩</hig>",
  161. "<hig>短衣劲装</hig>",
  162. "进阶残页",
  163. "聚气丹",
  164. "师门令牌",
  165. "喜宴",
  166. "突破丹"
  167. ];
  168. var goods = {
  169. //扬州城-醉仙楼-店小二
  170. "米饭": {
  171. "id": null,
  172. "sales": "店小二",
  173. place: "扬州城-醉仙楼"
  174. },
  175. "包子": {
  176. "id": null,
  177. "sales": "店小二",
  178. place: "扬州城-醉仙楼"
  179. },
  180. "鸡腿": {
  181. "id": null,
  182. "sales": "店小二",
  183. place: "扬州城-醉仙楼"
  184. },
  185. "面条": {
  186. "id": null,
  187. "sales": "店小二",
  188. place: "扬州城-醉仙楼"
  189. },
  190. "扬州炒饭": {
  191. "id": null,
  192. "sales": "店小二",
  193. place: "扬州城-醉仙楼"
  194. },
  195. "米酒": {
  196. "id": null,
  197. "sales": "店小二",
  198. place: "扬州城-醉仙楼"
  199. },
  200. "花雕酒": {
  201. "id": null,
  202. "sales": "店小二",
  203. place: "扬州城-醉仙楼"
  204. },
  205. "女儿红": {
  206. "id": null,
  207. "sales": "店小二",
  208. place: "扬州城-醉仙楼"
  209. },
  210. "醉仙酿": {
  211. "id": null,
  212. "sales": "店小二",
  213. place: "扬州城-醉仙楼"
  214. },
  215. "神仙醉": {
  216. "id": null,
  217. "sales": "店小二",
  218. place: "扬州城-醉仙楼"
  219. },
  220. //扬州城-杂货铺
  221. "布衣": {
  222. "id": null,
  223. "sales": "杂货铺老板 杨永福",
  224. place: "扬州城-杂货铺"
  225. },
  226. "钢刀": {
  227. "id": null,
  228. "sales": "杂货铺老板 杨永福",
  229. place: "扬州城-杂货铺"
  230. },
  231. "木棍": {
  232. "id": null,
  233. "sales": "杂货铺老板 杨永福",
  234. place: "扬州城-杂货铺"
  235. },
  236. "英雄巾": {
  237. "id": null,
  238. "sales": "杂货铺老板 杨永福",
  239. place: "扬州城-杂货铺"
  240. },
  241. "布鞋": {
  242. "id": null,
  243. "sales": "杂货铺老板 杨永福",
  244. place: "扬州城-杂货铺"
  245. },
  246. "铁戒指": {
  247. "id": null,
  248. "sales": "杂货铺老板 杨永福",
  249. place: "扬州城-杂货铺"
  250. },
  251. "簪子": {
  252. "id": null,
  253. "sales": "杂货铺老板 杨永福",
  254. place: "扬州城-杂货铺"
  255. },
  256. "长鞭": {
  257. "id": null,
  258. "sales": "杂货铺老板 杨永福",
  259. place: "扬州城-杂货铺"
  260. },
  261. "钓鱼竿": {
  262. "id": null,
  263. "sales": "杂货铺老板 杨永福",
  264. place: "扬州城-杂货铺"
  265. },
  266. "鱼饵": {
  267. "id": null,
  268. "sales": "杂货铺老板 杨永福",
  269. place: "扬州城-杂货铺"
  270. },
  271.  
  272. //扬州城-打铁铺
  273. "铁剑": {
  274. "id": null,
  275. "sales": "铁匠铺老板 铁匠",
  276. place: "扬州城-打铁铺"
  277. },
  278. "钢刀": {
  279. "id": null,
  280. "sales": "铁匠铺老板 铁匠",
  281. place: "扬州城-打铁铺"
  282. },
  283. "铁棍": {
  284. "id": null,
  285. "sales": "铁匠铺老板 铁匠",
  286. place: "扬州城-打铁铺"
  287. },
  288. "铁杖": {
  289. "id": null,
  290. "sales": "铁匠铺老板 铁匠",
  291. place: "扬州城-打铁铺"
  292. },
  293. "铁镐": {
  294. "id": null,
  295. "sales": "铁匠铺老板 铁匠",
  296. place: "扬州城-打铁铺"
  297. },
  298.  
  299. //扬州城-药铺
  300. "金创药": {
  301. "id": null,
  302. "sales": "药铺老板 平一指",
  303. place: "扬州城-药铺"
  304. },
  305. "引气丹": {
  306. "id": null,
  307. "sales": "药铺老板 平一指",
  308. place: "扬州城-药铺"
  309. },
  310. "养精丹": {
  311. "id": null,
  312. "sales": "药铺老板 平一指",
  313. place: "扬州城-药铺"
  314. },
  315. };
  316. var equip = {
  317. "铁镐": 0,
  318. };
  319. var npcs = {
  320. "店小二": 0
  321. };
  322. var place = {
  323. "住房": "jh fam 0 start;go west;go west;go north;go enter",
  324. "练功房": "jh fam 0 start;go west;go west;go north;go enter;go west;xiulian",
  325. "仓库": "jh fam 0 start;go north;go west;store",
  326. "扬州城-醉仙楼": "jh fam 0 start;go north;go north;go east",
  327. "扬州城-杂货铺": "jh fam 0 start;go east;go south",
  328. "扬州城-打铁铺": "jh fam 0 start;go east;go east;go south",
  329. "扬州城-药铺": "jh fam 0 start;go east;go east;go north",
  330. "扬州城-衙门正厅": "jh fam 0 start;go west;go north;go north",
  331. "扬州城-矿山": "jh fam 0 start;go west;go west;go west;go west",
  332. "扬州城-喜宴": "jh fam 0 start;go north;go north;go east;go up",
  333. "扬州城-擂台": "jh fam 0 start;go west;go south",
  334. "扬州城-当铺": "jh fam 0 start;go south;go east",
  335. "扬州城-帮派": "jh fam 0 start;go south;go south;go east",
  336. "扬州城-扬州武馆": "jh fam 0 start;go south;go south;go west",
  337. "扬州城-武庙": "jh fam 0 start;go north;go north;go west",
  338. "武当派-广场": "jh fam 1 start;",
  339. "武当派-三清殿": "jh fam 1 start;go north",
  340. "武当派-石阶": "jh fam 1 start;go west",
  341. "武当派-练功房": "jh fam 1 start;go west;go west",
  342. "武当派-太子岩": "jh fam 1 start;go west;go northup",
  343. "武当派-桃园小路": "jh fam 1 start;go west;go northup;go north",
  344. "武当派-舍身崖": "jh fam 1 start;go west;go northup;go north;go east",
  345. "武当派-南岩峰": "jh fam 1 start;go west;go northup;go north;go west",
  346. "武当派-乌鸦岭": "jh fam 1 start;go west;go northup;go north;go west;go northup",
  347. "武当派-五老峰": "jh fam 1 start;go west;go northup;go north;go west;go northup;go northup",
  348. "武当派-虎头岩": "jh fam 1 start;go west;go northup;go north;go west;go northup;go northup;go northup",
  349. "武当派-朝天宫": "jh fam 1 start;go west;go northup;go north;go west;go northup;go northup;go northup;go north",
  350. "武当派-三天门": "jh fam 1 start;go west;go northup;go north;go west;go northup;go northup;go northup;go north;go north",
  351. "武当派-紫金城": "jh fam 1 start;go west;go northup;go north;go west;go northup;go northup;go northup;go north;go north;go north",
  352. "武当派-林间小径": "jh fam 1 start;go west;go northup;go north;go west;go northup;go northup;go northup;go north;go north;go north;go north;go north",
  353. "武当派-后山小院": "jh fam 1 start;go west;go northup;go north;go west;go northup;go northup;go northup;go north;go north;go north;go north;go north;go north",
  354. "少林派-广场": "jh fam 2 start;",
  355. "少林派-山门殿": "jh fam 2 start;go north",
  356. "少林派-东侧殿": "jh fam 2 start;go north;go east",
  357. "少林派-西侧殿": "jh fam 2 start;go north;go west",
  358. "少林派-天王殿": "jh fam 2 start;go north;go north",
  359. "少林派-大雄宝殿": "jh fam 2 start;go north;go north;go northup",
  360. "少林派-钟楼": "jh fam 2 start;go north;go north;go northeast",
  361. "少林派-鼓楼": "jh fam 2 start;go north;go north;go northwest",
  362. "少林派-后殿": "jh fam 2 start;go north;go north;go northwest;go northeast",
  363. "少林派-练武场": "jh fam 2 start;go north;go north;go northwest;go northeast;go north",
  364. "少林派-罗汉堂": "jh fam 2 start;go north;go north;go northwest;go northeast;go north;go east",
  365. "少林派-般若堂": "jh fam 2 start;go north;go north;go northwest;go northeast;go north;go west",
  366. "少林派-方丈楼": "jh fam 2 start;go north;go north;go northwest;go northeast;go north;go north",
  367. "少林派-戒律院": "jh fam 2 start;go north;go north;go northwest;go northeast;go north;go north;go east",
  368. "少林派-达摩院": "jh fam 2 start;go north;go north;go northwest;go northeast;go north;go north;go west",
  369. "少林派-竹林": "jh fam 2 start;go north;go north;go northwest;go northeast;go north;go north;go north;go north",
  370. "少林派-藏经阁": "jh fam 2 start;go north;go north;go northwest;go northeast;go north;go north;go north;go west",
  371. "少林派-达摩洞": "jh fam 2 start;go north;go north;go northwest;go northeast;go north;go north;go north;go north;go north",
  372. "华山派-镇岳宫": "jh fam 3 start;",
  373. "华山派-苍龙岭": "jh fam 3 start;go eastup",
  374. "华山派-舍身崖": "jh fam 3 start;go eastup;go southup",
  375. "华山派-峭壁": "jh fam 3 start;go eastup;go southup;jumpdown",
  376. "华山派-山谷": "jh fam 3 start;go eastup;go southup;jumpdown;go southup",
  377. "华山派-山间平地": "jh fam 3 start;go eastup;go southup;jumpdown;go southup;go south",
  378. "华山派-林间小屋": "jh fam 3 start;go eastup;go southup;jumpdown;go southup;go south;go east",
  379. "华山派-玉女峰": "jh fam 3 start;go westup",
  380. "华山派-玉女祠": "jh fam 3 start;go westup;go west",
  381. "华山派-练武场": "jh fam 3 start;go westup;go north",
  382. "华山派-练功房": "jh fam 3 start;go westup;go north;go east",
  383. "华山派-客厅": "jh fam 3 start;go westup;go north;go north",
  384. "华山派-偏厅": "jh fam 3 start;go westup;go north;go north;go east",
  385. "华山派-寝室": "jh fam 3 start;go westup;go north;go north;go north",
  386. "华山派-玉女峰山路": "jh fam 3 start;go westup;go south",
  387. "华山派-玉女峰小径": "jh fam 3 start;go westup;go south;go southup",
  388. "华山派-思过崖": "jh fam 3 start;go westup;go south;go southup;go southup",
  389. "华山派-山洞": "jh fam 3 start;go westup;go south;go southup;go southup;break bi;go enter",
  390. "华山派-长空栈道": "jh fam 3 start;go westup;go south;go southup;go southup;break bi;go enter;go westup",
  391. "华山派-落雁峰": "jh fam 3 start;go westup;go south;go southup;go southup;break bi;go enter;go westup;go westup",
  392. "华山派-华山绝顶": "jh fam 3 start;go westup;go south;go southup;go southup;break bi;go enter;go westup;go westup;jumpup",
  393. "峨眉派-金顶": "jh fam 4 start",
  394. "峨眉派-庙门": "jh fam 4 start;go west",
  395. "峨眉派-广场": "jh fam 4 start;go west;go south",
  396. "峨眉派-走廊": "jh fam 4 start;go west;go south;go west",
  397. "峨眉派-休息室": "jh fam 4 start;go west;go south;go east;go south",
  398. "峨眉派-厨房": "jh fam 4 start;go west;go south;go east;go east",
  399. "峨眉派-练功房": "jh fam 4 start;go west;go south;go west;go west",
  400. "峨眉派-小屋": "jh fam 4 start;go west;go south;go west;go north;go north",
  401. "峨眉派-清修洞": "jh fam 4 start;go west;go south;go west;go south;go south",
  402. "峨眉派-大殿": "jh fam 4 start;go west;go south;go south",
  403. "峨眉派-睹光台": "jh fam 4 start;go northup",
  404. "峨眉派-华藏庵": "jh fam 4 start;go northup;go east",
  405. "逍遥派-青草坪": "jh fam 5 start",
  406. "逍遥派-林间小道": "jh fam 5 start;go east",
  407. "逍遥派-练功房": "jh fam 5 start;go east;go north",
  408. "逍遥派-木板路": "jh fam 5 start;go east;go south",
  409. "逍遥派-工匠屋": "jh fam 5 start;go east;go south;go south",
  410. "逍遥派-休息室": "jh fam 5 start;go west;go south",
  411. "逍遥派-木屋": "jh fam 5 start;go north;go north",
  412. "逍遥派-地下石室": "jh fam 5 start;go down;go down",
  413. "丐帮-树洞内部": "jh fam 6 start",
  414. "丐帮-树洞下": "jh fam 6 start;go down",
  415. "丐帮-暗道": "jh fam 6 start;go down;go east",
  416. "丐帮-破庙密室": "jh fam 6 start;go down;go east;go east;go east",
  417. "丐帮-土地庙": "jh fam 6 start;go down;go east;go east;go east;go up",
  418. "丐帮-林间小屋": "jh fam 6 start;go down;go east;go east;go east;go east;go east;go up",
  419. "襄阳城-广场": "jh fam 7 start",
  420. "武道塔": "jh fam 8 start"
  421. };
  422. var drop_list = [];
  423. var fenjie_list = [];
  424.  
  425. var role;
  426. var family = null;
  427. var sm_loser = null;
  428. var wudao_pfm = "1";
  429. var ks_pfm = "2000";
  430. var automarry = null;
  431. var autoKsBoss = null;
  432. var showHP = null;
  433. var eqlist = {1: [], 2: [],3: []};
  434. var unauto_pfm = '';
  435. var auto_pfmswitch = null;
  436. var autoeq = 0;
  437. //快捷键功能
  438. var KEY = {
  439. keys: [],
  440. roomItemSelectIndex: -1,
  441. init: function () {
  442. //添加快捷键说明
  443. $("span[command=stopstate] span:eq(0)").html("S");
  444. $("span[command=showcombat] span:eq(0)").html("A");
  445. $("span[command=showtool] span:eq(0)").html("C");
  446. $("span[command=pack] span:eq(0)").html("B");
  447. $("span[command=tasks] span:eq(0)").html("L");
  448. $("span[command=score] span:eq(0)").html("O");
  449. $("span[command=jh] span:eq(0)").html("J");
  450. $("span[command=skills] span:eq(0)").html("K");
  451. $("span[command=message] span:eq(0)").html("U");
  452. $("span[command=shop] span:eq(0)").html("P");
  453. $("span[command=stats] span:eq(0)").html("I");
  454. $("span[command=setting] span:eq(0)").html(",");
  455.  
  456. $(document).on("keydown", this.e);
  457.  
  458. this.add(27, function () {KEY.dialog_close();});
  459. this.add(192, function () {$(".map-icon").click();});
  460. this.add(32, function () {KEY.dialog_confirm();});
  461. this.add(83, function () {KEY.do_command("stopstate");});
  462. this.add(13, function () {KEY.do_command("showchat");});
  463. this.add(65, function () {KEY.do_command("showcombat");});
  464. this.add(67, function () {KEY.do_command("showtool");});
  465. this.add(66, function () {KEY.do_command("pack");});
  466. this.add(76, function () { KEY.do_command("tasks"); });
  467. this.add(79, function () {KEY.do_command("score");});
  468. this.add(74, function () {KEY.do_command("jh");});
  469. this.add(75, function () {KEY.do_command("skills");});
  470. this.add(73, function () {KEY.do_command("stats");});
  471. this.add(85, function () {KEY.do_command("message");});
  472. this.add(80, function () {KEY.do_command("shop");});
  473. this.add(188, function () {KEY.do_command("setting");});
  474.  
  475. this.add(81, function () { WG.sm_button();});
  476. this.add(87, function () {WG.go_yamen_task();});
  477. this.add(69, function () {WG.kill_all();});
  478. this.add(82, function () {WG.get_all();});
  479. this.add(84, function () {WG.sell_all();});
  480. this.add(89, function () {WG.zdwk();});
  481.  
  482. this.add(9, function () {//TAB
  483. KEY.onRoomItemSelect();
  484. return false;
  485. });
  486.  
  487. //方向
  488. this.add(102, function () {
  489. WG.Send("go east");
  490. KEY.onChangeRoom();
  491. });
  492. this.add(39, function () {
  493. WG.Send("go east");
  494. KEY.onChangeRoom();
  495. });
  496. this.add(100, function () {
  497. WG.Send("go west");
  498. KEY.onChangeRoom();
  499. });
  500. this.add(37, function () {
  501. WG.Send("go west");
  502. KEY.onChangeRoom();
  503. });
  504. this.add(98, function () {
  505. WG.Send("go south");
  506. KEY.onChangeRoom();
  507. });
  508. this.add(40, function () {
  509. WG.Send("go south");
  510. KEY.onChangeRoom();
  511. });
  512. this.add(104, function () {
  513. WG.Send("go go north");
  514. KEY.onChangeRoom();
  515. });
  516. this.add(38, function () {
  517. WG.Send("go north");
  518. KEY.onChangeRoom();
  519. });
  520. this.add(99, function () {
  521. WG.Send("go southeast");
  522. KEY.onChangeRoom();
  523. });
  524. this.add(97, function () {
  525. WG.Send("go southwest");
  526. KEY.onChangeRoom();
  527. });
  528. this.add(105, function () {
  529. WG.Send("go northeast");
  530. KEY.onChangeRoom();
  531. });
  532. this.add(103, function () {
  533. WG.Send("go northwest");
  534. KEY.onChangeRoom();
  535. });
  536.  
  537. this.add(49, function () {KEY.combat_commands(0);});
  538. this.add(50, function () {KEY.combat_commands(1);});
  539. this.add(51, function () {KEY.combat_commands(2);});
  540. this.add(52, function () {KEY.combat_commands(3);});
  541. this.add(53, function () {KEY.combat_commands(4);});
  542. this.add(54, function () {KEY.combat_commands(5);});
  543. this.add(55, function () {KEY.combat_commands(6);});
  544. this.add(56, function () {KEY.combat_commands(7);});
  545. this.add(57, function () {KEY.combat_commands(8);});
  546.  
  547. //alt
  548. this.add(49 + 512, function () {KEY.onRoomItemAction(0);});
  549. this.add(50 + 512, function () {KEY.onRoomItemAction(1);});
  550. this.add(51 + 512, function () {KEY.onRoomItemAction(2);});
  551. this.add(52 + 512, function () {KEY.onRoomItemAction(3);});
  552. this.add(53 + 512, function () {KEY.onRoomItemAction(4);});
  553. this.add(54 + 512, function () {KEY.onRoomItemAction(5);});
  554. //ctrl
  555. this.add(49 + 1024, function () {KEY.room_commands(0);});
  556. this.add(50 + 1024, function () {KEY.room_commands(1);});
  557. this.add(51 + 1024, function () {KEY.room_commands(2);});
  558. this.add(52 + 1024, function () {KEY.room_commands(3);});
  559. this.add(53 + 1024, function () {KEY.room_commands(4);});
  560. this.add(54 + 1024, function () {KEY.room_commands(5);});
  561. },
  562. add: function (k, c) {
  563. var tmp = {
  564. key: k,
  565. callback: c,
  566. };
  567. this.keys.push(tmp);
  568. },
  569. e: function (event) {
  570. if ($(".channel-box").is(":visible")) {
  571. KEY.chatModeKeyEvent(event);
  572. return;
  573. }
  574.  
  575. if ($(".dialog-confirm").is(":visible") &&
  576. ((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105)))
  577. return;
  578.  
  579. var kk = (event.ctrlKey || event.metaKey ? 1024 : 0) + (event.altKey ? 512 : 0) + event.keyCode;
  580. for (var k of KEY.keys) {
  581. if (k.key == kk)
  582. return k.callback();
  583. }
  584. },
  585. dialog_close: function () {
  586. $(".dialog-close").click();
  587. },
  588. dialog_confirm: function () {
  589. $(".dialog-btn.btn-ok").click();
  590. },
  591. do_command: function (name) {
  592. $("span[command=" + name + "]").click();
  593. },
  594. room_commands: function (index) {
  595. $("div.combat-panel div.room-commands span:eq(" + index + ")").click();
  596. },
  597. combat_commands: function (index) {
  598. $("div.combat-panel div.combat-commands span.pfm-item:eq(" + index + ")").click();
  599. },
  600. chatModeKeyEvent: function (event) {
  601. if (event.keyCode == 27) {
  602. KEY.dialog_close();
  603. } else if (event.keyCode == 13) {
  604. if ($(".sender-box").val().length) $(".sender-btn").click();
  605. else KEY.dialog_close();
  606. }
  607. },
  608. onChangeRoom: function () {
  609. KEY.roomItemSelectIndex = -1;
  610. },
  611. onRoomItemSelect: function () {
  612. if (KEY.roomItemSelectIndex != -1) {
  613. $(".room_items div.room-item:eq(" + KEY.roomItemSelectIndex + ")").css("background", "#000");
  614. }
  615. KEY.roomItemSelectIndex = (KEY.roomItemSelectIndex + 1) % $(".room_items div.room-item").length;
  616. var curItem = $(".room_items div.room-item:eq(" + KEY.roomItemSelectIndex + ")");
  617. curItem.css("background", "#444");
  618. curItem.click();
  619. },
  620. onRoomItemAction: function (index) {
  621. //NPC下方按键
  622. $(".room_items .item-commands span:eq(" + index + ")").click();
  623. },
  624. }
  625. function messageClear() {$(".WG_log pre").html("");}
  626. var log_line = 0;
  627. function messageAppend(m, t = 0) {
  628. 100 < log_line && (log_line = 0, $(".WG_log pre").empty());
  629. var ap = m + "\n";
  630. if (t == 1) {ap = "<hiy>" + ap + "</hiy>";
  631. }
  632. else if (t == 2) {ap = "<hig>" + ap + "</hig>";
  633. }
  634. else if (t == 3) {ap = "<hiw>" + ap + "</hiw>";
  635. }
  636. $(".WG_log pre").append(ap);
  637. log_line++;
  638. $(".WG_log")[0].scrollTop = 99999;
  639. }
  640. var sm_array = {
  641. '武当': {place: "武当派-三清殿",npc: "武当派第二代弟子 武当首侠 宋远桥"},
  642. '华山': {place: "华山派-客厅",npc: "华山派掌门 君子剑 岳不群"},
  643. '少林': {place: "少林派-天王殿",npc: "少林寺第三十九代弟子 道觉禅师"},
  644. '逍遥': {place: "逍遥派-青草坪",npc: "聪辩老人 苏星河"},
  645. '丐帮': {place: "丐帮-树洞下",npc: "丐帮七袋弟子 左全"},
  646. '峨眉': {place: "峨眉派-大殿",npc: "峨嵋派第四代弟子 静心"},
  647. '武馆': {place: "扬州城-扬州武馆",npc: "武馆教习"},
  648. };
  649. var WG = {
  650. sm_state: -1,
  651. sm_item: null,
  652. init: function () {
  653. $("li[command=SelectRole]").on("click", function () {
  654. WG.login();
  655. });
  656. },
  657. inArray: function (val, arr) {
  658. for (let i = 0; i < arr.length; i++) {
  659. let item = arr[i];
  660. if (item[0] == "<") {
  661. if (item == val) return true;
  662.  
  663. } else {
  664. if (val.indexOf(item) >= 0) return true;
  665. }
  666. }
  667. return false;
  668. },
  669. login: function () {
  670. role = $('.role-list .select').text().split(/[\s\n]/).pop();
  671. $(".bottom-bar").append("<span class='item-commands' style='display:none'><span WG='WG' cmd=''></span></span>"); //命令行模块
  672. var html = `
  673. <div class='WG_log'><pre></pre></div>
  674. <div style = " width: calc(100% - 40px);" >
  675. <span class='zdy-item sm_button'>师门Q</span>
  676. <span class='zdy-item go_yamen_task'>追捕W</span>
  677. <span class='zdy-item kill_all'>击杀E</span>
  678. <span class='zdy-item get_all'>拾取R</span>
  679. <span class='zdy-item sell_all'>清包T</span>
  680. <span class='zdy-item zdwk'>挖矿Y</span>
  681. <span class = "zdy-item auto_perform" style = "float:right;" >自动攻击</span>
  682. </div>
  683. `;
  684. $(".content-message").after(html);
  685. var css = `.zdy-item{
  686. display: inline-block;border: solid 1px gray;color: gray;background-color: black;
  687. text-align: center;cursor: pointer;border-radius: 0.25em;min-width: 2.5em;margin-right: 0.4em;
  688. margin-left: 0.4em;position: relative;padding-left: 0.4em;padding-right: 0.4em;line-height: 2em;}
  689. .WG_log{flex: 1;overflow-y: auto;border: 1px solid #404000;max-height: 15em;width: calc(100% - 40px);}
  690. .WG_log > pre{margin: 0px; white-space: pre-line;}
  691. .item-plushp{display: inline-block;float: right;width: 100px;}
  692. .item-dps{display: inline-block;float: right;width: 100px;}
  693. `;
  694. GM_addStyle(css);
  695. goods = GM_getValue("goods", goods);
  696. npcs = GM_getValue("npcs", npcs);
  697. equip = GM_getValue(role + "_equip", equip);
  698. family = GM_getValue(role + "_family", family);
  699. automarry = GM_getValue(role + "_automarry", automarry);
  700. autoKsBoss = GM_getValue(role + "_autoKsBoss", autoKsBoss);
  701. showHP = GM_getValue(role + "_showHP", showHP);
  702. ks_pfm = GM_getValue(role + "_ks_pfm", ks_pfm);
  703. eqlist = GM_getValue(role + "_eqlist", eqlist);
  704. autoeq = GM_getValue(role + "_auto_eq", autoeq);
  705. if (family == null) {
  706. family = $('.role-list .select').text().substr(0, 2);
  707. }
  708. wudao_pfm = GM_getValue(role + "_wudao_pfm", wudao_pfm);
  709. sm_loser = GM_getValue(role + "_sm_loser", sm_loser);
  710. unauto_pfm = GM_getValue(role + "_unauto_pfm", unauto_pfm);
  711. auto_pfmswitch = GM_getValue(role + "_auto_pfmswitch", auto_pfmswitch);
  712. if(auto_pfmswitch=='已开启'){
  713. G.auto_preform =true;
  714. }
  715. var unpfm = unauto_pfm.split(',');
  716. for(var pfmname of unpfm){
  717. if(pfmname)
  718. blackpfm.push(pfmname);
  719. }
  720. $(".sm_button").on("click", WG.sm_button);
  721. $(".go_yamen_task").on("click", WG.go_yamen_task);
  722. $(".kill_all").on("click", WG.kill_all);
  723. $(".get_all").on("click", WG.get_all);
  724. $(".sell_all").on("click", WG.clean_all);
  725. $(".zdwk").on("click", WG.zdwk);
  726. $(".auto_perform").on("click", WG.auto_preform_switch);
  727. setTimeout(() => {
  728. role = role;
  729. var logintext = '';
  730. document.title = role + "-MUD游戏-武神传说";
  731.  
  732. KEY.do_command("showtool");
  733. KEY.do_command("pack");
  734. KEY.do_command("score");
  735. setTimeout(() => {
  736. KEY.do_command("score");
  737. var rolep = role;
  738. if (G.level) {
  739. rolep = G.level + role;
  740. }
  741. if (WebSocket) {
  742. if (npcs['店小二'] == 0) {
  743. logintext = `
  744. <hiy>欢迎${rolep},插件已加载!第一次使用,请在设置中,初始化ID,并且设置一下是否自动婚宴,自动传送boss
  745. 插件版本: ${GM_info.script.version}
  746. </hiy>`;
  747. } else {
  748. logintext = `
  749. <hiy>欢迎${rolep},插件已加载!
  750. 插件版本: ${GM_info.script.version}
  751. 更新日志: ${updateinfo}
  752. </hiy>`;
  753. }
  754. } else {
  755. logintext = `
  756. <hiy>欢迎${role},插件未正常加载!
  757. 当前浏览器不支持自动喜宴自动boss,请使用火狐浏览器
  758. 谷歌系浏览器,请在network中勾选disable cache,多刷新几次,直至提示已加载!
  759. 插件版本: ${GM_info.script.version}
  760. </hiy>`;
  761. }
  762. messageAppend(logintext);
  763.  
  764. }, 500);
  765. KEY.do_command("showcombat");
  766. }, 1000);
  767. },
  768. updete_goods_id: function () {
  769. var lists = $(".dialog-list > .obj-list:first");
  770. var id;
  771. var name;
  772. if (lists.length) {
  773. messageAppend("检测到商品清单");
  774. for (var a of lists.children()) {
  775. a = $(a);
  776. id = a.attr("obj");
  777. name = $(a.children()[0]).html();
  778. goods[name].id = id;
  779. messageAppend(name + ":" + id);
  780. }
  781. GM_setValue("goods", goods);
  782. return true;
  783. } else {
  784. messageAppend("未检测到商品清单");
  785. return false;
  786. }
  787. },
  788. updete_npc_id: function () {
  789. var lists = $(".room_items .room-item");
  790.  
  791. for (var npc of lists) {
  792. if (npc.lastElementChild.lastElementChild == null) {
  793. npcs[npc.lastElementChild.innerText] = $(npc).attr("itemid");
  794. messageAppend(npc.lastElementChild.innerText + " 的ID:" + $(npc).attr("itemid"));
  795. }
  796. }
  797. GM_setValue("npcs", npcs);
  798. },
  799. updete_id_all: function () {
  800. var t = [];
  801. Object.keys(goods).forEach(function (key) {
  802. if (t[goods[key].place] == undefined)
  803. t[goods[key].place] = goods[key].sales;
  804. });
  805. var keys = Object.keys(t);
  806. var i = 0;
  807. var state = 0;
  808. var place, sales;
  809. //获取
  810. var timer = setInterval(() => {
  811. switch (state) {
  812. case 0:
  813. if (i >= keys.length) {
  814. messageAppend("初始化完成");
  815. WG.go("武当派-广场");
  816. clearInterval(timer);
  817. return;
  818. }
  819. place = keys[i];
  820. sales = t[place];
  821. WG.go(place);
  822. state = 1;
  823. break;
  824. case 1:
  825. WG.updete_npc_id();
  826. var id = npcs[sales];
  827. WG.Send("list " + id);
  828. state = 2;
  829. break;
  830. case 2:
  831. if (WG.updete_goods_id()) {
  832. state = 0;
  833. i++;
  834. } else
  835. state = 1;
  836. break;
  837. }
  838. }, 1000);
  839. },
  840. Send: async function (cmd) {
  841. if (cmd) {
  842. cmd = cmd instanceof Array ? cmd : cmd.split(';');
  843. for (var c of cmd) {
  844. $("span[WG='WG']").attr("cmd", c).click();
  845.  
  846. };
  847. }
  848. },
  849. sleep(time) {
  850. return new Promise((resolve) => setTimeout(resolve, time));
  851. },
  852. go: async function (p) {
  853. if (needfind[p] == undefined) {
  854. if (WG.at(p)) {
  855. return;
  856. }
  857. }
  858. if (place[p] != undefined) {
  859. WG.Send(place[p]);
  860. }
  861. },
  862. at: function (p) {
  863. var w = $(".room-name").html();
  864. return w.indexOf(p) == -1 ? false : true;
  865. },
  866. smhook: undefined,
  867. sm: function () {
  868. if (!WG.smhook) {
  869. WG.smhook = WG.add_hook('text', function (data) {
  870. if (data.msg.indexOf("辛苦了, 你先去休息") >= 0 ||
  871. data.msg.indexOf("和本门毫无瓜葛") >= 0 ||
  872. data.msg.indexOf("你没有") >= 0
  873. ) {
  874. //WG.Send("taskover signin");
  875. WG.sm_state = -1;
  876. $(".sm_button").text("师门Q");
  877. WG.remove_hook(WG.smhook);
  878. WG.smhook = undefined;
  879. messageAppend("自动去挖矿");
  880. setTimeout(WG.zdwk, 2000);
  881.  
  882. }
  883. });
  884. }
  885. switch (WG.sm_state) {
  886. case 0://前往师门接收任务
  887. WG.go(sm_array[family].place);
  888. WG.sm_state = 1;
  889. setTimeout(WG.sm, 700);
  890. break;
  891. case 1: //接受任务
  892. var lists = $(".room_items .room-item");
  893. var id = null;
  894. for (var npc of lists) {
  895. if (npc.lastElementChild.lastElementChild == null) {
  896. if (npc.lastElementChild.innerText == sm_array[family].npc)
  897. id = $(npc).attr("itemid");
  898. }
  899. }
  900. console.log(id);
  901. if (id != undefined) {
  902. WG.Send("task sm " + id);
  903. WG.Send("task sm " + id);
  904. WG.sm_state = 2;
  905. } else {
  906. WG.updete_npc_id();
  907. }
  908. setTimeout(WG.sm, 300);
  909. break;
  910. case 2:
  911. var mysm_loser = GM_getValue(role + "_sm_loser", sm_loser);
  912. //获取师门任务物品
  913. var item = $("span[cmd$='giveup']:last").parent().prev();
  914. if (item.length == 0) {
  915. WG.sm_state = 0;
  916. setTimeout(WG.sm, 1000);
  917. return;
  918. };
  919. var itemName = item.html();
  920. item = item[0].outerHTML;
  921. //(逗比写法) //能上交直接上交
  922. var tmpObj = $("span[cmd$='giveup']:last").prev();
  923. for (let i = 0; i < 6; i++) {
  924. if (tmpObj.children().html()) {
  925. if (tmpObj.html().indexOf(item) >= 0) {
  926. tmpObj.click();
  927. messageAppend("自动上交" + item);
  928. WG.sm_state = 0;
  929. setTimeout(WG.sm, 100);
  930. return;
  931. }
  932. tmpObj = tmpObj.prev();
  933. }
  934. }
  935. //不能上交自动购买
  936. WG.sm_item = goods[itemName];
  937. if (WG.sm_item != undefined) {
  938. WG.go(WG.sm_item.place);
  939. messageAppend("自动购买" + item);
  940. WG.sm_state = 3;
  941. setTimeout(WG.sm, 1000);
  942. } else {
  943. messageAppend("无法购买" + item);
  944. if (mysm_loser == '已停止') {
  945. WG.sm_state = -1;
  946. $(".sm_button").text("师门(Q)");
  947. } else {
  948. $("span[cmd$='giveup']:last").click();
  949. messageAppend("放弃任务");
  950. WG.sm_state = 0;
  951. setTimeout(WG.sm, 100);
  952. return;
  953. }
  954. }
  955. break;
  956. case 3:
  957. WG.go(WG.sm_item.place);
  958. if (WG.buy(WG.sm_item)) {
  959. WG.sm_state = 0;
  960. }
  961. setTimeout(WG.sm, 1000);
  962. break;
  963. default:
  964. break;
  965. }
  966. },
  967. sm_button: function () {
  968. if (WG.sm_state >= 0) {
  969. WG.sm_state = -1;
  970. $(".sm_button").text("师门(Q)");
  971. } else {
  972. WG.sm_state = 0;
  973. $(".sm_button").text("停止(Q)");
  974. setTimeout(WG.sm, 200);
  975. }
  976. },
  977. buy: function (good) {
  978. var tmp = npcs[good.sales];
  979. if (tmp == undefined) {
  980. WG.updete_npc_id();
  981. return false;
  982. }
  983. WG.Send("list " + tmp);
  984. WG.Send("buy 1 " + good.id + " from " + tmp);
  985. return true;
  986. },
  987. Give: function (items) {
  988. var tmp = npcs["店小二"];
  989. if (tmp == undefined) {
  990. WG.updete_npc_id();
  991. return false;
  992. }
  993. WG.Send("give " + tmp + " " + items);
  994. return true;
  995.  
  996. },
  997. eq: function (e) {
  998. WG.Send("eq " + equip[e]);
  999. },
  1000. ask: function (npc, i) {
  1001. npc = npcs[npc];
  1002. if (npc != undefined)
  1003. WG.Send("ask" + i + " " + npc);
  1004. else
  1005. WG.updete_npc_id();
  1006. },
  1007. yamen_lister: undefined,
  1008. go_yamen_task: async function () {
  1009. if (!WG.yamen_lister) {
  1010. WG.yamen_lister = WG.add_hook('text', function (data) {
  1011. if (data.msg.indexOf("最近没有在逃的逃犯了,你先休息下吧。") >= 0) {
  1012. clearInterval(WG.check_yamen_task);
  1013. WG.check_yamen_task = 'over';
  1014. WG.remove_hook(WG.yamen_lister);
  1015. WG.yamen_lister = undefined;
  1016.  
  1017. } else if (data.msg.indexOf("没有这个人") >= 0) {
  1018. WG.updete_npc_id();
  1019. }
  1020. });
  1021. }
  1022. WG.go("扬州城-衙门正厅");
  1023. await WG.sleep(200);
  1024. WG.updete_npc_id();
  1025. WG.ask("扬州知府 程药发", 1);
  1026. if (WG.check_yamen_task == 'over') {
  1027. return;
  1028. }
  1029. window.setTimeout(WG.check_yamen_task, 1000);
  1030. },
  1031.  
  1032. check_yamen_task: function () {
  1033. if (WG.check_yamen_task == 'over') {
  1034. return;
  1035. }
  1036. messageAppend("查找任务中");
  1037. var task = $(".task-desc:last").text();
  1038. if (task.length == 0) {
  1039. KEY.do_command("tasks");
  1040. window.setTimeout(WG.check_yamen_task, 1000);
  1041. return;
  1042. }
  1043. try {
  1044. zb_npc = task.match("犯:([^%]+),据")[1];
  1045. zb_place = task.match("在([^%]+)出")[1];
  1046. messageAppend("追捕任务:" + zb_npc + " 地点:" + zb_place);
  1047. KEY.do_command("score");
  1048. WG.go(zb_place);
  1049. window.setTimeout(WG.check_zb_npc, 1000);
  1050. } catch (error) {
  1051. messageAppend("查找衙门追捕失败");
  1052. window.setTimeout(WG.check_yamen_task, 1000);
  1053. KEY.do_command("tasks");
  1054. }
  1055. },
  1056. check_zb_npc: function () {
  1057. var lists = $(".room_items .room-item");
  1058. for (var npc of lists) {
  1059. if (npc.innerText.indexOf(zb_npc) != -1) {
  1060. WG.Send("kill " + $(npc).attr("itemid"));
  1061. messageAppend("找到" + zb_npc + ",自动击杀!!!");
  1062. return;
  1063. }
  1064. }
  1065. window.setTimeout(WG.check_zb_npc, 1000);
  1066. },
  1067.  
  1068. kill_all: function () {
  1069. var room=$(".room-name").text();
  1070. if(room=="扬州城-广场" || room== "襄阳城-广场" || room=="武道塔-入口")
  1071. return;//避免手滑送死
  1072. var lists = $(".room_items .room-item:gt(0)");
  1073. for (var npc of lists) {
  1074. WG.Send("kill " + $(npc).attr("itemid"));
  1075. }
  1076. },
  1077.  
  1078. get_all: function () {
  1079. var lists = $(".room_items .room-item:gt(0)");
  1080. for (var npc of lists) {
  1081. WG.Send("get all from " + $(npc).attr("itemid"));
  1082. }
  1083. },
  1084. clean_all: function () {
  1085. WG.go("扬州城-打铁铺");
  1086. WG.Send("sell all");
  1087. },
  1088. packup_listener: null,
  1089. sell_all: function () {
  1090. var t=$(".room-name").text();
  1091. if(t.indexOf("副本")>0)//如果在副本中停止执行
  1092. return;
  1093. if (WG.packup_listener) {
  1094. messageAppend("<hio>包裹整理</hio>运行中");
  1095. return;
  1096. }
  1097. let stores = [];
  1098. WG.packup_listener = WG.add_hook(["dialog", "text"], (data) => {
  1099. if (data.type == "dialog" && data.dialog == "list") {
  1100. if (data.stores == undefined) {
  1101. return;
  1102. }
  1103. stores = [];
  1104. //去重
  1105. for (let i = 0; i < data.stores.length; i++) {
  1106. let s = null;
  1107. for (let j = 0; j < stores.length; j++) {
  1108. if (stores[j].name == data.stores[i].name) {
  1109. s = stores[j];
  1110. break;
  1111. }
  1112. }
  1113. if (s != null) {
  1114. s.count += data.stores[i].count;
  1115. } else {
  1116. stores.push(data.stores[i]);
  1117. }
  1118. }
  1119. } else if (data.type == "dialog" && data.dialog == "pack") {
  1120. let cmds = [];
  1121. for (var i = 0; i < data.items.length; i++) {
  1122. //仓库
  1123. if (WG.inArray(data.items[i].name, store_list)) {
  1124. if (data.items[i].can_eq) {
  1125. //装备物品,不能叠加,计算总数
  1126. let store = null;
  1127. for (let j = 0; j < stores.length; j++) {
  1128. if (stores[j].name == data.items[i].name) {
  1129. store = stores[j];
  1130. break;
  1131. }
  1132. }
  1133. if (store != null) {
  1134. if (store.count < 4) {
  1135. store.count += data.items[i].count;
  1136. cmds.push("store " + data.items[i].count + " " + data.items[i].id);
  1137. messageAppend("<hio>包裹整理</hio>" + data.items[i].name + "储存到仓库");
  1138. } else {
  1139. messageAppend("<hio>包裹整理</hio>" + data.items[i].name + "超过设置的储存上限");
  1140. }
  1141. } else {
  1142. stores.push(data.items[i]);
  1143. cmds.push("store " + data.items[i].count + " " + data.items[i].id);
  1144. messageAppend("<hio>包裹整理</hio>" + data.items[i].name + "储存到仓库");
  1145. }
  1146. } else {
  1147. cmds.push("store " + data.items[i].count + " " + data.items[i].id);
  1148. messageAppend("<hio>包裹整理</hio>" + data.items[i].name + "储存到仓库");
  1149. }
  1150. }
  1151. //丢弃
  1152. if (WG.inArray(data.items[i].name, drop_list)) {
  1153. cmds.push("drop " + data.items[i].count + " " + data.items[i].id);
  1154. messageAppend("<hio>包裹整理</hio>" + data.items[i].name + "丢弃");
  1155.  
  1156. }
  1157. //分解
  1158. if (fenjie_list.length && WG.inArray(data.items[i].name, fenjie_list) && data.items[i].name.indexOf("★") == -1) {
  1159. cmds.push("fenjie " + data.items[i].id);
  1160. messageAppend("<hio>包裹整理</hio>" + data.items[i].name + "分解");
  1161.  
  1162. }
  1163. }
  1164. if (cmds.length > 0) {
  1165. WG.Send(cmds);
  1166. }
  1167. WG.go("扬州城-杂货铺");
  1168. WG.Send("sell all");
  1169. WG.Send("look3 1");
  1170. } else if (data.type == 'text' && data.msg == '没有这个玩家。') {
  1171. messageAppend("<hio>包裹整理</hio>完成");
  1172. WG.remove_hook(WG.packup_listener);
  1173. WG.packup_listener = undefined;
  1174. }
  1175. });
  1176.  
  1177. messageAppend("<hio>包裹整理</hio>开始");
  1178. WG.go("仓库");
  1179. WG.Send("store;pack");
  1180. },
  1181. zdwk: function () {
  1182. var t=$(".room-name").text();
  1183. if(t.indexOf("副本")>0)//如果在副本中停止执行
  1184. return;
  1185. if (G.level) {
  1186. if (G.level.indexOf('武帝') >= 0) {
  1187. WG.go("练功房");
  1188. WG.Send("xiulian");
  1189. return;
  1190. }
  1191. }
  1192. t = $(".room_items .room-item:first .item-name").text();
  1193. if( t.indexOf("<挖矿")>=0)
  1194. return;
  1195. messageAppend("当前不在挖矿状态");
  1196. WG.go("扬州城-矿山");
  1197. WG.eq("铁镐");
  1198. WG.Send("wa");
  1199. setTimeout(WG.zdwk, 5000);
  1200. },
  1201. timer_close: function () {
  1202. if (timer) {clearInterval(timer);timer = 0;}
  1203. },
  1204. wudao_auto: function () {
  1205. //创建定时器
  1206. if (timer == 0) { timer = setInterval(WG.wudao_auto, 2000);}
  1207. if (!WG.at("武道塔")) {
  1208. //进入武道塔
  1209. WG.go("武道塔");
  1210. WG.ask("守门人", 1);
  1211. WG.Send("go enter");
  1212. } else {
  1213. //武道塔内处理
  1214. messageAppend("武道塔");
  1215. var w = $(".room_items .room-item:last");
  1216. var t = w.text();
  1217. if (t.indexOf("守护者") != -1) {
  1218. WG.Send("kill " + w.attr("itemid"));
  1219. WG.wudao_autopfm();
  1220. } else {
  1221. WG.Send("liaoshang");
  1222. WG.Send("go up");
  1223. }
  1224. }
  1225. },
  1226. wudao_autopfm: function () {
  1227. var pfm = wudao_pfm.split(',');
  1228. for (var p of pfm) {
  1229. if ($("div.combat-panel div.combat-commands span.pfm-item:eq(" + p + ") span").css("left") == "0px")
  1230. $("div.combat-panel div.combat-commands span.pfm-item:eq(" + p + ") ").click();
  1231. }
  1232. },
  1233. xue_auto: function () {
  1234. var t = $(".room_items .room-item:first .item-name").text();
  1235. t = t.indexOf("<打坐") >0 || t.indexOf("<学习") >0 || t.indexOf("<练习") >0 || t.indexOf("<读书") >0;
  1236. //创建定时器
  1237. if (timer == 0) {
  1238. if (t == false) {
  1239. messageAppend("当前不在打坐或学技能");
  1240. return;
  1241. }
  1242. timer = setInterval(WG.xue_auto, 2000);
  1243. }
  1244. if (t == false) {
  1245. //学习状态中止,自动去挖矿
  1246. WG.timer_close();
  1247. WG.zdwk();
  1248. } else {
  1249. messageAppend("自动打坐学技能");
  1250. }
  1251. },
  1252. fbnum: 0,
  1253. needGrove: 0,
  1254. step :0,
  1255. oncegrove: function () {
  1256. this.fbnum += 1;
  1257. messageAppend("第" + this.fbnum + "次");
  1258. WG.Send("cr yz/lw/shangu;cr over");
  1259. if (this.needGrove == this.fbnum) {
  1260. WG.Send("taskover signin");
  1261. messageAppend("<hiy>" + this.fbnum + "次副本小树林秒进秒退已完成</hiy>");
  1262. this.timer_close();
  1263. this.needGrove = 0;
  1264. this.fbnum = 0;
  1265. messageAppend("自动去挖矿");
  1266. setTimeout(WG.zdwk, 2000);
  1267. }
  1268. },
  1269. oncegrove2: function () {
  1270. switch(this.step){
  1271. case 0:
  1272. messageAppend("第" + this.fbnum + "次进入流氓巷组队副本");
  1273. WG.Send("cr yz/lmw/xiangzi1 2 0");
  1274. //if($(".room_exits text").text()=="小巷子小巷子")
  1275. this.step=1;
  1276. break;
  1277. case 1:
  1278. this.kill_all();
  1279. if($(".room-item").text().match(/小流氓的尸体/g).length==2){
  1280. this.get_all();
  1281. WG.Send('go east');
  1282. //if($(".room_exits text").text()=="小巷子小巷子破茅屋巷子深处")
  1283. this.step=2;
  1284. }
  1285. break;
  1286. case 2:
  1287. this.kill_all();
  1288. if($(".room-item").text().match(/流氓的尸体/g).length==2){
  1289. this.get_all();
  1290. WG.Send('go north');
  1291. //if($(".room_exits text").text()=="破茅屋小巷子")
  1292. this.step=3;
  1293. }
  1294. break;
  1295. case 3:
  1296. this.kill_all();
  1297. if($(".room-item").text().match(/流氓头的尸体/g).length==1){
  1298. this.get_all();
  1299. WG.Send('go south;go east');
  1300. //if($(".room_exits text").text()=="巷子深处小巷子头目房间")
  1301. this.step=4;
  1302. }
  1303. break;
  1304. case 4:
  1305. this.kill_all();
  1306. if($(".room-item").text().match(/流氓的尸体/g).length==2){
  1307. this.get_all();
  1308. WG.Send('go east');
  1309. //if($(".room_exits text").text()=="巷子深处小巷子头目房间")
  1310. this.step=5;
  1311. }
  1312. break;
  1313. case 5:
  1314. this.kill_all();
  1315. if($(".room-item").text().match(/赵三拳的尸体/g).length==1){
  1316. this.get_all();
  1317. WG.Send('cr over');
  1318. //if($(".room_exits text").text()=="头目房间巷子深处")
  1319. this.step=0;
  1320. this.fbnum+=1;
  1321. messageAppend("流氓巷组队副本完成第:"+this.fbnum+"/"+this.needGrove);
  1322. //检查背包空格,小于5格就自动售卖
  1323. var inums=$(".dialog-title").text().match(/\w+/g);
  1324. if(inums[1]-inums[0]<5){
  1325. this.sell_all();
  1326. }
  1327. }
  1328. break;
  1329. }
  1330. if (this.needGrove == this.fbnum) {
  1331. WG.Send("taskover signin");
  1332. messageAppend("<hiy>" + this.fbnum + "次流氓巷组队副本已完成</hiy>");
  1333. this.timer_close();
  1334. this.needGrove = 0;
  1335. this.fbnum = 0;
  1336. messageAppend("自动去挖矿");
  1337. setTimeout(WG.zdwk, 2000);
  1338. }
  1339. },
  1340. grove_ask_info: function () {
  1341. return prompt("请输入需要秒进秒退的副本次数", "");
  1342. },
  1343. grove_auto: function () {
  1344. if (timer == 0) {
  1345. this.needGrove = this.grove_ask_info();
  1346. if (this.needGrove) //如果返回的有内容
  1347. {
  1348. if (parseFloat(this.needGrove).toString() == "NaN") {
  1349. messageAppend("请输入数字");
  1350. return;
  1351. }
  1352. messageAppend("开始秒进秒退小树林" + this.needGrove + "次");
  1353.  
  1354. timer = setInterval(() => {
  1355. this.oncegrove()
  1356. }, 1000);
  1357. }
  1358. }
  1359. },
  1360. grove_auto2: function () {//自动流氓巷
  1361. if (timer == 0) {
  1362. this.needGrove = this.grove_ask_info();
  1363. if (this.needGrove) //如果返回的有内容
  1364. {
  1365. if (parseFloat(this.needGrove).toString() == "NaN") {
  1366. messageAppend("请输入数字");
  1367. return;
  1368. }
  1369. messageAppend("开始流氓巷(组队)" + this.needGrove + "次");
  1370. this.step=0;
  1371. timer = setInterval(() => {
  1372. this.oncegrove2()
  1373. }, 1500);
  1374. }
  1375. }
  1376. },
  1377. showhideborad: function () {
  1378. if ($('.WG_log').css('display') == 'none') {
  1379. $('.WG_log').show();
  1380. } else {
  1381. $('.WG_log').hide();
  1382. }
  1383. },
  1384. calc: function () {
  1385. messageClear();
  1386. var html = `
  1387. <div>
  1388. <div style="width:50%;float:left">
  1389. <span>潜能计算器</span>
  1390. <input type="number" id="c" placeholder="初始等级" style="width:50%" class="mui-input-speech"><br/>
  1391. <input type="number" id="m" placeholder="目标等级" style="width:50%"><br/>
  1392. <select id="se" style="width:50%">
  1393. <option value='0'>选择技能颜色</option>
  1394. <option value='1' style="color: #c0c0c0;">白色</option>
  1395. <option value='2' style="color:#00ff00;">绿色</option>
  1396. <option value='3' style="color:#00ffff;">蓝色</option>
  1397. <option value='4' style="color:#ffff00;">黄色</option>
  1398. <option value='5' style="color:#912cee;">紫色</option>
  1399. <option value='6' style="color: #ffa600;">橙色</option>
  1400. </select><br/>
  1401. <input type="button" value="计算" style="width:50%" id="qnjs"><br/>
  1402. </div>
  1403. <div style="width:50%;float:left">
  1404. <span>开花计算器</span>
  1405. <input type="number" id="nl" placeholder="当前内力" style="width:50%" class="mui-input-speech"><br/>
  1406. <input type="number" id="xg" placeholder="先天根骨" style="width:50%"><br/>
  1407. <input type="number" id="hg" placeholder="后天根骨" style="width:50%"><br/>
  1408. <input type="button" value="计算" id = "kaihua" style="width:50%" <br/>
  1409. <label>人花分值:5000 地花分值:6500 天花分值:8000</label>
  1410. </div>
  1411.  
  1412. </div>`;
  1413. messageAppend(html);
  1414. $("#qnjs").on('click', function () {
  1415. messageAppend("需要潜能:" + Helper.dian(Number($("#c").val()), Number($("#m").val()), Number($("#se").val())));
  1416. });
  1417. $("#kaihua").on('click', function () {
  1418. messageAppend("你的分值:" + Helper.gen(Number($("#nl").val()), Number($("#xg").val()), Number($("#hg").val())));
  1419. });
  1420. },
  1421. setting: function () {
  1422. messageClear();
  1423. var a = `<div style='text-align:right;width:280px'>
  1424. 有空的话请点个star,您的支持是我最大的动力<a target="_blank" href="https://github.com/knva/wsmud_plugins">https://github.com/knva/wsmud_plugins</a>
  1425. <span>
  1426. <label for="family">门派选择:</label><select style='width:80px' id="family">
  1427. <option value="武当">武当</option>
  1428. <option value="华山">华山</option>
  1429. <option value="少林">少林</option>
  1430. <option value="峨眉">峨眉</option>
  1431. <option value="逍遥">逍遥</option>
  1432. <option value="丐帮">丐帮</option>
  1433. <option value="武馆">武馆</option>
  1434. </select>
  1435. </span>
  1436. <span><label for="sm_loser">师门自动放弃: </label><select style='width:80px' id = "sm_loser">
  1437. <option value="已停止">已停止</option>
  1438. <option value="已开启">已开启</option>
  1439. </select>
  1440. </span>
  1441. <span><label for="wudao_pfm">武道自动攻击: </label><input style='width:80px' type="text" id="wudao_pfm" name="wudao_pfm" value="">
  1442. </span>
  1443. <span><label for="marry_kiss">自动喜宴: </label><select style='width:80px' id = "marry_kiss">
  1444. <option value="已停止">已停止</option>
  1445. <option value="已开启">已开启</option>
  1446. </select>
  1447. </span>
  1448. <span><label for="ks_Boss">自动传到boss </label><select style='width:80px' id = "ks_Boss">
  1449. <option value="已停止">已停止</option>
  1450. <option value="已开启">已开启</option>
  1451. </select>
  1452. </span>
  1453. <span><label for="show_hp">全局显血: </label><select style='width:80px' id = "show_hp">
  1454. <option value="已停止">已停止</option>
  1455. <option value="已开启">已开启</option>
  1456. </select>
  1457. </span>
  1458. </span>
  1459. <span><label for="auto_eq">BOSS击杀时自动换装: </label><select style='width:80px' id = "auto_eq">
  1460. <option value="0">已停止</option>
  1461. <option value="1">套装1</option>
  1462. <option value="2">套装2</option>
  1463. <option value="3">套装3</option>
  1464. </select>
  1465. </span>
  1466. <span><label for="ks_pfm">叫杀延时(ms): </label><input style='width:80px' type="text" id="ks_pfm" name="ks_pfm" value="">
  1467. </span>
  1468. <span> <label for = "autopfmswitch" > 自动施法开关: </label><select style = 'width:80px' id = "autopfmswitch" >
  1469. <option value = "已停止" > 已停止 </option>
  1470. <option value = "已开启" > 已开启 </option>
  1471. </select>
  1472. </span>
  1473. <span><label for = "unautopfm" > 自动施法黑名单: </label><input style='width:80px' type="text" id="unauto_pfm" name="unauto_pfm" value="">
  1474. </span>
  1475. <div class="item-commands"><span class="updete_id_all">初始化ID</span></div>
  1476. </div>
  1477. `;
  1478. messageAppend(a);
  1479. $('#family').val(family);
  1480. $("#family").change(function () {
  1481. family = $("#family").val();
  1482. GM_setValue(role + "_family", family);
  1483. });
  1484. $('#wudao_pfm').val(wudao_pfm);
  1485. $('#wudao_pfm').focusout(function () {
  1486. wudao_pfm = $('#wudao_pfm').val();
  1487. GM_setValue(role + "_wudao_pfm", wudao_pfm);
  1488. });
  1489. $('#sm_loser').val(sm_loser);
  1490. $('#sm_loser').focusout(function () {
  1491. sm_loser = $('#sm_loser').val();
  1492. GM_setValue(role + "_sm_loser", sm_loser);
  1493. });
  1494. $('#ks_pfm').val(ks_pfm);
  1495. $('#ks_pfm').focusout(function () {
  1496. ks_pfm = $('#ks_pfm').val();
  1497. GM_setValue(role + "_ks_pfm", ks_pfm);
  1498. });
  1499. $('#marry_kiss').val(automarry);
  1500. $('#marry_kiss').change(function () {
  1501. automarry = $('#marry_kiss').val();
  1502. GM_setValue(role + "_automarry", automarry);
  1503. });
  1504. $('#ks_Boss').val(autoKsBoss);
  1505. $('#ks_Boss').change(function () {
  1506. autoKsBoss = $('#ks_Boss').val();
  1507. GM_setValue(role + "_autoKsBoss", autoKsBoss);
  1508. });
  1509. $('#show_hp').val(showHP);
  1510. $('#show_hp').change(function () {
  1511. showHP = $('#show_hp').val();
  1512. GM_setValue(role + "_showHP", showHP);
  1513. Helper.showallhp();
  1514. });
  1515. $('#auto_eq').val(autoeq);
  1516. $('#auto_eq').change(function () {
  1517. autoeq = $('#auto_eq').val();
  1518. GM_setValue(role + "_auto_eq", autoeq);
  1519.  
  1520. });
  1521. $('#autopfmswitch').val(auto_pfmswitch);
  1522. $('#autopfmswitch').change(function () {
  1523. auto_pfmswitch = $('#autopfmswitch').val();
  1524. GM_setValue(role + "_auto_pfmswitch", auto_pfmswitch);
  1525. if (auto_pfmswitch == '已开启') {
  1526. G.auto_preform = true;
  1527. }else{
  1528. G.auto_preform = false;
  1529. }
  1530. });
  1531. $('#unauto_pfm').val(unauto_pfm);
  1532. $('#unauto_pfm').change(function () {
  1533. unauto_pfm = $('#unauto_pfm').val();
  1534. GM_setValue(role + "_unauto_pfm", unauto_pfm);
  1535. messageAppend('修改后请刷新');
  1536. });
  1537. $(".updete_id_all").on("click", WG.updete_id_all);
  1538. },
  1539. hooks: [],
  1540. hook_index: 0,
  1541. add_hook: function (types, fn) {
  1542. var hook = {
  1543. 'index': WG.hook_index++,
  1544. 'types': types,
  1545. 'fn': fn
  1546. };
  1547. WG.hooks.push(hook);
  1548. return hook.index;
  1549. },
  1550. remove_hook: function (hookindex) {
  1551. var that = this;
  1552. console.log("remove_hook");
  1553. for (var i = 0; i < that.hooks.length; i++) {
  1554. if (that.hooks[i].index == hookindex) {
  1555. that.hooks.baoremove(i);
  1556. }
  1557. }
  1558. },
  1559. run_hook: function (type, data) {
  1560. //console.log(data);
  1561. for (var i = 0; i < this.hooks.length; i++) {
  1562. // if (this.hooks[i] !== undefined && this.hooks[i].type == type) {
  1563. // this.hooks[i].fn(data);
  1564. // }
  1565. var listener = this.hooks[i];
  1566. if (listener.types == data.type || (listener.types instanceof Array && $
  1567. .inArray(data.type, listener.types) >= 0)) {
  1568. listener.fn(data);
  1569. }
  1570. }
  1571. },
  1572. receive_message: function (msg) {
  1573. ws_on_message.apply(this, arguments);
  1574. if (!msg || !msg.data) return;
  1575. var data;
  1576. if (msg.data[0] == '{' || msg.data[0] == '[') {
  1577. var func = new Function("return " + msg.data + ";");
  1578. data = func();
  1579. } else {
  1580. data = {
  1581. type: 'text',
  1582. msg: msg.data
  1583. };
  1584. }
  1585. WG.run_hook(data.type, data);
  1586. },
  1587. auto_preform_switch: function () {
  1588.  
  1589. if (G.auto_preform) {
  1590. G.auto_preform = false;
  1591. messageAppend("<hio>自动施法</hio>关闭");
  1592. WG.auto_preform("stop");
  1593. } else {
  1594. G.auto_preform = true;
  1595. messageAppend("<hio>自动施法</hio>开启");
  1596. WG.auto_preform();
  1597. }
  1598. },
  1599. auto_preform: function (v) {
  1600.  
  1601. if (v == "stop") {
  1602. if (G.preform_timer) {
  1603. clearInterval(G.preform_timer);
  1604. G.preform_timer = undefined;
  1605. $(".auto_perform").css("background", "");
  1606. }
  1607. return;
  1608. }
  1609. if (G.preform_timer || G.auto_preform == false) return;
  1610. $(".auto_perform").css("background", "#3E0000");
  1611. G.preform_timer = setInterval(() => {
  1612. if (G.in_fight == false) WG.auto_preform("stop");
  1613. for (var skill of G.skills) {
  1614. if (WG.inArray(skill.id, blackpfm)) {
  1615. continue;
  1616. }
  1617. if (!G.gcd && !G.cds.get(skill.id)) {
  1618. WG.Send("perform " + skill.id);
  1619. break;
  1620. }
  1621. }
  1622. }, 350);
  1623. },
  1624. };
  1625. var Helper = {
  1626. formatCurrencyTenThou: function (num) {
  1627. num = num.toString().replace(/\$|\,/g, '');
  1628. if (isNaN(num)) num = "0";
  1629. var sign = (num == (num = Math.abs(num)));
  1630. num = Math.floor(num * 10 + 0.50000000001); //cents = num%10;
  1631. num = Math.floor(num / 10).toString();
  1632. for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++) {
  1633. num = num.substring(0, num.length - (4 * i + 3)) + ',' + num.substring(num.length - (4 * i + 3));
  1634. }
  1635. return (((sign) ? '' : '-') + num);
  1636. },
  1637. gen: function (nl, xg, hg) {
  1638. var jg = nl / 100 + xg * hg / 10;
  1639. var sd = this.formatCurrencyTenThou(jg);
  1640. return sd;
  1641. },
  1642. dian: function (c, m, se) {
  1643. var j = c + m;
  1644. var jj = m - c;
  1645. var jjc = jj / 2;
  1646. var z = j * jjc * se * 5;
  1647. var sd = this.formatCurrencyTenThou(z);
  1648. return sd;
  1649. },
  1650. //找boss,boss不在,-1,
  1651. findboss: function (data, bossname, callback) {
  1652. for (let i = 0; i < data.items.length; i++) {
  1653. if (data.items[i] != 0) {
  1654. if (data.items[i].name.indexOf(bossname) >= 0) {
  1655. callback(data.items[i].id);
  1656. }
  1657. }
  1658. }
  1659. callback(-1);
  1660. },
  1661. ksboss: '',
  1662. marryhy: '',
  1663. kksBoss: function (data) {
  1664. var boss_place = boss_place = data.content.match("出现在([^%]+)一带。");
  1665. var boss_name = data.content.match("听说([^%]+)出现在");
  1666. if (boss_name == null || boss_place == null) {
  1667. return;
  1668. }
  1669. if (WG.inArray(boss_name, blacklist)) {
  1670. messageAppend("黑名单boss,忽略!");
  1671. return;
  1672. }
  1673. boss_name = data.content.match("听说([^%]+)出现在")[1];
  1674. boss_place = data.content.match("出现在([^%]+)一带。")[1];
  1675. var autoKsBoss = GM_getValue(role + "_autoKsBoss", autoKsBoss);
  1676. var ks_pfm_p = GM_getValue(role + "_ks_pfm", ks_pfm);
  1677. var autoeq = GM_getValue(role + "_auto_eq", autoeq);
  1678. console.log("boss");
  1679. console.log(boss_place);
  1680. messageAppend("自动前往BOSS地点");
  1681. WG.Send("stopstate");
  1682. WG.go(boss_place);
  1683. this.ksboss = WG.add_hook(["items", "itemadd", "die"], function (data) {
  1684. if (data.type == "items") {
  1685. if (!WG.at(boss_place)) {return;}
  1686. Helper.findboss(data, boss_name, function (bid) {
  1687. if (bid != -1) {
  1688. next = 999;
  1689. Helper.eqhelper(autoeq);
  1690. setTimeout(() => {
  1691. WG.Send("kill " + bid);
  1692. //WG.Send("select " + bid);
  1693. next = 0;
  1694. }, Number(ks_pfm_p));
  1695. } else {
  1696. if (next == 999) {
  1697. console.log('found');
  1698. return;
  1699. }
  1700. let lj = needfind[boss_place];
  1701. if (needfind[boss_place] != undefined && next < lj.length) {
  1702. setTimeout(() => {
  1703. console.log(lj[next]);
  1704. WG.Send(lj[next]);
  1705. next++;
  1706. }, 1000);
  1707. } else {
  1708. console.log("not found");
  1709. }
  1710. }
  1711. });
  1712. }
  1713. if (data.type == "itemadd") {
  1714. if (data.name.indexOf(boss_name) >= 0) {
  1715. next = 0;
  1716. WG.get_all();
  1717. WG.remove_hook(this.index);
  1718. }
  1719. }
  1720. if (data.type == "die") {
  1721. next = 0;
  1722. WG.Send('relive');
  1723. WG.remove_hook(this.index);
  1724. }
  1725. });
  1726. setTimeout(() => {
  1727. console.log("复活挖矿");
  1728. WG.Send('relive');
  1729. WG.remove_hook(this.ksboss);
  1730. WG.zdwk();
  1731. next = 0;
  1732. }, 60000);
  1733. },
  1734. xiyan: function () {
  1735. WG.Send("stopstate");
  1736. WG.go("扬州城-喜宴");
  1737. this.marryhy = WG.add_hook(['items', 'cmds', 'text', 'msg'], function (data) {
  1738.  
  1739. if (data.type == 'items') {
  1740.  
  1741. for (let idx = 0; idx < data.items.length; idx++) {
  1742. if (data.items[idx] != 0) {
  1743. if (data.items[idx].name.indexOf(">婚宴礼桌<") >= 0) {
  1744. console.log("拾取");
  1745. WG.Send('get all from ' + data.items[idx].id);
  1746. console.log("xy" + this.index);
  1747. WG.remove_hook(this.index);
  1748.  
  1749. break;
  1750. }
  1751. }
  1752. }
  1753. } else if (data.type == 'text') {
  1754. if (data.msg == "你要给谁东西?") {
  1755. console.log("没人");
  1756. }
  1757. if (/^店小二拦住你说道:怎么又是你,每次都跑这么快,等下再进去。$/.test(data.msg)) {
  1758. console.log("cd");
  1759. messageAppend("<hiy>你太勤快了, 1秒后回去挖矿</hiy>")
  1760. }
  1761. if (/^店小二拦住你说道:这位(.+),不好意思,婚宴宾客已经太多了。$/.test(data.msg)) {
  1762. console.log("客满");
  1763. messageAppend("<hiy>你来太晚了, 1秒后回去挖矿</hiy>")
  1764.  
  1765. }
  1766. } else if (data.type == 'cmds') {
  1767.  
  1768. for (let idx = 0; idx < data.items.length; idx++) {
  1769. if (data.items[idx].name == '1金贺礼') {
  1770. WG.Send(data.items[idx].cmd + ';go up');
  1771. console.log("交钱");
  1772. break;
  1773. }
  1774. }
  1775. }
  1776. });
  1777. setTimeout(() => {
  1778. console.log("挖矿");
  1779. WG.remove_hook(this.marryhy);
  1780. WG.zdwk();
  1781. next = 0;
  1782. }, 30000);
  1783. },
  1784. showhp(id) {
  1785. let re = '';
  1786. for (let i = 0; i < roomData.length; i++) {
  1787. if (roomData[i] != 0) {
  1788. if (roomData[i].id == id) {
  1789. re = "角色名:" + roomData[i].name + "\n";
  1790. re += "血量:" + roomData[i].hp + "/" + roomData[i].max_hp + "\n";
  1791. re += "蓝量:" + roomData[i].mp + "/" + roomData[i].max_mp;
  1792. return re;
  1793. }
  1794. }
  1795. }
  1796. return '';
  1797. },
  1798. saveRoomstate(data) {
  1799. roomData = data.items;
  1800. },
  1801. showallhp() {
  1802. var myshow = GM_getValue(role + "_showHP", showHP);
  1803. if (myshow == "已开启") {
  1804. roomData.forEach(function (v, k) {
  1805. if (v != 0) {
  1806. if (v.hp) {
  1807. $(".item-plushp[itemid=" + v.id + "]").remove();
  1808. $("[itemid=" + v.id + "] .item-status").after("<span class='item-plushp' itemid='" + v.id + "'></span>").next();
  1809. $(".item-plushp[itemid=" + v.id + "]").html("<hig>hp:" + v.hp + "(" + Math.floor(v.hp / v.max_hp * 100) + "%)</hig>");
  1810. }
  1811. }
  1812. });
  1813. } else if (myshow == "已停止") {
  1814. $(".plushp").remove();
  1815. }
  1816. },
  1817. eqx: null,
  1818. eqhelper(type) {
  1819. if (type == undefined || type == 0 || type > eqlist.length) {
  1820. return;
  1821. }
  1822. if (eqlist == null || eqlist[type] == "") {
  1823. messageAppend("套装未保存,保存当前装备作为套装" + type + "!", 1);
  1824. this.eqx = WG.add_hook("dialog", (data) => {
  1825. if (data.dialog == "pack" && data.eqs != undefined) {
  1826. eqlist[type] = data.eqs;
  1827. GM_setValue(role + "_eqlist", eqlist);
  1828. messageAppend("套装" + type + "保存成功!", 1);
  1829. WG.remove_hook(this.eqx);
  1830. }
  1831. });
  1832. WG.Send("pack");
  1833. } else {
  1834. eqlist = GM_getValue(role + "_eqlist", eqlist);
  1835. for (let i = 1; i < eqlist[type].length; i++) {
  1836. if (eqlist[type][i] != null) {
  1837.  
  1838. WG.Send("eq " + eqlist[type][i].id);
  1839. }
  1840. }
  1841. if (eqlist[type][0] != null) {
  1842. WG.Send("eq " + eqlist[type][0].id);
  1843. }
  1844. messageAppend("套装装备成功" + type + "!", 1);
  1845. }
  1846. },
  1847. eqhelperdel: function (type) {
  1848. eqlist = GM_getValue(role + "_eqlist", eqlist);
  1849. eqlist[type] = [];
  1850. GM_setValue(role + "_eqlist", eqlist);
  1851. messageAppend("清除套装" + type + "设置成功!", 1);
  1852. },
  1853. uneqall: function () {
  1854. this.eqx = WG.add_hook("dialog", (data) => {
  1855. if (data.dialog == "pack" && data.eqs != undefined) {
  1856. for (let i = 0; i < data.eqs.length; i++) {
  1857. if (data.eqs[i] != null) {
  1858. WG.Send("uneq " + data.eqs[i].id);
  1859. }
  1860. }
  1861. WG.remove_hook(this.eqx);
  1862. }
  1863. });
  1864. WG.Send("pack");
  1865. messageAppend("取消所有装备成功!", 1);
  1866. },
  1867. show_DPS: function (id, item) {
  1868. let s = $(".room-item[itemid=" + id + "] .item-dps");
  1869. if (s.length == 0) {
  1870. s = $(".room-item[itemid=" + id + "] .item-status").after("<span class='item-dps'></span>").next();
  1871. }
  1872. let html = "";
  1873. if (item.damage) html = "<hir>" + item.damage + "(" + Math.floor(item.damage / item.max_hp * 100) + "%)</hir>";
  1874. s.html(html);
  1875. },
  1876. fight_listener: undefined,
  1877. auto_fight: function () {
  1878.  
  1879. if (Helper.fight_listener) {
  1880. messageAppend("<hio>自动比试</hio>结束");
  1881. WG.remove_hook(Helper.fight_listener);
  1882. Helper.fight_listener = undefined;
  1883. return;
  1884. }
  1885. let name = prompt("请输入NPC名称,例如:\"高根明\"");
  1886. let id = Helper.find_item(name);
  1887. if (id == null) return;
  1888. Helper.fight_listener = WG.add_hook(["sc", "combat"], function (data) {
  1889. if (data.type == "combat" && data.end) {
  1890. Helper.recover(1, 1, 0, function () {});
  1891. } else if (data.type == "sc" && data.id == id) {
  1892. let item = G.items.get(id);
  1893. if (item.hp >= item.max_hp) {
  1894. Helper.recover(1, 1, 0, function () {
  1895. WG.Send("stopstate;fight " + id);
  1896. });
  1897. }
  1898. }
  1899.  
  1900. });
  1901. WG.Send("stopstate;fight " + id);
  1902. messageAppend("<hio>自动比试</hio>开始");
  1903. },
  1904. find_item: function (name) {
  1905. for (let [k, v] of G.items) {
  1906. if (v.name == name) {
  1907. return k;
  1908. }
  1909. }
  1910. return null;
  1911. },
  1912. recover: function (hp, mp, cd, callback) {
  1913. //返回定时器
  1914. if (hp == 0) {
  1915. if (WG.recover_timer) {
  1916. clearTimeout(WG.recover_timer);
  1917. WG.recover_timer = undefined;
  1918. }
  1919. return;
  1920. }
  1921. WG.Send("dazuo");
  1922. WG.recover_timer = setInterval(function () {
  1923. //检查状态
  1924. let item = G.items.get(G.id);
  1925. if (item.mp / item.max_mp < mp) { //内力控制
  1926. if (item.state != "打坐") {
  1927. WG.Send("stopstate;dazuo");
  1928. }
  1929. return;
  1930. }
  1931. if (item.hp / item.max_hp < hp) {
  1932. //血满
  1933. if (item.state != "疗伤") {
  1934. WG.Send("stopstate;liaoshang");
  1935. }
  1936. return;
  1937. }
  1938. if (item.state) WG.Send("stopstate");
  1939. if (cd) {
  1940. for (let [k, v] of G.cds) {
  1941. if (k == "force.tu") continue;
  1942. if (v) return;
  1943. }
  1944. }
  1945. clearInterval(WG.recover_timer);
  1946. callback();
  1947. }, 1000);
  1948. },
  1949. useitem_hook: undefined,
  1950. auto_useitem: async function () {
  1951. var useflag = true;
  1952. if (!Helper.useitem_hook) {
  1953. Helper.useitem_hook = WG.add_hook("text", function (data) {
  1954. if (data.msg.indexOf("你身上没有这个东西") >= 0 || data.msg.indexOf("太多") >= 0 || data.msg.indexOf("不能使用") >= 0) {
  1955. useflag = false;
  1956. WG.remove_hook(Helper.useitem_hook);
  1957. Helper.useitem_hook = undefined;
  1958. }
  1959. })
  1960. }
  1961. let name = prompt("请输入物品id,在背包中点击查看物品,即可在提示窗口看到物品id输出");
  1962. if(!name){
  1963. WG.remove_hook(Helper.useitem_hook);
  1964. Helper.useitem_hook = undefined;
  1965. return;
  1966. }
  1967. let num = prompt("请输入物品使用次数,例如:\"10\"", '10');
  1968. if (name) {
  1969. if (name.length != 11) {
  1970. alert('id不合法');
  1971. WG.remove_hook(Helper.useitem_hook);
  1972. Helper.useitem_hook = undefined;
  1973. return;
  1974. }
  1975. for (var i = 0; i < num; i++) {
  1976. if (useflag) {
  1977. WG.Send('use ' + name);
  1978. await WG.sleep(1000);
  1979. } else {
  1980. WG.remove_hook(Helper.useitem_hook);
  1981. Helper.useitem_hook = undefined;
  1982. return;
  1983. }
  1984. }
  1985. }
  1986. WG.remove_hook(Helper.useitem_hook);
  1987. Helper.useitem_hook = undefined;
  1988. }
  1989. };
  1990. //全局变量
  1991. var G = {
  1992. id: undefined,
  1993. state: undefined,
  1994. room_name: undefined,
  1995. family: undefined,
  1996. items: new Map(),
  1997. stat_boss_success: 0,
  1998. stat_boss_find: 0,
  1999. stat_xiyan_success: 0,
  2000. stat_xiyan_find: 0,
  2001. cds: new Map(),
  2002. in_fight: false,
  2003. auto_preform: false,
  2004. can_auto: false,
  2005. level: undefined,
  2006. };
  2007. $(document).ready(function () {
  2008. $('head').append('<link href="https://s1.pstatp.com/cdn/expire-1-y/jquery-contextmenu/2.6.3/jquery.contextMenu.min.css" rel="stylesheet">');
  2009. KEY.init();
  2010. WG.init();
  2011. WG.add_hook("items", function (data) {
  2012. Helper.saveRoomstate(data);
  2013. Helper.showallhp();
  2014. });
  2015. WG.add_hook("sc", function (data) {
  2016. if ("hp" in data) {
  2017. roomData.forEach(function (v, k) {
  2018. if (v.id == data.id) {
  2019. v.hp = data.hp;
  2020. }
  2021. });
  2022. Helper.showallhp();
  2023. }
  2024. });
  2025. WG.add_hook("itemadd", function (data) {
  2026. roomData.push(data);
  2027. Helper.showallhp();
  2028. });
  2029. WG.add_hook("itemremove", function (data) {
  2030. roomData.forEach(function (v, k) {
  2031. if (v.id == data.id) {
  2032. $(".plushp[itemid=" + v.id + "]").remove();
  2033. roomData.splice(k, 1);
  2034. }
  2035. });
  2036. Helper.showallhp();
  2037. });
  2038. WG.add_hook(["login", "room", "items", "itemadd", "itemremove", "sc", "text", "state", "msg", "perform", "dispfm", "combat"], function (data) {
  2039. if (data.type == "login") {
  2040. G.id = data.id;
  2041. } else if (data.type == "room") {
  2042. let tmp = data.path.split("/");
  2043. G.map = tmp[0];
  2044. G.room = tmp[1];
  2045. if (G.map == 'home' || G.room == 'kuang')
  2046. G.can_auto = true;
  2047. else
  2048. G.can_auto = false;
  2049.  
  2050. G.room_name = data.name;
  2051. } else if (data.type == "items") {
  2052. G.items = new Map();
  2053. for (var i = 0; i < data.items.length; i++) {
  2054. let item = data.items[i];
  2055. if (item.id) {
  2056. let n = $.trim($('<body>' + item.name + '</body>').text());
  2057. let i = n.lastIndexOf(' ');
  2058. let j = n.lastIndexOf('<');
  2059. let t = "";
  2060. let s = "";
  2061. if (j >= 0) {
  2062. s = n.substr(j + 1, 2);
  2063. }
  2064. if (i >= 0) {
  2065. t = n.substr(0, i);
  2066. n = n.substr(i + 1).replace(/<.*>/g, '');
  2067. }
  2068.  
  2069. G.items.set(item.id, {
  2070. name: n,
  2071. title: t,
  2072. state: s,
  2073. max_hp: item.max_hp,
  2074. max_mp: item.max_mp,
  2075. hp: item.hp,
  2076. mp: item.mp,
  2077. p: item.p,
  2078. damage: 0
  2079. });
  2080. }
  2081.  
  2082. }
  2083. } else if (data.type == "itemadd") {
  2084. if (data.id) {
  2085. let n = $.trim($('<body>' + data.name + '</body>').text());
  2086. let i = n.lastIndexOf(' ');
  2087. let j = n.lastIndexOf('<');
  2088. let t = "";
  2089. let s = "";
  2090. if (i >= 0) {
  2091. t = n.substr(0, i);
  2092. if (j >= 0) {
  2093. s = n.substr(j + 1, 2);
  2094. }
  2095. n = n.substr(i + 1).replace(/<.*>/g, '');
  2096. }
  2097. G.items.set(data.id, {
  2098. name: n,
  2099. title: t,
  2100. state: s,
  2101. max_hp: data.max_hp,
  2102. max_mp: data.max_mp,
  2103. hp: data.hp,
  2104. mp: data.mp,
  2105. p: data.p,
  2106. damage: 0
  2107. });
  2108. }
  2109. } else if (data.type == "itemremove") {
  2110. G.items.delete(data.id);
  2111. } else if (data.type == "sc") {
  2112. let item = G.items.get(data.id);
  2113. if (data.hp !== undefined) {
  2114. item.hp = data.hp;
  2115. if (data.id != G.id) {
  2116. G.scid = data.id; //伤害统计需要
  2117. }
  2118. Helper.showallhp();
  2119. }
  2120. if (data.mp !== undefined) {
  2121. item.mp = data.mp;
  2122. }
  2123. } else if (data.type == "text") {
  2124. if (G.in_fight) {
  2125. let dps_index1 = data.msg.indexOf("造成");
  2126. if (dps_index1 >= 0) {
  2127. let dps_index2 = data.msg.indexOf("/", dps_index1);
  2128. let item = G.items.get(G.scid);
  2129. if (item) {
  2130. item.damage += parseInt(data.msg.slice(dps_index1 + 7, dps_index2 - 1));
  2131. Helper.show_DPS(G.scid, item);
  2132. }
  2133. }
  2134. }
  2135. } else if (data.type == "perform") {
  2136. G.skills = data.skills;
  2137. } else if (data.type == 'dispfm') {
  2138. if (data.id) {
  2139. if (data.distime) {}
  2140. G.cds.set(data.id, true);
  2141. var _id = data.id;
  2142. setTimeout(function () {
  2143. G.cds.set(_id, false);
  2144. }, data.distime);
  2145. }
  2146. if (data.rtime) {
  2147. G.gcd = true;
  2148. setTimeout(function () {
  2149. G.gcd = false;
  2150. }, data.rtime);
  2151. } else {
  2152. G.gcd = false;
  2153. }
  2154.  
  2155.  
  2156. } else if (data.type == "combat") {
  2157. if (data.start) {
  2158. G.in_fight = true;
  2159. WG.auto_preform();
  2160. }
  2161. if (data.end) {
  2162. G.in_fight = false;
  2163. WG.auto_preform("stop");
  2164. }
  2165. }
  2166. });
  2167.  
  2168. WG.add_hook("item", function (data) {
  2169. if (data.id != null) {
  2170. messageAppend(Helper.showhp(data.id));
  2171. }
  2172. });
  2173. WG.add_hook("state", function (data) {
  2174. console.dir(data);
  2175. });
  2176. WG.add_hook("dialog", function (data) {
  2177. //console.dir(data);
  2178. if (data.dialog == "pack" && data.items != undefined && data.items.length >= 0) {
  2179. //equip =
  2180. for (var i = 0; i < data.items.length; i++) {
  2181. if (data.items[i].name.indexOf("铁镐") >= 0) {
  2182. equip["铁镐"] = data.items[i].id;
  2183. //messageAppend("铁镐ID:" + data.items[i].id);
  2184. }
  2185. }
  2186. for (var j = 0; j < data.eqs.length; j++) {
  2187. if (data.eqs[j] != null && data.eqs[j].name.indexOf("铁镐") >= 0) {
  2188. equip["铁镐"] = data.eqs[j].id;
  2189. //messageAppend("铁镐ID:" + data.eqs[j].id);
  2190. }
  2191. }
  2192. } else if (data.dialog == 'pack' && data.desc != undefined) {
  2193. messageClear();
  2194. var itemname = data.desc.split("\n")[0];
  2195. var htmla = `<div class="item-commands ">
  2196. <span class = "copyid" data-clipboard-target = ".target1" > `+itemname+":"+data.id+
  2197. `复制到剪贴板 </span></div> `;
  2198. messageAppend(htmla);
  2199. $(".copyid").on('click',()=>{
  2200. var copydata = data.id;
  2201. GM_setClipboard(copydata);
  2202. messageAppend("复制成功");
  2203. });
  2204.  
  2205. }
  2206. if (data.dialog == 'score') {
  2207. if (!G.level){
  2208. G.level = data.level;
  2209. console.log("欢迎" + G.level);
  2210. }
  2211. }
  2212. });
  2213. WG.add_hook("msg", function (data) {
  2214. if (data.ch == "sys") {
  2215. var automarry = GM_getValue(role + "_automarry", automarry);
  2216. if (data.content.indexOf(",婚礼将在一分钟后开始。") >= 0) {
  2217. console.dir(data);
  2218. if (automarry == "已开启") {
  2219. console.log("xiyan");
  2220. messageAppend("自动前往婚宴地点")
  2221. Helper.xiyan();
  2222. } else if (automarry == "已停止") {
  2223. var b = "<div class=\"item-commands\"><span id = 'onekeyjh'>参加喜宴</span></div>"
  2224. messageClear();
  2225. messageAppend("<hiy>点击参加喜宴</hiy>");
  2226. messageAppend(b);
  2227. $('#onekeyjh').on('click', function () {
  2228. Helper.xiyan();
  2229. });
  2230. }
  2231. }
  2232. }
  2233. if (data.ch == "rumor") {
  2234. if (data.content.indexOf("听说") >= 0 &&
  2235. data.content.indexOf("出现在") >= 0 &&
  2236. data.content.indexOf("一带。") >= 0) {
  2237. console.dir(data);
  2238. if (autoKsBoss == "已开启") {
  2239.  
  2240. Helper.kksBoss(data);
  2241. } else if (autoKsBoss == "已停止") {
  2242. var c = "<div class=\"item-commands\"><span id = 'onekeyKsboss'>传送到boss</span></div>";
  2243. messageClear();
  2244. messageAppend("boss已出现");
  2245. messageAppend(c);
  2246. $('#onekeyKsboss').on('click', function () {
  2247. Helper.kksBoss(data);
  2248. });
  2249. }
  2250. }
  2251. }
  2252. });
  2253. $.contextMenu({
  2254. selector: '.container',
  2255. items: {
  2256. "关闭自动": {
  2257. name: "关闭自动",
  2258. visible: function (key, opt) { return timer != 0;},
  2259. callback: function (key, opt) {WG.timer_close();},
  2260. },
  2261. "自动": {
  2262. name: "自动",
  2263. visible: function (key, opt) {return timer == 0;},
  2264. "items": {
  2265. "自动打坐学习": {
  2266. name: "自动打坐学习",
  2267. callback: function (key, opt) { WG.xue_auto();},
  2268. },
  2269. "自动武道": {
  2270. name: "自动武道",
  2271. callback: function (key, opt) {WG.wudao_auto();},
  2272. },
  2273. "自动小树林": {
  2274. name: "自动小树林",
  2275. callback: function (key, opt) {WG.grove_auto();}
  2276. },
  2277. "自动流氓巷": {
  2278. name: "自动流氓巷",
  2279. callback: function (key, opt) {WG.grove_auto2();}
  2280. },
  2281. "自动整理并清包": {
  2282. name: "自动整理并清包",
  2283. callback: function (key, opt) { WG.sell_all();}
  2284. },
  2285. "自动比试": {
  2286. name: "自动比试",
  2287. visible: function (key, opt) {return Helper.fight_listener == undefined;},
  2288. callback: function (key, opt) { Helper.auto_fight();},
  2289. },
  2290. "关闭比试": {
  2291. name: "关闭比试",
  2292. visible: function (key, opt) {return Helper.fight_listener != undefined;},
  2293. callback: function (key, opt) {Helper.auto_fight();},
  2294. },
  2295. "自动使用道具": {name: "自动使用道具",callback: function (key, opt) {Helper.auto_useitem();},},
  2296. },
  2297. },
  2298. "换装设置": {
  2299. name: "换装设置",
  2300. "items": {
  2301. "xx0": {name: "套装1设定或装备",callback: function (key, opt) {Helper.eqhelper(1);},},
  2302. "xx1": {name: "清除套装1设置",callback: function (key, opt) {Helper.eqhelperdel(1);},},
  2303. "yy0": {name: "套装2设定或装备",callback: function (key, opt) {Helper.eqhelper(2);},},
  2304. "yy1": {name: "清除套装2设置",callback: function (key, opt) {Helper.eqhelperdel(2);},},
  2305. "zz0": {name: "套装3设定或装备",callback: function (key, opt) {Helper.eqhelper(3);},},
  2306. "zz1": {name: "清除套装3设置",callback: function (key, opt) {Helper.eqhelperdel(3);},},
  2307. "uneq": {name: "取消所有装备",callback: function (key, opt) {Helper.uneqall();},},
  2308. }
  2309. },
  2310. "手动喜宴": {
  2311. name: "手动喜宴",callback: function (key, opt) {Helper.xiyan();},
  2312. },
  2313. "快捷传送": {
  2314. name: "常用地点",
  2315. "items": {
  2316. "mp0": {name: "豪宅",callback: function (key, opt) {WG.go("住房");},},
  2317. "mp1": {name: "当铺",callback: function (key, opt) {WG.go("扬州城-当铺");},},
  2318. "mp2": {name: "擂台",callback: function (key, opt) { WG.go("扬州城-擂台");},},
  2319. "mp3": {name: "帮派",callback: function (key, opt) {WG.go("扬州城-帮派");},},
  2320. "mp4": {name: "武道",callback: function (key, opt) {WG.go("武道塔");},},
  2321. "mp5": {name: "矿山",callback: function (key, opt) {WG.go("扬州城-矿山");},},
  2322. "mp6": {name: "药铺",callback: function (key, opt) {WG.go("扬州城-药铺");},},
  2323. "mp7": {name: "武庙疗伤",callback: function (key, opt) {WG.go("扬州城-武庙");WG.Send("liaoshang");},}
  2324. },
  2325. },
  2326. "门派传送": {
  2327. name: "门派传送",
  2328. "items": {
  2329. "mp0": {name: "武当",callback: function (key, opt) {WG.go("武当派-广场");},},
  2330. "mp1": {name: "少林",callback: function (key, opt) {WG.go("少林派-广场");},},
  2331. "mp2": {name: "华山",callback: function (key, opt) {WG.go("华山派-镇岳宫");},},
  2332. "mp3": {name: "峨眉",callback: function (key, opt) {WG.go("峨眉派-金顶")},},
  2333. "mp4": {name: "逍遥",callback: function (key, opt) {WG.go("逍遥派-青草坪");},},
  2334. "mp5": {name: "丐帮",callback: function (key, opt) {WG.go("丐帮-树洞内部");},},
  2335. "mp6": {name: "武馆",callback: function (key, opt) {WG.go("扬州城-扬州武馆");},}
  2336. },
  2337. },
  2338. "打开仓库": {name: "打开仓库",callback: function (key, opt) {WG.go("仓库");},},
  2339. "更新ID": {
  2340. name: "更新ID",
  2341. callback: function (key, opt) {
  2342. WG.updete_goods_id();
  2343. WG.updete_npc_id();
  2344. },
  2345. },
  2346. "调试BOSS": {
  2347. name: "调试BOSS",
  2348. visible: false,
  2349. callback: function (key, opt) {
  2350. Helper.kksBoss({
  2351. "content": "听说南陇侯出现在逍遥派-林间小道一带。"
  2352. });
  2353. },
  2354. },
  2355. "设置": {name: "设置",callback: function (key, opt) {WG.setting();},},
  2356. "计算器": {name: "计算器",callback: function (key, opt) {WG.calc();},},
  2357. "打开面板": {
  2358. name: "打开面板",
  2359. visible: function (key, opt) {return $('.WG_log').css('display') == 'none';},
  2360. callback: function (key, opt) {WG.showhideborad();},
  2361. },
  2362. "关闭面板": {
  2363. name: "关闭面板",
  2364. visible: function (key, opt) {return $('.WG_log').css('display') != 'none';},
  2365. callback: function (key, opt) {WG.showhideborad();},
  2366. }
  2367. }
  2368. });
  2369. });
  2370. })();