- 登录钩子函数中执行
callscript(actor, "../QuestDiary/主界面基础按钮/主界面基础按钮QM", "@基础按钮QM") - @基础按钮QM执行了已下代码
#IF Equal <$CLIENTFLAG> 1 #ACT goto @PC端面板加载 #IF Equal <$CLIENTFLAG> 2 #ACT goto @移动端面板加载 [@PC端面板加载] #if #act goto @挂机按钮_PC [@挂机按钮_PC] ; 1是挂机中,0是未挂机 #if check [2] 1 #act MOV S$主界面按钮 然后调用的点击按钮触发函数,参数为“挂机_开关”,接着跳转到“主界面按钮触发”文件中,执行相应的触发函数
ClickEvent.RegisterMsg("挂机_开关", function(actor) release_print("-- 挂机开关函数被调用!!!") if getflagstatus(actor, 2) == 1 then setflagstatus(actor,2,0) stopautoattack(actor) else setflagstatus(actor,2,1) startautoattack(actor) end end) bug
个人标识取反,界面不刷新变化
完成上面步骤后,并没有结束,因为要设置挂机按钮标识取反,但是只是单纯的取反,界面不会被刷新,所以还要从上面再走一遍“挂机按钮选取图片”这一步骤的代码。这里使用的是QF的钩子函数
- StartAutoPlayGame 开启挂机触发
- StopAutoPlayGame 停止挂机触发
以下代码我敢聚无需设置挂机状态和打怪时间变量,没啥用,只需要修改个人标识然后跳转即可
--- StartAutoPlayGame 开启挂机触发 function startautoplaygame(actor) setplaydef(actor, "N$挂机状态", 1) setplaydef(actor, "N$打怪时间",0) setflagstatus(actor, VarCfg.flags.autoplay, 1) local flag = getconst(actor, "$CLIENTFLAG") flag = tonumber(flag) if flag == 1 then callscript(actor, "../QuestDiary/主界面基础按钮/主界面基础按钮QM", "@挂机按钮_PC") end if flag == 2 then callscript(actor, "../QuestDiary/主界面基础按钮/主界面基础按钮QM", "@挂机按钮_sj") end end --- StopAutoPlayGame 停止挂机触发 function stopautoplaygame(actor) setplaydef(actor, "N$挂机状态", 0) setflagstatus(actor, VarCfg.flags.autoplay, 0) local flag = getconst(actor, "$CLIENTFLAG") flag = tonumber(flag) if flag == 1 then callscript(actor, "../QuestDiary/主界面基础按钮/主界面基础按钮QM", "@挂机按钮_PC") end if flag == 2 then callscript(actor, "../QuestDiary/主界面基础按钮/主界面基础按钮QM", "@挂机按钮_sj") end end 点击按钮,特效出现大黑框问题
在modleinfo模型表中的该特效配置设置的一个字段blendmode,原本是0,改成1就行。
修改后:
[4045] = { index=4045, id=9101, -- type=4, -- sex=0, -- dir=1, -- blendmode=0, -- stand_pos_x=0, -- stand_pos_y=1, -- idle_interval=0.3, -- showstand_interval=10, type=4, sex=0, dir=1, blendmode=1, stand_pos_x=0, stand_pos_y=1, idle_interval=0.085, }, blendmode:混合模式(0normal常规、1add变亮、2screen滤色)
跳转地图后不战斗
只有使用这个方法才会战斗,其他方法都试了,不行
- delaygoto(actor, 1000,“StartAutoPlayGame”,0)不行
- startautoattack(actor)不行
- callscriptex(actor,“StartAutoPlayGame”)不行
- callscript(actor, “…/QuestDiary/游戏功能/跳转并挂机”, “@挂机_腐朽墓穴”)可行
[@挂机_腐朽墓穴] #if #act map xin1 StartAutoPlayGame 龙岭个人标识:
常量、标识配置全在MirServer\Mir200\Envir\QuestDiary\config这个文件夹中
- ConstCfg.lua:全局信息,我也不知道具体是啥
- EventCfg.lua:事件常量
- ModuleCfg.lua:模块常量,不知道干啥的
- MsgCfg.lua:不知道干啥的
- ResponseCfg.lua:不知道干啥的
- VarCfg.lua:引擎变量、个人标识记录