|
马上加入TC
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
刚接触TC 就拿天龙了做个实验
根据角色 自动绑定游戏窗口 无限多开
里面用到了大漠
#import "dm.dmsoft" dm
#include"答题.t"
#include"通用功能.t"
#include"打怪.t"
namespace 天龙挂机
int[] 窗口句柄
int 人物句柄,线程
string 人物名字
function bool init()
tab.active("tab0",0)
天龙挂机.枚举窗口句柄()
return true
endfunction
function bool 枚举窗口句柄()//遍历窗口 返回数组 读取人物名字
string[] rstr
string enums=system.enum("TianLongBaBu WndClass",1)
if(str.split(enums,"|",rstr)) //找到多个窗口
int c1,m=0
array.size(rstr,c1)
窗口句柄=int[c1]
while(m < c1)
窗口句柄=convert.strtoint(rstr[m],0)
m=m+ 1
endwhile
combo.deleteall("人物名字")
int n=0
while(n< c1)
combo.addtext("人物名字",dm.ReadString(窗口句柄[n],"[[[[00847520]+70]+1BC]+4]+34",0,20))
n=n+ 1
endwhile
else //////////////////一个窗口
if(enums!="")
窗口句柄=int[1]
窗口句柄[0]=convert.strtoint(enums,0)
combo.deleteall("人物名字")
combo.addtext("人物名字",dm.ReadString(窗口句柄[0],"[[[[00847520]+70]+1BC]+4]+34",0,20))
endif
endif
return true
endfunction
function int 人物句柄()
人物名字=combo.gettextbycur("人物名字",combo.getcursel("人物名字"))
int n=0
while(true)
if(人物名字==dm.ReadString(窗口句柄[n],"[[[[00847520]+70]+1BC]+4]+34",0,20))
return 窗口句柄[n]
break
endif
n=n+1
endwhile
endfunction
function int 返回人物句柄()//传递人物句柄
if(人物句柄>0)
return 人物句柄
endif
endfunction
function bool 初始设置()
if(combo.getcursel("人物名字")==-1)
help.messagebox("还没有选择人物")
return false
endif
//string 路径=辅助.获取资源路径("rc:")
dm.SetPath("d:\\tmp")
dm.SetDict(0,"dm_soft.txt")
人物句柄=天龙挂机.人物句柄()
if(dm.BindWindow(人物句柄,"dx","dx","dx",0)==0)
help.messagebox("绑定游戏失败!!!")
return false
endif
dm.LockInput(0)
help.sleep(500)
//statictext.settext("版本",dm.Ver())
help.settray(人物名字,false)
return true
endfunction
function bool 开始挂机()
control.enable("start",false)
control.enable("stop",true)
通用功能.初始变量()
天龙挂机.初始设置()
打怪.初始()
打怪.循环打怪()
control.enable("stop",true)
return true
endfunction
function bool start_click()
if(天龙挂机.初始设置()==false)
return false
endif
线程=thread.beginthread("天龙挂机.开始挂机","")
return true
endfunction
function bool stop_click()
if(线程>0)
打怪.关闭打怪()
thread.closethread(人物句柄)
endif
if(dm.UnBindWindow()==1)
control.enable("stop",false)
control.enable("start",true)
endif
return true
endfunction
function bool exit_click()
if(线程>0)
打怪.关闭打怪()
thread.closethread(人物句柄)
endif
if(dm.UnBindWindow()==1)
help.exit()
endif
return true
endfunction
function bool destroy()
return true
endfunction
endnamespace
怎么这个编辑器 代码里有 i 后 会自动变成斜体
|
|