资讯详情

分享一个手游脚本源码

目的

接触手机游戏模拟脚本的模型,支持多分辨率适应 脚本功能是批量给朋友送体力,功能简单

源码 lua

--版本 --[[ 此脚本功能 日期 制作 --]]   function IniScript()  VERSION="1.2" end   function ReadUI()  local  isNomal = false  setmetatable(_G, { 
           __index = function (_, n)    error("attempt to read undeclared variable "..n, 2)   end,  }) end  function ScriptMain()   if  (math.abs( screenX/screenY - 9/16) < 0.01)  then   送体力480854()  elseif  ( math.abs( screenX/screenY - 3/5) < 0.01)  then   送体力480800()   end end  function 送体力480854()  WriteLog(" 送体力开始",1)  while true do   KeepCapture()    local intX,intY = FindMultiColBGR(82,357,370,359,"06BB37","0|1|06BB37,0|2|06BB37,0|3|06BB37,0|19|11BE42,-5|15|29CE3B,9|15|0EFCB5",4,0.9)
		--体力上限查找
		if intX > -1 and intY > -1 then 
			RndTap(intX, intY) 
			for i=1,10 do
				KeepCapture() 
				local Tmp_ret,intX,intY = FindColBGR(329,430,358,500,"FFFFFF",0,0.9)
				if intX > -1 and intY > -1 then 
					WriteLog("体力已上限",1)
					return true
				elseif CmpColBGR("112|298|2C8F00,114|547|2A7CBE,369|361|332312,390|363|614006", 0.9)==1 then
					break
				end
				Delay(300)
			end
		elseif CmpColBGR("112|298|2C8F00,114|547|2A7CBE,369|361|332312,390|363|614006", 0.9)==1 then 
			RndTap(123, 273) 
			WriteLog("下次吧")
		elseif CmpColBGR("225|109|944210,272|111|EBB13D,256|120|FFFBEB,219|108|9E4412", 0.9)==1 then 
			RndTap(253,119) 
			WriteLog("首页")
			Delay(1300)
		else
			Swipe(99,248,337,248,1500)
		end
		Delay(200)
	end	
end

function 送体力480800()
	--WriteLog(" 送体力开始",1)
	while true do
		KeepCapture() 
		local intX,intY = FindMultiColBGR(82,357,370,359,"06BB37","0|1|06BB37,0|2|06BB37,0|3|06BB37,0|19|11BE42,-5|15|29CE3B,9|15|0EFCB5",4,0.9)
		if intX > -1 and intY > -1 then 
			RndTap(intX, intY) 
			for i=1,10 do
				KeepCapture() 
				local Tmp_ret,intX,intY = FindColBGR(329,446,358,513,"FFFFFF",0,0.9)
				if intX > -1 and intY > -1 then 
					WriteLog("体力已上限",1)
					return true
				elseif CmpColBGR("114|246|2F9200,111|285|2C8F00,116|471|2B7DBF,114|546|2A7CBE", 0.9) == 1 then
					RndTap(123, 246) 
					break
				end
				Delay(500)
			end
		elseif CmpColBGR("114|246|2F9200,111|285|2C8F00,116|471|2B7DBF,114|546|2A7CBE", 0.9) == 1 then 
			RndTap(123, 246) 
			WriteLog("下次吧")
		elseif CmpColBGR("225|109|944210,272|111|EBB13D,256|120|FFFBEB,219|108|9E4412", 0.9) == 1 then 
			RndTap(253,119) 
			WriteLog("首页")
			Delay(1300)
		else
			Swipe(99,248,337,248,1500)
		end
		Delay(200)
	end	
end

MoveWindow(0,0)
IniScript()
ReadUI()
ScriptMain()
ExitEx()

标签: 13d1压式传感器

锐单商城拥有海量元器件数据手册IC替代型号,打造 电子元器件IC百科大全!

锐单商城 - 一站式电子元器件采购平台