//~silent // 生成练习代码,自动填入系统设置中,代码长度最多400。 // 四区白三三 ($localVer) = 2022062701 ($changeLog) = 🆕 新增批量指定等级选项;优化逻辑判断。🌟 修改代码字符最大值为400;保存练习房间的选择;修正技能数量最大值为62 ($flowName) = 练习代码生成器 ($flowCode) = lxdm ($flowPath) = 提升 ($flowFinder) = 提升 //($repourl) = https://cdn.jsdelivr.net/gh/mapleobserver/wsmud-script ($repourl) = http://wsmud-cdn.if404.com @js ($version) = $.ajax({type: "GET", url: "(repourl)/version.txt", async: false, cache: false}).responseText; [if] (version) != null @js ($remoteVer) = var v = (version);v.(flowCode) [if] (localVer) < (remoteVer) && (remoteVer) != null [if] (UPnum) == null ($UPnum) = 0 [if] (UPnum) < 2 [if] (UPnum) == 1 @print 未获取到最新版本,使用备用地址再次尝试... ($repourl) = http://wsmud-cdn.if404.com ($UPnum) = (UPnum) + 1 [if] (flowPath) != 根文件夹 && (flowPath) != null ($flowSource) = (repourl)/(flowPath)/(flowName).flow.txt [else] ($flowSource) = (repourl)/(flowName).flow.txt [if] (flowFinder) == null ($flowFinder) = 根文件夹 @js WG.SendCmd("tm 当前(flowName)版本【(localVer)】,将开始自动更新至最新【(remoteVer)】。") ($f_ss)={"name":"(flowName)","source":"(flowSource)","finder":"(flowFinder)"} @js var time = Date.parse( new Date());var f=(f_ss);var n=f["name"];var s=f["source"];var fd=f["finder"];WorkflowConfig.removeWorkflow({"name":n,"type":"flow","finder":fd});$.get(s,{stamp:time},function(data,status){WorkflowConfig.createWorkflow(n,data,fd);}); @wait 1500 ($log) = ✅(flowName)已更新至最新版【(remoteVer)】,即将自动运行。 [else] ($log) = ⭕(flowName)暂时无法正常更新至【(remoteVer)】,直接运行当前版本【(localVer)】。 ($UPnum) = null @js WG.SendCmd("tm (log)") @print (log) [if] (UPnum) != null @js var f=(f_ss);ManagedPerformerCenter.start(f["name"], FlowStore.get(f["name"])); [exit] [else] ($UPnum) = null [if] (remoteVer) == null ($log) = ⚠️获取远程版本失败,维持当前版本不变。 [else] ($log) = 🚀开始运行(flowName),当前版本【(remoteVer)】。更新内容:(changeLog) @js WG.SendCmd("tm (log)") @print (log) @toolbar jh //获取境界 [while] (jj) == null @toolbar score @js ($jj) = $(`span[data-prop=level]`).text() //获取等级上限 [while] (level) == null @toolbar skills @js ($level) = /\d+/.exec($(".obj-money").text())['0'] //选择练习方式 [(LXtype)==null]($LXtype)=练至上限 #select ($LXtype) = 练习方式,批量指定等级|指定等级|练至上限,(LXtype) #config ($reset) = true [while] true [if] (len) != null && (len) > 400 ($len) = 0 ($list) = null #input ($info) = 练习代码太长无法保存,请重新选择,👇👇👇 //判断是否在副本中 @js ($fb) = '(:room)'.indexOf('副本区域') //选择是否添加房间代码 [(LX_map)==null]($LX_map)=住房-练功房 [(fb)!=-1]($LX_map)=不加 #select ($LX_map) = 是否添加前往房间的代码,不加|住房-练功房|帮会-练功房,(LX_map) //选择练习结束后动作 [(lx_after)==null]($lx_after)=挖矿 [if] (jj) == 武帝 || (jj) == 武神 ($lx_after) = 闭关 [(fb)!=-1]($lx_after)=不加 #select ($lx_after) = 是否添加练习结束后命令,不加|闭关|挖矿,(lx_after) //选择需要练习的技能 [if] (LXtype) == 批量指定等级 #input ($target_level) = 当前方式为(LXtype),技能上限 (level)
 * 请修改指定等级,(level) [else] #input ($target_level) = 当前技能上限,(level) ($_i) = 0 [while] (_i) < 62 @js ($s(_i)) = $(".skill-item").eq('(_i)').attr('skid') [if] (s(_i)) == null [break] @js ($n(_i)) = $(".skill-item").eq('(_i)').html().match(/[^\d]*/) @js ($n(_i)) = '(n(_i))'.replace(/span class="skill-level"/,'') @js ($n(_i)) = '(n(_i))'.replace(/<>/, '') //@js ($n(_i)) = '(n(_i))'.replace(/✔/, '') @js ($ln(_i)) = $(".skill-item").eq('(_i)').text().match(/[0-9]+/) [if] (s(_i)) != literate && (s(_i)) != lianyao [if] (LXtype) == 指定等级 #input ($l(_i)) = (n(_i))当前等级(ln(_i)),(ln(_i)) [else] #select ($k(_i)) = (n(_i))当前等级(ln(_i)),练习|跳过,跳过 ($_i) = (_i) + 1 #config // 生成代码 ($_j) = 0 //@print (s(_j)),(l(_j)) [while] (_j) < (_i) [if] (s(_j))==force || (s(_j))==unarmed || (s(_j))==dodge || (s(_j))==parry || (s(_j))==sword || (s(_j))==blade || (s(_j))==whip || (s(_j))==throwing || (s(_j))==staff || (s(_j))==club || (s(_j))==bite ($type) = base [else] ($type) = skill [if] (LXtype) == 批量指定等级 [if] (target_level) < (level) [if] (k(_j)) != 跳过 && (k(_j)) != null @js ($l(_j)) = (target_level) [else] ($LXtype) = 练至上限 [if] (LXtype) == 指定等级 || (LXtype) == 批量指定等级 [if] (l(_j)) != null && (l(_j)) > (ln(_j)) [if] (list) != null [if] (type) == base @js ($list) = 'lianxi '+'(s(_j))'+' '+'(l(_j))'+','+'(list)' [else] @js ($list) = '(list)'+',lianxi '+'(s(_j))'+' '+'(l(_j))' [else] ($list) = lianxi (s(_j)) (l(_j)) [else] [if] (k(_j)) != 跳过 && (k(_j)) != null [if] (list) != null [if] (type) == base @js ($list) = 'lianxi '+'(s(_j))'+','+'(list)' [else] @js ($list) = '(list)'+',lianxi '+'(s(_j))' [else] ($list) = lianxi (s(_j)) ($_j) = (_j)+1 [if] (list) != null //添加地图命令 [(fb)!=-1](LX_map)=不加 [if] (LX_map) != 不加 [if] (LX_map) == 住房-练功房 @js ($map) = 'jh fam 0 start,go west,go west,go north,go enter,go west,' [else] @js ($map) = 'jh fam 0 start,go south,go south,go east,go east,go east,go north,' [else] ($map) = null [if] (map) != null @js ($list) = '(map)'+'(list)' //添加练习结束后命令 [if] (lx_after) != 不加 [(lx_after)==闭关]($after)=xiulian [(lx_after)==挖矿]($after)=wakuang @js ($list) = '(list)'+','+'(after)' @print (list) @js ($len) = '(list)'.length [if] (len) > 400 [continue] [else] setting auto_work (list); @print 新练习代码已生效: @print (list) @print 打坐即可按照新代码开始练习,系统设置显示内容需刷新网页才能看见。 [else] @print 未设定任何技能! [break]