这段时间真够累的,不想沦落为程序员,纪念下。
通过hook键盘,将dll注入到游戏主程序。游戏中,F12呼出辅助工具界面。
主要功能:通过加载、读取任务脚本,实现:指定NPC对话、跑路到指定坐标、自动杀指定数量的指定名称怪、自动拾取打怪掉落的指定物品、自动加血加蓝。
文件分类:配置文件加载函数、对话框程序主程序、基础功能函数、主要功能函数、任务脚本解析函数、线程处理调用类函数
#include <IniFile.h>
//加载配置文件,各类基础数据的获取
//Call DWORD call_attack,call_choose,call_findway,call_usegoods,call_pickup,call_selectmonster,call_talknpc; //Base DWORD BaseAddr,BaseOffset; //Person DWORD ps_base,ps_x,ps_y,ps_z,ps_level,ps_life,ps_magic,ps_max_life,ps_max_magic,ps_npc; //Monster DWORD mt_base1,mt_base2,mt_base3,mt_base4,mt_max,mt_id,mt_distance,mt_name1,mt_name2,mt_status,mt_select; //Backpack DWORD bp_base1,bp_base2,bp_base3,bp_max_size,bp_type,bp_id,bp_num,bp_name1,bp_name2; //Ground DWORD gd_base1,gd_base2,gd_base3,gd_max,gd_object,gd_sysid,gd_id,gd_distance,gd_name1,gd_name2; //Map DWORD Map_Target,map_offset; //Setting FLOAT st_lifepoint,st_magicpoint,st_pickup_distance,st_select_distance; char st_lifegoods[1024]={ 0},st_magicgoods[1024]={ 0},st_pickup[1024]={ 0}; DWORD st_Time_Interval; BOOL LoadConfig() { INIFILE config("D:\\game\\诛仙2·时光之书\\element\\Config.ini"); //Base BaseAddr=config.GetInteger("BASE","BaseAddr"); BaseOffset=config.GetInteger("BASE","BaseOffset"); //Person ps_base=config.GetInteger("PERSON","base"); ps_x=config.GetInteger("PERSON","x"); ps_y=config.GetInteger("PERSON","y"); ps_z=config.GetInteger("PERSON","z"); ps_level=config.GetInteger("PERSON","level"); ps_life=config.GetInteger("PERSON","life"); ps_magic=config.GetInteger("PERSON","magic"); ps_max_life=config.GetInteger("PERSON","max_life"); ps_max_magic=config.GetInteger("PERSON","max_magic"); ps_npc=config.GetInteger("PERSON","npc"); //Monster mt_base1=config.GetInteger("MONSTER","base1"); mt_base2=config.GetInteger("MONSTER","base2"); mt_base3=config.GetInteger("MONSTER","base3"); mt_base4=config.GetInteger("MONSTER","base4"); mt_max=config.GetInteger("MONSTER","max"); mt_id=config.GetInteger("MONSTER","id"); mt_distance=config.GetInteger("MONSTER","distance"); mt_name1=config.GetInteger("MONSTER","name1"); mt_name2=config.GetInteger("MONSTER","name2"); mt_status=config.GetInteger("MONSTER","status"); mt_select=config.GetInteger("MONSTER","select"); //Backpack bp_base1=config.GetInteger("BACKPACK","base1"); bp_base2=config.GetInteger("BACKPACK","base2"); bp_base3=config.GetInteger("BACKPACK","base3"); bp_max_size=config.GetInteger("BACKPACK","max_size"); bp_type=config.GetInteger("BACKPACK","type"); bp_id=config.GetInteger("BACKPACK","id"); bp_num=config.GetInteger("BACKPACK","num"); bp_name1=config.GetInteger("BACKPACK","name1"); bp_name2=config.GetInteger("BACKPACK","name2"); //Ground gd_base1=config.GetInteger("GROUND","base1"); gd_base2=config.GetInteger("GROUND","base2"); gd_base3=config.GetInteger("GROUND","base3"); gd_max=config.GetInteger("GROUND","max"); gd_object=config.GetInteger("GROUND","object"); gd_sysid=config.GetInteger("GROUND","sysid"); gd_id=config.GetInteger("GROUND"