同步操作将从 cutself/proj 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
require("s_cmncfg")require("s_StateResolver")dm_command = {-- dm = luacom.CreateObject("dm.dmsoft"),dm = nil,----------------------InitDm = nil,FindPic = nil,------------------------DmS->DmStateStateFindPicNode = nil,状态找图结点 = nil,DmS_FindPicInfo = nil,DmS_HandleClick = nil,DmS_HandlePassScene = nil,DmS_HandleNothing = nil,DmS_FindPic = nil,DmS_FindPicClick = nil,DmS_FindPicPassScene = nil,----------------------DmInputBindWndString = nil,DmClickLBt = nil,}GetMyApp():AddScriptExecEnv("dm_command", dm_command)function dm_command:InitDm()assert(self.dm == nil)self.dm = DmOper()local dmRegKey = s_cmncfg.dmRegKeyif #dmRegKey > 0 thenlocal regRes = self.dm:Reg(dmRegKey, "")if regRes ~= 1 thenLogF("大漠注册失败,错误码:", regRes)assert(false, "dm:Reg")endendendfunction dm_command.FindPic(picName, deltaColor, sim, dir)assert(picName)picName = picName .. ".bmp"deltaColor = deltaColor or ""sim = sim or 0.9dir = dir or 0-- return dm_command.dm:FindPic(0, 0, 2000, 2000, picName, deltaColor, sim, dir)-- --[[local res, x, y = dm_command.dm:FindPic(0, 0, 2000, 2000, picName, deltaColor, sim, dir)if x >= 0 and y >= 0 thenLogT("找到图片:", picName, "\t坐标x:", x, "\t坐标y:", y)endreturn res, x, y--]]endlocal DmFindPic = dm_command.FindPiclocal function GetDmObjImpl_()local dm = dm_command.dmassert(dm)return dmendlocal StateFindPicNodeImpl = s_StateResolver.StateFindPicNodefunction dm_command.StateFindPicNode(stateName, ...)return StateFindPicNodeImpl(stateName, GetDmObjImpl_, ...)enddm_command.状态找图结点 = dm_command.StateFindPicNodefunction dm_command.DmS_FindPicInfo(picName, ...)if type(picName) == "string" thenpicName = picName .. ".bmp"return { picName, ... }endlocal names = {}for _, v in ipairs(picName) dotable.insert(names, v .. ".bmp")endreturn { names, ... }endfunction dm_command.DmS_HandleClick(stateNode, picName, posX, posY)local dm = dm_command.dmdm:MoveTo(posX, posY)dm:LeftClick()endfunction dm_command.DmS_HandlePassScene(stateNode, picName, posX, posY)return falseendfunction dm_command.DmS_HandleNothing(stateNode, picName, posX, posY)return trueendfunction dm_command.DmS_FindPic(picName, fnHandle, ...)local fnPrepare = function ()local res, x, y = DmFindPic(picName)return x >= 0 and y >= 0endreturn { picName, fnPrepare, fnHandle, ... }endfunction dm_command.DmS_FindPicClick(picName, clickX, clickY, ...)local fnPrepareif clickX == nil or clickY == nil thenfnPrepare = function ()local res, x, y = DmFindPic(picName)if x >= 0 and y >= 0 thenclickX = xclickY = yreturn trueelsereturn falseendendelsefnPrepare = function ()local res, x, y = DmFindPic(picName)return x >= 0 and y >= 0endendlocal fnHandle = function ()local dm = dm_command.dmdm:MoveTo(clickX, clickY)dm:LeftClick()endreturn { picName, fnPrepare, fnHandle, ... }endlocal function RetFalse()return falseendfunction dm_command.DmS_FindPicPassScene(picName)return dm_command.DmS_FindPic(picName, RetFalse)endfunction dm_command.DmInputBindWndString(str, posX, posY)return dm_command.dm:InputBindWndString(str, posX, posY)endfunction dm_command.DmClickLBt(posX, posY)local dm = dm_command.dmdm:MoveTo(posX, posY)dm:LeftClick()end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。