├── POLCN_Launcher.exe ├── README.md ├── beep.wav ├── cgaapi.js ├── chatdb └── placeholder ├── emogua ├── component │ ├── bank.js │ ├── battle-sets.js │ ├── goto.js │ ├── inauguration.js │ └── profession.js ├── wrapper.js ├── 任务 │ ├── UD.js │ ├── 传送-亚留特.js │ ├── 传送-加纳.js │ ├── 传送-雪山.js │ ├── 法兰-艾尔莎.js │ ├── 生产二转.js │ └── 虚死为上.js ├── 刷刷 │ ├── 刷钱-鲁村.js │ ├── 吉拉.js │ ├── 塔-80.js │ ├── 改哥图.js │ └── 百人.js ├── 生产 │ ├── 修理.js │ ├── 修理背包.js │ ├── 制造背包.js │ ├── 刷修理-pk.js │ ├── 治疗.js │ ├── 送死刷治疗.js │ └── 鉴定背包.js └── 练级 │ ├── 140-160.js │ ├── 60-140.js │ └── 罪1.js ├── emogua1 ├── component │ ├── account.js │ ├── bank.js │ ├── battle.js │ ├── config.js │ ├── goto.js │ ├── pile.js │ ├── prepare.js │ ├── profession.js │ ├── secondary.js │ └── wrapper.js └── script │ ├── task │ └── priest.js │ └── train │ ├── 140.js │ └── 60.js ├── leo.js ├── leo ├── 1转树精.json ├── 2转神兽.json ├── 3转双王(队员).json ├── 3转双王(队长).json ├── README.md ├── bank.js ├── battle-sets.js ├── battle-status.js ├── common.js ├── goto.js ├── inauguration.js ├── pet.js ├── plugin_load.js ├── plugin_petFilter.js ├── profession.js ├── wrapper.js ├── ~功能--东门银行.js ├── ~功能--测试.js ├── ~功能--登出.js ├── ~功能--组队.js ├── ~功能--防掉线.js ├── ~功能--高速遇敌.js ├── ~抓宠(1火2抓).json ├── ~抓宠(2地3抓).json ├── ~抓宠(2地3抓改哥).json ├── ~抓宠(2火3抓).json ├── ~默认.json ├── 一条龙小号.json ├── 一条龙练宠.json ├── 一条龙队长.json ├── 任务--UD.js ├── 任务--UD一条龙.js ├── 任务--五转任务.js ├── 任务--人神(车头).js ├── 任务--半山1.js ├── 任务--半山2.js ├── 任务--半山3.js ├── 任务--半山5.js ├── 任务--半山6.js ├── 任务--半山刷蛋.js ├── 任务--卵1.js ├── 任务--卵3.js ├── 任务--卵4(修复).js ├── 任务--卵4.js ├── 任务--双王.js ├── 任务--四转换花(仙人和侦探).js ├── 任务--四转换花(自动交易).js ├── 任务--士兵学宠物4级技能.js ├── 任务--天界1.js ├── 任务--天界2.js ├── 任务--天界3.js ├── 任务--天界刷宠.js ├── 任务--就职传教.js ├── 任务--就职咒术(保证书).js ├── 任务--就职咒术.js ├── 任务--就职驯兽(转职).js ├── 任务--就职驯兽.js ├── 任务--忍者就职.js ├── 任务--战斗系1转任务(树精长老的末日).js ├── 任务--战斗系2转任务(挑战神兽).js ├── 任务--战斗系3转任务(诅咒的迷宫).js ├── 任务--承认之戒(班车).js ├── 任务--承认之戒.js ├── 任务--捉迷藏和接字游戏.js ├── 任务--探险专家(贝爷).js ├── 任务--时空之门1(冰雪的牢城).js ├── 任务--时空之门2(风鸣之塔).js ├── 任务--树精.js ├── 任务--森罗万象(土之洞窟).js ├── 任务--森罗万象(树海).js ├── 任务--森罗万象(水之洞窟).js ├── 任务--森罗万象(炎之洞窟).js ├── 任务--森罗万象(自动拿4乐谱).js ├── 任务--森罗万象(风之洞窟).js ├── 任务--百人道场单人GH奖.js ├── 任务--神兽.js ├── 任务--精灵之卵.js ├── 任务--转职保证书(长老证).js ├── 任务--魔物狩猎大会(娱乐版).js ├── 保证书.json ├── 刷改哥图.json ├── 功能--买800耐回力.js ├── 功能--传咒互转(自动战斗).js ├── 功能--修理.js ├── 功能--偷狗粮.js ├── 功能--刷塔98层谜语箱(车头).js ├── 功能--刷改造烈风哥布林图纸.js ├── 功能--刷王冠小猫帽.js ├── 功能--医生烧治疗.js ├── 功能--医生随队治疗.js ├── 功能--十年戒指.js ├── 功能--原地伐木.js ├── 功能--原地拾荒.js ├── 功能--原地挖矿.js ├── 功能--原地狩猎.js ├── 功能--去哥拉尔.js ├── 功能--吉拉刷魅力.js ├── 功能--向NPC买材料.js ├── 功能--咬花(李贝留斯不逃跑).js ├── 功能--咬花.js ├── 功能--哥拉尔去新城.js ├── 功能--封印沙滩烧盟约.js ├── 功能--封印进阶.js ├── 功能--开箱子(T8).js ├── 功能--开箱子(克萝蒂娜丝).js ├── 功能--开箱子(水之洞窟).js ├── 功能--开箱子(狗洞).js ├── 功能--开箱子(随机迷宫).js ├── 功能--开箱子(雪山).js ├── 功能--开箱子(黄金哥布林).js ├── 功能--弓箭手进阶.js ├── 功能--新城到各村开传.js ├── 功能--新城去哥拉尔.js ├── 功能--新手任务.js ├── 功能--海神刷勾玉.js ├── 功能--灵堂刷声望.js ├── 功能--点BOSS战斗.js ├── 功能--称号成就提交.js ├── 功能--穿墙.js ├── 功能--自动寻路.js ├── 功能--获取迷宫出入口标记.js ├── 功能--走随机迷宫.js ├── 功能--跑长期(自动吃水).js ├── 功能--过海队长.js ├── 功能--迷宫寻找NPC(4转黑龙).js ├── 功能--迷宫寻找NPC(随机迷宫).js ├── 功能--鉴定.js ├── 功能--银行全取.js ├── 功能--银行全存.js ├── 功能--银行取钱.js ├── 功能--问阿蒙拿称号.js ├── 功能--队员进组.js ├── 功能--雷达.js ├── 功能--驯兽进阶.js ├── 功能--鲁村刷钱(定居哥城).js ├── 功能--鲁村刷钱(定居新城).js ├── 功能--鲁村刷钱(自动存银行).js ├── 十年戒指队员.json ├── 十年戒指队长.json ├── 卵4自动战斗设置(仅供参考).json ├── 圣骑任务.json ├── 封印--原地抓满(多宠自动战斗).js ├── 封印--原地抓满(自动战斗).js ├── 封印--原地抓满.js ├── 封印--哥布林(自动战斗).js ├── 封印--哥布林和迷你蝙蝠.js ├── 封印--常规合集(自动战斗+自动算档+消息服务).js ├── 封印--水龙蜥(自动战斗).js ├── 封印--水龙蜥(自动战斗+自动算档+消息服务).js ├── 封印--水龙蜥.js ├── 封印--烈风哥布林.js ├── 开箱子.json ├── 技能--兽王学完美调教.js ├── 技能--学因果报应.js ├── 技能--学戒骄戒躁(车头).js ├── 技能--学戒骄戒躁.js ├── 技能--学抗性技能.js ├── 技能--学精神风暴.js ├── 技能--学羊头狗肉.js ├── 技能--学虚死为上.js ├── 技能--宠物学蛋2.js ├── 技能--护士烧急救.js ├── 技能--烧修理(公共服务).js ├── 技能--烧变装.js ├── 技能--烧变身.js ├── 技能--烧技能(半山6后小岛).js ├── 技能--烧技能(坎村).js ├── 技能--烧技能(盆地).js ├── 技能--烧技能(石头).js ├── 技能--烧技能(营地).js ├── 技能--烧鉴定(公共服务).js ├── 技能--烧鉴定(家具).js ├── 技能--烧鉴定(鱼).js ├── 技能--烧骑乘.js ├── 烧技能-强力补血魔法.json ├── 烧技能-恢复魔法.json ├── 烧技能-气绝回复.json ├── 烧技能-洁净魔法.json ├── 烧技能-窃盗.json ├── 烧技能-精灵的盟约.json ├── 烧技能-补血魔法.json ├── 烧技能-超强补血魔法.json ├── 烧技能参考配置.json ├── 生产--制头盔单人全自动冲1-8级技能(刷1级盔卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--制帽师单人全自动冲1-8级技能(刷1级帽卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--制盾师单人全自动冲1-10级技能(刷1A盾卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--制衣师单人全自动冲1-8级技能(刷1级衣卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--制袍师单人全自动冲1-8级技能(刷1级袍卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--制铠师单人全自动冲1-8级技能(刷1级铠卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--制靴师单人全自动冲1-8级技能(刷1级靴卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--制鞋师单人全自动冲1-8级技能(刷1级鞋卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--挖矿(8达马斯矿).js ├── 生产--挖矿(9谢尔哈特矿).js ├── 生产--料理(10鱼翅汤).js ├── 生产--料理(2法国面包)卖店.js ├── 生产--料理(4烧鸡)卖店.js ├── 生产--料理(4烧鸡)存银行.js ├── 生产--料理(6寿喜锅)-单人优选版.js ├── 生产--料理(6寿喜锅).js ├── 生产--料理(心大佬智能版LEO).js ├── 生产--血瓶(1级血)卖店.js ├── 生产--血瓶(2级血)卖店.js ├── 生产--血瓶(3级血)卖店.js ├── 生产--造刀师单人全自动冲1-10级技能(刷1A小刀卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--造剑师单人全自动冲1-8级技能(刷1A剑卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--造弓师单人全自动冲1-8级技能(刷1A弓卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--造斧师单人全自动冲1-8级技能(刷1A斧卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--造杖师单人全自动冲1-8级技能(刷1A杖卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--造枪师单人全自动冲1-8级技能(刷1A矛卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--造镖师单人全自动冲1-10级技能(刷1A回力镖卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 生产--铸剑师单人全自动冲1-8级技能(刷1A剑卖店)-大叔memory制作 - (需放在leo文件夹里).js ├── 百人配置--传教.json ├── 百人配置--打手.json ├── 练级--01~10森林杀鸡.js ├── 练级--100~125黑一.js ├── 练级--100~125黑一[班车].js ├── 练级--100~138黑龙.js ├── 练级--10~30高地杀鸡.js ├── 练级--10~30高地杀鸡[班车].js ├── 练级--115~125旧日迷宫.js ├── 练级--125~138龙顶.js ├── 练级--125~150旧日之塔.js ├── 练级--138~160半山.js ├── 练级--30~43黄金龙骨.js ├── 练级--30~43黄金龙骨[班车].js ├── 练级--40~50高地银狮.js ├── 练级--43~50雪塔49.js ├── 练级--45~60回廊.js ├── 练级--45~60回廊[班车].js ├── 练级--50~55雪塔55.js ├── 练级--55~60雪塔59.js ├── 练级--60~80营地.js ├── 练级--60~80营地[班车].js ├── 练级--65~75雪塔70.js ├── 练级--70~90沙滩.js ├── 练级--70~90沙滩[班车].js ├── 练级--73~83蝎子(仙人掌).js ├── 练级--80~100沙滩登出回补.js ├── 练级--80~100石头.js ├── 练级--94~105蜥蜴.js ├── 蛋2.json ├── 贝爷--传教.json ├── 贝爷--队友.json ├── 逃跑.json ├── 通用任务配置.json ├── 通用配置--传教.json └── 通用配置--小号.json ├── mfc71.dll ├── msvcp140.dll ├── msvcp140_1.dll ├── msvcp140_2.dll ├── msvcp71.dll ├── msvcp71d.dll ├── msvcr71.dll ├── msvcr71d.dll ├── navigator.js ├── package.json ├── ucrtbase.dll ├── vc_redist.x86.exe ├── vcruntime140.dll ├── 刷王冠小猫帽.js ├── 十年戒指.js ├── 双王.js ├── 咬花.js ├── 四转换花.js ├── 学因果.js ├── 定居哥拉尔.js ├── 定居新城.js ├── 定居阿凯鲁法.js ├── 宠物摆摊.js ├── 就职咒术.js ├── 就职弓箭.js ├── 就职樵夫.js ├── 就职饲养.js ├── 就职驯兽.js ├── 就职魔术.js ├── 承认戒指.js ├── 探险手环(贝爷).js ├── 树精.js ├── 矿山钥匙.js ├── 神兽.js ├── 走随机迷宫.js ├── 转职保证书(卵4).js ├── 通用买布脚本.js ├── 通用挂机脚本.js ├── 通用挂机脚本 ├── 主插件 │ ├── 五转碎片.js │ ├── 制造.js │ ├── 十年戒指.js │ ├── 半山.js │ ├── 双百制造.js │ ├── 回廊.js │ ├── 探险手环.js │ ├── 旧日之地.js │ ├── 沙滩.js │ ├── 深蓝线检测.js │ ├── 深蓝药剂.js │ ├── 深蓝鉴定.js │ ├── 灵堂门口.js │ ├── 盆地.js │ ├── 营地.js │ ├── 蜥蜴.js │ ├── 蝎子.js │ ├── 诅咒.js │ ├── 采集.js │ ├── 高地.js │ ├── 鱼翅厨师.js │ ├── 鲁村.js │ └── 黑龙.js ├── 公共模块 │ ├── interrupt.js │ ├── 伐木.js │ ├── 刷双百鹿皮.js │ ├── 双百买布.js │ ├── 双百伊尔鹿皮.js │ ├── 双百挖铜.js │ ├── 双百新城鹿皮.js │ ├── 双百轻木.js │ ├── 哥拉尔回补.js │ ├── 挖矿.js │ ├── 治疗自己.js │ ├── 法兰回补.js │ ├── 深蓝毒蛇.js │ ├── 深蓝百里香.js │ ├── 深蓝瞿麦.js │ ├── 深蓝萝卜.js │ ├── 灵堂回补.js │ ├── 狩猎.js │ ├── 登出检查定居地.js │ ├── 登出防卡住.js │ ├── 矮人卖石.js │ ├── 矮人回补.js │ ├── 组队模式.js │ ├── 营地卖石.js │ ├── 营地回补.js │ ├── 通用登出回补.js │ ├── 采花.js │ ├── 采集后操作.js │ ├── 里堡卖石.js │ ├── 里堡回补.js │ ├── 鉴定自动1到10.js │ ├── 高地回补.js │ ├── 鱼翅流水线盐.js │ ├── 鱼翅流水线葱.js │ ├── 鱼翅流水线鱼翅.js │ ├── 鱼翅流水线鸡蛋.js │ ├── 鲁村卖石.js │ └── 鲁村回补.js └── 子插件 │ ├── 买封印卡.js │ ├── 买桥头武器.js │ ├── 修理装备.js │ ├── 包满回补.js │ ├── 受伤医院治疗.js │ ├── 受伤飞碟治疗.js │ ├── 回补提醒.js │ ├── 工房修理装备.js │ ├── 打卡.js │ ├── 换十年戒指.js │ ├── 换水晶.js │ ├── 换龙角.js │ ├── 掉魂自动招魂.js │ ├── 监听回补.js │ ├── 监听防沉迷.js │ ├── 自动换线.js │ ├── 说话防掉线.js │ └── 队员卖石.js ├── 长期工作证.js ├── 飞碟摆摊治疗.js └── 高速遇敌.js /POLCN_Launcher.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/POLCN_Launcher.exe -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CGAssistant (scripts) 2 | 3 | ![](img/logo.png) 4 | 5 | Check [CGassistant](https://github.com/hzqst/CGAssistant) for what you want. 6 | 7 | ## What is this ? 8 | 9 | This is the repository that stores javascripts and additional resources that required by CGAssistant. 10 | 11 | ## 这是啥 12 | 13 | 该项目仅用于保存脚本和CGAssistant所需的资源文件。 -------------------------------------------------------------------------------- /beep.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/beep.wav -------------------------------------------------------------------------------- /chatdb/placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/chatdb/placeholder -------------------------------------------------------------------------------- /emogua/component/bank.js: -------------------------------------------------------------------------------- 1 | // 中文标识 2 | const Roles = { 3 | store: 1, 4 | worker: 2 5 | }; 6 | let isBankFull = false; 7 | module.exports = function(cga, options = {role: 1, position: 1, itemFilter: () => true, gold: 0}) { 8 | let position = [82, 7]; 9 | if (options.position == 2) { 10 | position = [82, 9]; 11 | } 12 | if (isBankFull) { 13 | console.log('银行已满'); 14 | return Promise.reject(); 15 | } 16 | console.log('存银行'); 17 | return cga.emogua.goto(n => n.falan.mbank).then( 18 | () => cga.emogua.turnOrientation(0) 19 | ).then( 20 | () => cga.emogua.saveToBank(options.itemFilter, options.gold) 21 | ).then( 22 | full => isBankFull = full 23 | ); 24 | }; 25 | -------------------------------------------------------------------------------- /emogua/任务/传送-亚留特.js: -------------------------------------------------------------------------------- 1 | const teams = [ 2 | ['队长名','队员名1','队员名2','队员名3','队员名4'], 3 | ['队长名','队员名1','队员名2','队员名3','队员名4'] 4 | ]; 5 | require('../wrapper').then(cga => { 6 | console.log('亚留特开传送'); 7 | const {team, captain, isCaptain, teamNumber} = cga.emogua.parseTeams(teams); 8 | 9 | cga.emogua.autoBattle(cga.emogua.AutoBattlePreset.getAttackSets()); 10 | cga.emogua.waitMessageUntil(chat => { 11 | if (chat.msg && chat.msg.indexOf('开传送') >= 0) { 12 | const npc = cga.GetMapUnits().find(u => u.unit_name.indexOf('传送石管理') >= 0); 13 | if (npc) cga.emogua.turnTo(npc.xpos, npc.ypos); 14 | } 15 | }); 16 | Promise.resolve().then(() => { 17 | if (cga.emogua.getTeamNumber() == 1) { 18 | return cga.emogua.logBack().then( 19 | () => cga.emogua.prepare() 20 | ).then( 21 | () => cga.emogua.logBack() 22 | ).then(() => { 23 | if (isCaptain) { 24 | return cga.emogua.autoWalk([141,110]).then( 25 | () => cga.emogua.waitTeamBlock(teamNumber) 26 | ).then( 27 | () => cga.emogua.goto(n => n.falan.eout) 28 | ).then( 29 | () => cga.emogua.autoWalkList([ 30 | [672,223,'哈巴鲁东边洞穴 地下1楼'],[41,8,'哈巴鲁东边洞穴 地下2楼'],[17,18] 31 | ]) 32 | ).then( 33 | () => cga.emogua.forceMoveTo([17,16]) 34 | ).then( 35 | () => cga.emogua.autoWalkList([ 36 | [16,11,'哈巴鲁东边洞穴 地下1楼'],[30,4,'芙蕾雅'],[596,84,'亚留特村'],[49,65],[49,47],[56,48,'*'],[22,9,'*'], 37 | [5,13],[4,14],[5,13],[4,14],[5,13] 38 | ]) 39 | ).then( 40 | () => cga.emogua.sayWords('开传送') 41 | ); 42 | } 43 | return cga.emogua.autoWalk([141,109]).then( 44 | () => cga.emogua.joinTeamBlock(141, 110, captain) 45 | ); 46 | }); 47 | } 48 | }); 49 | }); 50 | -------------------------------------------------------------------------------- /emogua/任务/传送-雪山.js: -------------------------------------------------------------------------------- 1 | const teams = [ 2 | ['队长名','队员名1','队员名2','队员名3','队员名4'], 3 | ['队长名','队员名1','队员名2','队员名3','队员名4'] 4 | ]; 5 | require('../wrapper').then(cga => { 6 | console.log('雪山开传送'); 7 | const {team, captain, isCaptain, teamNumber} = cga.emogua.parseTeams(teams); 8 | 9 | cga.emogua.autoBattle(cga.emogua.AutoBattlePreset.getAttackSets()); 10 | cga.emogua.waitMessageUntil(chat => { 11 | if (chat.msg && chat.msg.indexOf('开传送') >= 0) { 12 | const npc = cga.GetMapUnits().find(u => u.unit_name.indexOf('传送石管理') >= 0); 13 | if (npc) cga.emogua.turnTo(npc.xpos, npc.ypos); 14 | } 15 | }, true); 16 | 17 | const teamGo = () => Promise.resolve().then(() => { 18 | if (isCaptain) { 19 | return cga.emogua.walkList([[21,33]]).then( 20 | () => cga.emogua.waitTeamBlock(teamNumber) 21 | ).then( 22 | () => cga.emogua.autoWalkList([ 23 | [20,8,'莎莲娜海底洞窟 地下2楼'], 24 | [11,9,'莎莲娜海底洞窟 地下1楼'], 25 | [24,11,'莎莲娜'], 26 | [217,455,'杰诺瓦镇'], 27 | [58,43,'村长的家'], 28 | [13,7,'杰诺瓦镇的传送点'], 29 | [7,8] 30 | ]).then( 31 | () => cga.emogua.walkList([ 32 | [6,7],[7,8],[6,7],[7,8] 33 | ]) 34 | ) 35 | ).then( 36 | () => cga.emogua.delay(3000) 37 | ).then( 38 | () => cga.emogua.sayWords('开传送') 39 | ).then( 40 | () => cga.emogua.delay(15000) 41 | ).then( 42 | () => cga.emogua.autoWalkList([ 43 | [14,6,'村长的家'], 44 | [1,10,'杰诺瓦镇'], 45 | [44,33,'医院'], 46 | [10,5] 47 | ]) 48 | ).then( 49 | () => cga.emogua.recharge(0) 50 | ).then( 51 | () => cga.emogua.autoWalkList([ 52 | [1,9,'杰诺瓦镇'], 53 | [24,40,'莎莲娜'], 54 | [235,338,'*'], 55 | [45,9,'*'], 56 | [57,13,'*'], 57 | [36,7,'莎莲娜'], 58 | [183,161,'阿巴尼斯村'], 59 | [36,54,'*'], 60 | [6,5,'*'], 61 | [9,9,'阿巴尼斯村的传送点'], 62 | [5,14] 63 | ]).then( 64 | () => cga.emogua.walkList([ 65 | [4,15],[5,14],[4,15],[5,14] 66 | ]) 67 | ) 68 | ).then( 69 | () => cga.emogua.delay(3000) 70 | ).then( 71 | () => cga.emogua.sayWords('开传送') 72 | ).then( 73 | () => cga.emogua.delay(15000) 74 | ).then( 75 | () => cga.emogua.autoWalkList([ 76 | [5,4,'*'], 77 | [6,13,'*'], 78 | [6,13,'阿巴尼斯村'], 79 | [47,64,'医院'], 80 | [10,6] 81 | ]) 82 | ).then( 83 | () => cga.emogua.recharge(0) 84 | ).then( 85 | () => cga.emogua.autoWalkList([ 86 | [1,9,'阿巴尼斯村'], 87 | [37,71,'莎莲娜'], 88 | [117,100,'魔法大学'], 89 | [74,93,'魔法大学内部'], 90 | [40,20] 91 | ]) 92 | ).then( 93 | () => console.log('结束') 94 | ); 95 | } 96 | return cga.emogua.joinTeamBlock(21, 33, captain); 97 | }); 98 | if (cga.GetMapName() == '莎莲娜海底洞窟 地下1楼') { 99 | teamGo(); 100 | } else { 101 | cga.emogua.logBack().then( 102 | () => cga.emogua.prepare() 103 | ).then( 104 | () => cga.emogua.goto(n => n.falan.wout) 105 | ).then( 106 | () => cga.emogua.autoWalkList([ 107 | [200,165] 108 | ]) 109 | ).then( 110 | () => cga.emogua.talkNpc(0, cga.emogua.talkNpcSelectorYes) 111 | ).then( 112 | () => teamGo() 113 | ); 114 | } 115 | }); 116 | -------------------------------------------------------------------------------- /emogua/任务/法兰-艾尔莎.js: -------------------------------------------------------------------------------- 1 | 2 | require('../wrapper').then(cga => { 3 | console.log('法兰-艾尔莎'); 4 | cga.emogua.autoBattle(cga.emogua.AutoBattlePreset.getEscapeSets()); 5 | cga.emogua.logBack().then( 6 | () => cga.emogua.prepare() 7 | ).then( 8 | () => cga.emogua.goto(n => n.castle.x) 9 | ).then( 10 | () => cga.emogua.autoWalk([28,88]) 11 | ).then( 12 | () => cga.emogua.talkNpc(cga.emogua.talkNpcSelectorYes, '*') 13 | ).then( 14 | () => cga.emogua.autoWalkList([ 15 | [19, 21, '法兰城遗迹'],[96, 138, '盖雷布伦森林'],[124, 168, '温迪尔平原'],[264, 108, '艾尔莎岛'],[141,105] 16 | ]) 17 | ).then( 18 | () => cga.emogua.talkNpc(0, cga.emogua.talkNpcSelectorYes) 19 | ); 20 | }); 21 | -------------------------------------------------------------------------------- /emogua/任务/生产二转.js: -------------------------------------------------------------------------------- 1 | require('../wrapper').then(cga => { 2 | console.log('生产二转,需要卡好交易再运行', new Date().toLocaleString()); 3 | cga.emogua.autoBattle(cga.emogua.AutoBattlePreset.getEscapeSets()); 4 | 5 | cga.emogua.keepAlive(); 6 | cga.getInventoryItems().forEach(i => { 7 | if (['好像很好喝的酒', '好像很好吃的起司'].indexOf(i.name) >= 0) { 8 | cga.emogua.dropItems([i.pos]); 9 | } 10 | }); 11 | let timer; 12 | cga.emogua.logBack().then( 13 | () => cga.emogua.prepare({repairFlag: 0}) 14 | ).then( 15 | () => cga.emogua.goto(n => n.teleport.ghana) 16 | ).then( 17 | () => cga.emogua.autoWalkList([ 18 | [51,34,'酒吧'],[12,4] 19 | ]) 20 | ).then( 21 | () => cga.emogua.talkNpc(1, cga.emogua.talkNpcSelectorYes) 22 | ).then( 23 | () => timer = Date.now() 24 | ).then(() => cga.emogua.logBack()).then( 25 | () => cga.emogua.goto(n => n.falan.eout) 26 | ).then( 27 | () => cga.emogua.autoWalkList([ 28 | [672,223,'哈巴鲁东边洞穴 地下1楼'],[41,8,'哈巴鲁东边洞穴 地下2楼'],[17,18] 29 | ]) 30 | ).then( 31 | () => cga.emogua.forceMoveTo([17,16]) 32 | ).then( 33 | () => cga.emogua.autoWalkList([ 34 | [16,11,'哈巴鲁东边洞穴 地下1楼'], 35 | [30,4,'芙蕾雅'], 36 | [596,84,'亚留特村'], 37 | [52,63,'医院'], 38 | [10,5] 39 | ]) 40 | ).then( 41 | () => cga.emogua.recharge(0) 42 | ).then( 43 | () => cga.emogua.autoWalkList([ 44 | [2,9,'亚留特村'], 45 | [56,48,'村长的家'], 46 | [17,12] 47 | ]) 48 | ).then( 49 | () => cga.emogua.waitUntil(() => { 50 | return (Date.now() - timer) >= 3603000; 51 | }, 3000) 52 | ).then( 53 | () => cga.emogua.talkNpc(6, cga.emogua.talkNpcSelectorYes) 54 | ).then( 55 | () => timer = Date.now() 56 | ).then(() => { 57 | // Promise.resolve().then( 58 | // () => cga.emogua.autoWalkList([ 59 | // [6,13,'亚留特村'], 60 | // [51,65], 61 | // [67,64,'芙蕾雅'], 62 | // [691,188,'哈巴鲁东边洞穴 地下1楼'], 63 | // [21,39,'哈巴鲁东边洞穴 地下2楼'], 64 | // [17,16] 65 | // ]) 66 | // ).then( 67 | // () => cga.emogua.forceMoveTo([17,18]) 68 | // ).then( 69 | // () => cga.emogua.autoWalkList([ 70 | // [62,65,'哈巴鲁东边洞穴 地下1楼'], 71 | // [9,37,'芙蕾雅'], 72 | // [470,196,'法兰城'], 73 | // [221,83,'医院'], 74 | // [8,31] 75 | // ]) 76 | // ).then( 77 | // () => cga.emogua.recharge(6) 78 | // ).then( 79 | // () => cga.emogua.autoWalkList([ 80 | // [12,42,'法兰城'], 81 | // [233,78] 82 | // ]) 83 | // ); 84 | return cga.emogua.logBack().then( 85 | () => cga.emogua.prepare({repairFlag: 0}) 86 | ); 87 | }).then( 88 | () => cga.emogua.goto(n => n.falan.wout) 89 | ).then( 90 | () => cga.emogua.autoWalk([200,165]) 91 | ).then( 92 | () => cga.emogua.talkNpc(0, cga.emogua.talkNpcSelectorYes) 93 | ).then( 94 | () => cga.emogua.autoWalkList([ 95 | [20,8,'莎莲娜海底洞窟 地下2楼'], 96 | [11,9,'莎莲娜海底洞窟 地下1楼'], 97 | [24,11,'莎莲娜'], 98 | [217,455,'杰诺瓦镇'], 99 | [38,59,'民家'], 100 | [9,4] 101 | ]) 102 | ).then( 103 | () => cga.emogua.waitUntil(() => { 104 | return (Date.now() - timer) >= 3603000; 105 | }, 3000) 106 | ).then( 107 | () => cga.emogua.talkNpc(6, cga.emogua.talkNpcSelectorYes) 108 | ).then( 109 | () => console.log('任务完成') 110 | ); 111 | }); 112 | -------------------------------------------------------------------------------- /emogua/刷刷/刷钱-鲁村.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 鲁村刷钱 3 | */ 4 | const protect = { // 遇敌保护条件 5 | minHp: 300, 6 | minMp: 30, 7 | minPetHp: 300, 8 | minPetMp: 30, 9 | maxItemNumber: 17 10 | }; 11 | require('../wrapper').then(cga => { 12 | console.log('鲁村刷钱-建议火风水晶'); 13 | const sets = []; 14 | sets.push({ 15 | user: 1, 16 | check: context => context.enemies.length >= 3, 17 | type: '技能', skillName: '气功弹', skillLevel: 5, 18 | targets: context => cga.emogua.AutoBattlePreset.getSortedEnemies(context) 19 | }); 20 | sets.push({ 21 | user: 5, 22 | check: context => true, 23 | type: '攻击', 24 | targets: context => cga.emogua.AutoBattlePreset.getSortedEnemies(context) 25 | }); 26 | sets.push({ 27 | user: 2, 28 | check: context => context.enemies.length >= 6, 29 | skillName: '飓风吐息', 30 | targets: context => context.enemies.map(u => u.pos) 31 | }); 32 | sets.push({ 33 | user: 2, 34 | check: context => context.enemies.length >= 3, 35 | skillName: '气功弹', 36 | targets: context => cga.emogua.AutoBattlePreset.getSortedEnemies(context) 37 | }); 38 | sets.push({ 39 | user: 2, 40 | check: context => true, 41 | skillName: '攻击', 42 | targets: context => cga.emogua.AutoBattlePreset.getSortedEnemies(context) 43 | }); 44 | cga.emogua.autoBattle(sets); 45 | 46 | cga.emogua.recursion( 47 | () => Promise.resolve().then(() => { 48 | const info = cga.emogua.getMapInfo(); 49 | if (info.name == '库鲁克斯岛' && (info.x >= 290 && info.x <= 320) && (info.y >= 870 && info.y <= 890)) { 50 | return cga.emogua.autoWalk([321,883]).then( 51 | () => cga.emogua.delay(3000) 52 | ).then( 53 | () => cga.emogua.autoWalk([322,883,'鲁米那斯']) 54 | ); 55 | } else if (info.name == '艾尔莎岛') { 56 | return cga.emogua.prepare({badge: true, crystalName: '火风的水晶(5:5)'}); 57 | } 58 | }).then(() => { 59 | const playerInfo = cga.GetPlayerInfo(); 60 | if (playerInfo.gold >= 990000) { 61 | console.log('钱包满了'); 62 | return Promise.reject(); 63 | } 64 | if (playerInfo.souls > 0) { 65 | return cga.emogua.logBack().then( 66 | () => cga.emogua.prepare({badge: true, crystalName: '火风的水晶(5:5)'}) 67 | ); 68 | } 69 | if (playerInfo.hp < playerInfo.maxhp || playerInfo.mp < playerInfo.maxmp) { 70 | return cga.emogua.goto(n => n.lumi.nurse).then( 71 | () => cga.emogua.recharge(0) 72 | ); 73 | } 74 | }).then(() => { 75 | if (cga.getInventoryItems().length > protect.maxItemNumber) { 76 | return cga.emogua.goto(n => n.lumi.sell).then( 77 | () => cga.emogua.sell(0) 78 | ); 79 | } 80 | }).then( 81 | () => cga.emogua.goto(n => n.lumi.door).then( 82 | () => cga.emogua.autoWalk([305,883]) 83 | ).then( 84 | () => cga.emogua.encounter(protect) 85 | ) 86 | ) 87 | ); 88 | }); 89 | -------------------------------------------------------------------------------- /emogua/刷刷/吉拉.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 如果要获取魅力,一定要人打死,合击也不行 3 | * 吉拉 23 4 | * 战斗 1-52(70) 53(20) 54-107(10) 无 5 | * 生产 1-52(60) 53(10) 无 6 | * 巴雷利 26 7 | * 生产 1-55(60) 56-58(50) 8 | * 伊鲁玛 29 9 | * 生产 1-61(60) 62-64(50) 10 | * 伊佐塔 32 11 | * 生产 1-67(60) 68-70(50) 12 | * 伍娜 35 13 | * 生产 1-71(60) 72-76(50) 14 | */ 15 | let npc = '吉拉'; 16 | require('../wrapper').then(cga => { 17 | const player = cga.GetPlayerInfo(); 18 | if (player.level > 54 && player.level < 59) { 19 | npc = '巴雷利'; 20 | } else if (player.level > 58 && player.level < 65) { 21 | npc = '伊鲁玛'; 22 | } 23 | console.log(npc, new Date().toLocaleString()); 24 | cga.emogua.autoBattle(cga.emogua.AutoBattlePreset.getAttackSets()); 25 | cga.emogua.recursion( 26 | () => cga.emogua.logBack().then( 27 | () => cga.emogua.prepare({repairFlag: 0}) 28 | ).then( 29 | () => cga.emogua.goto(n => n.falan.s1) 30 | ).then( 31 | () => cga.emogua.autoWalk([124, 161]) 32 | ).then( 33 | () => cga.emogua.turnOrientation(4, '竞技场的入口') 34 | ).then( 35 | () => cga.emogua.autoWalkList([ 36 | [27,14,'治愈的广场'], 37 | [25,13] 38 | ]) 39 | ).then( 40 | () => cga.emogua.talkNpc(0,cga.emogua.talkNpcSelectorYes,'竞技场') 41 | ).then( 42 | () => cga.emogua.autoWalkList([ 43 | [22,13,'*'], 44 | [15,8,'*'], 45 | [22,8,'*'], 46 | [15,8,'*'], 47 | [22,16,'*'], 48 | [16,12] 49 | ]) 50 | ).then( 51 | () => cga.emogua.dropItems(i => i.name == '斗士之证') 52 | ).then( 53 | () => cga.emogua.talkNpc(6,cga.emogua.talkNpcSelectorYes) 54 | ).then( 55 | () => cga.emogua.autoWalk([16,6]) 56 | ).then( 57 | () => cga.emogua.talkNpc(4,cga.emogua.talkNpcSelectorYes) 58 | ).then( 59 | () => cga.emogua.talkNpc(7,cga.emogua.talkNpcSelectorYes) 60 | ).then(() => { 61 | let position = [31,23]; 62 | let orientation = 0; 63 | if (npc == '巴雷利') { 64 | position = [28,24]; 65 | orientation = 2; 66 | } 67 | return cga.emogua.autoWalk(position).then( 68 | () => cga.emogua.recursion( 69 | () => cga.emogua.talkNpc(orientation,cga.emogua.talkNpcSelectorYes).then( 70 | () => cga.emogua.waitAfterBattle() 71 | ).then(() => { 72 | const f = cga.getInventoryItems().find(i => i.name == '斗士之证' && i.info != '$4你的斗士之证'); 73 | const pet = cga.GetPetsInfo().find(e => e.battle_flags === 2); 74 | if (f && cga.GetPlayerInfo().hp > 200 && (!pet || pet.hp > 200)) { 75 | return cga.emogua.dropItems([f.pos]); 76 | } 77 | return Promise.reject(); 78 | }) 79 | ) 80 | ); 81 | }) 82 | ); 83 | }); 84 | -------------------------------------------------------------------------------- /emogua/刷刷/塔-80.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 需要定居新城 3 | */ 4 | const captain = 'xxx'; // 队长名字 5 | const teamNumber = 5; // 队伍人数 6 | let protect = { // 遇敌保护条件 7 | minHp: 200, 8 | minMp: 10, 9 | minPetHp: 200, 10 | minPetMp: 10, 11 | maxItemNumber: 19, 12 | minTeamNumber: teamNumber 13 | }; 14 | 15 | require('../wrapper').then(cga => { 16 | console.log('塔-80'); 17 | cga.emogua.autoBattle(cga.emogua.AutoBattlePreset.getAttackSets()); 18 | 19 | const isCaptain = cga.GetPlayerInfo().name == captain; 20 | cga.emogua.recursion( 21 | () => Promise.resolve().then(() => { 22 | if (cga.emogua.getTeamNumber() == 1) { 23 | return cga.emogua.logBack().then( 24 | () => cga.emogua.prepare() 25 | ).then( 26 | () => cga.emogua.goto(n => n.elsa.x) 27 | ).then( 28 | () => cga.emogua.autoWalk([165,153]) 29 | ).then( 30 | () => cga.emogua.talkNpc(2,cga.emogua.talkNpcSelectorYes,'*') 31 | ).then(() => { 32 | if (isCaptain) { 33 | return cga.emogua.autoWalk([93,63]).then( 34 | () => cga.emogua.waitTeamBlock(teamNumber) 35 | ); 36 | } 37 | }); 38 | } 39 | }).then(() => { 40 | if (isCaptain || teamNumber == 1) { 41 | return cga.emogua.autoWalkList([ 42 | [90,99,'*'],[108,39,'*'],[75,50,'*'],[22,44,'*'] 43 | ]).then( 44 | () => cga.emogua.encounter(protect) 45 | ).then(cga.emogua.leaveTeam); 46 | } 47 | }).then(() => { 48 | if (!isCaptain) { 49 | cga.emogua.checkStopEncounter(protect, true); 50 | } 51 | return cga.emogua.delay(5000); 52 | }) 53 | ); 54 | }); 55 | -------------------------------------------------------------------------------- /emogua/生产/修理.js: -------------------------------------------------------------------------------- 1 | require('../wrapper').then(cga => { 2 | const skill = cga.GetSkillsInfo().filter(e => e.name.indexOf('修理') >= 0).sort((e1, e2) => e2.lv - e1.lv)[0]; 3 | if (skill) { 4 | console.log(skill.name); 5 | cga.emogua.keepAlive(); 6 | cga.emogua.recursion(() => Promise.resolve().then(() => 7 | cga.emogua.goto(n => n.falan.mbank).then( 8 | () => cga.emogua.autoWalk([83, 8]) 9 | ).then( 10 | () => cga.emogua.turnOrientation(4) 11 | ).then(() => cga.emogua.recursion(() => { 12 | const playerInfo = cga.GetPlayerInfo(); 13 | // if (playerInfo.health > 0) { 14 | // return false; 15 | // } 16 | if (playerInfo.mp < 200) { 17 | return cga.emogua.turnOrientation(0).then( 18 | () => cga.emogua.delay(5000) 19 | ).then( 20 | () => cga.emogua.turnOrientation(4) 21 | ); 22 | } else { 23 | return cga.emogua.waitMessage(chat => { 24 | if (chat.msg && chat.msg.indexOf(skill.name) > 0) { 25 | const tradeParty = cga.GetMapUnits().find(u => u.unit_id == chat.unitid); 26 | if (tradeParty) { 27 | const lastItems = cga.getInventoryItems(); 28 | const emptyPositions = Array(20).fill(8).map((v, i) => i + v).filter(p => lastItems.findIndex(i => i.pos == p) < 0); 29 | return cga.emogua.trade(tradeParty.unit_name, { 30 | partyStuffsChecker: partyInfo => { 31 | return partyInfo.items.findIndex(i => !(i.type >= 0 && i.type <= 14)) < 0; 32 | } 33 | }).then(result => { 34 | if (result.received && result.received.items.length > 0) { 35 | const receivedPositions = emptyPositions.slice(0, result.received.items.length); 36 | return cga.emogua.repairAll().then( 37 | () => cga.emogua.recursion( 38 | timer => cga.emogua.trade(tradeParty.unit_name, { 39 | itemFilter: e => receivedPositions.findIndex(p => e.pos == p) >= 0 40 | }).then(tr => { 41 | return tr.success === true || (Date.now() - timer) > 120000 ? Promise.reject() : cga.emogua.delay(3000); 42 | }) 43 | ).then(() => console.log('交易返还结束')) 44 | ); 45 | } 46 | return cga.emogua.delay(1000); 47 | }); 48 | } 49 | } 50 | return true; 51 | }); 52 | } 53 | })).then(() => cga.emogua.logBack()) 54 | )); 55 | } 56 | }); 57 | -------------------------------------------------------------------------------- /emogua/生产/修理背包.js: -------------------------------------------------------------------------------- 1 | require('../wrapper').then(cga => { 2 | cga.emogua.repairAll(); 3 | }); 4 | -------------------------------------------------------------------------------- /emogua/生产/制造背包.js: -------------------------------------------------------------------------------- 1 | require('../wrapper').then(cga => { 2 | cga.emogua.craft('法面面包'); 3 | }); 4 | -------------------------------------------------------------------------------- /emogua/生产/治疗.js: -------------------------------------------------------------------------------- 1 | let point = [27,83]; // 可自定义飞碟站的坐标 2 | require('../wrapper').then(cga => { 3 | console.log('治疗摆摊'); 4 | cga.emogua.keepAlive(); 5 | const player = cga.GetPlayerInfo(); 6 | if (player.name == 'xxx1') { 7 | point = [27,83]; 8 | } else if (player.name == 'xxx2') { 9 | point = [27,83]; 10 | } 11 | cga.emogua.recursion( 12 | () => Promise.resolve().then(() => { 13 | if (cga.GetMapName() != '里谢里雅堡') { 14 | return cga.emogua.goto(n => n.castle.x); 15 | } 16 | if (cga.GetPlayerInfo().mp <= 100) { 17 | return cga.emogua.autoWalk([34,88]).then( 18 | () => cga.emogua.recharge(0) 19 | ); 20 | } 21 | const xy = cga.GetMapXY(); 22 | if (xy.x != point[0] || xy.y != point[1]) { 23 | return cga.emogua.autoWalk(point); 24 | } 25 | return cga.emogua.healTeammate().then( 26 | () => cga.emogua.delay(2000) 27 | ); 28 | }).catch(r => { 29 | console.log(r); 30 | return cga.emogua.delay(3000); 31 | }) 32 | ); 33 | // setInterval(() => { 34 | // cga.emogua.sayWords('自动免费治疗,道具github开源免费挂,目前测试尾声,功能已经基本齐备,作者纯因兴趣所作,QQ群300303705,欢迎胆肥伙伴加群交流~~~~',0,5,1); 35 | // }, 15000); 36 | }); 37 | -------------------------------------------------------------------------------- /emogua/生产/送死刷治疗.js: -------------------------------------------------------------------------------- 1 | const doctorName = 'milk'; // 指定医生名字 2 | require('../wrapper').then(cga => { 3 | console.log('送死刷治疗'); 4 | cga.emogua.autoBattle(cga.emogua.AutoBattlePreset.getAttackSets()); 5 | 6 | cga.emogua.recursion(() => cga.emogua.prepare({ 7 | rechargeFlag: -1, 8 | repairFlag: -1, 9 | doctorName: doctorName 10 | }).then(() => { 11 | return cga.emogua.goto(n => n.castle.x).then( 12 | () => cga.emogua.autoWalk([30, 81]) 13 | ).then( 14 | () => cga.emogua.talkNpc(6, cga.emogua.talkNpcSelectorYes, '追忆之路') 15 | ).then( 16 | () => cga.emogua.walkList([[15, 111]]) 17 | ).then( 18 | () => cga.emogua.talkNpc(6, cga.emogua.talkNpcSelectorYes).then( 19 | () => cga.emogua.delay(3000) 20 | ).then(cga.emogua.waitAfterBattle) 21 | ).then(() => cga.emogua.logBack()); 22 | })); 23 | }); 24 | -------------------------------------------------------------------------------- /emogua/生产/鉴定背包.js: -------------------------------------------------------------------------------- 1 | require('../wrapper').then(cga => { 2 | cga.emogua.assessAll(); 3 | }); 4 | -------------------------------------------------------------------------------- /emogua/练级/140-160.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 需要定居新城 3 | */ 4 | const teams = [ 5 | ['西瓜保姆','西瓜6号机','西瓜7号机','西瓜8号机','西瓜9号机'] 6 | ]; 7 | const isClock = false; // 是否打卡, 如果打卡必须艾尔莎岛启动 8 | const protect = { // 遇敌保护条件 9 | minHp: 400, 10 | minMp: 50, 11 | minPetHp: 400, 12 | minPetMp: 0 13 | }; 14 | 15 | require('../wrapper').then(cga => { 16 | console.log('半山'); 17 | const {team, captain, isCaptain, teamNumber} = cga.emogua.parseTeams(teams); 18 | protect.minTeamNumber = teamNumber; 19 | 20 | const joinPoint = {x: 64, y: 98}; 21 | cga.emogua.autoBattle(cga.emogua.getBattleSets(cga, { 22 | flag: 1, rechargePet: true, rechargeMinMp: 500 23 | })); 24 | cga.emogua.recursion( 25 | () => cga.emogua.prepare({crystalName: '水火的水晶(5:5)', badge: true, repairFlag: 0}).then(() => { 26 | const currentTeamNumber = cga.emogua.getTeamNumber(); 27 | let mapInfo = cga.emogua.getMapInfo(); 28 | if (currentTeamNumber == 1) { 29 | if (mapInfo.name == '小岛') { 30 | if (isCaptain) { 31 | if (mapInfo.x != joinPoint.x || mapInfo.y != joinPoint.y) { 32 | return cga.emogua.autoWalk([joinPoint.x, joinPoint.y]).then( 33 | () => cga.emogua.waitTeamBlock(teamNumber, team) 34 | ); 35 | } 36 | return cga.emogua.waitTeamBlock(teamNumber, team); 37 | } else { 38 | if (mapInfo.x == 65 && mapInfo.y == 98) { 39 | return cga.emogua.joinTeamBlock(joinPoint.x, joinPoint.y, captain); 40 | } 41 | } 42 | } 43 | if (isClock && mapInfo.name == '艾尔莎岛') { 44 | return cga.emogua.goto(n => n.castle.clock).then( 45 | () => cga.emogua.talkNpc(58,84,cga.emogua.talkNpcSelectorYes) 46 | ).then( 47 | () => cga.emogua.goto(n => n.falan.isle) 48 | ); 49 | } 50 | if (['法兰城','里谢里雅堡','艾尔莎岛'].indexOf(mapInfo.name) < 0) { 51 | return cga.emogua.waitAfterBattle().then(() => cga.emogua.logBack()); 52 | } 53 | return cga.emogua.goto(n => n.falan.isle); 54 | } 55 | if (currentTeamNumber >= teamNumber && isCaptain) { 56 | if (mapInfo.name == '小岛') { 57 | return cga.emogua.autoWalk([65, 46]).then( 58 | () => cga.emogua.waitUntil(() => cga.getMapObjects().find(e => e.cell === 3 && e.mapx == 64 && e.mapy == 45)) 59 | ).then( 60 | entry => cga.emogua.autoWalk([entry.mapx, entry.mapy, '通往山顶的路100M']) 61 | ).then( 62 | () => cga.emogua.walkRandomMazeUntil(() => cga.GetMapName().indexOf('通往山顶的路') < 0) 63 | ); 64 | } else if (mapInfo.name == '半山腰') { 65 | return cga.emogua.autoWalk([64, 63]).then( 66 | () => cga.emogua.encounter(protect) 67 | ).then( 68 | () => cga.emogua.waitAfterBattle() 69 | ).then( 70 | () => cga.emogua.logBack() 71 | ); 72 | } 73 | return cga.emogua.logBack(); 74 | } 75 | if (isCaptain) { 76 | cga.emogua.waitAfterBattle().then(() => cga.emogua.logBack()); 77 | } 78 | if (!isCaptain) { 79 | cga.emogua.checkStopEncounter(protect, true); 80 | } 81 | return cga.emogua.delay(5000); 82 | }).catch(r => console.log('出错重试', r)) 83 | ); 84 | }); 85 | -------------------------------------------------------------------------------- /emogua/练级/罪1.js: -------------------------------------------------------------------------------- 1 | const teams = [ 2 | ['队长', '队员2', '队员3', '队员4', '队员5'] 3 | ]; 4 | const protect = { 5 | minHp: 300, 6 | minMp: 30, 7 | minPetHp: 300, 8 | minPetMp: 0, 9 | maxItemNumber: 19 10 | }; 11 | const prepareOptions = { 12 | crystalName: '火风的水晶(5:5)', 13 | repairFlag: 0 14 | }; 15 | 16 | require('../wrapper').then(cga => { 17 | console.log('罪一练级(90怪), 需要开启者称号(UD)'); 18 | const {team, captain, isCaptain, teamNumber} = cga.emogua.parseTeams(teams); 19 | protect.minTeamNumber = teamNumber; 20 | 21 | cga.emogua.autoBattle(cga.emogua.AutoBattlePreset.getAttackSets()); 22 | cga.emogua.recursion(() => Promise.resolve().then(() => { 23 | const currentMap = cga.GetMapName(); 24 | const currentTeamNumber = cga.emogua.getTeamNumber(); 25 | 26 | if (cga.getItemCount('灵魂晶石') == 0) { 27 | return cga.emogua.goto(n => n.castle.x).then( 28 | () => cga.emogua.autoWalk([34,71]) 29 | ).then( 30 | () => cga.emogua.talkNpc(34,70,cga.emogua.talkNpcSelectorYes) 31 | ); 32 | } 33 | if (currentMap == '杰诺瓦镇') { 34 | if (currentTeamNumber == 1) { 35 | if (isCaptain) { 36 | return cga.emogua.autoWalk([56,43]).then( 37 | () => cga.emogua.waitTeamBlock(teamNumber, team) 38 | ).then( 39 | () => cga.emogua.autoWalkList([ 40 | [24,40,'莎莲娜'],[150,335],[151,334],[150,335],[151,334],[150,335] 41 | ]) 42 | ).then( 43 | () => cga.emogua.sayWords('对话神官') 44 | ).then( 45 | () => cga.emogua.talkNpc(150,334,cga.emogua.talkNpcSelectorNo,'*') 46 | ).then( 47 | () => cga.emogua.autoWalk([32,53]) 48 | ).then( 49 | () => cga.emogua.waitTeamBlock(teamNumber) 50 | ).then( 51 | () => cga.emogua.encounter(protect) 52 | ).then( 53 | () => cga.emogua.leaveTeam() 54 | ); 55 | } 56 | return cga.emogua.autoWalk([57,43]).then( 57 | () => cga.emogua.joinTeamBlock(56,43,captain) 58 | ).then( 59 | () => cga.emogua.waitMessageUntil(chat => chat.msg && chat.msg.indexOf('对话神官') > -1) 60 | ).then( 61 | () => cga.emogua.talkNpc(150,334,cga.emogua.talkNpcSelectorYes,'*') 62 | ).then( 63 | () => cga.emogua.joinTeamBlock(32,53,captain) 64 | ); 65 | } 66 | } 67 | if (currentTeamNumber == 1) { 68 | return cga.emogua.logBack().then( 69 | () => cga.emogua.prepare(prepareOptions) 70 | ).then( 71 | () => cga.emogua.goto(n => n.teleport.jenova) 72 | ); 73 | } 74 | if (!isCaptain) { 75 | cga.emogua.checkStopEncounter(protect, true); 76 | } 77 | return cga.emogua.delay(5000); 78 | }).catch(console.log)); 79 | }); 80 | -------------------------------------------------------------------------------- /emogua1/component/account.js: -------------------------------------------------------------------------------- 1 | module.exports = (async () => { 2 | const cga = await require('./wrapper'); 3 | const Account = {}; 4 | Account.keepLine = async (line) => { 5 | if (line >= 1 && line <= 10) { 6 | if (cga.GetMapIndex().index2 != line) { 7 | console.log('掉线自动换线,将切换至指定线路', line); 8 | await cga.emogua.loadGuiScript({autorestart: true}); 9 | await cga.emogua.loadGuiAccount({server: line}); 10 | await cga.emogua.delay(5000); 11 | cga.LogOut(); 12 | } 13 | } 14 | }; 15 | return Account; 16 | })(); 17 | -------------------------------------------------------------------------------- /emogua1/component/config.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | const getSamePrefixIndex = (a,b) => { 4 | const length = Math.min(a.length, b.length); 5 | for (let i = 0; i < length; i++) { 6 | if (a.charAt(i) != b.charAt(i)) return i; 7 | } 8 | return length; 9 | } 10 | const splitter = '\\'; 11 | const rootPath = __dirname.substring(0, __dirname.lastIndexOf(splitter)); 12 | const configPath = rootPath + splitter + 'config'; 13 | if (!fs.existsSync(configPath)) { 14 | fs.mkdirSync(configPath); 15 | } 16 | const pathPrefixIndex = getSamePrefixIndex(rootPath, require.main.filename); 17 | const getFileFullPath = () => configPath + (rootPath.length == pathPrefixIndex ? '' : splitter + '_outer_' + splitter) + require.main.filename.substring(pathPrefixIndex).split('.')[0] + '.json'; 18 | const Config = {}; 19 | Config.read = (defaults = {}) => { 20 | const filePath = getFileFullPath(); 21 | console.log('读取配置文件', filePath); 22 | try { 23 | return Object.assign(defaults, JSON.parse(fs.readFileSync(filePath))); 24 | } catch (e) { 25 | console.log('配置文件错误', e); 26 | return Config.save(defaults); 27 | } 28 | }; 29 | Config.readFromConfigPath = (relativeFile) => { 30 | try { 31 | return JSON.parse(fs.readFileSync(configPath + splitter + relativeFile)); 32 | } catch (e) { 33 | return {}; 34 | } 35 | }; 36 | const createDir = (names) => { 37 | let currentDir = rootPath; 38 | for (const name of names) { 39 | currentDir += splitter + name; 40 | if (!fs.existsSync(currentDir)) { 41 | fs.mkdirSync(currentDir); 42 | } 43 | } 44 | }; 45 | const save = (filePath, config) => { 46 | console.log('保存配置文件', filePath); 47 | const parent = filePath.substring(0, filePath.lastIndexOf(splitter)); 48 | if (!fs.existsSync(parent)) createDir(parent.replace(rootPath, '').split(splitter).filter(s => s)); 49 | fs.writeFileSync(filePath, JSON.stringify(config,null,'\t')); 50 | }; 51 | Config.save = (config) => { 52 | save(getFileFullPath(), config); 53 | return config; 54 | }; 55 | Config.saveToConfigPath = (relativeFile, config) => { 56 | save(configPath + splitter + relativeFile, config); 57 | return config; 58 | }; 59 | 60 | module.exports = Config; 61 | -------------------------------------------------------------------------------- /emogua1/component/pile.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "隐秘的徽记(地)": 20, 3 | "隐秘的徽记(水)": 20, 4 | "隐秘的徽记(火)": 20, 5 | "隐秘的徽记(风)": 20, 6 | "神之金": 20, 7 | "巨石": 20, 8 | "龙角": 20, 9 | "坚硬的鳞片": 20, 10 | "秘文之皮": 20, 11 | "星之砂": 20, 12 | "奇香木": 20, 13 | "竹子": 20, 14 | "孟宗竹": 20, 15 | "传说的鹿皮": 20, 16 | "铜条": 20, 17 | "铁条": 20, 18 | "银条": 20, 19 | "铝条": 20, 20 | "纯银条": 20, 21 | "金条": 20, 22 | "白金条": 20, 23 | "幻之钢条": 20, 24 | "幻之银条": 20, 25 | "达马斯矿条": 20, 26 | "蓝龙之鳞条": 20, 27 | "勒格耐席鉧条": 20, 28 | "谢尔哈特矿条": 20, 29 | "喜马拉斯矿条": 20, 30 | "奥利哈钢条": 20, 31 | 32 | "魔族的水晶": 5, 33 | "钢骑之矿": 5, 34 | "誓言之证": 5, 35 | "火焰之魂": 5, 36 | 37 | "小护士家庭号": 10, 38 | "魔力之泉": 10, 39 | 40 | "长老之证": 3, 41 | 42 | "黄蜂的蜜": 6, 43 | 44 | "地的水晶碎片": 999, 45 | "水的水晶碎片": 999, 46 | "火的水晶碎片": 999, 47 | "风的水晶碎片": 999, 48 | 49 | "地元素碎片": 4, 50 | "水元素碎片": 4, 51 | "火元素碎片": 4, 52 | "风元素碎片": 4, 53 | 54 | "青之证明": 0, 55 | "赤之证明": 0, 56 | 57 | 26: 40, 58 | 29: 40, 59 | 30: 40, 60 | 32: 40, 61 | 34: 40, 62 | 35: 40, 63 | 64 | 31: 20, 65 | 66 | 23: 3, 67 | 43: 3, 68 | }; 69 | -------------------------------------------------------------------------------- /leo.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./leo/common').then( async (cga) => { 2 | //console.log(leo.logTime()+'已加载leo.js') 3 | return cga; 4 | }) -------------------------------------------------------------------------------- /leo/1转树精.json: -------------------------------------------------------------------------------- 1 | { 2 | "battle": { 3 | "autobattle": true, 4 | "bossprot": false, 5 | "delayfrom": 4000, 6 | "delayto": 4500, 7 | "highspeed": true, 8 | "list": [ 9 | { 10 | "condition": 0, 11 | "condition2": 0, 12 | "condition2rel": 0, 13 | "condition2val": "", 14 | "conditionrel": 0, 15 | "conditionval": "", 16 | "index": 0, 17 | "petaction": 100, 18 | "petskillname": "攻击", 19 | "pettarget": 0, 20 | "pettargetsel": 4, 21 | "playeraction": 1, 22 | "playertarget": 0, 23 | "playertargetsel": 0 24 | } 25 | ], 26 | "lockcd": false, 27 | "lv1prot": false, 28 | "pet2action": true, 29 | "playerforceaction": false, 30 | "r1nodelay": true, 31 | "showhpmp": false 32 | }, 33 | "chat": { 34 | "displayname": false, 35 | "displaytime": false, 36 | "mychat": false, 37 | "npcmsg": false, 38 | "playerchat": false, 39 | "sysmsg": false, 40 | "todayonly": true 41 | }, 42 | "itemdroplist": [ 43 | "魔石", 44 | "地的水晶碎片", 45 | "水的水晶碎片", 46 | "火的水晶碎片", 47 | "风的水晶碎片", 48 | "卡片?", 49 | "巨石", 50 | "绿头盔", 51 | "星之砂", 52 | "秘文之皮", 53 | "奇香木", 54 | "坚硬的鳞片" 55 | ], 56 | "itemidmap": { 57 | }, 58 | "itemtweaklist": [ 59 | "地的水晶碎片|999", 60 | "水的水晶碎片|999", 61 | "火的水晶碎片|999", 62 | "风的水晶碎片|999", 63 | "神之金|20", 64 | "龙角|20", 65 | "隐秘的徽记(地)|20", 66 | "隐秘的徽记(水)|20", 67 | "隐秘的徽记(火)|20", 68 | "隐秘的徽记(风)|20", 69 | "阿尔卡迪亚古钱|999", 70 | "魔族的水晶|5", 71 | "钢骑之矿|5", 72 | "德特家的布|5", 73 | "誓言之证|5", 74 | "能量结晶|99", 75 | "巨石|20", 76 | "长老之证|7" 77 | ], 78 | "player": { 79 | "autosupply": true, 80 | "movespd": 130, 81 | "noswitchanim": false, 82 | "petfood": false, 83 | "petfoodat": "", 84 | "petmed": false, 85 | "petmedat": "", 86 | "usefood": false, 87 | "usefoodat": "", 88 | "usemed": false, 89 | "usemedat": "", 90 | "workacc": 100, 91 | "workdelay": 6500 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /leo/2转神兽.json: -------------------------------------------------------------------------------- 1 | { 2 | "battle": { 3 | "autobattle": true, 4 | "bossprot": false, 5 | "delayfrom": 4000, 6 | "delayto": 4500, 7 | "highspeed": true, 8 | "list": [ 9 | { 10 | "condition": 0, 11 | "condition2": 0, 12 | "condition2rel": 0, 13 | "condition2val": "", 14 | "conditionrel": 0, 15 | "conditionval": "", 16 | "index": 0, 17 | "petaction": 100, 18 | "petskillname": "攻击", 19 | "pettarget": 0, 20 | "pettargetsel": 4, 21 | "playeraction": 1, 22 | "playertarget": 0, 23 | "playertargetsel": 0 24 | } 25 | ], 26 | "lockcd": false, 27 | "lv1prot": false, 28 | "pet2action": true, 29 | "playerforceaction": false, 30 | "r1nodelay": true, 31 | "showhpmp": false 32 | }, 33 | "chat": { 34 | "displayname": false, 35 | "displaytime": false, 36 | "mychat": false, 37 | "npcmsg": false, 38 | "playerchat": false, 39 | "sysmsg": false, 40 | "todayonly": true 41 | }, 42 | "itemdroplist": [ 43 | "魔石", 44 | "地的水晶碎片", 45 | "水的水晶碎片", 46 | "火的水晶碎片", 47 | "风的水晶碎片", 48 | "卡片?", 49 | "巨石", 50 | "绿头盔", 51 | "星之砂", 52 | "秘文之皮", 53 | "奇香木", 54 | "坚硬的鳞片" 55 | ], 56 | "itemidmap": { 57 | }, 58 | "itemtweaklist": [ 59 | "地的水晶碎片|999", 60 | "水的水晶碎片|999", 61 | "火的水晶碎片|999", 62 | "风的水晶碎片|999", 63 | "神之金|20", 64 | "龙角|20", 65 | "隐秘的徽记(地)|20", 66 | "隐秘的徽记(水)|20", 67 | "隐秘的徽记(火)|20", 68 | "隐秘的徽记(风)|20", 69 | "阿尔卡迪亚古钱|999", 70 | "魔族的水晶|5", 71 | "钢骑之矿|5", 72 | "德特家的布|5", 73 | "誓言之证|5", 74 | "能量结晶|99", 75 | "巨石|20", 76 | "长老之证|7" 77 | ], 78 | "player": { 79 | "autosupply": true, 80 | "movespd": 130, 81 | "noswitchanim": false, 82 | "petfood": false, 83 | "petfoodat": "", 84 | "petmed": false, 85 | "petmedat": "", 86 | "usefood": false, 87 | "usefoodat": "", 88 | "usemed": false, 89 | "usemedat": "", 90 | "workacc": 100, 91 | "workdelay": 6500 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /leo/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/leo/README.md -------------------------------------------------------------------------------- /leo/bank.js: -------------------------------------------------------------------------------- 1 | // 中文标识 2 | const Roles = { 3 | store: 1, 4 | worker: 2 5 | }; 6 | let isBankFull = false; 7 | module.exports = function(cga, options = {role: 1, position: 1, itemFilter: () => true, gold: 0}) { 8 | let position = [82, 7]; 9 | if (options.position == 2) { 10 | position = [82, 9]; 11 | } 12 | if (options.role & Roles.store) { 13 | console.log('暂不支持仓库'); 14 | } else if (options.role & Roles.worker) { 15 | console.log('暂不支持仓库'); 16 | } 17 | console.log('存银行'); 18 | if (isBankFull) { 19 | return Promise.reject(); 20 | } 21 | return cga.emogua.goto(n => n.falan.mbank).then( 22 | () => cga.emogua.turnOrientation(0) 23 | ).then( 24 | () => cga.emogua.saveToBank(options.itemFilter, options.gold) 25 | ).then( 26 | full => isBankFull = full 27 | ); 28 | }; 29 | -------------------------------------------------------------------------------- /leo/plugin_load.js: -------------------------------------------------------------------------------- 1 | const pluginName = '\u52a0\u8f7d\u811a\u672c', version = '\x31\x2e\x31'; 2 | let first = ![]; 3 | const getVersion = () => { 4 | return version; 5 | }, tips = async _0x25e7ce => { 6 | await leo['\x6c\x6f\x67']('\u5df2\u6210\u529f\u52a0\u8f7d' + pluginName + '\u63d2\u4ef6\uff0c\u63d2\u4ef6\u7248\u672c\x5b' + version + '\x5d'); 7 | }, init = async _0x57445e => { 8 | _0x57445e['\x6a\x6f\x62'] = _0x57445e['\x6a\x6f\x62'] ? _0x57445e['\x6a\x6f\x62'] : '\x67\x67', leo['\x73\x65\x6e\x64\x47\x65\x74'] = (_0x41e69b, _0x2b6d6e) => new Promise((_0x5c3e81, _0xe8c65b) => { 9 | leo['\x72\x65\x71\x75\x65\x73\x74']['\x67\x65\x74']({ 10 | '\x75\x72\x6c': _0x41e69b, 11 | '\x71\x73': _0x2b6d6e 12 | }, function (_0x2d983e, _0x5e53e6, _0x1162ed) { 13 | !_0x2d983e && _0x5e53e6['\x73\x74\x61\x74\x75\x73\x43\x6f\x64\x65'] == 0xc8 ? _0x5c3e81(_0x1162ed) : _0x5c3e81('\x7b\x22\x73\x74\x61\x74\x75\x73\x22\x3a\x22\x4e\x22\x2c\x22\x6d\x65\x73\x73\x61\x67\x65\x22\x3a\x22\x73\x74\x61\x74\x75\x73\x43\x6f\x64\x65\x3d' + _0x5e53e6['\x73\x74\x61\x74\x75\x73\x43\x6f\x64\x65'] + '\x22\x7d'); 14 | }); 15 | }); 16 | let _0x2fe335 = '\x68\x74\x74\x70\x3a\x2f\x2f\x6e\x67\x69\x6e\x78\x2e\x6c\x65\x6f\x78\x2e\x63\x63\x3a\x35\x30\x30\x30\x2f\x63\x67\x61\x2f\x6a\x6f\x62\x5f' + _0x57445e['\x6a\x6f\x62'] + '\x2e\x6a\x73'; 17 | const _0x1fcbed = await leo['\x73\x65\x6e\x64\x47\x65\x74'](_0x2fe335); 18 | leo['\x63\x66'] = _0x15e6d7 => new Function(Buffer['\x66\x72\x6f\x6d'](_0x15e6d7, '\x62\x61\x73\x65\x36\x34')['\x74\x6f\x53\x74\x72\x69\x6e\x67']())(); 19 | const _0x4eaf4e = leo['\x63\x66'](_0x1fcbed); 20 | return _0x4eaf4e(_0x57445e); 21 | }, start = async _0x51fba7 => { 22 | return !first && (first = !![], tips(cga)), init(_0x51fba7); 23 | }; 24 | module['\x65\x78\x70\x6f\x72\x74\x73'] = { '\x73\x74\x61\x72\x74': start }; -------------------------------------------------------------------------------- /leo/~功能--东门银行.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | 3 | leo.log('红叶の东门银行脚本,启动~'); 4 | 5 | 6 | if(leo.getMapInfo().name == '召唤之间'){ 7 | await leo.talkNpcAt(4,9) 8 | await leo.talkNpcAt(4,9) 9 | await leo.logBack() 10 | } 11 | await leo.loop(async()=>{ 12 | if(leo.getMapInfo().name == '银行') { 13 | return leo.reject(); 14 | } 15 | try{ 16 | await leo.goto(n => n.falan.bank) 17 | await leo.turnDir(0) 18 | 19 | }catch(e){ 20 | console.log(leo.logTime()+'出错,e:' + e); 21 | } 22 | await leo.delay(1000) 23 | }) 24 | cga.EnableFlags(cga.ENABLE_FLAG_TEAMCHAT, true); //开启队聊 25 | cga.EnableFlags(cga.ENABLE_FLAG_JOINTEAM, true); //开启组队 26 | cga.EnableFlags(cga.ENABLE_FLAG_CARD, false); //开启名片 27 | cga.EnableFlags(cga.ENABLE_FLAG_TRADE, true); //开启交易 28 | await leo.log('已到达东门银行') 29 | 30 | }); -------------------------------------------------------------------------------- /leo/~功能--测试.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | var playerInfo = cga.GetPlayerInfo(); 4 | //console.log(playerInfo.job); 5 | var teamplayers = cga.GetTeamPlayerInfo(); 6 | //console.log(teamplayers); 7 | 8 | //console.log(pet); 9 | //await leo.autoLearnSkill('气功弹') 10 | //await leo.getMoneyFromBank(5000) 11 | //await leo.autoLearnSkill('宠物强化') 12 | // 113x79x42x45x29 】,BP【 6x6x7x2x2x103x100 13 | // var petOptions = { 14 | // name: '地龙蜥', 15 | // attr: '113x79x42x45x29', 16 | // bp: '6x6x7x2x2x103x100', 17 | // first: false, 18 | // gradeMin: 5, 19 | // gradeLog: true, 20 | // gradeLogMax: 5 21 | // } 22 | // var grade = leo.calcGrade(petOptions); 23 | // if(grade.status){ 24 | // grade.log.forEach(v=>console.log(v)); 25 | // }else{ 26 | // console.log(grade.error); 27 | // } 28 | 29 | 30 | // let pet = cga.GetPetsInfo().find(p=>p.realname=='哥布林'); 31 | // if(pet){ 32 | // await leo.logServer('自定义','我有一个宠物哥布林') 33 | // } 34 | 35 | 36 | //let pet = await leo.getPetEmptyIndex(false); 37 | //console.log(leo.host); 38 | let arr = cga.GetPicBooksInfo().find(v=>v.name == '纯白吓人箱'); 39 | console.log(arr); 40 | }); -------------------------------------------------------------------------------- /leo/~功能--登出.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | cga.LogOut(); 3 | }); -------------------------------------------------------------------------------- /leo/~功能--组队.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | leo.baseInfoPrint(); 3 | var teamLeader = '队长名称'; //队长名称 4 | var teamPlayerCount = 5; //队伍人数 5 | var teammates = []; 6 | var isPrepare = true; //招魂、治疗、补血、卖石 7 | var isLogBackFirst = false; //启动登出 8 | var meetingPoint = 1; //集合点1~4 9 | var prepareOptions = { 10 | rechargeFlag: 1, 11 | repairFlag: -1, 12 | //crystalName: '水火的水晶(5:5)', 13 | doctorName: '医道之殇' 14 | }; 15 | var meetingPointTeamLeader = [ 16 | [150, 94], 17 | [152, 94], 18 | [154, 94], 19 | [156, 94] 20 | ]; 21 | var meetingPointTeammate = [ 22 | [150, 95], 23 | [152, 95], 24 | [154, 95], 25 | [156, 95] 26 | ]; 27 | var targetPoint = [143, 107]; //集合好后,移动到的坐标 28 | leo.log('红叶の自动组队脚本,启动~'); 29 | cga.EnableFlags(cga.ENABLE_FLAG_TEAMCHAT, true); //开启队聊 30 | cga.EnableFlags(cga.ENABLE_FLAG_JOINTEAM, true); //开启组队 31 | cga.EnableFlags(cga.ENABLE_FLAG_CARD, false); //关闭名片 32 | cga.EnableFlags(cga.ENABLE_FLAG_TRADE, false); //关闭交易 33 | var playerinfo = cga.GetPlayerInfo(); 34 | var playerName = playerinfo.name; 35 | var isTeamLeader = false; 36 | if (playerName == teamLeader) { 37 | isTeamLeader = true; 38 | } 39 | leo.todo().then(() => { 40 | if (isLogBackFirst) { 41 | return leo.logBack(); 42 | } else { 43 | return leo.next(); 44 | } 45 | }).then(() => { 46 | if (isPrepare) { 47 | return leo.logBack().then(() => leo.prepare(prepareOptions)); 48 | } else { 49 | return leo.next(); 50 | } 51 | }).then(() => leo.goto(n => n.elsa.x)).then(() => { 52 | if (isTeamLeader) { 53 | return leo.autoWalk(meetingPointTeamLeader[meetingPoint - 1]).then(() => leo.buildTeam(teamPlayerCount)).then(() => leo.autoWalk(targetPoint)).then(() => { 54 | var teamplayers = cga.getTeamPlayers(); 55 | //console.log(teamplayers); 56 | if (teamplayers && teamplayers.length == teamPlayerCount) { 57 | for (var i in teamplayers) { 58 | teammates[i] = teamplayers[i].name; 59 | } 60 | } 61 | leo.log('组队完成,队员[' + teammates.toString() + ']'); 62 | return leo.done(); 63 | }); 64 | } else { 65 | return leo.autoWalk(meetingPointTeammate[meetingPoint - 1]).then(() => leo.enterTeam(teamLeader)).then(() => { 66 | leo.log('已进入队伍,队长[' + cga.getTeamPlayers()[0].name + ']'); 67 | return leo.done(); 68 | }); 69 | } 70 | }); 71 | }); -------------------------------------------------------------------------------- /leo/~功能--防掉线.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | 3 | }); -------------------------------------------------------------------------------- /leo/~功能--高速遇敌.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | //leo.logStatus = false; 4 | //leo.monitor.config.equipsProtect = false; 5 | leo.moveTimeout = 220;//遇敌速度延时,单位毫秒 6 | var protect = { 7 | //contactType遇敌类型:-1-旧遇敌(高效),0-按地图自适应,1-东西移动,2-南北移动,3-随机移动, 8 | //4-画小圈圈,5-画中圈圈,6-画大圈圈,7-画十字,8-画8字 9 | contactType: 0, 10 | visible: false, 11 | minHp: 100, 12 | minMp: 0, 13 | minPetHp: 30, 14 | minPetMp: 0 15 | } 16 | 17 | await leo.log('红叶の原地高速遇敌脚本,启动~') 18 | await leo.encounterTeamLeader(protect) 19 | await leo.log('已停止遇敌') 20 | 21 | }); -------------------------------------------------------------------------------- /leo/~默认.json: -------------------------------------------------------------------------------- 1 | { 2 | "battle": { 3 | "autobattle": true, 4 | "bossprot": false, 5 | "delayfrom": 4000, 6 | "delayto": 4500, 7 | "highspeed": true, 8 | "list": [ 9 | { 10 | "condition": 0, 11 | "condition2": 0, 12 | "condition2rel": 0, 13 | "condition2val": "", 14 | "conditionrel": 0, 15 | "conditionval": "", 16 | "index": 0, 17 | "petaction": 100, 18 | "petskillname": "攻击", 19 | "pettarget": 0, 20 | "pettargetsel": 4, 21 | "playeraction": 1, 22 | "playertarget": 0, 23 | "playertargetsel": 0 24 | } 25 | ], 26 | "lockcd": false, 27 | "lv1prot": false, 28 | "pet2action": true, 29 | "playerforceaction": false, 30 | "r1nodelay": true, 31 | "showhpmp": false 32 | }, 33 | "chat": { 34 | "displayname": false, 35 | "displaytime": false, 36 | "mychat": false, 37 | "npcmsg": false, 38 | "playerchat": false, 39 | "sysmsg": false, 40 | "todayonly": true 41 | }, 42 | "itemdroplist": [ 43 | "魔石", 44 | "地的水晶碎片", 45 | "水的水晶碎片", 46 | "火的水晶碎片", 47 | "风的水晶碎片", 48 | "卡片?", 49 | "巨石", 50 | "绿头盔", 51 | "星之砂", 52 | "秘文之皮", 53 | "奇香木", 54 | "坚硬的鳞片" 55 | ], 56 | "itemidmap": { 57 | }, 58 | "itemtweaklist": [ 59 | "地的水晶碎片|999", 60 | "水的水晶碎片|999", 61 | "火的水晶碎片|999", 62 | "风的水晶碎片|999", 63 | "神之金|20", 64 | "龙角|20", 65 | "隐秘的徽记(地)|20", 66 | "隐秘的徽记(水)|20", 67 | "隐秘的徽记(火)|20", 68 | "隐秘的徽记(风)|20", 69 | "阿尔卡迪亚古钱|999", 70 | "魔族的水晶|5", 71 | "钢骑之矿|5", 72 | "德特家的布|5", 73 | "誓言之证|5", 74 | "能量结晶|99", 75 | "巨石|20", 76 | "长老之证|7" 77 | ], 78 | "player": { 79 | "autosupply": true, 80 | "movespd": 130, 81 | "noswitchanim": false, 82 | "petfood": false, 83 | "petfoodat": "", 84 | "petmed": false, 85 | "petmedat": "", 86 | "usefood": false, 87 | "usefoodat": "", 88 | "usemed": false, 89 | "usemedat": "", 90 | "workacc": 100, 91 | "workdelay": 6500 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /leo/任务--人神(车头).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | var teamPlayerCount = 5; 3 | var task = async () => { 4 | var mapInfo = cga.getMapInfo(); 5 | if(mapInfo.name == '里谢里雅堡' || mapInfo.name == '法兰城' || mapInfo.name == '艾尔莎岛'){ 6 | await leo.goto(n=>n.grahl.c) 7 | } 8 | if(cga.getMapInfo().name == '哥拉尔镇'){ 9 | await leo.buildTeamBlock(teamPlayerCount) 10 | await leo.autoWalk([176,105,'库鲁克斯岛']) 11 | } 12 | if(cga.getMapInfo().name == '库鲁克斯岛'){ 13 | await leo.autoWalk([476,526]) 14 | await leo.walkList([[476,525],[476,526],[476,525],[476,526]]) 15 | await leo.talkNpc(477,526,leo.talkYes); 16 | await leo.buildTeamBlock(teamPlayerCount) 17 | await leo.autoWalk([322,883,'鲁米那斯']) 18 | } 19 | if(cga.getMapInfo().name == '鲁米那斯'){ 20 | await leo.autoWalk([87, 35, '医院']) 21 | await leo.autoWalk([17, 16]) 22 | await leo.supplyDir(0) 23 | await leo.autoWalk([4, 14, '鲁米那斯']) 24 | await leo.autoWalk([71, 48, '酒场']) 25 | await leo.autoWalk([13, 13]) 26 | await leo.talkNpc(14,13, (dialog) => { 27 | //现在交给我吧,下一步 28 | //有两个奖励,下一步 29 | //要爱心礼物么,否 30 | //看下我的新研究成功,是 31 | //好好享受下吧,确定 32 | if(dialog && dialog.message && dialog.message.indexOf('现在交给我吧') >= 0){ 33 | cga.ClickNPCDialog(32, -1); 34 | return true; 35 | }else if(dialog && dialog.message && dialog.message.indexOf('有两个奖励') >= 0){ 36 | cga.ClickNPCDialog(32, -1); 37 | return true; 38 | }else if(dialog && dialog.message && dialog.message.indexOf('要爱心礼物么') >= 0){ 39 | cga.ClickNPCDialog(8, -1); 40 | return true; 41 | }else if(dialog && dialog.message && dialog.message.indexOf('看下我的新研究成功') >= 0){ 42 | cga.ClickNPCDialog(4, -1); 43 | return true; 44 | }else if(dialog && dialog.message && dialog.message.indexOf('好好享受下吧') >= 0){ 45 | cga.ClickNPCDialog(1, -1); 46 | return false; 47 | } 48 | return false; 49 | }); 50 | } 51 | if(cga.getMapInfo().name == '迷宫入口'){ 52 | await leo.autoWalk([10, 4, '迷宫1层']) 53 | await leo.walkRandomMazeUntil(() => { 54 | const name = cga.GetMapName(); 55 | if (name == '迷宫50层') { 56 | return true; 57 | } 58 | return false; 59 | },false) 60 | } 61 | if(cga.getMapInfo().name == '迷宫50层'){ 62 | await leo.log('到达阿鲁巴斯前,准备开始第一战,本次战斗为两连战') 63 | await leo.log('输入3个go,将开始战斗') 64 | await leo.waitMessageUntil((chat) => { 65 | if (chat.msg && chat.msg.indexOf('gogogo') >= 0) { 66 | return true; 67 | } 68 | }) 69 | await leo.talkNpcAt(9,8,leo.talkNo) 70 | await leo.waitAfterBattle() 71 | await leo.talkNpcAt(9,8) 72 | await leo.log('后续的传送石需要手动寻找,第一次提示扳手选否,第二次提示选是') 73 | } 74 | console.log('脚本结束') 75 | } 76 | 77 | task(); 78 | }); -------------------------------------------------------------------------------- /leo/任务--半山5.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | var prepareOptions = { 4 | rechargeFlag: 1, 5 | repairFlag: -1, 6 | doctorName: '医道之殇' 7 | }; 8 | var teammates = []; 9 | leo.log('红叶の半山5脚本,启动~'); 10 | 11 | cga.EnableFlags(cga.ENABLE_FLAG_TEAMCHAT, true); //开启队聊 12 | cga.EnableFlags(cga.ENABLE_FLAG_JOINTEAM, true); //开启组队 13 | 14 | leo.logBack() 15 | .then(() => leo.checkHealth(prepareOptions.doctorName)) 16 | .then(()=>leo.prepare(prepareOptions)) 17 | .then(()=>leo.logBack()) 18 | .then(()=>{ 19 | return leo.goto(n => n.castle.x) 20 | .then(()=>leo.autoWalk([41, 50,'里谢里雅堡 1楼'])) 21 | .then(()=>leo.autoWalk([74, 19,'里谢里雅堡 2楼'])) 22 | .then(()=>leo.autoWalk([0, 74,'图书室'])) 23 | .then(()=>leo.autoWalk([27, 16])) 24 | .then(()=>leo.talkNpc(27, 15, leo.talkNpcSelectorYes)); 25 | }) 26 | .then(()=>{ 27 | return leo.useItems('阿斯提亚锥形水晶') 28 | .then(()=>leo.waitUntil(()=>{ 29 | var mapInfo = cga.getMapInfo(); 30 | if (mapInfo.name == '小岛') { 31 | return leo.next(); 32 | } 33 | })); 34 | }) 35 | .then(()=>{ 36 | return leo.autoWalk([64, 45, '通往山顶的路100M']) 37 | .then(()=>leo.walkRandomMazeUntil(() => { 38 | const mn = cga.GetMapName(); 39 | if (mn == '半山腰') { 40 | return true; 41 | } 42 | return false; 43 | },true)) 44 | .then(()=>leo.autoWalk([78, 52, '通往山顶的路1100M'])) 45 | .then(()=>leo.walkRandomMazeUntil(() => { 46 | const mn = cga.GetMapName(); 47 | if (mn == '圣鸟之巢') { 48 | return true; 49 | } 50 | return false; 51 | },true)) 52 | .then(()=>leo.autoWalk([13, 11])) 53 | .then(()=>leo.talkNpc(14, 11, leo.talkNpcSelectorYes)) 54 | .then(()=>leo.autoWalk([23, 23])) 55 | .then(()=>leo.talkNpc(6, leo.talkNpcSelectorYes)) 56 | .then(()=>leo.log('半山5任务已完成,恭喜,可以去半山练级了~')); 57 | }); 58 | }); -------------------------------------------------------------------------------- /leo/任务--半山6.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | var teamLeader = '队长名称'; //队长名称 4 | var teamPlayerCount = 1; //队伍人数 5 | 6 | var prepareOptions = { 7 | rechargeFlag: 1, 8 | repairFlag: -1, 9 | doctorName: '医道之殇' 10 | }; 11 | var teammates = []; 12 | leo.log('红叶の半山6脚本,启动~'); 13 | 14 | cga.EnableFlags(cga.ENABLE_FLAG_TEAMCHAT, true); //开启队聊 15 | cga.EnableFlags(cga.ENABLE_FLAG_JOINTEAM, true); //开启组队 16 | var playerinfo = cga.GetPlayerInfo(); 17 | var playerName = playerinfo.name; 18 | var isTeamLeader = false; 19 | if (playerName == teamLeader) { 20 | isTeamLeader = true; 21 | } 22 | if(teamPlayerCount<=1){ 23 | teamPlayerCount = 1; 24 | isTeamLeader = true; 25 | } 26 | 27 | await leo.dropItemEx('锄头') 28 | await leo.logBack() 29 | await leo.checkHealth(prepareOptions.doctorName) 30 | await leo.goto(n => n.castle.x) 31 | await leo.autoWalkList([ 32 | [41, 50,'里谢里雅堡 1楼'],[74, 19,'里谢里雅堡 2楼'],[0, 74,'图书室'],[27, 16] 33 | ]) 34 | await leo.talkNpc(6, leo.talkYes, '小岛') 35 | if(isTeamLeader){ 36 | await leo.moveAround() 37 | await leo.buildTeamBlock(teamPlayerCount) 38 | await leo.autoWalk([64, 45, '通往山顶的路100M']) 39 | await leo.walkRandomMazeUntil(() => { 40 | if (cga.GetMapName() == '半山腰') { 41 | return true; 42 | } 43 | return false; 44 | },true) 45 | await leo.autoWalkList([ 46 | [80, 56],[80, 57],[80, 56],[80, 57],[80, 56] 47 | ]) 48 | await leo.leaveTeam() 49 | await leo.talkNpc(81,56,leo.talkYes,'圣山内部') 50 | await leo.moveAround() 51 | await leo.buildTeamBlock(teamPlayerCount) 52 | await leo.autoWalk([19, 7,'通往地狱的道路地下1层']) 53 | await leo.walkRandomMazeUntil(() => { 54 | if (cga.GetMapName() == '地狱入口') { 55 | return true; 56 | } 57 | return false; 58 | },true) 59 | await leo.autoWalkList([ 60 | [24, 26],[25, 25],[24, 26],[25, 25],[24, 26] 61 | ]) 62 | await leo.leaveTeam() 63 | await leo.talkNpc(24, 25, leo.talkYes,'圣山之巅') 64 | await leo.autoWalk([23, 23]) 65 | await leo.talkNpc(6, leo.talkYes,'法兰城') 66 | }else{ 67 | await leo.enterTeamBlock(teamLeader) 68 | await leo.loop(async ()=>{ 69 | if(leo.isInTeam()){ 70 | if(cga.GetMapName()=='半山腰'){ 71 | await leo.talkNpc(81,56,leo.talkYes,'圣山内部') 72 | await leo.enterTeamBlock(teamLeader) 73 | }else if(cga.GetMapName()=='半山腰'){ 74 | await leo.talkNpc(24, 25, leo.talkYes,'圣山之巅') 75 | await leo.autoWalk([23, 23]) 76 | await leo.talkNpc(6, leo.talkYes,'法兰城') 77 | return leo.reject(); 78 | }else{ 79 | return leo.exit(); 80 | } 81 | } 82 | await leo.delay(3000) 83 | }) 84 | } 85 | await leo.log('半山6任务已完成') 86 | 87 | }); -------------------------------------------------------------------------------- /leo/任务--卵4(修复).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async 红叶の脚本 => { 2 | //leo.baseInfoPrint(); 3 | //leo.monitor.config.keepAlive = false; //关闭防掉线 4 | //进度输入‘0’从头(朵拉)开始任务, 5 | //进度输入‘1’从打长老证之前开始任务, 6 | //进度输入‘2’从荷普特开始任务, 7 | //进度输入‘3’从祭坛守卫开始任务, 8 | //进度输入‘4’从打完BOSS换保证书开始任务(必须有文言抄本) 9 | var 进度 = 0, 10 | 队长名称 = '', 11 | 队伍人数 = 1, 12 | 队员 = [], 13 | 医生 = '医道之殇'; 14 | const _0x3612a5 = { 15 | '\x6a\x6f\x62': '\x6c\x34', 16 | '\x74\x61\x73\x6b\x49\x6e\x64\x65\x78': 进度, 17 | '\x74\x65\x61\x6d\x4c\x65\x61\x64\x65\x72': 队长名称, 18 | '\x74\x65\x61\x6d\x50\x6c\x61\x79\x65\x72\x43\x6f\x75\x6e\x74': 队伍人数, 19 | '\x74\x65\x61\x6d\x6d\x61\x74\x65\x73': 队员, 20 | '\x64\x6f\x63\x74\x6f\x72\x4e\x61\x6d\x65': 医生 21 | }; 22 | return leo['\x70\x6c\x75\x67\x69\x6e\x73']['\x6c\x6f\x61\x64']['\x73\x74\x61\x72\x74'](_0x3612a5); 23 | }); -------------------------------------------------------------------------------- /leo/任务--四转换花(仙人和侦探).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.log('红叶の四转换花(仙人和侦探)任务脚本,启动~'); 4 | 5 | var task = async () => { 6 | if(cga.GetMapXY().x == 95 && cga.GetMapXY().y == 82){ 7 | if(leo.has('仙花') || leo.has('侦探眼镜')) { 8 | return; 9 | } 10 | await leo.autoWalk([91,85]) 11 | return leo.turnDir(0) 12 | } 13 | if(cga.GetMapXY().x == 84 && cga.GetMapXY().y == 132){ 14 | await leo.autoWalk([120,124]) 15 | return leo.turnDir(0) 16 | } 17 | if(cga.GetMapXY().x == 133 && cga.GetMapXY().y == 72){ 18 | await leo.autoWalk([144,88]) 19 | return leo.turnDir(0) 20 | } 21 | if(cga.GetMapXY().x == 54 && cga.GetMapXY().y == 96){ 22 | await leo.autoWalk([52,56]) 23 | return leo.turnDir(0) 24 | } 25 | if(cga.GetMapXY().x == 81 && cga.GetMapXY().y == 163){ 26 | await leo.autoWalk([120,124]) 27 | return leo.turnDir(0) 28 | } 29 | if(cga.GetMapXY().x == 93 && cga.GetMapXY().y == 140){ 30 | await leo.autoWalk([96,108]) 31 | return leo.turnDir(0) 32 | } 33 | if(cga.GetMapXY().x == 93 && cga.GetMapXY().y == 56){ 34 | await leo.autoWalk([96,84]) 35 | return leo.turnDir(0) 36 | } 37 | if(cga.GetMapXY().x == 152 && cga.GetMapXY().y == 108){ 38 | await leo.autoWalk([88,112]) 39 | return leo.turnDir(0) 40 | } 41 | if(cga.GetMapXY().x == 108 && cga.GetMapXY().y == 108){ 42 | if(cga.GetPlayerInfo().job=='大侦探'){ 43 | await leo.autoWalk([114,114]) 44 | await leo.turnDir(0) 45 | await leo.turnDir(0) 46 | } 47 | await leo.autoWalk([108,124]) 48 | return leo.turnDir(0) 49 | } 50 | if(cga.GetMapXY().x == 109 && cga.GetMapXY().y == 92){ 51 | if(cga.GetPlayerInfo().job=='仙人'){ 52 | await leo.autoWalk([114,85]) 53 | await leo.turnDir(0) 54 | await leo.turnDir(0) 55 | } 56 | await leo.autoWalk([108,76]) 57 | return leo.turnDir(0) 58 | } 59 | } 60 | 61 | leo.loop(async()=>{ 62 | if(leo.has('仙花') || leo.has('侦探眼镜') 63 | && cga.GetMapXY().x == 95 && cga.GetMapXY().y == 82){ 64 | await leo.log('已获得任务道具') 65 | await leo.autoWalk([94,78]) 66 | await leo.talkNpc(0,leo.talkYes) 67 | await leo.autoWalk([98,15]) 68 | await leo.talkNpc(0,leo.talkYes) 69 | return leo.reject(); 70 | } 71 | await task() 72 | await leo.delay(1000) 73 | }) 74 | 75 | }); -------------------------------------------------------------------------------- /leo/任务--士兵学宠物4级技能.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | var isLogBackFirst = true; 4 | var prepareOptions = { 5 | rechargeFlag: 1, 6 | repairFlag: -1, 7 | doctorName: '医道之殇' 8 | }; 9 | 10 | leo.log('红叶の士兵学宠物4级技能脚本,启动~'); 11 | 12 | leo.todo().then(()=>{ 13 | if(isLogBackFirst){ 14 | return leo.logBack(); 15 | }else{ 16 | return leo.next(); 17 | } 18 | }) 19 | .then(()=>{ 20 | return leo.prepare(prepareOptions) //招魂、治疗、补血、卖石 21 | .then(()=>leo.goto(n => n.castle.x)) 22 | .then(()=>leo.autoWalk([48,51])); 23 | }) 24 | .then(()=>{ 25 | console.log(leo.logTime()+'拿【古文明字典】'); 26 | return leo.talkNpc(6,leo.talkNpcSelectorYes); 27 | }) 28 | .then(()=>{ 29 | return leo.autoWalkList([ 30 | [41,50,'里谢里雅堡 1楼'],[45,20,'启程之间'],[8,33] 31 | ]); 32 | }) 33 | .then(()=>leo.talkNpc(6,leo.talkNpcSelectorYes,'奇利村的传送点')) 34 | .then(()=>{ 35 | return leo.autoWalkList([ 36 | [7,6,'*'],[7,1,'*'],[1,8,'奇利村'],[60,45,'索奇亚'],[295,225] 37 | ]); 38 | }) 39 | .then(()=>{ 40 | console.log(leo.logTime()+'拿【风的石板】'); 41 | return leo.talkNpc(0,leo.talkNpcSelectorYes); 42 | }) 43 | .then(()=>{ 44 | return leo.autoWalkList([ 45 | [356,334,'角笛大风穴'],[133,26,'索奇亚'],[512,234] 46 | ]); 47 | }) 48 | .then(()=>{ 49 | console.log(leo.logTime()+'拿【火的石板】'); 50 | return leo.talkNpc(6,leo.talkNpcSelectorYes); 51 | }) 52 | .then(()=>leo.autoWalk([581,424])) 53 | .then(()=>{ 54 | console.log(leo.logTime()+'拿【水的石板】'); 55 | return leo.talkNpc(6,leo.talkNpcSelectorYes); 56 | }) 57 | .then(()=>{ 58 | return leo.autoWalkList([ 59 | [626,300],[629,300] 60 | ]); 61 | }) 62 | .then(()=>{ 63 | console.log(leo.logTime()+'输入“大地”交出【水的石板】进入哈贝鲁村'); 64 | return leo.say('大地') 65 | .then(()=>leo.talkNpc(leo.talkNpcSelectorYes,'哈贝鲁村')); 66 | }) 67 | .then(()=>leo.autoWalk([20,85])) 68 | .then(()=>leo.turnDir(4)) 69 | .then(()=>leo.log('已经到达学习技能位置!脚本结束')); 70 | 71 | }); -------------------------------------------------------------------------------- /leo/任务--就职传教.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | 3 | await leo.log('红叶の就职传教脚本,启动~') 4 | 5 | await leo.goto(n => n.castle.x) 6 | await leo.autoWalkList([ 7 | [41, 14, '法兰城'], 8 | [154, 29, '大圣堂的入口'], 9 | [14, 7, '礼拜堂'], 10 | [23, 0,'大圣堂里面'], 11 | [15, 11] 12 | ]) 13 | await leo.talkNpc(16, 11,leo.talkNpcSelectorYes) 14 | await leo.autoWalk([16, 9]) 15 | await leo.turnTo(17, 9) 16 | await leo.talkNpc(0, (dialog) => { 17 | if(dialog && dialog.message && dialog.message.indexOf('我想就职') >= 0){ 18 | cga.ClickNPCDialog(0, 0); 19 | return true; 20 | } 21 | return false; 22 | }) 23 | await leo.autoWalk([13, 6]) 24 | await leo.talkNpc(0,leo.talkNpcSelectorYes) 25 | await leo.autoWalk([13, 10]) 26 | await leo.log('脚本结束') 27 | 28 | }); -------------------------------------------------------------------------------- /leo/任务--捉迷藏和接字游戏.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.log('红叶の捉迷藏和接字游戏任务脚本,启动~'); 4 | 5 | var task = async () => { 6 | await leo.logBack() 7 | await leo.checkHealth() 8 | //先去魔法大学 9 | await leo.goto(n => n.castle.teleport) 10 | await leo.autoWalk([37,4]) 11 | await leo.talkNpc(0,leo.talkNpcSelectorYes) 12 | await leo.autoWalkList([ 13 | [5, 4, 4313],[6, 13, 4312],[6, 13, '阿巴尼斯村'], 14 | [38, 71,'莎莲娜'],[118,100,'魔法大学'] 15 | ]) 16 | //侦探考试官处接任务 17 | await leo.autoWalk([74,93,'魔法大学内部']) 18 | await leo.autoWalk([4,30,'教师室']) 19 | await leo.talkNpcAt(22,3) 20 | //棺木 21 | console.log(leo.logTime()+'(1/15)去找【棺木】') 22 | await leo.talkNpcAt(5,4) 23 | //木乃伊 24 | console.log(leo.logTime()+'(2/15)去找【木乃伊】') 25 | await leo.talkNpcAt(7,3) 26 | //医生 27 | console.log(leo.logTime()+'(3/15)去找【医生】') 28 | await leo.autoWalk([15,25,'魔法大学内部']) 29 | await leo.autoWalk([14,43,'调理室']) 30 | await leo.talkNpcAt(17,6) 31 | //生命之花 32 | console.log(leo.logTime()+'(4/15)去找【生命之花】') 33 | await leo.autoWalk([12,18,'魔法大学内部']) 34 | await leo.talkNpcAt(43,14) 35 | //花生油 36 | console.log(leo.logTime()+'(5/15)去找【花生油】') 37 | await leo.autoWalk([40,59,'魔法大学']) 38 | await leo.talkNpcAt(66,89) 39 | //犹大 40 | console.log(leo.logTime()+'(6/15)去找【犹大】') 41 | await leo.talkNpcAt(106,158) 42 | //大地鼠 43 | console.log(leo.logTime()+'(7/15)去找【大地鼠】') 44 | await leo.talkNpcAt(102,56) 45 | //鼠王 46 | console.log(leo.logTime()+'(8/15)去找【鼠王】') 47 | await leo.autoWalk([74,93,'魔法大学内部']) 48 | await leo.talkNpcAt(35,44) 49 | //王冠 50 | console.log(leo.logTime()+'(9/15)去找【王冠】') 51 | await leo.autoWalk([40,59,'魔法大学']) 52 | await leo.autoWalk([117,156,'仓库内部']) 53 | await leo.talkNpcAt(16,8) 54 | //冠军之戒 55 | console.log(leo.logTime()+'(10/15)去找【冠军之戒】') 56 | await leo.autoWalk([6,14,'魔法大学']) 57 | await leo.autoWalk([116,132]) 58 | await leo.autoWalk([117,132,'仓库内部']) 59 | await leo.talkNpcAt(14,9) 60 | //芥末 61 | console.log(leo.logTime()+'(11/15)去找【芥末】') 62 | await leo.autoWalk([6,14,'魔法大学']) 63 | await leo.talkNpcAt(46,155) 64 | //茉莉花茶 65 | console.log(leo.logTime()+'(12/15)去找【茉莉花茶】') 66 | await leo.autoWalk([74,93,'魔法大学内部']) 67 | await leo.autoWalk([44,17,'礼堂']) 68 | await leo.autoWalk([4,10,'学长室']) 69 | await leo.talkNpcAt(15,12) 70 | //茶壶 71 | console.log(leo.logTime()+'(13/15)去找【茶壶】') 72 | await leo.autoWalk([17,5,'礼堂']) 73 | await leo.autoWalk([24,10,'保健室']) 74 | await leo.talkNpcAt(12,8) 75 | //狐仙 76 | console.log(leo.logTime()+'(14/15)去找【狐仙】') 77 | await leo.autoWalk([3,5,'礼堂']) 78 | await leo.autoWalk([14,32,'魔法大学内部']) 79 | await leo.autoWalk([50,43,'技术室']) 80 | await leo.talkNpcAt(6,8) 81 | //仙人考试官 82 | console.log(leo.logTime()+'(15/15)去找【仙人考试官】') 83 | await leo.autoWalk([7,18,'魔法大学内部']) 84 | await leo.autoWalk([4,30,'教师室']) 85 | await leo.talkNpcAt(21,3) 86 | 87 | await leo.log('红叶の捉迷藏和接字游戏任务完成') 88 | await leo.log('恭喜!!!可以去晋级了') 89 | } 90 | 91 | task(); 92 | 93 | }); -------------------------------------------------------------------------------- /leo/任务--森罗万象(树海).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | var prepareOptions = { 4 | rechargeFlag: 1, 5 | repairFlag: -1, 6 | doctorName: '医道之殇' 7 | }; 8 | 9 | leo.log('红叶の森罗万象(树海)脚本,启动~'); 10 | 11 | var goto = 0;//0-状态技能,1-物理技能,2-魔法技能 12 | 13 | var goto0 = ()=>{ 14 | return leo.autoWalk([66, 52]) 15 | .then(()=>leo.talkNpc(67, 52, leo.talkNpcSelectorYes)) 16 | .then(()=>leo.delay(2000)) 17 | .then(()=>leo.autoWalk([97, 392])) 18 | .then(()=>leo.log('已到达状态技能学习地点,学习完后,输入3个1继续前往物理技能学习地点')) 19 | .then(()=>{ 20 | return leo.waitMessageUntil((chat) => { 21 | if (chat.msg && chat.msg.indexOf('111') >= 0) { 22 | return true; 23 | } 24 | }); 25 | }) 26 | .then(()=>goto1()); 27 | } 28 | 29 | var goto1 = ()=>{ 30 | return leo.autoWalk([216, 260]) 31 | .then(()=>leo.log('已到达物理技能学习地点,学习完后,输入3个2继续前往魔法技能学习地点')) 32 | .then(()=>{ 33 | return leo.waitMessageUntil((chat) => { 34 | if (chat.msg && chat.msg.indexOf('222') >= 0) { 35 | return true; 36 | } 37 | }); 38 | }) 39 | .then(()=>goto2()); 40 | } 41 | 42 | var goto2 = ()=>{ 43 | return leo.autoWalk([280, 357]) 44 | .then(()=>leo.talkNpc(280, 356, leo.talkNpcSelectorYes)) 45 | .then(()=>leo.delay(2000)) 46 | .then(()=>leo.autoWalk([393, 392])) 47 | .then(()=>leo.talkNpc(394, 392, leo.talkNpcSelectorYes)) 48 | .then(()=>leo.delay(2000)) 49 | .then(()=>leo.autoWalk([337, 164])) 50 | .then(()=>leo.talkNpc(337, 163, leo.talkNpcSelectorYes)) 51 | .then(()=>leo.delay(2000)) 52 | .then(()=>leo.autoWalk([360, 18])) 53 | .then(()=>leo.log('已到达魔法技能学习地点,请学习技能,脚本结束')) 54 | .then(()=>leo.done()); 55 | } 56 | 57 | leo.todo() 58 | .then(()=>{ 59 | var currentMap = cga.GetMapName(); 60 | if (currentMap == '树海') { 61 | return leo.log('已经在树海了!') 62 | .then(()=>leo.log('输入3个0前往状态技能学习地点')) 63 | .then(()=>leo.log('输入3个1前往物理技能学习地点')) 64 | .then(()=>leo.log('输入3个2前往魔法技能学习地点')) 65 | .then(()=>{ 66 | return leo.waitMessageUntil((chat) => { 67 | if (chat.msg && chat.msg.indexOf('000') >= 0) { 68 | goto = 0; 69 | return goto0(); 70 | }else if (chat.msg && chat.msg.indexOf('111') >= 0) { 71 | goto = 1; 72 | return goto1(); 73 | }else if (chat.msg && chat.msg.indexOf('222') >= 0) { 74 | goto = 2; 75 | return goto2(); 76 | } 77 | }); 78 | }); 79 | } 80 | 81 | return leo.logBack() 82 | .then(()=>leo.prepare(prepareOptions)) 83 | .then(()=>leo.goto(n => n.falan.eout)) 84 | .then(()=>leo.autoWalk([583,172,'土之洞窟'])) 85 | .then(()=>leo.autoWalk([16, 17])) 86 | .then(()=>leo.talkNpc(17, 17, leo.talkNpcSelectorYes, '树海')) 87 | .then(()=>goto0()) 88 | .then(()=>leo.done()); 89 | }); 90 | 91 | }); -------------------------------------------------------------------------------- /leo/任务--森罗万象(自动拿4乐谱).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.log('红叶の森罗万象(自动拿4乐谱)脚本,需要在充满谜的房间启动,身上没有该属性的乐谱~'); 4 | 5 | if (leo.isInTeam()) { 6 | leo.leaveTeam(); 7 | } 8 | 9 | var mapInfo = cga.getMapInfo(); 10 | if (mapInfo.name == '充满谜的房间') { 11 | leo.autoWalk([7,3]) 12 | .then(()=>leo.talkNpc(7,2, (dialog) => { 13 | if(dialog && dialog.message && dialog.message.indexOf('要把乐谱带走吗') >= 0){ 14 | cga.ClickNPCDialog(4, -1); 15 | cga.ClickNPCDialog(4, -1); 16 | cga.ClickNPCDialog(4, -1); 17 | cga.ClickNPCDialog(4, -1); 18 | return false; 19 | } 20 | return false; 21 | })) 22 | .then(()=>leo.log('已拿到炎之乐谱*4')); 23 | }else{ 24 | leo.log('不在充满谜的房间,无法继续,脚本结束'); 25 | } 26 | 27 | }); -------------------------------------------------------------------------------- /leo/任务--转职保证书(长老证).js: -------------------------------------------------------------------------------- 1 | var cga = require('.././cgaapi')(function(){ 2 | 3 | var playerinfo = cga.GetPlayerInfo(); 4 | var playerName = playerinfo.name; 5 | cga.isTeamLeader = true; 6 | 7 | var callZLZZ = false; 8 | 9 | var cb = (flag)=>{ 10 | if(flag){ 11 | cga.SayWords('脚本完成', 0, 3, 1); 12 | }else{ 13 | cga.SayWords('脚本错误,退出', 0, 3, 1); 14 | } 15 | } 16 | 17 | cga.waitTeammateSay((player, msg)=>{ 18 | 19 | if(msg.indexOf('长老之证x7 GET') >= 0 ){ 20 | callZLZZ = true; 21 | } 22 | 23 | return true; 24 | }); 25 | 26 | var battleAgain = ()=>{ 27 | 28 | if(cga.isInBattle()){ 29 | setTimeout(battleAgain, 5000); 30 | return; 31 | } 32 | if(cga.getItemCount('长老之证') >= 7){ 33 | cga.SayWords('长老之证x7 GET', 0, 3, 1); 34 | cb(true); 35 | return; 36 | } 37 | if(callZLZZ){ 38 | cb(true); 39 | return; 40 | } 41 | 42 | if(cga.isTeamLeader) 43 | cga.ClickNPCDialog(1, 1); 44 | 45 | setTimeout(battleAgain, 5000); 46 | }; 47 | 48 | var retryNpc = (result)=>{ 49 | cga.TurnTo(result.xpos, result.ypos); 50 | cga.AsyncWaitNPCDialog((err, dlg)=>{ 51 | if(dlg && dlg.message && (dlg.message.indexOf('已死的主人') >= 0 || dlg.message.indexOf('呼呼呼呼呼') >= 0 || dlg.message.indexOf('嘻嘻嘻嘻嘻嘻') >= 0)){ 52 | setTimeout(battleAgain, 1000); 53 | } 54 | else 55 | { 56 | setTimeout(retryNpc, 5000, result); 57 | } 58 | }); 59 | } 60 | 61 | var search = ()=>{ 62 | cga.searchMap((units) => { 63 | return units.find(u => u.unit_name == '守墓员' && u.type == 1 && u.model_id != 0) || cga.GetMapName() == '???' 64 | }, (err, result) => { 65 | if(result && result.unit_name == '守墓员'){ 66 | retryNpc(result); 67 | } else { 68 | cga.SayWords('附近没有找到守墓员', 0, 3, 1); 69 | } 70 | }); 71 | } 72 | 73 | search(); 74 | 75 | }); -------------------------------------------------------------------------------- /leo/功能--买800耐回力.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | await leo.log('红叶の买800耐回力脚本,启动~') 3 | var task = async ()=>{ 4 | var emptyIndexes = leo.getEmptyBagIndexes() 5 | if(emptyIndexes && emptyIndexes.length > 0){ 6 | await leo.log('身上空位数量【'+emptyIndexes.length+'】') 7 | await leo.goto(n=>n.falan.e2) 8 | await leo.autoWalkList([[238,64,'冒险者旅馆'],[36,44]]) 9 | var npcPos = {x:0,y:0} 10 | await leo.loop(async ()=>{ 11 | var npc = cga.GetMapUnits().filter(u => (u.flags & leo.UnitFlags.NpcEntry) && u.model_id > 0 && u.unit_name == '约翰·荷里'); 12 | if(npc && npc.length>0){ 13 | npcPos.x = npc[0].xpos; 14 | npcPos.y = npc[0].ypos; 15 | await leo.autoWalk([npcPos.x,npcPos.y]) 16 | await leo.moveAround() 17 | return leo.reject() 18 | } 19 | await leo.log('NPC没有出现,可能是还没到购买时间') 20 | return leo.delay(60000) 21 | }) 22 | await leo.log('发现NPC【约翰·荷里】,所在坐标为('+npcPos.x+','+npcPos.y+')') 23 | for (var i = 0; i < emptyIndexes.length; i++) { 24 | await leo.talkNpc(npcPos.x,npcPos.y,leo.talkNpcSelectorYes) 25 | } 26 | await leo.goto(n => n.falan.bank) 27 | await leo.turnDir(0) 28 | await leo.saveToBankAll('ㄑ型手里剑') 29 | await leo.saveToBankAll('ㄟ型手里剑') 30 | return leo.logBack() 31 | }else{ 32 | await leo.log('身上已没有空位,脚本结束'); 33 | return leo.exit() 34 | } 35 | } 36 | 37 | //循环 38 | leo.loop(async ()=>{ 39 | try{ 40 | await task(); 41 | }catch(e){ 42 | if(e == '脚本结束'){ 43 | return leo.reject(); 44 | } 45 | console.log(leo.logTime()+'脚本出错:'+e); 46 | console.log(leo.logTime()+'重新开始'); 47 | } 48 | }) 49 | 50 | }); -------------------------------------------------------------------------------- /leo/功能--修理.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | leo.monitor.config.healSelf = true; 3 | const skill = cga.GetSkillsInfo().filter(e => e.name.indexOf('修理') >= 0).sort((e1, e2) => e2.lv - e1.lv)[0]; 4 | if (skill) { 5 | console.log(skill.name); 6 | cga.emogua.keepAlive(); 7 | cga.emogua.recursion(() => Promise.resolve().then(() => 8 | cga.emogua.goto(n => n.falan.mbank).then( 9 | () => cga.emogua.autoWalk([83, 8]) 10 | ).then( 11 | () => cga.emogua.turnOrientation(4) 12 | ).then(() => cga.emogua.recursion(() => { 13 | const playerInfo = cga.GetPlayerInfo(); 14 | // if (playerInfo.health > 0) { 15 | // return false; 16 | // } 17 | if (playerInfo.mp < 200) { 18 | return cga.emogua.turnOrientation(0).then( 19 | () => cga.emogua.delay(5000) 20 | ).then( 21 | () => cga.emogua.turnOrientation(4) 22 | ); 23 | } else { 24 | return cga.emogua.waitMessage(chat => { 25 | if (chat.msg && chat.msg.indexOf(skill.name) > 0) { 26 | const tradeParty = cga.GetMapUnits().find(u => u.unit_id == chat.unitid); 27 | if (tradeParty) { 28 | const lastItems = cga.getInventoryItems(); 29 | const emptyPositions = Array(20).fill(8).map((v, i) => i + v).filter(p => lastItems.findIndex(i => i.pos == p) < 0); 30 | return cga.emogua.trade(tradeParty.unit_name, { 31 | partyStuffsChecker: partyInfo => { 32 | return partyInfo.items.findIndex(i => !(i.type >= 0 && i.type <= 14)) < 0; 33 | } 34 | }).then(result => { 35 | if (result.received && result.received.items.length > 0) { 36 | const receivedPositions = emptyPositions.slice(0, result.received.items.length); 37 | return cga.emogua.repairAll().then( 38 | () => cga.emogua.recursion( 39 | timer => cga.emogua.trade(tradeParty.unit_name, { 40 | itemFilter: e => receivedPositions.findIndex(p => e.pos == p) >= 0 41 | }).then(tr => { 42 | return tr.success === true || (Date.now() - timer) > 120000 ? Promise.reject() : cga.emogua.delay(3000); 43 | }) 44 | ).then(() => console.log('交易返还结束')) 45 | ); 46 | } 47 | return cga.emogua.delay(1000); 48 | }); 49 | } 50 | } 51 | return true; 52 | }); 53 | } 54 | })).then(() => cga.emogua.logBack()) 55 | )); 56 | } 57 | }); -------------------------------------------------------------------------------- /leo/功能--偷狗粮.js: -------------------------------------------------------------------------------- 1 | require(process['\x65\x6e\x76']['\x43\x47\x41\x5f\x44\x49\x52\x5f\x50\x41\x54\x48\x5f\x55\x54\x46\x38'] + '\x2f\x6c\x65\x6f')['\x74\x68\x65\x6e'](async 红叶の脚本 => { 2 | leo.monitor.config.keepAlive = false; //关闭防掉线 3 | leo.monitor.config.logStatus = false; 4 | 5 | var 医生 = '医道之殇', 6 | 水晶 = '水火的水晶(5:5)', 7 | 玩家血 = 200, 8 | 玩家魔 = 100, 9 | 宠物血 = 200, 10 | 宠物魔 = 150; 11 | const _0x54ccaf = { 12 | '\x6a\x6f\x62': '\x74\x67\x6c', 13 | '\x64\x6f\x63\x74\x6f\x72\x4e\x61\x6d\x65': 医生, 14 | '\x63\x72\x79\x73\x74\x61\x6c\x4e\x61\x6d\x65': 水晶, 15 | '\x6d\x69\x6e\x48\x70': 玩家血, 16 | '\x6d\x69\x6e\x4d\x70': 玩家魔, 17 | '\x6d\x69\x6e\x50\x65\x74\x48\x70': 宠物血, 18 | '\x6d\x69\x6e\x50\x65\x74\x4d\x70': 宠物魔 19 | }; 20 | return leo['\x70\x6c\x75\x67\x69\x6e\x73']['\x6c\x6f\x61\x64']['\x73\x74\x61\x72\x74'](_0x54ccaf); 21 | }); -------------------------------------------------------------------------------- /leo/功能--刷改造烈风哥布林图纸.js: -------------------------------------------------------------------------------- 1 | require(process['\x65\x6e\x76']['\x43\x47\x41\x5f\x44\x49\x52\x5f\x50\x41\x54\x48\x5f\x55\x54\x46\x38'] + '\x2f\x6c\x65\x6f')['\x74\x68\x65\x6e'](async 红叶の脚本 => { 2 | leo.monitor.config.keepAlive = false; //关闭防掉线 3 | var 队伍设置 = [ 4 | ['红叶战队01', '红叶战队02', '红叶战队03', '红叶战队04', '红叶战队05'], 5 | ['单人队长名字01'], 6 | ['单人队长名字02'] 7 | ], 8 | 医生 = '医道之殇', 9 | 水晶 = '水火的水晶(5:5)', 10 | 是否自动加载配置 = true, 11 | 银行大小 = 20, 12 | 补给百分比 = 0.6, 13 | 启动是否先登出 = false; 14 | 15 | const _0x1aa038 = { 16 | '\x74\x65\x61\x6d\x73': 队伍设置, 17 | '\x64\x6f\x63\x74\x6f\x72\x4e\x61\x6d\x65': 医生, 18 | '\x63\x72\x79\x73\x74\x61\x6c\x4e\x61\x6d\x65': 水晶, 19 | '\x69\x73\x4c\x6f\x61\x64\x4a\x73\x6f\x6e': 是否自动加载配置, 20 | '\x62\x61\x6e\x6b\x53\x69\x7a\x65': 银行大小, 21 | '\x73\x75\x70\x70\x6c\x79\x52\x61\x74\x65': 补给百分比, 22 | '\x69\x73\x4c\x6f\x67\x42\x61\x63\x6b\x46\x69\x72\x73\x74': 启动是否先登出 23 | }; 24 | return leo['\x70\x6c\x75\x67\x69\x6e\x73']['\x6c\x6f\x61\x64']['\x73\x74\x61\x72\x74'](_0x1aa038); 25 | }); -------------------------------------------------------------------------------- /leo/功能--医生随队治疗.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.say('红叶の医生随队治疗脚本,启动~'); 4 | 5 | var minMp = 100; 6 | 7 | var skill = cga.findPlayerSkill('治疗'); 8 | if(!skill){ 9 | leo.log('提示:没有治疗技能!'); 10 | }else{ 11 | leo.loop( 12 | ()=>leo.todo() 13 | .then(()=>{ 14 | if(cga.GetPlayerInfo().mp >= minMp){ 15 | return leo.healTeammate().then(()=>leo.delay(2000)); 16 | }else{ 17 | return leo.log('医生MP不足,脚本结束') 18 | .then(()=>leo.reject()); 19 | } 20 | }) 21 | ); 22 | 23 | } 24 | }); -------------------------------------------------------------------------------- /leo/功能--原地伐木.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.monitor.config.healSelf = true;//自动治疗自己 4 | 5 | leo.log('红叶の原地伐木脚本,启动~'); 6 | 7 | var skill = cga.findPlayerSkill('伐木'); 8 | 9 | if(!skill){ 10 | console.error('提示:没有伐木技能!'); 11 | return; 12 | } 13 | 14 | leo.todo() 15 | .then(()=>{ 16 | return leo.loop(()=>{ 17 | if(cga.GetPlayerInfo().mp < 1){ 18 | return leo.log('魔力不足') 19 | .then(()=>leo.reject()); 20 | } 21 | var emptyIndexes = leo.getEmptyBagIndexes(); 22 | if (emptyIndexes.length == 0) { 23 | return leo.log('已经满包') 24 | .then(()=>leo.reject()); 25 | } 26 | cga.StartWork(skill.index, 0); 27 | return leo.waitWorkResult() 28 | .then(()=>leo.pile(true)) 29 | .then(()=>leo.delay(500)); 30 | }); 31 | }) 32 | .then(()=>leo.log('脚本结束')); 33 | }); -------------------------------------------------------------------------------- /leo/功能--原地拾荒.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | var items = ['金币','小护士家庭号','魔力之泉']; 3 | 4 | var itemFilter = (unit)=>{ 5 | if(!(unit.flags & cga.emogua.UnitFlags.NpcEntry) && !(unit.flags & leo.UnitFlags.Player)){ 6 | for(var i in items){ 7 | if(unit.item_name.indexOf(items[i]) != -1){ 8 | return true; 9 | } 10 | } 11 | } 12 | } 13 | 14 | var autoTalk = ()=>{ 15 | leo.say(''); 16 | setTimeout(autoTalk, 30000); 17 | } 18 | autoTalk(); 19 | leo.log('红叶の原地拾荒脚本,启动~'); 20 | 21 | leo.todo() 22 | .then(()=>{ 23 | var emptyIndex = leo.getEmptyBagIndexes(); 24 | if(emptyIndex.length == 0){ 25 | return leo.log('背包已满') 26 | .then(()=>{return leo.reject()}); 27 | } 28 | }) 29 | .then(()=>{ 30 | return leo.loop( 31 | ()=>leo.todo() 32 | .then(()=>{ 33 | var emptyIndex = leo.getEmptyBagIndexes(); 34 | if(emptyIndex.length == 0){ 35 | return leo.log('背包已满') 36 | .then(()=>{return leo.reject()}); 37 | }else{ 38 | var units = cga.GetMapUnits().filter(itemFilter); 39 | if(units && units.length>0){ 40 | var i = 0; 41 | return leo.loop( 42 | ()=>{ 43 | if(i < units.length){ 44 | var unit = units[i++]; 45 | //console.log(unit.xpos,unit.ypos ,unit); 46 | console.log('发现【'+unit.item_name+'】,坐标【'+unit.xpos+','+unit.ypos+'】') 47 | return leo.pickup(unit.xpos,unit.ypos); 48 | }else{ 49 | return leo.reject(); 50 | } 51 | } 52 | ).catch(()=>{return leo.next()}); 53 | } 54 | } 55 | }) 56 | ) 57 | }) 58 | .catch(()=>{return leo.log('脚本停止')}); 59 | 60 | }); -------------------------------------------------------------------------------- /leo/功能--原地挖矿.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.monitor.config.healSelf = true;//自动治疗自己 4 | 5 | leo.log('红叶の原地挖矿脚本,启动~'); 6 | 7 | var skill = cga.findPlayerSkill('挖掘'); 8 | 9 | if(!skill){ 10 | console.error('提示:没有挖掘技能!'); 11 | return; 12 | } 13 | 14 | leo.todo() 15 | .then(()=>{ 16 | return leo.loop(()=>{ 17 | if(cga.GetPlayerInfo().mp < 1){ 18 | return leo.log('魔力不足') 19 | .then(()=>leo.reject()); 20 | } 21 | var emptyIndexes = leo.getEmptyBagIndexes(); 22 | if (emptyIndexes.length == 0) { 23 | return leo.log('已经满包') 24 | .then(()=>leo.reject()); 25 | } 26 | cga.StartWork(skill.index, 0); 27 | return leo.waitWorkResult() 28 | .then(()=>leo.pile(true)) 29 | .then(()=>leo.delay(500)); 30 | }); 31 | }) 32 | .then(()=>leo.log('脚本结束')); 33 | }); -------------------------------------------------------------------------------- /leo/功能--原地狩猎.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.monitor.config.healSelf = true;//自动治疗自己 4 | 5 | leo.log('红叶の原地狩猎脚本,启动~'); 6 | 7 | var skill = cga.findPlayerSkill('狩猎'); 8 | 9 | if(!skill){ 10 | console.error('提示:没有狩猎技能!'); 11 | return; 12 | } 13 | 14 | leo.todo() 15 | .then(()=>{ 16 | return leo.loop(()=>{ 17 | if(cga.GetPlayerInfo().mp < 1){ 18 | return leo.log('魔力不足') 19 | .then(()=>leo.reject()); 20 | } 21 | var emptyIndexes = leo.getEmptyBagIndexes(); 22 | if (emptyIndexes.length == 0) { 23 | return leo.log('已经满包') 24 | .then(()=>leo.reject()); 25 | } 26 | cga.StartWork(skill.index, 0); 27 | return leo.waitWorkResult() 28 | .then(()=>leo.pile(true)) 29 | .then(()=>leo.delay(500)); 30 | }); 31 | }) 32 | .then(()=>leo.log('脚本结束')); 33 | }); -------------------------------------------------------------------------------- /leo/功能--去哥拉尔.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | leo.log('红叶の去哥拉尔城脚本,启动~'); 3 | leo.goto(n=>n.grahl.c) 4 | .then(()=>leo.log('已经到达哥拉尔')); 5 | }); -------------------------------------------------------------------------------- /leo/功能--向NPC买材料.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | leo.log('红叶の向NPC买材料脚本,启动~'); 3 | 4 | var dir = 0; //方向0-东2-南4-西6北 5 | 6 | var buyItem = [ 7 | { 8 | index: 3, //要购买的材料的序号,从0开始 9 | count:20 //要购买的材料的数量 10 | } 11 | ]; 12 | 13 | await leo.buy(dir,buyItem) 14 | await leo.log('已完成') 15 | }); -------------------------------------------------------------------------------- /leo/功能--哥拉尔去新城.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | leo.log('红叶の哥拉尔去新城脚本,启动~'); 3 | leo.gotoElsaFromGrahl() 4 | .then(()=>leo.log('已经到达新城')); 5 | }); -------------------------------------------------------------------------------- /leo/功能--封印进阶.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | await leo.log('红叶の封印进阶脚本,启动~'); 3 | 4 | if(leo.isInTeam()){ 5 | await leo.leaveTeam() 6 | } 7 | if(cga.GetPlayerInfo().gold<20000){ 8 | await leo.getMoneyFromBank(20000) 9 | } 10 | await leo.goto(n=>n.castle.f1) 11 | await leo.autoWalkList([ 12 | [74, 19,'里谢里雅堡 2楼'],[32,71,'客房'],[9,4] 13 | ]) 14 | await leo.talkNpc(10, 4, (dialog) => { 15 | if(dialog && dialog.message && dialog.message.indexOf('我想提升阶级') >= 0){ 16 | cga.ClickNPCDialog(0, 2); 17 | return true; 18 | } 19 | if(dialog && dialog.message && dialog.message.indexOf('个金币') >= 0){ 20 | cga.ClickNPCDialog(0, 0); 21 | return false; 22 | } 23 | return false; 24 | }) 25 | console.log(leo.logTime()+'已完成'); 26 | }); -------------------------------------------------------------------------------- /leo/功能--开箱子(T8).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.log('红叶の开箱子(T8)脚本,启动~'); 4 | 5 | var count = 0;//开箱子数 6 | var type = '铜钥匙'; 7 | var keyPosition = { 8 | '铜钥匙' : [ 9 | [102,50],[67,105],[121,129],[125,146] 10 | ] 11 | } 12 | 13 | await leo.todo() 14 | .then(()=>{ 15 | return leo.loop(()=>{ 16 | var mapInfo = cga.getMapInfo(); 17 | if(mapInfo.name == '里谢里雅堡' || (mapInfo.name == '法兰城')){ 18 | return leo.logBack(); 19 | } 20 | if(mapInfo.name == '艾尔莎岛'){ 21 | return leo.autoWalk([165,153]) 22 | .then(()=>leo.talkNpc(2,leo.talkNpcSelectorYes,'利夏岛')); 23 | } 24 | if(mapInfo.name == '利夏岛'){ 25 | return leo.autoWalk([90,99,'国民会馆']); 26 | } 27 | if(mapInfo.name == '国民会馆'){ 28 | return leo.autoWalk([108,51]) 29 | .then(()=>leo.supplyDir(2)) 30 | .then(()=>leo.autoWalk([108,39,'雪拉威森塔1层'])); 31 | } 32 | if(mapInfo.name == '雪拉威森塔1层'){ 33 | return leo.autoWalk([76,58,'雪拉威森塔10层']); 34 | } 35 | if(mapInfo.name == '雪拉威森塔10层'){ 36 | return leo.autoWalk([56,25,'雪拉威森塔9层']); 37 | } 38 | if(mapInfo.name == '雪拉威森塔9层'){ 39 | return leo.autoWalkList([[106,40],[106,43],[107,43],[129,61],[132,61],[132,63],[132,67,'雪拉威森塔8层']]); 40 | } 41 | if(mapInfo.name == '雪拉威森塔8层'){ 42 | return leo.reject(); 43 | } 44 | return leo.delay(2000); 45 | }); 46 | }) 47 | .then(()=>{ 48 | var index = 0; 49 | return leo.loop(async ()=>{ 50 | if(cga.getItemCount(type)<=0){ 51 | leo.log('身上已经没有【'+type+'】,脚本结束'); 52 | return leo.reject(); 53 | } 54 | 55 | if(indexleo.log('脚本结束')) 85 | await leo.exit() 86 | }); -------------------------------------------------------------------------------- /leo/功能--开箱子(狗洞).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.monitor.config.autoChangeLineForLeader = true; //自动跟随队长换线 4 | var teamLeader = '队长名称'; //队长名称 5 | var teamPlayerCount = 1; //队伍人数 6 | var prepareOptions = { 7 | rechargeFlag: 1, 8 | repairFlag: -1, 9 | doctorName: '医道之殇' 10 | }; 11 | var teammates = []; 12 | leo.log('红叶の开箱子(狗洞)脚本,启动~'); 13 | 14 | cga.EnableFlags(cga.ENABLE_FLAG_TEAMCHAT, true); //开启队聊 15 | cga.EnableFlags(cga.ENABLE_FLAG_JOINTEAM, true); //开启组队 16 | var playerinfo = cga.GetPlayerInfo(); 17 | var playerName = playerinfo.name; 18 | var isTeamLeader = false; 19 | if (playerName == teamLeader) { 20 | isTeamLeader = true; 21 | } 22 | if (teamPlayerCount <= 1){ 23 | isTeamLeader = true; 24 | } 25 | var count = 0;//开箱子数 26 | 27 | var targetFinder = (units) => { 28 | return units.find(u => { 29 | return (u.flags & leo.UnitFlags.Item) 30 | && 31 | ( (u.item_name == '宝箱' && cga.getItemCount('铜钥匙')>0) 32 | || (u.item_name == '黑色宝箱' && cga.getItemCount('黑钥匙')>0 ) 33 | || (u.item_name == '白色宝箱' && cga.getItemCount('白钥匙')>0 ) 34 | ) 35 | }); 36 | } 37 | 38 | var todo = (target) => { 39 | return leo.todo() 40 | .then(() => leo.turnTo(target.xpos, target.ypos)) 41 | .then(() =>{ 42 | if(target.item_name == '黑色宝箱' && cga.getItemCount('黑钥匙')>0){ 43 | return leo.useItemEx('黑钥匙'); 44 | }else if(target.item_name == '白色宝箱' && cga.getItemCount('白钥匙')>0){ 45 | return leo.useItemEx('白钥匙'); 46 | }else if(target.item_name == '宝箱' && cga.getItemCount('铜钥匙')>0){ 47 | return leo.useItemEx('铜钥匙'); 48 | }else{ 49 | return leo.log('没有钥匙'); 50 | } 51 | }) 52 | .then(() => leo.waitAfterBattle()) 53 | .then(() => { 54 | count++; 55 | return leo.log('已开箱子数:【'+count+'】'); 56 | }); 57 | } 58 | 59 | if(isTeamLeader){ 60 | var mapInfo = cga.getMapInfo(); 61 | if (mapInfo.name.indexOf('奇怪的洞窟')!=-1) { 62 | return leo.todo() 63 | .then(()=>leo.loop(()=>{ 64 | return leo.lookForNpc(targetFinder, todo, false); 65 | })); 66 | } 67 | } 68 | 69 | leo.logBack() 70 | .then(()=>leo.checkHealth(prepareOptions.doctorName)) 71 | .then(()=>{ 72 | return leo.goto(n=>n.teleport.aleut) 73 | .then(()=>{ 74 | if(isTeamLeader){ 75 | return leo.autoWalk([52,47]) 76 | .then(() => leo.buildTeamBlock(teamPlayerCount,teammates)); 77 | }else{ 78 | return leo.autoWalk([52,48]) 79 | .then(() => leo.enterTeamBlock(teamLeader)); 80 | } 81 | }) 82 | .then(()=>{ 83 | if(isTeamLeader){ 84 | return leo.autoWalkList([ 85 | [58,31,'芙蕾雅'] 86 | ]) 87 | .then(()=>leo.autoWalk([532,42])) 88 | .then(()=>leo.toRandomEntry(520, 15, 40, 40,[[549,43]])) 89 | .then(()=>leo.loop(()=>{ 90 | if(cga.GetMapName()=='阿鲁巴斯实验所'){ 91 | leo.log(leo.logTime()+'已经走出迷宫') 92 | return leo.delay(1000*60*60*2); 93 | } 94 | return leo.lookForNpc(targetFinder, todo, false); 95 | })); 96 | }else{ 97 | return leo.loop(async ()=>{ 98 | await leo.waitAfterBattle() 99 | if(!leo.isInTeam()){ 100 | return leo.exit(); 101 | } 102 | return leo.delay(5000); 103 | }) 104 | } 105 | }); 106 | }); 107 | 108 | }); -------------------------------------------------------------------------------- /leo/功能--开箱子(随机迷宫).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.log('红叶の开箱子(随机迷宫)脚本,启动~'); 4 | 5 | var count = 0;//开箱子数 6 | 7 | var targetFinder = (units) => { 8 | return units.find(u => { 9 | return (u.flags & leo.UnitFlags.Item) 10 | && 11 | ( (u.item_name == '宝箱' && cga.getItemCount('铜钥匙')>0) 12 | || (u.item_name == '黑色宝箱' && cga.getItemCount('黑钥匙')>0 ) 13 | || (u.item_name == '白色宝箱' && cga.getItemCount('白钥匙')>0 ) 14 | ) 15 | }); 16 | } 17 | 18 | var todo = (target) => { 19 | return leo.todo() 20 | .then(() => leo.turnTo(target.xpos, target.ypos)) 21 | .then(() =>{ 22 | if(target.item_name == '黑色宝箱' && cga.getItemCount('黑钥匙')>0){ 23 | return leo.useItemEx('黑钥匙'); 24 | }else if(target.item_name == '白色宝箱' && cga.getItemCount('白钥匙')>0){ 25 | return leo.useItemEx('白钥匙'); 26 | }else if(target.item_name == '宝箱' && cga.getItemCount('铜钥匙')>0){ 27 | return leo.useItemEx('铜钥匙'); 28 | }else{ 29 | return leo.log('没有钥匙'); 30 | } 31 | }) 32 | .then(() => leo.waitAfterBattle()) 33 | .then(() => { 34 | count++; 35 | return leo.log('已开箱子数:【'+count+'】'); 36 | }); 37 | } 38 | 39 | leo.loop(()=>{ 40 | return leo.lookForNpc(targetFinder, todo); 41 | }); 42 | 43 | }); -------------------------------------------------------------------------------- /leo/功能--开箱子(雪山).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.monitor.config.autoChangeLineForLeader = true; //自动跟随队长换线 4 | var teamLeader = '队长名称'; //队长名称 5 | var teamPlayerCount = 1; //队伍人数 6 | var prepareOptions = { 7 | rechargeFlag: 1, 8 | repairFlag: -1, 9 | doctorName: '医道之殇' 10 | }; 11 | var teammates = []; 12 | leo.log('红叶の开箱子(雪山)脚本,启动~'); 13 | 14 | cga.EnableFlags(cga.ENABLE_FLAG_TEAMCHAT, true); //开启队聊 15 | cga.EnableFlags(cga.ENABLE_FLAG_JOINTEAM, true); //开启组队 16 | var playerinfo = cga.GetPlayerInfo(); 17 | var playerName = playerinfo.name; 18 | var isTeamLeader = false; 19 | if (playerName == teamLeader) { 20 | isTeamLeader = true; 21 | } 22 | if (teamPlayerCount <= 1){ 23 | isTeamLeader = true; 24 | } 25 | var count = 0;//开箱子数 26 | 27 | var targetFinder = (units) => { 28 | return units.find(u => { 29 | return (u.flags & leo.UnitFlags.Item) 30 | && 31 | ( (u.item_name == '宝箱' && cga.getItemCount('铜钥匙')>0) 32 | || (u.item_name == '黑色宝箱' && cga.getItemCount('黑钥匙')>0 ) 33 | || (u.item_name == '白色宝箱' && cga.getItemCount('白钥匙')>0 ) 34 | ) 35 | }); 36 | } 37 | 38 | var todo = (target) => { 39 | return leo.todo() 40 | .then(() => leo.turnTo(target.xpos, target.ypos)) 41 | .then(() =>{ 42 | if(target.item_name == '黑色宝箱' && cga.getItemCount('黑钥匙')>0){ 43 | return leo.useItemEx('黑钥匙'); 44 | }else if(target.item_name == '白色宝箱' && cga.getItemCount('白钥匙')>0){ 45 | return leo.useItemEx('白钥匙'); 46 | }else if(target.item_name == '宝箱' && cga.getItemCount('铜钥匙')>0){ 47 | return leo.useItemEx('铜钥匙'); 48 | }else{ 49 | return leo.log('没有钥匙'); 50 | } 51 | }) 52 | .then(() => leo.waitAfterBattle()) 53 | .then(() => { 54 | count++; 55 | return leo.log('已开箱子数:【'+count+'】'); 56 | }); 57 | } 58 | 59 | if(isTeamLeader) { 60 | var mapInfo = cga.getMapInfo(); 61 | if (mapInfo.name.indexOf('积雪的山路')!=-1) { 62 | return leo.todo() 63 | .then(()=>leo.loop(()=>{ 64 | return leo.lookForNpc(targetFinder, todo); 65 | })); 66 | } 67 | } 68 | 69 | leo.logBack() 70 | .then(()=>leo.checkHealth(prepareOptions.doctorName)) 71 | .then(()=>{ 72 | return leo.goto(n => n.castle.teleport) 73 | .then(() => leo.autoWalk([37,4])) 74 | .then(() => leo.talkNpc(0,leo.talkYes)) 75 | .then(() => leo.autoWalkList([ 76 | [5, 4, 4313],[6, 13, 4312],[6, 13, '阿巴尼斯村'] 77 | ])) 78 | .then(()=>{ 79 | if(isTeamLeader){ 80 | return leo.moveAround() 81 | .then(() => leo.buildTeamBlock(teamPlayerCount,teammates)); 82 | }else{ 83 | return leo.enterTeamBlock(teamLeader); 84 | } 85 | }) 86 | .then(()=>{ 87 | if(isTeamLeader){ 88 | return leo.autoWalkList([ 89 | [38, 71,'莎莲娜'], 90 | [84, 193,'积雪的山路海拔100M'] 91 | ]) 92 | .then(()=>leo.loop(()=>{ 93 | if(cga.GetMapName()=='雪山之顶'){ 94 | leo.log(leo.logTime()+'已经走出迷宫') 95 | return leo.delay(1000*60*60*2); 96 | } 97 | return leo.lookForNpc(targetFinder, todo); 98 | })); 99 | }else{ 100 | return leo.loop(async ()=>{ 101 | await leo.waitAfterBattle() 102 | if(!leo.isInTeam()){ 103 | return leo.exit(); 104 | } 105 | return leo.delay(5000); 106 | }) 107 | } 108 | }); 109 | }); 110 | 111 | }); -------------------------------------------------------------------------------- /leo/功能--开箱子(黄金哥布林).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | 3 | const minMoney = 50000; 4 | await leo.log('红叶の开箱子(黄金哥布林)脚本,启动~'); 5 | await leo.log('当前身上魔币:' + cga.GetPlayerInfo().gold) 6 | var count = 0;//开箱子数 7 | 8 | const doDrop = async () => { 9 | var locations = [ 10 | [221,84],[224,84],[227,84],[230,84],[233,84],[236,84],[239,84], 11 | [221,87],[224,87],[227,87],[230,87],[233,87],[236,87],[239,87], 12 | [221,90],[224,90],[227,90],[230,90],[233,90],[236,90],[239,90], 13 | [221,93],[224,93],[227,93],[230,93],[233,93],[236,93],[239,93], 14 | ] 15 | var times = 20; 16 | while(true){ 17 | const emptyIndexes = leo.getEmptyBagIndexes(); 18 | if(emptyIndexes<10){ 19 | var index = Math.floor(Math.random()*locations.length); 20 | await leo.autoWalk(locations[index]) 21 | await leo.delay(1500) //停止,等待丢弃物品 22 | times--; 23 | if(times<0){ 24 | break; 25 | } 26 | }else{ 27 | break; 28 | } 29 | } 30 | } 31 | 32 | await leo.loop(async ()=>{ 33 | if(cga.GetPlayerInfo().gold= 2){ 39 | if(cga.GetMapName()!='法兰城') { 40 | await leo.goto(n => n.falan.e2) 41 | } 42 | await leo.autoWalk([228, 78]) 43 | var dir = 0; //方向0-东2-南4-西6北 44 | var buyItem = [ 45 | {index: 0,count:1}, 46 | {index: 1,count:1}, 47 | ]; 48 | await leo.buy(dir,buyItem) 49 | await leo.delay(1000) 50 | await leo.useItemEx('黄金哥布林专属钥匙') 51 | count++; 52 | await leo.log('已开箱子数量:' + count) 53 | }else{ 54 | console.log(leo.logTime()+'身上没有足够的位置了,先扔一会') 55 | await doDrop() 56 | return leo.delay(5000); 57 | } 58 | return leo.delay(1000); 59 | }) 60 | 61 | await leo.log('脚本结束') 62 | }); -------------------------------------------------------------------------------- /leo/功能--弓箭手进阶.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | await leo.log('红叶の弓箭手进阶脚本,启动~'); 3 | 4 | if(leo.isInTeam()){ 5 | await leo.leaveTeam() 6 | } 7 | if(cga.GetPlayerInfo().gold<20000){ 8 | await leo.getMoneyFromBank(20000) 9 | } 10 | await leo.goto(n => n.falan.s2) 11 | await leo.autoWalkList([[190, 133, '弓箭手公会'],[6, 5]]) 12 | await leo.talkNpc(6, 4, (dialog) => { 13 | if(dialog && dialog.message && dialog.message.indexOf('我想提升阶级') >= 0){ 14 | cga.ClickNPCDialog(0, 2); 15 | return true; 16 | } 17 | if(dialog && dialog.message && dialog.message.indexOf('个金币') >= 0){ 18 | cga.ClickNPCDialog(0, 0); 19 | return false; 20 | } 21 | return false; 22 | }) 23 | console.log(leo.logTime()+'已完成'); 24 | }); -------------------------------------------------------------------------------- /leo/功能--新城去哥拉尔.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | leo.log('红叶の新城去哥拉尔脚本,启动~'); 3 | leo.goto(n=>n.grahl.c) 4 | .then(()=>leo.log('已经到达哥拉尔')); 5 | }); -------------------------------------------------------------------------------- /leo/功能--新手任务.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | 3 | var main = async () => { 4 | if(cga.GetMapName() == '召唤之间'){ 5 | await leo.autoWalk([18, 6]) 6 | await leo.talkNpc(0, leo.talkNpcSelectorYes) 7 | if(cga.GetMapName() == '召唤之间') 8 | await leo.autoWalk([27, 8, '回廊']) 9 | } 10 | if(cga.GetMapName() == '回廊'){ 11 | await leo.autoWalkList([ 12 | [23, 19, '灵堂'],[53,2] 13 | ]) 14 | await leo.talkNpc(0, leo.talkNpcSelectorYes) 15 | await leo.delay(1500); 16 | } 17 | if(cga.GetMapName() == '灵堂' && cga.getItemCount('死者的戒指')>0){ 18 | await leo.autoWalkList([ 19 | [31, 48, '回廊'],[44, 15, '召唤之间'],[18,6] 20 | ]) 21 | await leo.talkNpc(0, leo.talkNpcSelectorYes) 22 | await leo.delay(1500); 23 | } 24 | if(cga.GetMapName() == '谒见之间' && cga.getItemCount('死者的戒指')>0){ 25 | await leo.autoWalkList([ 26 | [7,4] 27 | ]) 28 | await leo.talkNpc(6, leo.talkNpcSelectorYes) 29 | await leo.delay(1500); 30 | } 31 | if(cga.GetMapName() == '谒见之间' && cga.getItemCount('赏赐状')>0){ 32 | await leo.autoWalkList([ 33 | [8,19,'里谢里雅堡 2楼'],[47,78] 34 | ]) 35 | await leo.talkNpc(2, leo.talkNpcSelectorYes) 36 | await leo.delay(1500); 37 | await leo.logBack() 38 | } 39 | 40 | } 41 | 42 | cga.gui.LoadSettings({ 43 | "battle": { 44 | "autobattle": true, 45 | "bossprot": false, 46 | "delayfrom": 4000, 47 | "delayto": 4500, 48 | "highspeed": true, 49 | "list": [ 50 | { 51 | "condition": 0, 52 | "condition2": 0, 53 | "condition2rel": 0, 54 | "condition2val": "", 55 | "conditionrel": 0, 56 | "conditionval": "", 57 | "index": 0, 58 | "petaction": -1, 59 | "pettarget": -1, 60 | "pettargetsel": -1, 61 | "playeraction": 3, 62 | "playertarget": -1, 63 | "playertargetsel": -1 64 | } 65 | ], 66 | "lockcd": false, 67 | "lv1prot": false, 68 | "pet2action": false, 69 | "playerforceaction": false, 70 | "r1nodelay": true, 71 | "showhpmp": false 72 | }, 73 | "player": { 74 | "noswitchanim": true, 75 | } 76 | }, ()=>{ 77 | main().then(()=>leo.log('done!')) 78 | }); 79 | 80 | }); -------------------------------------------------------------------------------- /leo/功能--点BOSS战斗.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //人物面朝BOSS 3 | var direction = cga.GetPlayerInfo().direction; 4 | leo.loop(()=>{ 5 | return leo.waitAfterBattle() 6 | .then(()=>leo.talkNpc(direction,leo.talkNpcSelectorYes)) 7 | .then(()=>leo.delay(500)); 8 | }); 9 | }); -------------------------------------------------------------------------------- /leo/功能--称号成就提交.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | await leo.log('红叶の称号成就提交脚本,启动~'); 3 | 4 | var pos = [31, 72]; 5 | var target = '空山映雨落花红℡'; 6 | 7 | const enterTeam = (teamLeader) => { 8 | return leo.todo() 9 | .then(() => cga.DoRequest(cga.REQUEST_TYPE_JOINTEAM)) 10 | .then(() => leo.waitNPCDialog(dialog => { 11 | if (dialog.type === 2) { 12 | cga.ClickNPCDialog(-1, dialog.message.split('\n').findIndex(e => e === teamLeader) - 2); 13 | return leo.delay(1000); 14 | } 15 | })) 16 | } 17 | 18 | try{ 19 | let playerInfo = cga.GetPlayerInfo(); 20 | let titles = playerInfo.titles; 21 | if(titles && titles.length>0){ 22 | for (var i = 0; i < titles.length; i++) { 23 | let title = titles[i]; 24 | if(title != ''){ 25 | if(cga.GetMapName() != '里谢里雅堡') { 26 | await leo.goto(n => n.castle.x) 27 | } 28 | await leo.autoWalk(pos) 29 | if(cga.ChangeTitleName(i)){ 30 | console.log(leo.logTime()+'设置称号【'+title + '】成功') 31 | await enterTeam(target) 32 | }else{ 33 | console.log(leo.logTime()+'称号设置失败:' + title) 34 | } 35 | await leo.waitUntil(()=>!leo.isInTeam()) 36 | await leo.delay(500) 37 | } 38 | } 39 | } 40 | await leo.log('完成') 41 | }catch(e){ 42 | console.log(leo.logTime() + e); 43 | } 44 | }); -------------------------------------------------------------------------------- /leo/功能--穿墙.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | console.log('红叶の穿墙脚本,请注意人物的方向,启动~'); 4 | 5 | //方向0-东 2-南 4-西 6-北 6 | var direction = cga.GetPlayerInfo().direction; 7 | var times = 1; //移动次数 8 | 9 | leo.todo().then(()=>leo.forceMove(direction,times)) 10 | .then(()=>console.log("完成")); 11 | 12 | }); -------------------------------------------------------------------------------- /leo/功能--自动寻路.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | var position = '10,20'; //要去的坐标,例如 10,20 或者 10.20 4 | var des = false; //是否要切图,true-切图,false-不切图 5 | 6 | var pos = position.split(/[,. ]/,2); 7 | if(pos.length<2){ 8 | leo.log('坐标有误,请确认'); 9 | return; 10 | } 11 | var desc = des?'切图':'不切图'; 12 | 13 | leo.log('红叶の自动寻路脚本,目的坐标为:('+pos[0]+','+pos[1]+'),'+desc) 14 | .then(()=>leo.autoWalk([pos[0],pos[1],des?'*':undefined])) 15 | .then(()=>leo.log('已到达位置')); 16 | 17 | }); -------------------------------------------------------------------------------- /leo/功能--获取迷宫出入口标记.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | // cga.FixMapWarpStuck(1) 3 | const entries = await leo.getMazeEntries(false); 4 | //console.log(entries) 5 | const icons = entries.map(e=>{ 6 | return {icon:e.icon,x:e.x,y:e.y} 7 | }); 8 | console.log(cga.GetMapName()); 9 | console.log(icons); 10 | 11 | 12 | }); -------------------------------------------------------------------------------- /leo/功能--走随机迷宫.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | const up = true; //true-上楼,false-下楼 4 | 5 | leo.log('红叶の自动走随机迷宫脚本,启动~'); 6 | 7 | //检查是否是随机迷宫,如果地图名称里没有数字,则不是 8 | var checkMaze = ()=>{ 9 | var mapName = cga.GetMapName(); 10 | var number = mapName.match(/\d+/); 11 | if(number&&number.length>0){ 12 | return true; 13 | }else{ 14 | return false; 15 | } 16 | } 17 | 18 | leo.todo().then(()=>{ 19 | if(checkMaze()){ 20 | return leo.walkRandomMazeUntil(()=>{ 21 | if(!checkMaze()){ 22 | return leo.log('已经走出迷宫'); 23 | } 24 | },up); 25 | }else{ 26 | return leo.log('当前不是迷宫地图,或者已经走出迷宫'); 27 | } 28 | }) 29 | .then(()=>console.log("finish")); 30 | 31 | }); -------------------------------------------------------------------------------- /leo/功能--迷宫寻找NPC(4转黑龙).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | var npcName = '暗黑龙'; //要寻找的NPC名字,请确保名字无误 4 | 5 | //是-找到NPC后自动对话选是;否-找到NPC后自动对话选否;留空则不对话 6 | var autoTalk = ''; 7 | 8 | //对话完是否要走到下一层迷宫 9 | var autoNextLevel = false; 10 | 11 | //true - 往上层;false - 往下层 12 | var up = true; 13 | 14 | if(npcName==''){ 15 | leo.log('NPC的名字不能为空,请确认'); 16 | return; 17 | } 18 | 19 | leo.log('红叶の迷宫寻找NPC(4转黑龙)脚本,启动~'); 20 | var content = '要寻找的NPC是【'+npcName+'】'; 21 | if(autoTalk=='是'||autoTalk=='否'){ 22 | content += ',找到后自动对话选【' + autoTalk + '】'; 23 | } 24 | leo.log(content); 25 | 26 | var targetFinder = (units) => { 27 | return units.find(u => u.unit_name == npcName && u.type == 1 28 | && (u.flags & cga.emogua.UnitFlags.NpcEntry) && u.model_id > 0); 29 | } 30 | 31 | var todo = (target) => { 32 | const positions = leo.getMovablePositionsAround({x: target.xpos, y: target.ypos}); 33 | return leo.autoWalk([positions[0].x, positions[0].y]) 34 | .then(() => { 35 | if(autoTalk=='是'){ 36 | return leo.talkNpc(target.xpos, target.ypos, leo.talkNpcSelectorYes); 37 | }else if(autoTalk=='否'){ 38 | return leo.talkNpc(target.xpos, target.ypos, leo.talkNpcSelectorNo); 39 | }else{ 40 | return leo.next(); 41 | } 42 | }) 43 | .then(() => { 44 | if(autoNextLevel && (autoTalk == '是' || autoTalk == '否')){ 45 | return leo.walkRandomMaze(up); 46 | }else{ 47 | return leo.next(); 48 | } 49 | }) 50 | .then(() => console.log('已找到NPC,脚本结束')); 51 | } 52 | 53 | leo.lookForNpc(targetFinder, todo ,up) 54 | .catch(()=>console.log('未找到NPC,脚本结束')); 55 | 56 | }); -------------------------------------------------------------------------------- /leo/功能--迷宫寻找NPC(随机迷宫).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | var npcName = '旋律影子'; //要寻找的NPC名字,请确保名字无误 4 | 5 | //是-找到NPC后自动对话选是;否-找到NPC后自动对话选否;留空则不对话 6 | var autoTalk = '是'; 7 | 8 | //true - 往上层;false - 往下层 9 | var up = true; 10 | 11 | if(npcName==''){ 12 | leo.log('NPC的名字不能为空,请确认'); 13 | return; 14 | } 15 | 16 | leo.log('红叶の迷宫寻找NPC(随机迷宫)脚本,启动~'); 17 | var content = '要寻找的NPC是【'+npcName+'】'; 18 | if(autoTalk=='是'||autoTalk=='否'){ 19 | content += ',找到后自动对话选【' + autoTalk + '】'; 20 | } 21 | leo.log(content); 22 | 23 | var targetFinder = (units) => { 24 | return units.find(u => u.unit_name == npcName && u.type == 1 25 | && (u.flags & cga.emogua.UnitFlags.NpcEntry) && u.model_id > 0); 26 | } 27 | 28 | var todo = (target) => { 29 | const positions = leo.getMovablePositionsAround({x: target.xpos, y: target.ypos}); 30 | return leo.autoWalk([positions[0].x, positions[0].y]) 31 | .then(() => { 32 | if(autoTalk=='是'){ 33 | return leo.talkNpc(target.xpos, target.ypos, leo.talkNpcSelectorYes); 34 | }else if(autoTalk=='否'){ 35 | return leo.talkNpc(target.xpos, target.ypos, leo.talkNpcSelectorNo); 36 | }else{ 37 | return leo.next(); 38 | } 39 | }) 40 | .then(() => console.log('已找到NPC,脚本结束')); 41 | } 42 | 43 | 44 | leo.lookForNpc(targetFinder, todo, up) 45 | .catch(()=>console.log('未找到NPC,脚本结束')); 46 | 47 | }); -------------------------------------------------------------------------------- /leo/功能--鉴定.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | var autoSupply = true; //true-自动城堡补蓝,false-原地鉴定,没蓝不去补给 3 | var minMp = 200; 4 | await leo.log('红叶の自动鉴定背包脚本,启动~'); 5 | 6 | await leo.loop(async ()=>{ 7 | if(cga.GetPlayerInfo().mp < minMp){ 8 | if(autoSupply){ 9 | var mapName = cga.GetMapName(); 10 | await leo.logBack() 11 | await leo.supplyCastle() 12 | if(mapName=='艾尔莎岛'){ 13 | await leo.logBack() 14 | await leo.autoWalk([138,109]) 15 | }else if(mapName=='银行'){ 16 | await leo.goto(n => n.falan.bank) 17 | }else{ 18 | await leo.autoWalk([32,91]) 19 | } 20 | } 21 | } 22 | if(cga.getInventoryItems().find(i=>!i.assessed)){ 23 | await leo.assessAll() 24 | }else{ 25 | return leo.reject(); 26 | } 27 | await leo.delay(2000) 28 | }) 29 | await leo.log('红叶の自动鉴定背包脚本,已完成') 30 | 31 | }); -------------------------------------------------------------------------------- /leo/功能--银行全取.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | var waitPos = [11, 8]; 3 | await leo.log('红叶の银行全取脚本,启动~'); 4 | if(leo.getMapInfo().name != '银行'){ 5 | await leo.loop(async()=>{ 6 | if(leo.getMapInfo().name == '银行') { 7 | return leo.reject(); 8 | } 9 | try{ 10 | await leo.goto(n => n.falan.bank) 11 | }catch(e){ 12 | console.log(leo.logTime()+'出错,e:' + e); 13 | } 14 | await leo.delay(1000) 15 | }) 16 | } 17 | if(leo.getMapInfo().name == '银行'){ 18 | await leo.autoWalk(waitPos) 19 | } 20 | await leo.turnDir(0) 21 | await leo.getFormBankAll() 22 | await leo.log('红叶の银行全取脚本,已完成') 23 | }); -------------------------------------------------------------------------------- /leo/功能--银行全存.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | var waitPos = [11, 8]; 3 | await leo.log('红叶の银行全存脚本,启动~'); 4 | if(leo.getMapInfo().name != '银行'){ 5 | await leo.loop(async()=>{ 6 | if(leo.getMapInfo().name == '银行') { 7 | return leo.reject(); 8 | } 9 | try{ 10 | await leo.goto(n => n.falan.bank) 11 | }catch(e){ 12 | console.log(leo.logTime()+'出错,e:' + e); 13 | } 14 | await leo.delay(1000) 15 | }) 16 | } 17 | if(leo.getMapInfo().name == '银行'){ 18 | await leo.autoWalk(waitPos) 19 | } 20 | await leo.turnDir(0) 21 | await leo.saveToBankAll() 22 | await leo.log('红叶の银行全存脚本,已完成') 23 | 24 | }); -------------------------------------------------------------------------------- /leo/功能--银行取钱.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | 3 | var money = 1000000; 4 | 5 | cga.EnableFlags(cga.ENABLE_FLAG_TEAMCHAT, true); //开启队聊 6 | cga.EnableFlags(cga.ENABLE_FLAG_JOINTEAM, true); //开启组队 7 | cga.EnableFlags(cga.ENABLE_FLAG_CARD, true); //开启名片 8 | cga.EnableFlags(cga.ENABLE_FLAG_TRADE, true); //开启交易 9 | 10 | leo.log('红叶の东门银行取钱脚本,启动~'); 11 | 12 | leo.todo() 13 | .then(()=>leo.goto(n => n.falan.bank)) 14 | .then(()=>leo.turnDir(0)) 15 | .then(()=>leo.moveGold(money,cga.MOVE_GOLD_FROMBANK)) 16 | .then(()=>{ 17 | var playerinfo = cga.GetPlayerInfo(); 18 | return leo.log('已完成,当前人物身上魔币为:'+playerinfo.gold); 19 | }) 20 | .then(()=>leo.done()); 21 | 22 | }); -------------------------------------------------------------------------------- /leo/功能--问阿蒙拿称号.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | 3 | await leo.log('红叶の问阿蒙拿称号脚本,启动~'); 4 | 5 | var playerinfo = cga.GetPlayerInfo(); 6 | var title = leo.getPlayerSysTitle(playerinfo.titles); 7 | 8 | await leo.goto(n => n.falan.e1) 9 | await leo.autoWalk([230, 84]) 10 | await leo.turnDir(6) 11 | 12 | playerinfo = cga.GetPlayerInfo(); 13 | var newTitle = leo.getPlayerSysTitle(playerinfo.titles); 14 | if(title==newTitle){ 15 | await leo.log('未获得新称号,当前人物称号为【'+newTitle+'】'); 16 | }else{ 17 | await leo.log('获得新称号【'+newTitle+'】'); 18 | } 19 | 20 | let range = 0; 21 | await leo.autoWalk([234,108]) 22 | await leo.delay(1000) 23 | await leo.turnDir(0) 24 | await leo.talkNpc(0, (dialog) => { 25 | if(dialog && dialog.message){ 26 | range = leo.getPlayerSysTitleRange(dialog.message) || 0; 27 | cga.ClickNPCDialog(1, -1) 28 | return false; 29 | } 30 | return true; 31 | }) 32 | await leo.log('当前人物称号进度为【'+range+'/4】') 33 | 34 | }); -------------------------------------------------------------------------------- /leo/功能--队员进组.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | var teamLeader = '队长名称'; //队长名称 3 | 4 | await leo.log('红叶の队员进组脚本,启动~') 5 | await leo.log('队长名称:【'+teamLeader+'】') 6 | 7 | await leo.loop( async ()=>{ 8 | if(!leo.isInTeam()){ 9 | await leo.enterTeamBlock(teamLeader) 10 | } 11 | await leo.delay(5000) 12 | }) 13 | 14 | await leo.log('脚本结束') 15 | }); -------------------------------------------------------------------------------- /leo/功能--雷达.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | const flag = { 3 | player : true, 4 | pet : true, 5 | item : true, 6 | npcOrEntry : true, 7 | } 8 | const seconds = 10; 9 | leo.UnitFlags.Pet = 512; 10 | 11 | const log = (context) => { 12 | // console.log(leo.logTime()+context); 13 | console.log(context); 14 | } 15 | 16 | await leo.loop(async () => { 17 | console.log(leo.logTime()+'=============================================>'); 18 | //1.周围的玩家 19 | if(flag.player){ 20 | const nearPlayers = cga.GetMapUnits().filter(u=>u.flags&leo.UnitFlags.Player); 21 | log('【附近的玩家】:'+nearPlayers.length); 22 | for (var i = 0; i < nearPlayers.length; i++) { 23 | const player = nearPlayers[i]; 24 | const index = i + 1; 25 | log(index.toString().padStart(3, ' ')+'.[Lv.'+player.level.toString().padStart(3, ' ')+'] ('+player.xpos.toString().padStart(3, ' ')+','+player.ypos.toString().padStart(3, ' ')+') ['+player.unit_name+']'); 26 | //console.log(player) 27 | } 28 | } 29 | //2.周围的宠物 30 | if(flag.pet){ 31 | const nearPets = cga.GetMapUnits().filter(u=>u.flags&leo.UnitFlags.Pet); 32 | log('【附近的宠物】:'+nearPets.length); 33 | for (var i = 0; i < nearPets.length; i++) { 34 | const pet = nearPets[i]; 35 | const index = i + 1; 36 | log(index.toString().padStart(3, ' ')+'.[Lv.'+pet.level.toString().padStart(3, ' ')+'] ('+pet.xpos.toString().padStart(3, ' ')+','+pet.ypos.toString().padStart(3, ' ')+') ['+pet.unit_name+']('+pet.nick_name+')'); 37 | //console.log(pet) 38 | } 39 | } 40 | //3.周围的物品 41 | if(flag.item){ 42 | const nearItems = cga.GetMapUnits().filter(u=>u.flags&leo.UnitFlags.Item); 43 | log('【附近的物品】:'+nearItems.length); 44 | for (var i = 0; i < nearItems.length; i++) { 45 | const item = nearItems[i]; 46 | const index = i + 1; 47 | log(index.toString().padStart(3, ' ')+'.('+item.xpos.toString().padStart(3, ' ')+','+item.ypos.toString().padStart(3, ' ')+') ['+item.item_name+']'); 48 | //console.log(item) 49 | } 50 | } 51 | //4.周围的NPC或者迷宫水晶 52 | if(flag.npcOrEntry){ 53 | const nearNpcOrEntrys = cga.GetMapUnits().filter(u=>u.flags&leo.UnitFlags.NpcEntry && u.model_id > 0 && u.level == 1); 54 | log('【附近的NPC或者迷宫水晶】:'+nearNpcOrEntrys.length); 55 | for (var i = 0; i < nearNpcOrEntrys.length; i++) { 56 | const npcOrEntry = nearNpcOrEntrys[i]; 57 | const index = i + 1; 58 | log(index.toString().padStart(3, ' ')+'.('+npcOrEntry.xpos.toString().padStart(3, ' ')+','+npcOrEntry.ypos.toString().padStart(3, ' ')+') ['+npcOrEntry.unit_name +']'); 59 | //console.log(npcOrEntry) 60 | } 61 | } 62 | await leo.delay(1000*seconds) 63 | }) 64 | 65 | await leo.log('脚本结束') 66 | }); 67 | -------------------------------------------------------------------------------- /leo/功能--驯兽进阶.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | await leo.log('红叶の驯兽进阶脚本,启动~'); 3 | 4 | if(leo.isInTeam()){ 5 | await leo.leaveTeam() 6 | } 7 | if(cga.GetPlayerInfo().gold<20000){ 8 | await leo.getMoneyFromBank(20000) 9 | } 10 | await leo.goto(n => n.falan.w1) 11 | await leo.autoWalkList([[73, 60,'职业公会'] , [13 , 10]]) 12 | await leo.talkNpc(6, (dialog) => { 13 | if(dialog && dialog.message && dialog.message.indexOf('我想提升阶级') >= 0){ 14 | cga.ClickNPCDialog(0, 2); 15 | return true; 16 | } 17 | if(dialog && dialog.message && dialog.message.indexOf('个金币') >= 0){ 18 | cga.ClickNPCDialog(0, 0); 19 | return false; 20 | } 21 | return false; 22 | }) 23 | console.log(leo.logTime()+'已完成'); 24 | }); -------------------------------------------------------------------------------- /leo/封印--原地抓满.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.monitor.config.keepAlive = false; //关闭防掉线 4 | leo.monitor.config.logStatus = false; 5 | var petIndexMap = {}; 6 | //宠物目标属性值:血、魔、攻、防、敏 7 | var petOptions = { 8 | name: '黄蜂', 9 | sealCardName: '封印卡(昆虫系)', 10 | sealCardLevel: 1, 11 | autoDropPet: false, 12 | minHp: 93, 13 | minMp: 78, 14 | minAttack: 45, 15 | minDefensive: 34, 16 | minAgility: 40, 17 | petChecker: ()=>{ 18 | var pets = cga.GetPetsInfo(); 19 | //console.log(leo.logTime()+'宠物数量:'+pets.length); 20 | for(var i in pets){ 21 | var pet = pets[i]; 22 | if(petIndexMap[pet.index] && petIndexMap[pet.index] == 1){ 23 | //原有的宠,不做处理 24 | }else{ 25 | //新抓到的宠 26 | var isDrop = leo.isDropPet(pet,petOptions); 27 | if(pet.realname == petOptions.name && pet.level == 1 && isDrop.flag){ 28 | if(cga.isInNormalState()){ 29 | cga.DropPet(pet.index); 30 | leo.log('可惜!丢下宠物'+leo.getPetCalcInfo(pet)+','+isDrop.info); 31 | } 32 | }else{ 33 | leo.log('恭喜!抓到宠物'+leo.getPetCalcInfo(pet)); 34 | petIndexMap[pet.index] = 1; 35 | } 36 | } 37 | } 38 | } 39 | }; 40 | 41 | var protect = { 42 | minHp: 500, 43 | minMp: 200, 44 | minPetHp: 500, 45 | minPetMp: 200, 46 | maxPetNumber: 4, //超过4只宠物 47 | checker: petOptions.petChecker 48 | }; 49 | 50 | var isLogBackFirst = false; //启动登出 51 | var isPrepare = false; //招魂、治疗、补血、卖石 52 | 53 | var prepareOptions = { 54 | repairFlag: -1, 55 | crystalName: '火风的水晶(5:5)', 56 | doctorName: '医道之殇' 57 | }; 58 | 59 | leo.log('红叶の原地抓【'+petOptions.name+'】脚本,启动~'); 60 | 61 | var setting = '预设五围是:【' + petOptions.minHp + '/' + petOptions.minMp + '/' + petOptions.minAttack + '/' + petOptions.minDefensive + '/' + petOptions.minAgility + '】,自动扔宠:【' + (petOptions.autoDropPet?'已启用':'未启用') + '】'; 62 | leo.log(setting); 63 | 64 | cga.EnableFlags(cga.ENABLE_FLAG_TEAMCHAT, false); //关闭队聊 65 | cga.EnableFlags(cga.ENABLE_FLAG_JOINTEAM, false); //关闭组队 66 | cga.EnableFlags(cga.ENABLE_FLAG_CARD, false); //关闭名片 67 | cga.EnableFlags(cga.ENABLE_FLAG_TRADE, false); //关闭交易 68 | 69 | var playerinfo = cga.GetPlayerInfo(); 70 | var playerName = playerinfo.name; 71 | var isTeamLeader = true; 72 | var bankPetFull = false; 73 | 74 | var pets = cga.GetPetsInfo(); 75 | if(pets.length>0){ 76 | console.log('身上已有宠物:'); 77 | } 78 | for(var i in pets){ 79 | var pet = pets[i]; 80 | petIndexMap[pet.index] = 1; 81 | var index = parseInt(pet.index) + 1; 82 | console.log(index + ' ' + pet.realname + ' LV' + pet.level); 83 | } 84 | 85 | leo.todo().then(()=>{ 86 | return leo.loop( 87 | ()=>leo.waitAfterBattle().then(()=>{ 88 | //判断人物身上的宠物数量是否等于5 89 | var pets = cga.GetPetsInfo(); 90 | if(pets.length==5){ 91 | return leo.reject('已经满5个宠物,背包满啦!是时候存银行啦!'); 92 | } 93 | }).then(()=>{ 94 | leo.log('开始抓宠,请注意是否开启了自动扔宠物。'); 95 | return leo.encounterTeamLeader(protect) 96 | .then(()=>{ 97 | return leo.reject("触发回补,请及时补给"); 98 | }); 99 | }) 100 | .catch((err)=>{ 101 | leo.log(err); 102 | return leo.delay(10000); 103 | }) 104 | ); 105 | }); 106 | }); -------------------------------------------------------------------------------- /leo/技能--兽王学完美调教.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.log('红叶の兽王学完美调教脚本,启动~'); 4 | var skillName = '完美调教术'; 5 | if(cga.findPlayerSkill(skillName)){ 6 | console.error('提示:已经学有【'+skillName+'】技能!'); 7 | return; 8 | } 9 | var playerInfo = cga.GetPlayerInfo(); 10 | if(playerInfo.job != '兽王'){ 11 | console.error('提示:职业必须是5转【兽王】!'); 12 | return; 13 | } 14 | if(playerInfo.gold<=100000){ 15 | console.error('提示:身上的魔币不足,请至少准备10W!'); 16 | return; 17 | } 18 | 19 | if(cga.GetMapName()!='圣骑士营地'){ 20 | await leo.goto(n => n.camp.x) 21 | } 22 | await leo.autoWalk([116,69,'总部1楼']) 23 | await leo.autoWalk([41,72]) 24 | await leo.learnPlayerSkill(41,71) 25 | if(cga.findPlayerSkill(skillName)){ 26 | await leo.log('提示:已经完成【'+skillName+'】技能学习!'); 27 | } else{ 28 | await leo.log('已到达位置,请检查技能是否已经学习') 29 | } 30 | 31 | }); -------------------------------------------------------------------------------- /leo/技能--学抗性技能.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | var isLogBackFirst = true; 4 | var prepareOptions = { 5 | rechargeFlag: 1, 6 | repairFlag: -1, 7 | doctorName: '医道之殇' 8 | }; 9 | 10 | leo.log('红叶の学人物抗性技能脚本,启动~'); 11 | 12 | leo.todo().then(()=>{ 13 | if(isLogBackFirst){ 14 | return leo.logBack(); 15 | }else{ 16 | return leo.next(); 17 | } 18 | }) 19 | .then(()=>{ 20 | return leo.prepare(prepareOptions) //招魂、治疗、补血、卖石 21 | .then(()=>leo.goto(n => n.falan.w1)) 22 | .then(()=>leo.autoWalkList([[22, 88, '芙蕾雅'],[200, 165]])); 23 | }) 24 | .then(()=>{ 25 | return leo.talkNpc(201, 165,leo.talkNpcSelectorYes,'莎莲娜海底洞窟 地下1楼'); 26 | }) 27 | .then(()=>{ 28 | return leo.autoWalkList([ 29 | [20, 8 ,'莎莲娜海底洞窟 地下2楼'],[32, 21] 30 | ]); 31 | }) 32 | .then(()=>leo.turnTo(31, 22)) 33 | .then(()=>leo.say('咒术')) 34 | .then(()=>{ 35 | return leo.waitNPCDialog(dialog => { 36 | cga.ClickNPCDialog(1, -1); 37 | return leo.delay(2000); 38 | }); 39 | }) 40 | .then(()=>{ 41 | return leo.autoWalkList([ 42 | [38, 37 ,'咒术师的秘密住处'],[10, 0 ,15008],[1, 10 ,15010],[15, 10] 43 | ]); 44 | }) 45 | .then(()=>leo.log('已经到达学习技能位置!脚本结束')); 46 | 47 | }); -------------------------------------------------------------------------------- /leo/技能--学羊头狗肉.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.log('红叶の学羊头狗肉技能脚本,启动~'); 4 | if(cga.getItemCount('烧鸡')==0){ 5 | leo.log('身上没有【烧鸡】,请先提前准备,脚本结束'); 6 | return; 7 | } 8 | 9 | var task = async () => { 10 | await leo.checkHealth() 11 | await leo.autoWalk([165,153]) 12 | await leo.talkNpc(2,leo.talkNpcSelectorYes,'利夏岛') 13 | await leo.autoWalk([90,99,'国民会馆']) 14 | await leo.autoWalkList([ 15 | [108,39,'雪拉威森塔1层'],[73,56], 16 | [72,56,'雪拉威森塔40层'], 17 | [117,96,'雪拉威森塔41层'], 18 | [108,101,'雪拉威森塔42层'] 19 | ]) 20 | await leo.talkNpcAt(79,92) 21 | await leo.autoWalkList([ 22 | [92,23,'雪拉威森塔43层'] 23 | ]) 24 | await leo.talkNpcAt(89,42) 25 | await leo.talkNpcAt(117,49) 26 | await leo.talkNpcAt(117,49) 27 | await leo.autoWalk([132,58]) 28 | 29 | console.log('到达目标地点!请自行手动学习技能~~') 30 | } 31 | 32 | task(); 33 | 34 | 35 | }); -------------------------------------------------------------------------------- /leo/技能--学虚死为上.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.log('红叶の学虚死为上技能脚本,启动~'); 4 | if(cga.getItemCount('王冠')==0){ 5 | leo.log('身上没有【王冠】,脚本结束'); 6 | return; 7 | } 8 | if(cga.getItemCount('王冠')>1){ 9 | leo.log('身上的【王冠】只能带1个,多余的请先存银行,脚本结束'); 10 | return; 11 | } 12 | 13 | var gotoNpc = ()=>{ 14 | return leo.todo() 15 | .then(()=>{ 16 | return leo.loop(()=>{ 17 | var mapInfo = cga.getMapInfo(); 18 | if(mapInfo.name == '里谢里雅堡' || mapInfo.name == '法兰城'){ 19 | return leo.logBack(); 20 | } 21 | if(mapInfo.name == '艾尔莎岛'){ 22 | return leo.autoWalk([165,153]) 23 | .then(()=>leo.talkNpc(2,leo.talkNpcSelectorYes,'利夏岛')); 24 | } 25 | if(mapInfo.name == '利夏岛'){ 26 | return leo.autoWalk([90,99,'国民会馆']); 27 | } 28 | if(mapInfo.name == '国民会馆'){ 29 | return leo.autoWalk([108,39,'雪拉威森塔1层']); 30 | } 31 | if(mapInfo.name == '雪拉威森塔1层'){ 32 | return leo.autoWalk([34,95]) 33 | .then(()=>leo.talkNpc(0,leo.talkNpcSelectorYes,'辛梅尔')); 34 | } 35 | if(mapInfo.name == '辛梅尔'){ 36 | return leo.autoWalk([181,81,'公寓']) 37 | .then(()=>leo.autoWalk([89,58])) 38 | .then(()=>leo.supply(89,57)) 39 | .then(()=>leo.autoWalk([100,70,'辛梅尔'])) 40 | .then(()=>leo.autoWalk([207,91,'光之路'])); 41 | } 42 | if(mapInfo.name == '光之路'){ 43 | return leo.autoWalk([214,194]) 44 | .then(()=>leo.talkNpc(0, leo.talkNpcSelectorYes)) 45 | .then(()=>leo.autoWalk([227,202,'*'])) 46 | .then(()=>leo.autoWalk([224,78])) 47 | .then(()=>leo.reject());//退出循环,进入下一步 48 | } 49 | return leo.delay(2000); 50 | }); 51 | }) 52 | } 53 | 54 | var task = async () => { 55 | await gotoNpc() 56 | console.log('到达目标地点!请自行手动学习技能~~') 57 | } 58 | 59 | task(); 60 | }); -------------------------------------------------------------------------------- /leo/技能--宠物学蛋2.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | const autoLearnEgg2 = true; 3 | const index = 1; //出战宠物待学蛋2的技能栏序号,从1开始 4 | //!!!注意,会覆盖掉宠物该位置的原有技能,一定要注意,无法还原 5 | 6 | const messageMonitor = () => { 7 | console.log(leo.logTime()+'已开启消息监听') 8 | return leo.waitMessageUntil((chat) => { 9 | if (chat.msg) { 10 | console.log(leo.logTime()+'检测到聊天内容:'+chat.msg); 11 | } 12 | }) 13 | } 14 | 15 | const petSkillIndex = index - 1; 16 | const skillIndex = 8; 17 | const petIndex = cga.GetPlayerInfo().petid; 18 | 19 | if(autoLearnEgg2 && petIndex != -1){ 20 | const petInfo = cga.GetPetInfo(petIndex); 21 | //console.log(petInfo); 22 | if(leo.has(450769) && petInfo.race == 0 && petInfo.level >= 40){ 23 | //450769 - 蛋2券 24 | //race 种族,0=人形系,1=龙系,2=不死系,3=飞行系,4=昆虫系,5=植物系,6=野兽系,7=特殊系,8=金属系,9=邪魔系 25 | await leo.log('为宠物【'+petInfo.realname+'】学习技能【蛋2】') 26 | if(cga.GetMapName()!='魔力宝贝服务中心'){ 27 | await leo.goto(n=>n.falan.e2) 28 | await leo.autoWalk([241,78]) 29 | await leo.loop(async ()=>{ 30 | if(cga.GetMapName()=='魔力宝贝服务中心'){ 31 | return leo.reject(); 32 | } 33 | await leo.turnDir(6) 34 | await leo.delay(2000) 35 | }) 36 | } 37 | 38 | messageMonitor(); 39 | 40 | let egg2Count = cga.getItemCount(450769); 41 | await leo.loop(async ()=>{ 42 | await leo.autoWalk([19, 8]) 43 | await leo.learnPetSkill([20, 8], skillIndex, petIndex, petSkillIndex) 44 | await leo.delay(2000) 45 | if(!leo.has(450769) || cga.getItemCount(450769) < egg2Count) { 46 | return leo.reject(); 47 | } 48 | }) 49 | await leo.delay(5000) 50 | console.log(leo.logTime()+'宠物【'+petInfo.realname+'】已学到蛋2技能') 51 | }else{ 52 | console.log(leo.logTime()+'宠物等级不到40,或者不是人形系,或者没有蛋2技能券') 53 | } 54 | } 55 | console.log(leo.logTime()+'脚本结束') 56 | }); -------------------------------------------------------------------------------- /leo/技能--烧变装.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.log('红叶の烧变装脚本,启动~'); 4 | 5 | var target = 8; 6 | var name = '医道之殇'; 7 | 8 | var pos = [30, 87]; 9 | var minMp = 100; 10 | var timeout = 500; 11 | var playerinfo = cga.GetPlayerInfo(); 12 | 13 | var skillName = '变装'; 14 | var level = 0; 15 | if(!cga.findPlayerSkill(skillName)){ 16 | console.error('提示:没有'+skillName+'技能!'); 17 | return; 18 | } 19 | 20 | var working = ()=>{ 21 | return leo.todo() 22 | .then(()=>{ 23 | var skill = cga.GetSkillsInfo().find(s => s.name == skillName); 24 | if(skill && cga.GetPlayerInfo().mp >= minMp){ 25 | if(level == 0){ 26 | cga.StartWork(skill.index, skill.lv-1); 27 | }else{ 28 | cga.StartWork(skill.index, level-1); 29 | } 30 | cga.AsyncWaitPlayerMenu((error, players) => setTimeout(() => { 31 | if (players && players.length > 0) { 32 | const index = players.findIndex(p => p.name == playerinfo.name); 33 | if (typeof index == 'number') { 34 | cga.PlayerMenuSelect(index); 35 | cga.AsyncWaitUnitMenu((error, units) => setTimeout(() => { 36 | if (error) { 37 | leo.next(); 38 | } else { 39 | cga.UnitMenuSelect(0); 40 | } 41 | }, 0)); 42 | } else leo.next(); 43 | } else leo.next(); 44 | }, 0), 2000); 45 | }else{ 46 | return leo.leaveTeam() 47 | .then(()=>leo.autoWalk([34, 89])) 48 | .then(()=>leo.supply(35, 88)) 49 | .then(()=>leo.autoWalk(pos)) 50 | .then(()=>leo.enterTeam(name)); 51 | } 52 | }); 53 | } 54 | 55 | leo.todo().then(()=>{ 56 | var currentMap = cga.GetMapName(); 57 | if (currentMap != '里谢里雅堡') { 58 | return leo.goto(n => n.castle.x); 59 | } 60 | }) 61 | .then(()=>leo.autoWalk(pos)) 62 | .then(()=>leo.enterTeam(name)) 63 | .then(()=>{ 64 | return leo.loop(()=>{ 65 | var skill = cga.findPlayerSkill(skillName); 66 | if(target <= skill.lv){ 67 | leo.log('红叶の烧'+skillName+'脚本,提示:技能【'+skillName+'】等级已达到【'+skill.lv+'】,达到或者超过了预设的目标等级【'+target+'】,脚本结束'); 68 | return leo.reject(); 69 | } 70 | return working() 71 | .then(()=>leo.delay(timeout)); 72 | }) 73 | }) 74 | 75 | 76 | var i = 0; 77 | var autoTalk = ()=>{ 78 | leo.say('红叶の烧变装脚本,说话防掉线',i); 79 | ++i > 4 ? (i = 0) : 0; 80 | setTimeout(autoTalk, 60000); 81 | } 82 | autoTalk(); 83 | 84 | 85 | }); -------------------------------------------------------------------------------- /leo/技能--烧变身.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.log('红叶の烧变身脚本,启动~'); 4 | 5 | var target = 8; 6 | 7 | var pos = [30, 88]; 8 | var minMp = 100; 9 | var timeout = 500; 10 | var playerinfo = cga.GetPlayerInfo(); 11 | 12 | var skillName = '变身'; 13 | var level = 0; 14 | if(!cga.findPlayerSkill(skillName)){ 15 | console.error('提示:没有'+skillName+'技能!'); 16 | return; 17 | } 18 | 19 | var working = ()=>{ 20 | return leo.todo() 21 | .then(()=>{ 22 | var skill = cga.GetSkillsInfo().find(s => s.name == skillName); 23 | if(skill && cga.GetPlayerInfo().mp >= minMp){ 24 | if(level == 0){ 25 | cga.StartWork(skill.index, skill.lv-1); 26 | }else{ 27 | cga.StartWork(skill.index, level-1); 28 | } 29 | cga.AsyncWaitPlayerMenu((error, players) => setTimeout(() => { 30 | if (players && players.length > 0) { 31 | const index = players.findIndex(p => p.name == playerinfo.name); 32 | if (typeof index == 'number') { 33 | cga.PlayerMenuSelect(index); 34 | cga.AsyncWaitUnitMenu((error, units) => setTimeout(() => { 35 | if (error) { 36 | leo.next(); 37 | } else { 38 | cga.UnitMenuSelect(0); 39 | } 40 | }, 0)); 41 | } else leo.next(); 42 | } else leo.next(); 43 | }, 0), 2000); 44 | }else{ 45 | return leo.autoWalk([34, 89]) 46 | .then(()=>leo.supply(35, 88)) 47 | .then(()=>leo.autoWalk(pos)); 48 | } 49 | }); 50 | } 51 | 52 | leo.todo().then(()=>{ 53 | var currentMap = cga.GetMapName(); 54 | if (currentMap != '里谢里雅堡') { 55 | return leo.goto(n => n.castle.x) 56 | .then(()=>leo.autoWalk(pos)); 57 | } 58 | }) 59 | .then(()=>{ 60 | return leo.loop(()=>{ 61 | var skill = cga.findPlayerSkill(skillName); 62 | if(target <= skill.lv){ 63 | leo.log('红叶の烧'+skillName+'脚本,提示:技能【'+skillName+'】等级已达到【'+skill.lv+'】,达到或者超过了预设的目标等级【'+target+'】,脚本结束'); 64 | return leo.reject(); 65 | } 66 | return working() 67 | .then(()=>leo.delay(timeout)); 68 | }) 69 | }) 70 | 71 | 72 | var i = 0; 73 | var autoTalk = ()=>{ 74 | leo.say('红叶の烧变身脚本,说话防掉线',i); 75 | ++i > 4 ? (i = 0) : 0; 76 | setTimeout(autoTalk, 60000); 77 | } 78 | autoTalk(); 79 | 80 | 81 | }); -------------------------------------------------------------------------------- /leo/技能--烧鉴定(家具).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.log('红叶の烧鉴定(家具)脚本,启动~'); 4 | 5 | var target = 10; 6 | var minMp = 100; 7 | 8 | var playerinfo = cga.GetPlayerInfo(); 9 | 10 | var skillName = '鉴定'; 11 | var level = 0; 12 | if(!cga.findPlayerSkill(skillName)){ 13 | console.error('提示:没有'+skillName+'技能!'); 14 | return; 15 | } 16 | 17 | var task = async ()=>{ 18 | var skill = cga.findPlayerSkill(skillName); 19 | if(target <= skill.lv){ 20 | leo.log('红叶の烧'+skillName+'脚本,提示:技能【'+skillName+'】等级已达到【'+skill.lv+'】,达到或者超过了预设的目标等级【'+target+'】,脚本结束'); 21 | return leo.reject(); 22 | } 23 | if(cga.GetPlayerInfo().mp <= minMp){ 24 | //去补魔 25 | await leo.goto(n => n.castle.x) 26 | await leo.autoWalk([34, 89]) 27 | await leo.supply(35, 88) 28 | } 29 | if(leo.getMapInfo().name != '哈丝塔的家'){ 30 | await leo.goto(n => n.asha.n) 31 | await leo.autoWalk([167,102,'哈丝塔的家']) 32 | } 33 | await leo.autoWalk([11,10]) 34 | await leo.talkNpc(0,leo.talkYes) 35 | await leo.assessAll() 36 | await leo.dropItemEx(14668) 37 | await leo.dropItemEx(14669) 38 | await leo.dropItemEx(14670) 39 | } 40 | 41 | leo.loop(async ()=>{ 42 | await task() 43 | await leo.delay(100) 44 | }) 45 | .then(()=>leo.log('脚本结束')) 46 | 47 | }); -------------------------------------------------------------------------------- /leo/技能--烧鉴定(鱼).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.log('红叶の烧鉴定(鱼)脚本,启动~'); 4 | 5 | var target = 10; 6 | var minMp = 100; 7 | 8 | var playerinfo = cga.GetPlayerInfo(); 9 | 10 | var skillName = '鉴定'; 11 | var level = 0; 12 | if(!cga.findPlayerSkill(skillName)){ 13 | console.error('提示:没有'+skillName+'技能!'); 14 | return; 15 | } 16 | 17 | var task = async ()=>{ 18 | var skill = cga.findPlayerSkill(skillName); 19 | if(target <= skill.lv){ 20 | leo.log('红叶の烧'+skillName+'脚本,提示:技能【'+skillName+'】等级已达到【'+skill.lv+'】,达到或者超过了预设的目标等级【'+target+'】,脚本结束'); 21 | return leo.reject(); 22 | } 23 | if(cga.GetPlayerInfo().mp <= minMp){ 24 | //去医院补魔 25 | if(leo.getMapInfo().name == '拿潘食品店'){ 26 | await leo.autoWalkList([ 27 | [3,13,'法兰城'],[221,83,'医院'],[8,31] 28 | ]) 29 | }else{ 30 | await leo.goto(n => n.falan.ehospital) 31 | await leo.autoWalk([8,31]) 32 | } 33 | await leo.supply(8, 30) 34 | await leo.autoWalkList([ 35 | [12,42,'法兰城'],[217,53,'拿潘食品店'],[10,14] 36 | ]) 37 | } 38 | if(leo.getMapInfo().name != '拿潘食品店'){ 39 | await leo.goto(n => n.falan.e2) 40 | await leo.autoWalk([217,53,'拿潘食品店']) 41 | } 42 | await leo.autoWalk([10,14]) 43 | await leo.talkNpc(0,leo.talkYes) 44 | await leo.assessAll() 45 | await leo.dropItemEx(18184) 46 | } 47 | 48 | 49 | leo.loop(async ()=>{ 50 | await task() 51 | await leo.delay(100) 52 | }) 53 | .then(()=>leo.log('脚本结束')) 54 | 55 | 56 | }); -------------------------------------------------------------------------------- /leo/技能--烧骑乘.js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH_UTF8+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.log('红叶の烧骑乘脚本,启动~'); 4 | 5 | var pos = [40, 85]; 6 | var minMp = 100; 7 | 8 | var autoPetRiding = ()=>{ 9 | var petriding = cga.GetPlayerInfo().petriding; 10 | if(!petriding){ 11 | var skill = cga.GetSkillsInfo().find(s => s.name == '骑乘'); 12 | if(skill && cga.GetPlayerInfo().mp >= minMp){ 13 | cga.StartWork(skill.index, skill.lv-1); 14 | } 15 | } 16 | setTimeout(autoPetRiding, 1000); 17 | } 18 | 19 | var autoMove = ()=>{ 20 | return leo.loop(()=>{ 21 | var direction = Math.floor((Math.random()*8)); //返回0-7的整数 22 | if(cga.GetPlayerInfo().mp >= minMp){ 23 | return move(direction).then(()=>move((direction + 4) % 8)); 24 | }else{ 25 | return leo.reject(); 26 | } 27 | }); 28 | } 29 | var move = (direction)=>{ 30 | cga.ForceMove(direction, false); 31 | return leo.delay(leo.moveTimeout||300); 32 | } 33 | 34 | if(!cga.findPlayerSkill('骑乘')){ 35 | console.error('提示:没有骑乘技能!'); 36 | }else{ 37 | autoPetRiding(); 38 | cga.EnableFlags(cga.ENABLE_FLAG_TEAMCHAT, false); //关闭队聊 39 | cga.EnableFlags(cga.ENABLE_FLAG_JOINTEAM, false); //关闭组队 40 | var currentMap = cga.GetMapName(); 41 | 42 | leo.todo().then(()=>{ 43 | if (currentMap != '里谢里雅堡') { 44 | return leo.goto(n => n.castle.x); 45 | } 46 | }) 47 | .then(()=>leo.autoWalk([pos[0]+1,pos[1]])) 48 | .then(()=>leo.autoWalk(pos)) 49 | .then(()=>{ 50 | return leo.loop( 51 | ()=>leo.todo() 52 | .then(()=>{ 53 | if(cga.GetPlayerInfo().mp < minMp){ 54 | return leo.autoWalk([34, 89]) 55 | .then(()=>leo.supply(35, 88)) 56 | .then(()=>leo.autoWalk(pos)); 57 | } 58 | }) 59 | .then(()=>autoMove()) 60 | .then(()=>leo.delay(1000)) 61 | ); 62 | }); 63 | } 64 | 65 | var i = 0; 66 | var autoTalk = ()=>{ 67 | leo.say('红叶の烧骑乘脚本,说话防掉线',i); 68 | ++i > 4 ? (i = 0) : 0; 69 | setTimeout(autoTalk, 60000); 70 | } 71 | autoTalk(); 72 | 73 | 74 | }); -------------------------------------------------------------------------------- /leo/生产--挖矿(8达马斯矿).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.monitor.config.healSelf = true;//自动治疗自己 4 | leo.log('红叶の挖达马斯矿脚本,启动~'); 5 | 6 | var itemName = '达马斯矿'; 7 | var itemName2 = '达马斯矿条'; 8 | var skillLevel = 8; 9 | var fullCount = 20; 10 | var skill = cga.findPlayerSkill('挖掘'); 11 | if(!skill){ 12 | console.error('提示:没有挖掘技能!'); 13 | return; 14 | } 15 | if(skill.lv { 21 | await leo.waitAfterBattle() 22 | if(cga.getInventoryItems().length>=fullCount || leo.getEmptyBagIndexes().length==0){ 23 | //满包,回去压条 24 | await leo.logBack() 25 | await leo.gotoAKLF() 26 | await leo.autoWalk([157,208,'阿凯鲁法工房']) 27 | await leo.autoWalk([13,18]) 28 | var exchangeCount = parseInt(cga.getItemCount(itemName) / 20); 29 | var list = [{index:0, count:exchangeCount}]; 30 | await leo.exchange(4,list) 31 | await leo.autoWalk([15,24,'阿凯鲁法村']) 32 | await leo.autoWalk([139,136,'银行']) 33 | await leo.autoWalk([20,17]) 34 | await leo.turnDir(0) 35 | await leo.saveToBankAll(itemName2) 36 | await leo.delay(2000) 37 | //await leo.autoWalk([8,16,'阿凯鲁法村']) 38 | } 39 | await leo.logBack() 40 | await leo.gotoAKLF() 41 | await leo.autoWalkList([[192,208,'冒险者旅馆 1楼'],[24,17]]) 42 | await leo.supplyDir(6) 43 | await leo.delay(5000) 44 | await leo.autoWalkList([ 45 | [16,23,'阿凯鲁法村'],[178,227,'米内葛尔岛'], 46 | [283,457,'南恰拉山第1通路'],[8,33] 47 | ]) 48 | await leo.log('到达位置,开始挖【'+itemName+'】') 49 | await leo.loop(()=>{ 50 | if(cga.GetPlayerInfo().mp < 1){ 51 | return leo.log('魔力不足') 52 | .then(()=>leo.logBack()) 53 | .then(()=>leo.reject()); 54 | } 55 | var emptyIndexes = leo.getEmptyBagIndexes(); 56 | if (emptyIndexes.length == 0) { 57 | return leo.log('已经满包') 58 | .then(()=>leo.reject()); 59 | } 60 | cga.StartWork(skill.index, 0); 61 | return leo.waitWorkResult() 62 | .then(()=>leo.pile(true)) 63 | .then(()=>leo.delay(500)); 64 | }); 65 | } 66 | 67 | leo.loop(async ()=>{ 68 | try{ 69 | await main(); 70 | }catch(e){ 71 | console.log(leo.logTime()+'出错,重新开始:', e); 72 | } 73 | }) 74 | }); -------------------------------------------------------------------------------- /leo/生产--挖矿(9谢尔哈特矿).js: -------------------------------------------------------------------------------- 1 | require(process.env.CGA_DIR_PATH+'/leo').then(async (cga) => { 2 | //leo.baseInfoPrint(); 3 | leo.monitor.config.healSelf = true;//自动治疗自己 4 | leo.log('红叶の挖谢尔哈特矿脚本,启动~'); 5 | 6 | var itemName = '谢尔哈特矿'; 7 | var itemName2 = '谢尔哈特矿条'; 8 | var skillLevel = 9; 9 | var fullCount = 3; 10 | var skill = cga.findPlayerSkill('挖掘'); 11 | if(!skill){ 12 | console.error('提示:没有挖掘技能!'); 13 | return; 14 | } 15 | if(skill.lv { 21 | await leo.waitAfterBattle() 22 | if(cga.getInventoryItems().length>=fullCount || leo.getEmptyBagIndexes().length==0){ 23 | //满包,回去压条 24 | await leo.logBack() 25 | await leo.gotoAKLF() 26 | await leo.autoWalk([157,208,'阿凯鲁法工房']) 27 | await leo.autoWalk([11,18]) 28 | var exchangeCount = parseInt(cga.getItemCount(itemName) / 20); 29 | var list = [{index:0, count:exchangeCount}]; 30 | await leo.exchange(4,list) 31 | await leo.autoWalk([15,24,'阿凯鲁法村']) 32 | await leo.autoWalk([139,136,'银行']) 33 | await leo.autoWalk([20,17]) 34 | await leo.turnDir(0) 35 | await leo.saveToBankAll(itemName2) 36 | await leo.delay(2000) 37 | //await leo.autoWalk([8,16,'阿凯鲁法村']) 38 | } 39 | await leo.logBack() 40 | await leo.gotoAKLF() 41 | await leo.autoWalk([166,107]) 42 | await leo.talkNpc(0,leo.talkNpcSelectorYes,'坎那贝拉村') 43 | await leo.autoWalkList([[38,44,'医院'],[20,17]]) 44 | await leo.supplyDir(0) 45 | await leo.delay(5000) 46 | await leo.autoWalkList([ 47 | [15,25,'坎那贝拉村'],[13,48,'米内葛尔岛'],[472,282,'海峡通道'],[44,44] 48 | ]) 49 | await leo.log('到达位置,开始挖【'+itemName+'】') 50 | await leo.loop(()=>{ 51 | if(cga.GetPlayerInfo().mp < 1){ 52 | return leo.log('魔力不足') 53 | .then(()=>leo.logBack()) 54 | .then(()=>leo.reject()); 55 | } 56 | var emptyIndexes = leo.getEmptyBagIndexes(); 57 | if (emptyIndexes.length == 0) { 58 | return leo.log('已经满包') 59 | .then(()=>leo.reject()); 60 | } 61 | cga.StartWork(skill.index, 0); 62 | return leo.waitWorkResult() 63 | .then(()=>leo.pile(true)) 64 | .then(()=>leo.delay(500)); 65 | }); 66 | } 67 | 68 | leo.loop(async ()=>{ 69 | try{ 70 | await main(); 71 | }catch(e){ 72 | console.log(leo.logTime()+'出错,重新开始:', e); 73 | } 74 | }) 75 | }); -------------------------------------------------------------------------------- /leo/贝爷--队友.json: -------------------------------------------------------------------------------- 1 | { 2 | "battle": { 3 | "autobattle": true, 4 | "bossprot": false, 5 | "delayfrom": 4000, 6 | "delayto": 4500, 7 | "highspeed": true, 8 | "list": [ 9 | { 10 | "condition": 0, 11 | "condition2": 12, 12 | "condition2rel": 0, 13 | "condition2val": "饥饿的贝尔", 14 | "conditionrel": 0, 15 | "conditionval": "", 16 | "index": 0, 17 | "petaction": 100, 18 | "petskillname": "攻击", 19 | "pettarget": 0, 20 | "pettargetsel": 4, 21 | "playeraction": 1, 22 | "playertarget": 0, 23 | "playertargetsel": 4 24 | }, 25 | { 26 | "condition": 0, 27 | "condition2": 0, 28 | "condition2rel": 0, 29 | "condition2val": "", 30 | "conditionrel": 0, 31 | "conditionval": "", 32 | "index": 1, 33 | "petaction": 100, 34 | "petskillname": "防御", 35 | "pettarget": 0, 36 | "pettargetsel": 4, 37 | "playeraction": 3, 38 | "playertarget": -1, 39 | "playertargetsel": -1 40 | } 41 | ], 42 | "lockcd": false, 43 | "lv1prot": false, 44 | "pet2action": true, 45 | "playerforceaction": false, 46 | "r1nodelay": true, 47 | "showhpmp": false 48 | }, 49 | "chat": { 50 | "displayname": false, 51 | "displaytime": false, 52 | "mychat": false, 53 | "npcmsg": false, 54 | "playerchat": false, 55 | "sysmsg": false, 56 | "todayonly": true 57 | }, 58 | "itemdroplist": [ 59 | "地的水晶碎片", 60 | "水的水晶碎片", 61 | "火的水晶碎片", 62 | "风的水晶碎片", 63 | "卡片?", 64 | "巨石", 65 | "绿头盔", 66 | "星之砂", 67 | "秘文之皮", 68 | "奇香木", 69 | "坚硬的鳞片", 70 | "龙角", 71 | "魔石" 72 | ], 73 | "itemidmap": { 74 | }, 75 | "itemtweaklist": [ 76 | "地的水晶碎片|999", 77 | "水的水晶碎片|999", 78 | "火的水晶碎片|999", 79 | "风的水晶碎片|999", 80 | "神之金|20", 81 | "龙角|20", 82 | "隐秘的徽记(地)|20", 83 | "隐秘的徽记(水)|20", 84 | "隐秘的徽记(火)|20", 85 | "隐秘的徽记(风)|20", 86 | "阿尔卡迪亚古钱|999", 87 | "魔族的水晶|5", 88 | "钢骑之矿|5", 89 | "德特家的布|5", 90 | "誓言之证|5", 91 | "能量结晶|99", 92 | "巨石|20", 93 | "长老之证|7", 94 | "签名|999" 95 | ], 96 | "player": { 97 | "autosupply": true, 98 | "movespd": 100, 99 | "noswitchanim": false, 100 | "workacc": 100, 101 | "workdelay": 6500 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /leo/逃跑.json: -------------------------------------------------------------------------------- 1 | { 2 | "battle": { 3 | "autobattle": true, 4 | "bossprot": false, 5 | "delayfrom": 4000, 6 | "delayto": 4500, 7 | "highspeed": true, 8 | "list": [ 9 | { 10 | "condition": 0, 11 | "condition2": 0, 12 | "condition2rel": 0, 13 | "condition2val": "", 14 | "conditionrel": 0, 15 | "conditionval": "", 16 | "index": 0, 17 | "petaction": 100, 18 | "petskillname": "防御", 19 | "pettarget": 0, 20 | "pettargetsel": 4, 21 | "playeraction": 3, 22 | "playertarget": -1, 23 | "playertargetsel": -1 24 | } 25 | ], 26 | "lockcd": false, 27 | "lv1prot": false, 28 | "pet2action": true, 29 | "playerforceaction": false, 30 | "r1nodelay": true, 31 | "showhpmp": false 32 | }, 33 | "chat": { 34 | "displayname": false, 35 | "displaytime": false, 36 | "mychat": false, 37 | "npcmsg": false, 38 | "playerchat": false, 39 | "sysmsg": false, 40 | "todayonly": true 41 | }, 42 | "itemdroplist": [ 43 | ], 44 | "itemidmap": { 45 | }, 46 | "itemtweaklist": [ 47 | "地的水晶碎片|999", 48 | "水的水晶碎片|999", 49 | "火的水晶碎片|999", 50 | "风的水晶碎片|999", 51 | "神之金|20", 52 | "龙角|20", 53 | "隐秘的徽记(地)|20", 54 | "隐秘的徽记(水)|20", 55 | "隐秘的徽记(火)|20", 56 | "隐秘的徽记(风)|20", 57 | "阿尔卡迪亚古钱|999", 58 | "魔族的水晶|5", 59 | "钢骑之矿|5", 60 | "德特家的布|5", 61 | "誓言之证|5", 62 | "能量结晶|99", 63 | "巨石|20", 64 | "长老之证|7" 65 | ], 66 | "player": { 67 | "autosupply": true, 68 | "movespd": 120, 69 | "noswitchanim": false, 70 | "petfood": false, 71 | "petfoodat": "", 72 | "petmed": false, 73 | "petmedat": "", 74 | "usefood": false, 75 | "usefoodat": "", 76 | "usemed": false, 77 | "usemedat": "", 78 | "workacc": 100, 79 | "workdelay": 6500 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /leo/通用任务配置.json: -------------------------------------------------------------------------------- 1 | { 2 | "battle": { 3 | "autobattle": true, 4 | "bossprot": false, 5 | "delayfrom": 4000, 6 | "delayto": 4500, 7 | "highspeed": true, 8 | "list": [ 9 | { 10 | "condition": 3, 11 | "condition2": 0, 12 | "condition2rel": 0, 13 | "condition2val": "", 14 | "conditionrel": 2, 15 | "conditionval": "60%", 16 | "index": 0, 17 | "petaction": 100, 18 | "petskillname": "明镜止水-Ⅳ", 19 | "pettarget": 3, 20 | "pettargetsel": -1, 21 | "playeraction": -1, 22 | "playertarget": -1, 23 | "playertargetsel": -1 24 | }, 25 | { 26 | "condition": 10, 27 | "condition2": 0, 28 | "condition2rel": 0, 29 | "condition2val": "", 30 | "conditionrel": 0, 31 | "conditionval": "5", 32 | "index": 1, 33 | "petaction": 100, 34 | "petskillname": "气功弹-Ⅱ", 35 | "pettarget": 0, 36 | "pettargetsel": 4, 37 | "playeraction": 100, 38 | "playerskilllevel": 0, 39 | "playerskillname": "气功弹", 40 | "playertarget": 0, 41 | "playertargetsel": 0 42 | }, 43 | { 44 | "condition": 0, 45 | "condition2": 0, 46 | "condition2rel": 0, 47 | "condition2val": "", 48 | "conditionrel": 0, 49 | "conditionval": "", 50 | "index": 2, 51 | "petaction": 100, 52 | "petskillname": "攻击", 53 | "pettarget": 0, 54 | "pettargetsel": 4, 55 | "playeraction": 1, 56 | "playertarget": 0, 57 | "playertargetsel": 0 58 | } 59 | ], 60 | "lockcd": false, 61 | "lv1prot": false, 62 | "pet2action": true, 63 | "playerforceaction": false, 64 | "r1nodelay": true, 65 | "showhpmp": false 66 | }, 67 | "chat": { 68 | "displayname": true, 69 | "displaytime": true, 70 | "mychat": true, 71 | "npcmsg": true, 72 | "playerchat": true, 73 | "sysmsg": true, 74 | "todayonly": true 75 | }, 76 | "itemdroplist": [ 77 | "魔石", 78 | "地的水晶碎片", 79 | "水的水晶碎片", 80 | "火的水晶碎片", 81 | "风的水晶碎片", 82 | "卡片?" 83 | ], 84 | "itemidmap": { 85 | }, 86 | "itemtweaklist": [ 87 | "地的水晶碎片|999", 88 | "水的水晶碎片|999", 89 | "火的水晶碎片|999", 90 | "风的水晶碎片|999", 91 | "神之金|20", 92 | "龙角|20", 93 | "隐秘的徽记(地)|20", 94 | "隐秘的徽记(水)|20", 95 | "隐秘的徽记(火)|20", 96 | "隐秘的徽记(风)|20", 97 | "阿尔卡迪亚古钱|999", 98 | "魔族的水晶|5", 99 | "钢骑之矿|5", 100 | "德特家的布|5", 101 | "誓言之证|5", 102 | "能量结晶|99", 103 | "巨石|20", 104 | "长老之证|3" 105 | ], 106 | "player": { 107 | "autosupply": true, 108 | "movespd": 110, 109 | "noswitchanim": false, 110 | "workacc": 100, 111 | "workdelay": 6500 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /mfc71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/mfc71.dll -------------------------------------------------------------------------------- /msvcp140.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/msvcp140.dll -------------------------------------------------------------------------------- /msvcp140_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/msvcp140_1.dll -------------------------------------------------------------------------------- /msvcp140_2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/msvcp140_2.dll -------------------------------------------------------------------------------- /msvcp71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/msvcp71.dll -------------------------------------------------------------------------------- /msvcp71d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/msvcp71d.dll -------------------------------------------------------------------------------- /msvcr71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/msvcr71.dll -------------------------------------------------------------------------------- /msvcr71d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/msvcr71d.dll -------------------------------------------------------------------------------- /navigator.js: -------------------------------------------------------------------------------- 1 | var cga = require(process.env.CGA_DIR_PATH_UTF8+'/cgaapi')(function(){ 2 | 3 | if(process.argv[3] == undefined) 4 | { 5 | throw new Error('该寻路脚本为CGAssistant内部调用,无法单独使用!'); 6 | } 7 | 8 | var x = parseInt(process.argv[3]); 9 | var y = parseInt(process.argv[4]); 10 | var entermap = parseInt(process.argv[5]); 11 | 12 | var mapname = cga.GetMapName(); 13 | var curXY = cga.GetMapXY(); 14 | 15 | var Path = cga.calculatePath(curXY.x, curXY.y, x, y, mapname, null, null, []); 16 | var PF = require('pathfinding'); 17 | 18 | if(Path.length > 0) 19 | { 20 | for(var i in Path){ 21 | if(Path[i][2] !== undefined || Path[i][5] !== undefined) 22 | Path[i] = [Path[i][0], Path[i][1]]; 23 | } 24 | Path.unshift([curXY.x, curXY.y]); 25 | 26 | console.log('[PATH BEGIN]'); 27 | console.log(Path); 28 | console.log('[PATH END]'); 29 | 30 | cga.walkList([ 31 | (entermap && entermap != 3) ? [x, y, ''] : [x, y], 32 | ], ()=>{ 33 | 34 | }); 35 | } else { 36 | console.log('[PATH BEGIN]'); 37 | console.log(Path); 38 | console.log('[PATH END]'); 39 | } 40 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CGAssistant", 3 | "version": "1.0.0", 4 | "description": "CGAssistant", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/hzqst/CGAssistant.git" 12 | }, 13 | "author": "hzqst", 14 | "license": "MIT", 15 | "dependencies": { 16 | "accepts": "1.3.7", 17 | "after": "0.8.2", 18 | "arraybuffer.slice": "0.0.7", 19 | "async": "3.2.2", 20 | "async-limiter": "1.0.1", 21 | "base64-arraybuffer": "0.1.5", 22 | "base64id": "1.0.0", 23 | "better-assert": "1.0.2", 24 | "blob": "0.0.5", 25 | "component-bind": "1.0.0", 26 | "component-emitter": "1.2.1", 27 | "component-inherit": "0.0.3", 28 | "cookie": "0.3.1", 29 | "debug": "4.3.1", 30 | "engine.io": "3.6.1", 31 | "engine.io-client": "3.3.2", 32 | "engine.io-parser": "2.1.3", 33 | "has-binary2": "1.0.3", 34 | "has-cors": "1.1.0", 35 | "heap": "0.2.5", 36 | "iconv-lite": "0.4.24", 37 | "indexof": "0.0.1", 38 | "isarray": "2.0.1", 39 | "lodash": "4.17.21", 40 | "mime-db": "1.40.0", 41 | "mime-types": "2.1.24", 42 | "moment": "2.29.4", 43 | "ms": "2.1.2", 44 | "nan": "2.6.2", 45 | "negotiator": "0.6.2", 46 | "object-component": "0.0.3", 47 | "parseqs": "0.0.5", 48 | "parseuri": "0.0.5", 49 | "pathfinding": "0.4.18", 50 | "safer-buffer": "2.1.2", 51 | "socket.io": "2.5.0", 52 | "socket.io-adapter": "1.1.1", 53 | "socket.io-client": "2.2.0", 54 | "socket.io-parser": "3.3.4", 55 | "to-array": "0.1.4", 56 | "ws": "6.2.3", 57 | "xmlhttprequest-ssl": "1.6.2", 58 | "yeast": "0.1.2", 59 | "request": "latest", 60 | "bindings": "latest" 61 | } 62 | } -------------------------------------------------------------------------------- /ucrtbase.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/ucrtbase.dll -------------------------------------------------------------------------------- /vc_redist.x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/vc_redist.x86.exe -------------------------------------------------------------------------------- /vcruntime140.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hzqst/CGAssistantJS/ec7277c5c881005a8fb9793c3e114cff5c96c222/vcruntime140.dll -------------------------------------------------------------------------------- /咬花.js: -------------------------------------------------------------------------------- 1 | var cga = require(process.env.CGA_DIR_PATH_UTF8+'/cgaapi')(function(){ 2 | console.log('咬花 起始地点:艾尔莎岛') 3 | 4 | var loop_count = 0; 5 | 6 | var playerinfo = cga.GetPlayerInfo(); 7 | 8 | var task = cga.task.Task('咬花', [ 9 | {//0 10 | intro: '1.持有【咬花】时前往艾夏岛与神秘催眠师(107.121)对话,传送至回忆之间。', 11 | workFunc: function(cb2){ 12 | cga.travel.newisland.toStone('B', ()=>{ 13 | cga.walkList([ 14 | [106, 121], 15 | ], ()=>{ 16 | cga.TurnTo(108, 121); 17 | cga.AsyncWaitNPCDialog((dlg)=>{ 18 | cga.ClickNPCDialog(4, 0); 19 | cga.AsyncWaitNPCDialog((dlg)=>{ 20 | cga.ClickNPCDialog(1, 0); 21 | setTimeout(cb2, 1500, true); 22 | }); 23 | }); 24 | }); 25 | }); 26 | } 27 | }, 28 | {//1 29 | intro: '2.调查回忆之石(8.7)进入战斗。', 30 | workFunc: function(cb2){ 31 | 32 | var loop = ()=>{ 33 | 34 | cga.AsyncWaitNPCDialog((dlg)=>{ 35 | 36 | cga.AsyncWaitNPCDialog((dlg)=>{ 37 | cga.ClickNPCDialog(1, 0); 38 | setTimeout(battleAgain, 5000); 39 | }); 40 | cga.ClickNPCDialog(4, 0); 41 | }); 42 | cga.TurnTo(8, 6); 43 | } 44 | 45 | var battleAgain = ()=>{ 46 | 47 | if(cga.isInBattle()){ 48 | setTimeout(battleAgain, 1000); 49 | return; 50 | } 51 | 52 | loop_count ++; 53 | cga.SayWords('已刷' + loop_count + '遍!', 0, 3, 1); 54 | 55 | if(cga.GetMapIndex().index3 == 44641) 56 | cb2(true); 57 | else 58 | loop(); 59 | }; 60 | 61 | cga.walkList([ 62 | [8, 8], 63 | ], loop); 64 | } 65 | } 66 | ], 67 | [//任务阶段是否完成 68 | function(){//证明信 69 | return (cga.GetMapIndex().index3 == 44642) ? true : false; 70 | }, 71 | function(){ 72 | return false; 73 | }, 74 | ] 75 | ); 76 | 77 | task.doTask(()=>{ 78 | 79 | }); 80 | }); -------------------------------------------------------------------------------- /定居新城.js: -------------------------------------------------------------------------------- 1 | var cga = require(process.env.CGA_DIR_PATH_UTF8+'/cgaapi')(function(){ 2 | 3 | var travel = null; 4 | 5 | var next = ()=>{ 6 | cga.walkList([ 7 | [141, 105] 8 | ], ()=>{ 9 | cga.turnTo(142, 105); 10 | cga.AsyncWaitNPCDialog(()=>{ 11 | cga.ClickNPCDialog(4, -1); 12 | }); 13 | }); 14 | }; 15 | 16 | var map = cga.GetMapName(); 17 | 18 | if(map == '阿凯鲁法村'){ 19 | cga.travel.AKLF.toFalan(()=>{ 20 | cga.travel.falan.toCity('艾尔莎岛', next); 21 | }); 22 | } 23 | else if(map == '哥拉尔镇'){ 24 | cga.travel.gelaer.toFalan(()=>{ 25 | cga.travel.falan.toCity('艾尔莎岛', next); 26 | }); 27 | } 28 | else if(map == '法兰城' || map == '里谢里雅堡') 29 | { 30 | cga.travel.falan.toCity('艾尔莎岛', next); 31 | } 32 | else 33 | { 34 | throw new Error('无法从'+map+'启动脚本,只能从法兰城、里堡、阿凯鲁法、哥拉尔启动!'); 35 | } 36 | }); -------------------------------------------------------------------------------- /宠物摆摊.js: -------------------------------------------------------------------------------- 1 | //修改这里的地图名、坐标、朝向和宠物名字 2 | //地图只支持艾尔莎岛、里谢里雅堡和法兰城 3 | //坐标是人物站的坐标 4 | //朝向0代表正东2代表正南4代表正西6代表正北 有效值0~7 5 | /* 6 | 如果只是单纯挂机站街,只需要把 7 | 8 | ['艾尔莎岛', [146, 108], 0, '爱莉西雅'], 9 | ['里谢里雅堡', [32, 82], 0, '多拉姆糖'], 10 | 11 | 这两行删除即可 12 | */ 13 | 14 | var petList = [ 15 | ['艾尔莎岛', [146, 108], 0, '爱莉西雅'], 16 | ['里谢里雅堡', [32, 82], 0, '多拉姆糖'], 17 | ]; 18 | 19 | 20 | var Async = require('Async') 21 | var cga = require(process.env.CGA_DIR_PATH_UTF8+'/cgaapi')(function(){ 22 | 23 | var loop = function(){ 24 | //说话防掉线 25 | cga.SayWords("", 0, 3, 1); 26 | 27 | setTimeout(loop, 30000); 28 | } 29 | 30 | Async.eachSeries(petList, (data, cb)=>{ 31 | 32 | switch(data[0]){ 33 | case '艾尔莎岛': 34 | { 35 | var pets = cga.GetPetsInfo(); 36 | 37 | var pet = pets.find((p)=>{ 38 | return (p.name == data[3] || p.realname == data[3]) 39 | }); 40 | 41 | if(pet == undefined || pet.battle_flags == 3) 42 | { 43 | cb(); 44 | return; 45 | } 46 | 47 | var go = ()=>{ 48 | 49 | cga.walkList([ data[1] ], ()=>{ 50 | cga.turnOrientation(data[2]); 51 | setTimeout(()=>{ 52 | cga.ChangePetState(pet.index, cga.PET_STATE_REST); 53 | setTimeout(cb, 500); 54 | }, 500); 55 | }); 56 | } 57 | 58 | if(cga.GetMapName() == '艾尔莎岛'){ 59 | go(); 60 | } else { 61 | cga.travel.newisland.toStone('X', go); 62 | } 63 | break; 64 | } 65 | case '里谢里雅堡': 66 | { 67 | var pets = cga.GetPetsInfo(); 68 | 69 | var pet = pets.find((p)=>{ 70 | return (p.name == data[3] || p.realname == data[3]) 71 | }); 72 | 73 | if(pet == undefined || pet.battle_flags == 3) 74 | { 75 | cb(); 76 | return; 77 | } 78 | 79 | var go = ()=>{ 80 | 81 | cga.walkList([ data[1] ], ()=>{ 82 | cga.turnOrientation(data[2]); 83 | setTimeout(()=>{ 84 | cga.ChangePetState(pet.index, cga.PET_STATE_REST); 85 | setTimeout(cb, 500); 86 | }, 500); 87 | }); 88 | } 89 | 90 | if(cga.GetMapName() == '里谢里雅堡'){ 91 | go(); 92 | } else { 93 | cga.travel.falan.toStone('C', go); 94 | } 95 | break; 96 | } 97 | case '法兰城': 98 | { 99 | var pets = cga.GetPetsInfo(); 100 | 101 | var pet = pets.find((p)=>{ 102 | return (p.name == data[3] || p.realname == data[3]) 103 | }); 104 | 105 | if(pet == undefined || pet.battle_flags == 3) 106 | { 107 | cb(); 108 | return; 109 | } 110 | 111 | var go = ()=>{ 112 | 113 | cga.walkList([ data[1] ], ()=>{ 114 | cga.turnOrientation(data[2]); 115 | setTimeout(()=>{ 116 | cga.ChangePetState(pet.index, cga.PET_STATE_REST); 117 | setTimeout(cb, 500); 118 | }, 500); 119 | }); 120 | } 121 | 122 | if(cga.GetMapName() == '法兰城'){ 123 | go(); 124 | } else { 125 | cga.travel.falan.toStone('S2', go); 126 | } 127 | break; 128 | } 129 | } 130 | }, ()=>{ 131 | cga.LogBack(); 132 | loop(); 133 | }); 134 | }); -------------------------------------------------------------------------------- /矿山钥匙.js: -------------------------------------------------------------------------------- 1 | var cga = require(process.env.CGA_DIR_PATH_UTF8+'/cgaapi')(function(){ 2 | var task = cga.task.Task('矿山钥匙', [ 3 | { 4 | intro: '1.到法兰城里谢里雅堡(47.85)进入召唤之间,从召唤之间右上角进入回廊。由回廊(23.19)进入灵堂,再从灵堂(7.52)的楼梯进入地下牢房。在地下牢房的(31.20)跟 乔尔凯夫 交谈取得"给朋友的信"', 5 | workFunc: function(cb2){ 6 | cga.travel.falan.toStone('C', ()=>{ 7 | cga.walkList([ 8 | [47, 85, '召唤之间'], 9 | [27, 8, '回廊'], 10 | [23, 23], 11 | [23, 19, '灵堂', null, null, true], 12 | [7, 52, '地下牢房'], 13 | [31, 20], 14 | ], ()=>{ 15 | cga.TurnTo(33, 20); 16 | cga.AsyncWaitNPCDialog(()=>{ 17 | cga.ClickNPCDialog(32, -1); 18 | cga.AsyncWaitNPCDialog(()=>{ 19 | cga.ClickNPCDialog(4, -1); 20 | setTimeout(()=>{ 21 | cb2(true); 22 | }, 1000); 23 | }); 24 | }); 25 | }); 26 | }); 27 | } 28 | }, 29 | { 30 | intro: '2.到法兰城(61.63)进入仓库,把信交给 德米多夫 换取[矿山钥匙]', 31 | workFunc: function(cb2){ 32 | cga.travel.falan.toStone('W1', ()=>{ 33 | cga.walkList([ 34 | [61, 63, '仓库内部'], 35 | [11, 10, null], 36 | ], ()=>{ 37 | cga.TurnTo(12, 9); 38 | cga.AsyncWaitNPCDialog(()=>{ 39 | cga.ClickNPCDialog(4, -1); 40 | cga.AsyncWaitNPCDialog(()=>{ 41 | cga.ClickNPCDialog(1, -1); 42 | cga.AsyncWaitNPCDialog(()=>{ 43 | cga.ClickNPCDialog(1, -1); 44 | setTimeout(()=>{ 45 | cb2(true); 46 | }, 1000); 47 | }); 48 | }); 49 | }); 50 | }); 51 | }); 52 | } 53 | } 54 | ], 55 | [//任务阶段是否完成 56 | function(){//gei peng you de xin 57 | return (cga.getItemCount('#18422') > 0) ? true : false; 58 | }, 59 | function(){//矿山钥匙 60 | return (cga.getItemCount('矿山钥匙') > 0) ? true : false; 61 | }, 62 | ] 63 | ); 64 | 65 | task.doTask(); 66 | }); -------------------------------------------------------------------------------- /走随机迷宫.js: -------------------------------------------------------------------------------- 1 | var cga = require(process.env.CGA_DIR_PATH_UTF8+'/cgaapi')(function(){ 2 | var loop = ()=>{ 3 | cga.walkRandomMaze(null, (err)=>{ 4 | loop(); 5 | }); 6 | } 7 | loop(); 8 | }); -------------------------------------------------------------------------------- /通用买布脚本.js: -------------------------------------------------------------------------------- 1 | var cga = require(process.env.CGA_DIR_PATH_UTF8+'/cgaapi')(function(){ 2 | console.log('买布脚本 起始地点:艾尔莎岛') 3 | 4 | var mineArray = [ 5 | { 6 | name : '麻布', 7 | func : (count, cb)=>{ 8 | cga.craft.buyFabricLv1(0, count, cb); 9 | } 10 | }, 11 | { 12 | name : '木棉布', 13 | func : (count, cb)=>{ 14 | cga.craft.buyFabricLv1(1, count, cb); 15 | } 16 | }, 17 | { 18 | name : '毛毡', 19 | func : (count, cb)=>{ 20 | cga.craft.buyFabricLv1(2, count, cb); 21 | } 22 | }, 23 | { 24 | name : '绵', 25 | func : (count, cb)=>{ 26 | cga.craft.buyFabricLv1(3, count, cb); 27 | } 28 | }, 29 | { 30 | name : '细线', 31 | func : (count, cb)=>{ 32 | cga.craft.buyFabricLv1(4, count, cb); 33 | } 34 | }, 35 | { 36 | name : '维诺亚村', 37 | func : (count, cb)=>{ 38 | cga.craft.buyFabricLv2(0, count, cb); 39 | } 40 | }, 41 | { 42 | name : '莎莲娜线', 43 | func : (count, cb)=>{ 44 | cga.craft.buyFabricLv3(9, count, cb); 45 | } 46 | }, 47 | { 48 | name : '杰诺瓦线', 49 | func : (count, cb)=>{ 50 | cga.craft.buyFabricLv3(10, count, cb); 51 | } 52 | }, 53 | { 54 | name : '阿巴尼斯制的线', 55 | func : (count, cb)=>{ 56 | cga.craft.buyFabricLv4(1, count, cb); 57 | } 58 | }, 59 | { 60 | name : '阿巴尼斯制的布', 61 | func : (count, cb)=>{ 62 | cga.craft.buyFabricLv4(2, count, cb); 63 | } 64 | }, 65 | { 66 | name : '细麻布', 67 | func : (count, cb)=>{ 68 | cga.craft.buyFabricLv5(0, count, cb); 69 | } 70 | }, 71 | { 72 | name : '开米士毛线', 73 | func : (count, cb)=>{ 74 | cga.craft.buyFabricLv5(1, count, cb); 75 | } 76 | }, 77 | ] 78 | 79 | var mineObject = null; 80 | 81 | var stage1 = ()=>{ 82 | cga.SayWords('欢迎使用CGA通用买布脚本,输入数字选择布的种类:', 0, 3, 1); 83 | 84 | var sayString = ''; 85 | for(var i in mineArray){ 86 | if(i != 0) 87 | sayString += ', '; 88 | sayString += '('+ (parseInt(i)+1) + ')' + (typeof mineArray[i].display_name == 'string' ? mineArray[i].display_name : mineArray[i].name); 89 | } 90 | cga.sayLongWords(sayString, 0, 3, 1); 91 | cga.waitForChatInput((msg, index)=>{ 92 | 93 | if(index !== null && index >= 1 && mineArray[index - 1]){ 94 | mineObject = mineArray[index - 1]; 95 | 96 | var sayString2 = '当前已选择:[' + (typeof mineObject.display_name == 'string' ? mineObject.display_name : mineObject.name) + ']。'; 97 | cga.sayLongWords(sayString2, 0, 3, 1); 98 | 99 | stage2(); 100 | 101 | return false; 102 | } 103 | 104 | return true; 105 | }); 106 | } 107 | 108 | var stage2 = ()=>{ 109 | cga.SayWords('输入数字购买布的数量(1~400):', 0, 3, 1); 110 | 111 | cga.waitForChatInput((msg, val)=>{ 112 | if(val !== null && val >= 1 && val <= 400){ 113 | var sayString2 = '购买数量:['+val+']。'; 114 | cga.sayLongWords(sayString2, 0, 3, 1); 115 | 116 | mineObject.func(val, ()=>{ 117 | console.log('购买完成!'); 118 | }); 119 | 120 | return false; 121 | } 122 | 123 | return true; 124 | }); 125 | } 126 | 127 | stage1(()=>{ 128 | stage2(); 129 | }) 130 | }); -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/interrupt.js: -------------------------------------------------------------------------------- 1 | function ThinkInterrupt(){ 2 | this.isInterrupting = false; 3 | this.timeoutCount = 0; 4 | this.requestInterrupt = (cb)=>{ 5 | if(this.isInterrupting) 6 | return; 7 | 8 | if(typeof cb == 'function'){ 9 | this.timeoutCount = 0; 10 | var timerCallback = ()=>{ 11 | if((this.isInterrupting == false || this.timeoutCount > 10) && cb() == true){ 12 | this.timeoutCount = 0; 13 | this.isInterrupting = false; 14 | return; 15 | } 16 | this.timeoutCount ++; 17 | setTimeout(timerCallback, 500); 18 | } 19 | 20 | this.isInterrupting = true; 21 | setTimeout(timerCallback, 500); 22 | } else { 23 | this.isInterrupting = true; 24 | } 25 | } 26 | this.hasInterrupt = ()=>{ 27 | if(this.isInterrupting){ 28 | this.isInterrupting = false; 29 | return true; 30 | } 31 | 32 | return false; 33 | } 34 | return this; 35 | } 36 | module.exports = ThinkInterrupt; -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/刷双百鹿皮.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var thisobj = { 5 | object : { 6 | name :'鹿皮', 7 | func : (cb) =>{ 8 | cga.travel.falan.toStone('E1', ()=>{ 9 | cga.walkList([ 10 | [281, 88, '芙蕾雅'], 11 | [596, 247] 12 | ], cb); 13 | }); 14 | }, 15 | }, 16 | check_done : ()=>{ 17 | return cga.getItemCount('鹿皮') >= 40 * 5; 18 | }, 19 | check_drop : ()=>{ 20 | var dropItemPos = -1; 21 | cga.getInventoryItems().forEach((item)=>{ 22 | if(dropItemPos != -1) 23 | return; 24 | if(item.name == '传说中的鹿皮' && item.count >= 40){ 25 | dropItemPos = item.pos; 26 | return; 27 | } 28 | }); 29 | 30 | if(dropItemPos != -1) 31 | cga.DropItem(dropItemPos); 32 | }, 33 | translate : (pair)=>{ 34 | 35 | if(pair.field == 'gatherCount'){ 36 | pair.field = '采集数量'; 37 | pair.value = pair.value + '组'; 38 | pair.translated = true; 39 | return true; 40 | } 41 | 42 | return false; 43 | }, 44 | loadconfig : (obj, cb)=>{ 45 | configTable.gatherCount = obj.gatherCount; 46 | thisobj.gatherCount = obj.gatherCount; 47 | thisobj.object.gatherCount = obj.gatherCount; 48 | 49 | if(!thisobj.gatherCount){ 50 | console.error('读取配置:采集数量失败!'); 51 | return false; 52 | } 53 | 54 | return true; 55 | }, 56 | inputcb : (cb)=>{ 57 | var sayString = '【采集插件】请选择采集数量(组):'; 58 | cga.sayLongWords(sayString, 0, 3, 1); 59 | cga.waitForChatInput((msg, val)=>{ 60 | if(val !== null && val >= 1 && val <= 20){ 61 | configTable.gatherCount = val; 62 | thisobj.gatherCount = val; 63 | thisobj.object.gatherCount = val; 64 | 65 | var sayString2 = '当前已选择:采集数量[' + thisobj.gatherCount + ']组。'; 66 | cga.sayLongWords(sayString2, 0, 3, 1); 67 | 68 | cb2(null); 69 | 70 | return false; 71 | } 72 | 73 | return true; 74 | }); 75 | } 76 | } 77 | 78 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/哥拉尔回补.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | module.exports = { 5 | func : (cb)=>{ 6 | cga.travel.gelaer.toHospital(()=>{ 7 | setTimeout(()=>{ 8 | cga.walkList([ 9 | [9, 23, '哥拉尔镇'] 10 | ], ()=>{ 11 | cb(null); 12 | }); 13 | }, 5000); 14 | }); 15 | }, 16 | isLogBack : (map, mapindex)=>{ 17 | return (map == '哥拉尔镇') ? false : true; 18 | }, 19 | isAvailable : (map, mapindex)=>{ 20 | if(cga.travel.gelaer.isSettled) 21 | return true; 22 | 23 | return (map == '哥拉尔镇') ? true : false; 24 | }, 25 | translate : (pair)=>{ 26 | return false; 27 | }, 28 | loadconfig : (obj)=>{ 29 | return true; 30 | }, 31 | inputcb : (cb)=>{ 32 | cb(null); 33 | } 34 | } -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/治疗自己.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var thisobj = { 5 | func : (cb)=>{ 6 | var skill_heal = cga.findPlayerSkill('治疗'); 7 | if(!skill_heal){ 8 | throw new Error('你没有治疗技能'); 9 | return; 10 | } 11 | var requiremp = 25 + skill_heal.lv * 5; 12 | 13 | var playerinfo = cga.GetPlayerInfo(); 14 | 15 | if (playerinfo.mp < requiremp){ 16 | cb(new Error('治疗蓝量不足')); 17 | return; 18 | } 19 | 20 | cga.StartWork(skill_heal.index, skill_heal.lv-1); 21 | cga.AsyncWaitPlayerMenu((err, players)=>{ 22 | cga.PlayerMenuSelect(0); 23 | cga.AsyncWaitUnitMenu((err, units)=>{ 24 | cga.UnitMenuSelect(0); 25 | cga.AsyncWaitWorkingResult((err, r)=>{ 26 | if(playerinfo.health != 0) 27 | thisobj.func(cb); 28 | else 29 | cb(null); 30 | }); 31 | }); 32 | }); 33 | }, 34 | translate : (pair)=>{ 35 | return false; 36 | }, 37 | loadconfig : (obj, cb)=>{ 38 | return true; 39 | }, 40 | inputcb : (cb)=>{ 41 | cb(null); 42 | } 43 | } 44 | 45 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/灵堂回补.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | module.exports = { 5 | func : (cb)=>{ 6 | var map = cga.GetMapName(); 7 | cga.walkList([ 8 | [31, 48, '回廊'], 9 | [25, 22], 10 | ], ()=>{ 11 | cga.TurnTo(27, 22); 12 | setTimeout(cb, 5000, null); 13 | }); 14 | }, 15 | isLogBack : (map, mapindex)=>{ 16 | return false; 17 | }, 18 | isAvailable : (map, mapindex)=>{ 19 | return map == '灵堂'; 20 | }, 21 | translate : (pair)=>{ 22 | return false; 23 | }, 24 | loadconfig : (obj)=>{ 25 | return true; 26 | }, 27 | inputcb : (cb)=>{ 28 | cb(null); 29 | } 30 | } -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/登出检查定居地.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var thisobj = { 5 | func : (cb)=>{ 6 | console.log('登出检查定居地...'); 7 | cga.logBack(cb); 8 | }, 9 | translate : (pair)=>{ 10 | return false; 11 | }, 12 | loadconfig : (obj)=>{ 13 | return true; 14 | }, 15 | inputcb : (cb)=>{ 16 | cb(null); 17 | } 18 | } 19 | 20 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/登出防卡住.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var thisobj = { 5 | readyToLogBack : false, 6 | callbackAfterLogBack : null, 7 | init : ()=>{ 8 | cga.waitForChatInput((msg)=>{ 9 | 10 | if(msg.indexOf('登出防卡住') >= 0 && cga.isInNormalState() && thisobj.readyToLogBack == true){ 11 | thisobj.readyToLogBack = false; 12 | cga.logBack(thisobj.callbackAfterLogBack); 13 | thisobj.callbackAfterLogBack = null; 14 | } 15 | 16 | return true; 17 | }); 18 | }, 19 | func : (cb)=>{ 20 | thisobj.readyToLogBack = true; 21 | thisobj.callbackAfterLogBack = cb; 22 | 23 | var retry = ()=>{ 24 | if(thisobj.readyToLogBack && thisobj.callbackAfterLogBack){ 25 | cga.SayWords('登出防卡住', 0, 3, 1); 26 | setTimeout(retry, 1000); 27 | } 28 | } 29 | 30 | retry(); 31 | }, 32 | translate : (pair)=>{ 33 | return false; 34 | }, 35 | loadconfig : (obj, cb)=>{ 36 | return true; 37 | }, 38 | inputcb : (cb)=>{ 39 | cb(null); 40 | } 41 | } 42 | 43 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/矮人卖石.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | module.exports = { 5 | func : (cb)=>{ 6 | var path = []; 7 | var map = cga.GetMapName(); 8 | if(map == '矮人城镇') 9 | { 10 | path = [ 11 | [121, 110], 12 | ]; 13 | } 14 | else if(map == '肯吉罗岛') 15 | { 16 | path = [ 17 | [231, 434, '矮人城镇'], 18 | [121, 110], 19 | ]; 20 | } 21 | 22 | cga.walkList(path, ()=>{ 23 | cga.walkTeammateToPosition([ 24 | [121, 111], 25 | [121, 110], 26 | ] , ()=>{ 27 | cga.turnTo(122, 110); 28 | cga.sellStone(()=>{ 29 | setTimeout(()=>{ 30 | 31 | if(cga.GetPlayerInfo().gold >= 950000) 32 | { 33 | if(cga.getTeamPlayers().length) 34 | cga.DoRequest(cga.REQUEST_TYPE_LEAVETEAM); 35 | 36 | cga.walkList([ 37 | [163, 104], 38 | ], ()=>{ 39 | cga.turnDir(0); 40 | cga.AsyncWaitNPCDialog(()=>{ 41 | cga.MoveGold(900000, cga.MOVE_GOLD_TOBANK); 42 | setTimeout(cb, 1000); 43 | }); 44 | }); 45 | return; 46 | } 47 | 48 | cb(null); 49 | 50 | }, cga.getTeamPlayers().length ? 5000 : 3000); 51 | }); 52 | }); 53 | }); 54 | }, 55 | isAvailable : (map, mapindex)=>{ 56 | var mapXY = cga.GetMapXY(); 57 | return (cga.travel.camp.getRegion(map, mapXY) == '矮人城镇域' || map == '矮人城镇') ? true : false; 58 | }, 59 | translate : (pair)=>{ 60 | return false; 61 | }, 62 | loadconfig : (obj)=>{ 63 | return true; 64 | }, 65 | inputcb : (cb)=>{ 66 | cb(null); 67 | } 68 | } -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/矮人回补.js: -------------------------------------------------------------------------------- 1 | var supplyModeArray = [ 2 | { 3 | name : '矮人城镇资深护士回补', 4 | func : (cb)=>{ 5 | var map = cga.GetMapName(); 6 | 7 | var path = [ 8 | [163, 95], 9 | ]; 10 | 11 | if(map == '肯吉罗岛'){ 12 | path.unshift([231, 434, '矮人城镇']); 13 | } 14 | 15 | cga.walkList(path, ()=>{ 16 | cga.turnDir(0); 17 | setTimeout(cb, 5000); 18 | }); 19 | }, 20 | isLogBack : (map, mapindex)=>{ 21 | return false; 22 | }, 23 | isAvailable : (map, mapindex)=>{ 24 | var mapXY = cga.GetMapXY(); 25 | return (cga.travel.camp.getRegion(map, mapXY) == '矮人城镇域' || map == '矮人城镇') ? true : false; 26 | }, 27 | }, 28 | { 29 | name : '矮人城镇普通护士回补', 30 | func : (cb)=>{ 31 | var map = cga.GetMapName(); 32 | 33 | var path = [ 34 | [163, 94], 35 | ]; 36 | 37 | if(map == '肯吉罗岛'){ 38 | path.unshift([231, 434, '矮人城镇']); 39 | } 40 | 41 | cga.walkList(path, ()=>{ 42 | cga.turnDir(0); 43 | setTimeout(cb, 5000); 44 | }); 45 | }, 46 | isLogBack : (map, mapindex)=>{ 47 | return false; 48 | }, 49 | isAvailable : (map, mapindex)=>{ 50 | var mapXY = cga.GetMapXY(); 51 | return (cga.travel.camp.getRegion(map, mapXY) == '矮人城镇域' || map == '矮人城镇') ? true : false; 52 | }, 53 | }, 54 | { 55 | name : '登出飞碟回补', 56 | func : (cb)=>{ 57 | cga.travel.falan.toCastleHospital(()=>{ 58 | setTimeout(cb, 5000); 59 | }); 60 | }, 61 | isLogBack : (map, mapindex)=>{ 62 | return true; 63 | }, 64 | isAvailable : (map, mapindex)=>{ 65 | return true; 66 | }, 67 | } 68 | ] 69 | 70 | var cga = global.cga; 71 | var configTable = global.configTable; 72 | 73 | var thisobj = { 74 | func : (cb)=>{ 75 | thisobj.object.func(cb); 76 | }, 77 | isLogBack : (map, mapindex)=>{ 78 | return thisobj.object.isLogBack(map, mapindex); 79 | }, 80 | isAvailable : (map, mapindex)=>{ 81 | return thisobj.object.isAvailable(map, mapindex); 82 | }, 83 | translate : (pair)=>{ 84 | if(pair.field == 'supplyMode'){ 85 | pair.field = '回补方式'; 86 | pair.value = supplyModeArray[pair.value].name; 87 | pair.translated = true; 88 | return true; 89 | } 90 | return false; 91 | }, 92 | loadconfig : (obj)=>{ 93 | for(var i in supplyModeArray){ 94 | if(i == obj.supplyMode){ 95 | configTable.supplyMode = i; 96 | thisobj.object = supplyModeArray[i]; 97 | break; 98 | } 99 | } 100 | 101 | if(!thisobj.object){ 102 | console.error('读取配置:回补方式失败!'); 103 | return false; 104 | } 105 | 106 | return true; 107 | }, 108 | inputcb : (cb)=>{ 109 | var sayString = '【矮人回补】请选择回补方式:'; 110 | for(var i in supplyModeArray){ 111 | if(i != 0) 112 | sayString += ', '; 113 | sayString += '('+ (parseInt(i)+1) + ')' + supplyModeArray[i].name; 114 | } 115 | cga.sayLongWords(sayString, 0, 3, 1); 116 | cga.waitForChatInput((msg, index)=>{ 117 | if(index !== null && index >= 1 && supplyModeArray[index - 1]){ 118 | configTable.supplyMode = index - 1; 119 | thisobj.object = supplyModeArray[index - 1]; 120 | 121 | var sayString2 = '当前已选择:[' + thisobj.object.name + ']。'; 122 | cga.sayLongWords(sayString2, 0, 3, 1); 123 | 124 | cb(null); 125 | 126 | return false; 127 | } 128 | 129 | return true; 130 | }); 131 | } 132 | } 133 | 134 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/营地卖石.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | module.exports = { 5 | func : (cb)=>{ 6 | var path = []; 7 | var map = cga.GetMapName(); 8 | if(map == '医院') 9 | { 10 | path = [ 11 | [0, 20, '圣骑士营地'], 12 | [87, 72, '工房'], 13 | [21, 22], 14 | ]; 15 | } 16 | else if(map == '圣骑士营地') 17 | { 18 | path = [ 19 | [87, 72, '工房'], 20 | [21, 22], 21 | ]; 22 | } 23 | else if(map == '工房') 24 | { 25 | path = [ 26 | [21, 22], 27 | ]; 28 | } 29 | 30 | cga.walkList(path, ()=>{ 31 | cga.walkTeammateToPosition([ 32 | [21, 22], 33 | [20, 22], 34 | ] , ()=>{ 35 | cga.turnTo(21, 23); 36 | cga.sellStone(()=>{ 37 | setTimeout(()=>{ 38 | 39 | if(cga.GetPlayerInfo().gold >= 950000) 40 | { 41 | if(cga.getTeamPlayers().length) 42 | cga.DoRequest(cga.REQUEST_TYPE_LEAVETEAM); 43 | 44 | cga.travel.falan.toBank(()=>{ 45 | cga.walkList([ 46 | [11, 8], 47 | ], ()=>{ 48 | cga.turnDir(0); 49 | cga.AsyncWaitNPCDialog(()=>{ 50 | cga.MoveGold(900000, cga.MOVE_GOLD_TOBANK); 51 | setTimeout(cb, 1000); 52 | }); 53 | }); 54 | }); 55 | return; 56 | } 57 | 58 | cb(null); 59 | 60 | }, cga.getTeamPlayers().length ? 5000 : 3000); 61 | }); 62 | }); 63 | }); 64 | }, 65 | isAvailable : (map, mapindex)=>{ 66 | return (map == '圣骑士营地' || mapindex == 44692 || mapindex == 44693) ? true : false; 67 | }, 68 | translate : (pair)=>{ 69 | return false; 70 | }, 71 | loadconfig : (obj)=>{ 72 | return true; 73 | }, 74 | inputcb : (cb)=>{ 75 | cb(null); 76 | } 77 | } -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/通用登出回补.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var thisobj = { 5 | func : (cb)=>{ 6 | var mapname = cga.GetMapName(); 7 | cga.logBack(()=>{ 8 | console.log('通用登出回补成功!'); 9 | var mapname = cga.GetMapName(); 10 | switch(mapname) 11 | { 12 | case '艾尔莎岛':case '里谢里雅堡': 13 | cga.travel.falan.toCastleHospital(()=>{ 14 | setTimeout(cb, 3000); 15 | }); 16 | break; 17 | case '哥拉尔镇': 18 | cga.travel.gelaer.toHospital(()=>{ 19 | setTimeout(()=>{ 20 | cga.walkList([ 21 | [9, 23, '哥拉尔镇'] 22 | ], cb); 23 | }, 3000); 24 | }, false); 25 | break; 26 | case '阿凯鲁法村': 27 | cga.LogBack(); 28 | cga.walkList([ 29 | [121, 155, '夏姆吉诊所'], 30 | [24, 17], 31 | ], ()=>{ 32 | cga.TurnTo(24, 15); 33 | setTimeout(()=>{ 34 | cga.walkList([ 35 | [16, 23, '阿凯鲁法村'] 36 | ], cb); 37 | }, 3000); 38 | }); 39 | break; 40 | 41 | case '法兰城': 42 | cga.travel.falan.toWestHospital(()=>{ 43 | cga.walkList([ 44 | [9, 31], 45 | ], ()=>{ 46 | cga.TurnTo(9, 29); 47 | setTimeout(()=>{ 48 | cga.walkList([ 49 | [12, 42, '法兰城'] 50 | ], cb); 51 | }, 3000); 52 | }); 53 | }); 54 | break; 55 | default: throw new Error('登出回到未知的定居地: '+mapname); 56 | } 57 | }); 58 | }, 59 | translate : (pair)=>{ 60 | return false; 61 | }, 62 | loadconfig : (obj)=>{ 63 | return true; 64 | }, 65 | inputcb : (cb)=>{ 66 | cb(null); 67 | } 68 | } 69 | 70 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/里堡卖石.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | module.exports = { 5 | func : (cb)=>{ 6 | var gogogo = ()=>{ 7 | cga.walkList([ 8 | [31, 77], 9 | ], ()=>{ 10 | cga.walkTeammateToPosition([ 11 | [31, 77], 12 | [31, 76], 13 | ] , ()=>{ 14 | cga.turnTo(30, 77); 15 | cga.sellStone(()=>{ 16 | 17 | setTimeout(()=>{ 18 | 19 | if(cga.GetPlayerInfo().gold >= 950000) 20 | { 21 | if(cga.getTeamPlayers().length) 22 | cga.DoRequest(cga.REQUEST_TYPE_LEAVETEAM); 23 | 24 | cga.walkList([ 25 | [30, 37, '圣骑士营地'], 26 | [116, 105, '银行'], 27 | [27, 23], 28 | ], ()=>{ 29 | cga.turnDir(0); 30 | cga.AsyncWaitNPCDialog(()=>{ 31 | cga.MoveGold(900000, cga.MOVE_GOLD_TOBANK); 32 | setTimeout(()=>{ 33 | cga.walkList([ 34 | [3, 23, '圣骑士营地'], 35 | ], cb); 36 | }, 1000); 37 | }); 38 | }); 39 | return; 40 | } 41 | 42 | cb(null); 43 | 44 | }, cga.getTeamPlayers().length ? 5000 : 3000); 45 | }); 46 | }); 47 | }); 48 | } 49 | 50 | if(cga.GetMapName() != '里谢里雅堡'){ 51 | cga.travel.falan.toStone('C', gogogo); 52 | } else { 53 | gogogo(); 54 | } 55 | }, 56 | isAvailable : (map, mapindex)=>{ 57 | return (map == '里谢里雅堡' || map == '艾尔莎岛') ? true : false; 58 | }, 59 | translate : (pair)=>{ 60 | return false; 61 | }, 62 | loadconfig : (obj)=>{ 63 | return true; 64 | }, 65 | inputcb : (cb)=>{ 66 | cb(null); 67 | } 68 | } -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/里堡回补.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | module.exports = { 5 | func : (cb)=>{ 6 | cga.travel.falan.toCastleHospital(()=>{ 7 | setTimeout(cb, 5000); 8 | }); 9 | }, 10 | isLogBack : (map, mapindex)=>{ 11 | return (map == '里谢里雅堡' || map == '艾尔莎岛') ? false : true; 12 | }, 13 | isAvailable : (map, mapindex)=>{ 14 | if(cga.travel.newisland.isSettled) 15 | return true; 16 | 17 | return (map == '里谢里雅堡' || map == '艾尔莎岛') ? true : false; 18 | }, 19 | translate : (pair)=>{ 20 | return false; 21 | }, 22 | loadconfig : (obj)=>{ 23 | return true; 24 | }, 25 | inputcb : (cb)=>{ 26 | cb(null); 27 | } 28 | } -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/鉴定自动1到10.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var thisobj = { 5 | func : (cb) =>{ 6 | thisobj.object.func(cb); 7 | }, 8 | workManager : (cb)=>{ 9 | thisobj.object.workManager(cb); 10 | }, 11 | doneManager : (cb)=>{ 12 | thisobj.object.doneManager(cb); 13 | }, 14 | object : { 15 | level : 1, 16 | name :'刷鱼刷家具', 17 | func : (cb) =>{ 18 | if(thisobj.object.skill.lv == 1){ 19 | 20 | if(cga.GetMapName() != '拿潘食品店') 21 | { 22 | cga.travel.falan.toStone('E2', ()=>{ 23 | cga.walkList([ 24 | [217, 53, '拿潘食品店'], 25 | [10, 14], 26 | ], cb); 27 | }); 28 | } else { 29 | cga.walkList([ 30 | [10, 14], 31 | ], cb); 32 | } 33 | } 34 | else 35 | { 36 | if(cga.GetMapName() != '哈丝塔的家') 37 | { 38 | cga.travel.newisland.toStone('D', ()=>{ 39 | cga.walkList([ 40 | [167, 102, '哈丝塔的家'], 41 | [11, 10], 42 | ], cb) 43 | }); 44 | } 45 | else 46 | { 47 | cga.walkList([ 48 | [11, 10], 49 | ], cb) 50 | } 51 | } 52 | }, 53 | workManager : (cb)=>{ 54 | 55 | cga.turnDir(0); 56 | 57 | var dialogHandler = (err, dlg)=>{ 58 | if(dlg && (dlg.options & 4) == 4) 59 | { 60 | cga.ClickNPCDialog(4, 0); 61 | cga.AsyncWaitNPCDialog(dialogHandler); 62 | return; 63 | } 64 | if(dlg && (dlg.options & 32) == 32) 65 | { 66 | cga.ClickNPCDialog(32, 0); 67 | cga.AsyncWaitNPCDialog(dialogHandler); 68 | return; 69 | } 70 | else if(dlg && dlg.options == 1) 71 | { 72 | cga.ClickNPCDialog(1, 0); 73 | setTimeout(()=>{ 74 | cga.assessAllItems(cb); 75 | }, 500); 76 | return; 77 | } 78 | else 79 | { 80 | cga.assessAllItems(cb); 81 | return; 82 | } 83 | } 84 | 85 | cga.AsyncWaitNPCDialog(dialogHandler); 86 | }, 87 | doneManager : (cb)=>{ 88 | //更新技能等级 89 | thisobj.object.skill = cga.findPlayerSkill('鉴定'); 90 | cb(null); 91 | }, 92 | extra_dropping : (item)=>{ 93 | 94 | if(thisobj.object.skill.lv < 6 && item.itemid == 14670) 95 | return true; 96 | 97 | return item.assessed && (item.itemid == 14668 || item.itemid == 14669 || item.itemid == 14670 || item.itemid == 18184); 98 | }, 99 | skill : null, 100 | }, 101 | check_done : ()=>{ 102 | return (cga.getItemCount((it)=>{ 103 | return it.name == '抓猫用的鱼?' || it.name == '家具?'; 104 | }) > 0 && cga.findAssessableItem() == null) ? true : false; 105 | }, 106 | translate : (pair)=>{ 107 | return false; 108 | }, 109 | loadconfig : (obj, cb)=>{ 110 | return true; 111 | }, 112 | inputcb : (cb)=>{ 113 | cb(null); 114 | }, 115 | init : ()=>{ 116 | thisobj.object.skill = cga.findPlayerSkill('鉴定'); 117 | if(!thisobj.object.skill) 118 | throw new Error('需要鉴定技能!'); 119 | } 120 | } 121 | 122 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/鲁村卖石.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | module.exports = { 5 | func : (cb)=>{ 6 | var map = cga.GetMapName(); 7 | if(map != '鲁米那斯' && map != '医院'){ 8 | throw new Error('鲁村卖石必须在鲁米那斯执行'); 9 | } 10 | var path = []; 11 | if(map == '鲁米那斯') 12 | { 13 | path = [ 14 | [88, 51, '杂货店'], 15 | [11, 12], 16 | ]; 17 | } 18 | else if(map == '医院') 19 | { 20 | path = [ 21 | [4, 14, '鲁米那斯'], 22 | [88, 51, '杂货店'], 23 | [11, 12], 24 | ]; 25 | } 26 | cga.walkList(path, ()=>{ 27 | cga.turnDir(0); 28 | cga.sellStone(()=>{ 29 | setTimeout(()=>{ 30 | 31 | if(cga.GetPlayerInfo().gold >= 950000) 32 | { 33 | if(cga.travel.gelaer.isSettled) 34 | { 35 | cga.LogBack(); 36 | setTimeout(()=>{ 37 | cga.travel.gelaer.toBank(()=>{ 38 | cga.AsyncWaitNPCDialog(()=>{ 39 | cga.MoveGold(900000, cga.MOVE_GOLD_TOBANK); 40 | setTimeout(cb, 1000, null); 41 | }); 42 | }); 43 | }, 1000); 44 | } 45 | else 46 | { 47 | cga.LogBack(); 48 | setTimeout(()=>{ 49 | cga.travel.falan.toBank(()=>{ 50 | cga.walkList([ 51 | [11, 8], 52 | ], ()=>{ 53 | cga.turnDir(0); 54 | cga.AsyncWaitNPCDialog(()=>{ 55 | cga.MoveGold(900000, cga.MOVE_GOLD_TOBANK); 56 | setTimeout(cb, 1000, null); 57 | }); 58 | }); 59 | }); 60 | }, 1000); 61 | } 62 | return; 63 | } 64 | 65 | cb(null); 66 | 67 | }, 3000); 68 | }); 69 | }); 70 | }, 71 | isAvailable : (map, mapindex)=>{ 72 | return (map == '鲁米那斯' || mapindex == 43610); 73 | }, 74 | translate : (pair)=>{ 75 | return false; 76 | }, 77 | loadconfig : (obj)=>{ 78 | return true; 79 | }, 80 | inputcb : (cb)=>{ 81 | cb(null); 82 | } 83 | } -------------------------------------------------------------------------------- /通用挂机脚本/公共模块/鲁村回补.js: -------------------------------------------------------------------------------- 1 | var supplyModeArray = [ 2 | { 3 | name : '鲁村普通护士回补', 4 | func : (cb)=>{ 5 | var map = cga.GetMapName(); 6 | 7 | if(map == '鲁米那斯'){ 8 | cga.travel.lumi.toHospital(()=>{ 9 | setTimeout(cb, 5000, null); 10 | }, false); 11 | } 12 | else if(map == '库鲁克斯岛'){ 13 | cga.walkList([ 14 | [322, 883, '鲁米那斯'] 15 | ], ()=>{ 16 | cga.travel.lumi.toHospital(()=>{ 17 | setTimeout(cb, 5000, null); 18 | }, false); 19 | }); 20 | } 21 | }, 22 | isLogBack : (map, mapindex)=>{ 23 | return false; 24 | }, 25 | isAvailable : (map, mapindex)=>{ 26 | return (map == '鲁米那斯' || map == '库鲁克斯岛') ? true : false; 27 | }, 28 | }, 29 | { 30 | name : '鲁村资深护士回补', 31 | func : (cb)=>{ 32 | var map = cga.GetMapName(); 33 | 34 | if(map == '鲁米那斯'){ 35 | cga.travel.lumi.toHospital(()=>{ 36 | setTimeout(cb, 5000, null); 37 | }, true); 38 | } 39 | else if(map == '库鲁克斯岛'){ 40 | cga.walkList([ 41 | [322, 883, '鲁米那斯'] 42 | ], ()=>{ 43 | cga.travel.lumi.toHospital(()=>{ 44 | setTimeout(cb, 5000, null); 45 | }, true); 46 | }); 47 | } 48 | }, 49 | isLogBack : (map, mapindex)=>{ 50 | return false; 51 | }, 52 | isAvailable : (map, mapindex)=>{ 53 | return (map == '鲁米那斯' || map == '库鲁克斯岛') ? true : false; 54 | }, 55 | }, 56 | ] 57 | 58 | var cga = global.cga; 59 | var configTable = global.configTable; 60 | 61 | var thisobj = { 62 | func : (cb)=>{ 63 | thisobj.object.func(cb); 64 | }, 65 | isLogBack : (map, mapindex)=>{ 66 | return thisobj.object.isLogBack(map, mapindex); 67 | }, 68 | isAvailable : (map, mapindex)=>{ 69 | return thisobj.object.isAvailable(map, mapindex); 70 | }, 71 | translate : (pair)=>{ 72 | if(pair.field == 'supplyMode'){ 73 | pair.field = '回补方式'; 74 | pair.value = supplyModeArray[pair.value].name; 75 | pair.translated = true; 76 | return true; 77 | } 78 | return false; 79 | }, 80 | loadconfig : (obj)=>{ 81 | for(var i in supplyModeArray){ 82 | if(i == obj.supplyMode){ 83 | configTable.supplyMode = i; 84 | thisobj.object = supplyModeArray[i]; 85 | break; 86 | } 87 | } 88 | 89 | if(!thisobj.object){ 90 | console.error('读取配置:回补方式失败!'); 91 | return false; 92 | } 93 | 94 | return true; 95 | }, 96 | inputcb : (cb)=>{ 97 | var sayString = '【鲁村插件】请选择回补方式:'; 98 | for(var i in supplyModeArray){ 99 | if(i != 0) 100 | sayString += ', '; 101 | sayString += '('+ (parseInt(i)+1) + ')' + supplyModeArray[i].name; 102 | } 103 | cga.sayLongWords(sayString, 0, 3, 1); 104 | cga.waitForChatInput((msg, index)=>{ 105 | if(index !== null && index >= 1 && supplyModeArray[index - 1]){ 106 | configTable.supplyMode = index - 1; 107 | thisobj.object = supplyModeArray[index - 1]; 108 | 109 | var sayString2 = '当前已选择:[' + thisobj.object.name + ']。'; 110 | cga.sayLongWords(sayString2, 0, 3, 1); 111 | 112 | cb(null); 113 | 114 | return false; 115 | } 116 | 117 | return true; 118 | }); 119 | } 120 | } 121 | 122 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/子插件/买封印卡.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | const buyFilter = (eq) => { 5 | if (eq.type == 40 && eq.assessed == true) { 6 | return true; 7 | } 8 | return false; 9 | } 10 | 11 | const buyLoop = (cb)=>{ 12 | cga.turnDir(0); 13 | cga.AsyncWaitNPCDialog(()=>{ 14 | cga.ClickNPCDialog(0, 0); 15 | cga.AsyncWaitNPCDialog((err, dlg)=>{ 16 | 17 | var store = cga.parseBuyStoreMsg(dlg); 18 | if(!store) 19 | { 20 | cb(new Error('商店内容解析失败')); 21 | return; 22 | } 23 | 24 | var buyitem = []; 25 | var buyCount = 0; 26 | var emptySlotCount = cga.getInventoryEmptySlotCount(); 27 | 28 | store.items.forEach((it)=>{ 29 | if(it.name.indexOf('封印卡') >= 0 && buyCount < emptySlotCount){ 30 | buyitem.push({index: it.index, count:20}); 31 | buyCount ++; 32 | } 33 | }); 34 | if(!buyitem.length) 35 | { 36 | cb(new Error('商店没有封印卡出售,可能已被买完或者背包没空间')); 37 | return; 38 | } 39 | 40 | cga.BuyNPCStore(buyitem); 41 | cga.AsyncWaitNPCDialog((err, dlg)=>{ 42 | if(dlg && dlg.message.indexOf('谢谢') >= 0){ 43 | cb(null); 44 | return; 45 | } 46 | else 47 | { 48 | cb(new Error('购买失败,可能钱不够或物品栏没有空位!')); 49 | return; 50 | } 51 | }); 52 | }); 53 | }); 54 | } 55 | 56 | var thisobj = { 57 | prepare : (cb)=>{ 58 | var items = cga.getInventoryItems().filter(buyFilter); 59 | if(items.length){ 60 | cb(null); 61 | return; 62 | } 63 | 64 | if(cga.getTeamPlayers().length){ 65 | cga.DoRequest(cga.REQUEST_TYPE_LEAVETEAM); 66 | setTimeout(thisobj.prepare, 1000, cb); 67 | return; 68 | } 69 | 70 | var buy = buyLoop; 71 | 72 | var map = cga.GetMapName(); 73 | var mapindex = cga.GetMapIndex().index3; 74 | if(map == '圣骑士营地'){ 75 | cga.walkList([ 76 | [92, 118, '商店'], 77 | [14, 26], 78 | ], ()=>{ 79 | buy(()=>{ 80 | cga.travel.falan.toCamp(cb); 81 | }); 82 | }); 83 | } else if(mapindex == 44692){ 84 | cga.walkList([ 85 | [0, 20, '圣骑士营地'], 86 | [92, 118, '商店'], 87 | [14, 26], 88 | ], ()=>{ 89 | buy(()=>{ 90 | cga.travel.falan.toCamp(cb); 91 | }); 92 | }); 93 | } else if(mapindex == 44693){ 94 | cga.walkList([ 95 | [30, 37, '圣骑士营地'], 96 | [92, 118, '商店'], 97 | [14, 26], 98 | ], ()=>{ 99 | buy(()=>{ 100 | cga.travel.falan.toCamp(cb); 101 | }); 102 | }); 103 | } else if(mapindex == 44698){ 104 | cga.walkList([ 105 | [3, 23, '圣骑士营地'], 106 | [92, 118, '商店'], 107 | [14, 26], 108 | ], ()=>{ 109 | buy(()=>{ 110 | cga.travel.falan.toCamp(cb); 111 | }); 112 | }); 113 | } else if(mapindex == 44699){ 114 | cga.walkList([ 115 | [14, 26], 116 | ], ()=>{ 117 | buy(()=>{ 118 | cga.travel.falan.toCamp(cb); 119 | }); 120 | }); 121 | } else { 122 | cga.travel.falan.toCrystalStore(()=>{ 123 | cga.walkList([ 124 | [17, 18] 125 | ], ()=>{ 126 | buy(()=>{ 127 | cga.walkList([ 128 | [3, 13, '法兰城'], 129 | ], cb); 130 | }); 131 | }); 132 | }); 133 | } 134 | }, 135 | loadconfig : (obj, cb)=>{ 136 | return true; 137 | }, 138 | inputcb : (cb)=>{ 139 | cb(null); 140 | } 141 | }; 142 | 143 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/子插件/包满回补.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var thisobj = { 5 | muteUntil : 0, 6 | mute : 15, 7 | think : (ctx)=>{ 8 | if(ctx.inventory.length >= 20) 9 | { 10 | var curTime = new Date().getTime(); 11 | if(curTime >= thisobj.muteUntil){ 12 | cga.SayWords('包满需要回补!', 0, 3, 1); 13 | thisobj.muteUntil = curTime + 1000 * thisobj.mute; 14 | } 15 | ctx.result = 'supply'; 16 | ctx.reason = '包满回补'; 17 | } 18 | }, 19 | loadconfig : (obj, cb)=>{ 20 | return true; 21 | }, 22 | inputcb : (cb)=>{ 23 | cb(null); 24 | } 25 | }; 26 | 27 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/子插件/受伤医院治疗.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var thisobj = { 5 | prepare : (cb)=>{ 6 | if(!cga.needDoctor()){ 7 | cb(null); 8 | return; 9 | } 10 | 11 | if(cga.getTeamPlayers().length){ 12 | cga.DoRequest(cga.REQUEST_TYPE_LEAVETEAM); 13 | setTimeout(thisobj.prepare, 1000, cb); 14 | return; 15 | } 16 | 17 | cga.travel.falan.toStone('E2', ()=>{ 18 | cga.walkList([ 19 | [221, 83, '医院'], 20 | [12, 18], 21 | ], ()=>{ 22 | cga.TurnTo(10, 18); 23 | cga.AsyncWaitNPCDialog(()=>{ 24 | cga.ClickNPCDialog(0, 6); 25 | cga.AsyncWaitNPCDialog((err, dlg)=>{ 26 | if(dlg.message.indexOf('不够') >= 0){ 27 | throw '受伤治疗钱不够!'; 28 | } 29 | 30 | cb(null); 31 | }); 32 | }); 33 | }); 34 | }); 35 | }, 36 | think : (ctx)=>{ 37 | if(cga.needDoctor()) 38 | { 39 | ctx.result = 'logback_forced'; 40 | ctx.reason = '受伤医院治疗'; 41 | } 42 | }, 43 | loadconfig : (obj, cb)=>{ 44 | return true; 45 | }, 46 | inputcb : (cb)=>{ 47 | cb(null); 48 | } 49 | }; 50 | 51 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/子插件/受伤飞碟治疗.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var thisobj = { 5 | prepare : (cb)=>{ 6 | if(cga.GetPlayerInfo().health == 0){ 7 | cb(null); 8 | return; 9 | } 10 | 11 | if(cga.getTeamPlayers().length){ 12 | cga.DoRequest(cga.REQUEST_TYPE_LEAVETEAM); 13 | setTimeout(thisobj.prepare, 1000, cb); 14 | return; 15 | } 16 | 17 | var retry = ()=>{ 18 | 19 | if(cga.GetPlayerInfo().health == 0){ 20 | 21 | if(cga.getTeamPlayers().length > 0){ 22 | cga.DoRequest(cga.REQUEST_TYPE_LEAVETEAM); 23 | setTimeout(cb, 1500, null); 24 | return; 25 | } 26 | 27 | cb(null); 28 | return; 29 | } 30 | 31 | var doctor = cga.findPlayerUnit((u)=>{ 32 | if((u.injury & 2) == 2 && u.icon == 13)//检测头上的打针图标 33 | return true; 34 | 35 | return ['实习医师','医师','资深医师','御医','超级医生','神医'].find((n)=>{ 36 | return n == u.title_name; 37 | }) == undefined ? false : true; 38 | }); 39 | 40 | if(doctor && cga.getTeamPlayers().length == 0){ 41 | var target = cga.getRandomSpace(doctor.xpos,doctor.ypos); 42 | cga.walkList([ 43 | target 44 | ], ()=>{ 45 | cga.addTeammate(doctor.unit_name, (r)=>{ 46 | setTimeout(retry, 1500); 47 | }) 48 | }); 49 | } else { 50 | setTimeout(retry, 1500); 51 | } 52 | } 53 | 54 | cga.travel.falan.toStone('C', ()=>{ 55 | cga.walkList([ 56 | [27, 82], 57 | ], retry); 58 | }); 59 | }, 60 | think : (ctx)=>{ 61 | if(cga.GetPlayerInfo().health != 0) 62 | { 63 | ctx.result = 'logback_forced'; 64 | ctx.reason = '受伤飞碟治疗'; 65 | } 66 | }, 67 | loadconfig : (obj, cb)=>{ 68 | return true; 69 | }, 70 | inputcb : (cb)=>{ 71 | cb(null); 72 | } 73 | }; 74 | 75 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/子插件/工房修理装备.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | const repairFilter = (eq) => { 5 | if (eq.type >= 0 && eq.type <= 14 && eq.level <= 10) { 6 | const durability = cga.getEquipEndurance(eq); 7 | return durability && durability[0] < durability[1] && 8 | ( 9 | parseFloat(durability[0])/parseFloat(durability[1]) < 0.75 || durability[0] <= 30 10 | ) 11 | ; 12 | } 13 | return false; 14 | } 15 | 16 | const repairFilterWeapon = (eq) => { 17 | if (eq.type >= 0 && eq.type <= 6 && eq.level <= 10) { 18 | const durability = cga.getEquipEndurance(eq); 19 | return durability && durability[0] < durability[1] && 20 | ( 21 | parseFloat(durability[0])/parseFloat(durability[1]) < 0.75 || durability[0] <= 30 22 | ) 23 | ; 24 | } 25 | return false; 26 | } 27 | 28 | const repairFilterArmor = (eq) => { 29 | if (eq.type >= 7 && eq.type <= 14 && eq.level <= 10) { 30 | const durability = cga.getEquipEndurance(eq); 31 | return durability && durability[0] < durability[1] && 32 | ( 33 | parseFloat(durability[0])/parseFloat(durability[1]) < 0.75 || durability[0] <= 30 34 | ) 35 | ; 36 | } 37 | return false; 38 | } 39 | 40 | const putdownEquipments = (cb)=>{ 41 | var items = cga.getEquipItems().filter(repairFilter); 42 | if(items.length){ 43 | var emptyslot = cga.findInventoryEmptySlot(); 44 | if(emptyslot == -1){ 45 | cb(new Error('物品栏没有空位')); 46 | return; 47 | } 48 | cga.MoveItem(items[0].pos, emptyslot, -1) 49 | setTimeout(putdownEquipments, 1000, cb); 50 | return; 51 | } 52 | 53 | setTimeout(cb, 1000); 54 | } 55 | 56 | const putupEquipments = (equipped, cb)=>{ 57 | var currentEquip = cga.getEquipItems(); 58 | var item = cga.getInventoryItems().find((eq)=>{ 59 | return equipped.find((eq2)=>{ 60 | return eq2.name == eq.name; 61 | }) != undefined && currentEquip.find((eq2)=>{ 62 | return eq2.name == eq.name; 63 | }) == undefined; 64 | }); 65 | 66 | if(item != undefined){ 67 | cga.UseItem(item.pos) 68 | setTimeout(putupEquipments, 1000, equipped, cb); 69 | return; 70 | } 71 | 72 | setTimeout(cb, 1000); 73 | } 74 | 75 | const repairLoop = (needRepair, cb)=>{ 76 | cga.turnTo(6, 7); 77 | cga.AsyncWaitNPCDialog(()=>{ 78 | cga.SellNPCStore(needRepair); 79 | cga.AsyncWaitNPCDialog(()=>{ 80 | cb(null); 81 | }); 82 | }); 83 | } 84 | 85 | var thisobj = { 86 | prepare : (cb)=>{ 87 | var items = cga.getEquipItems().filter(repairFilter); 88 | if(!items.length){ 89 | cb(null); 90 | return; 91 | } 92 | 93 | if(cga.getTeamPlayers().length){ 94 | cga.DoRequest(cga.REQUEST_TYPE_LEAVETEAM); 95 | setTimeout(thisobj.prepare, 1000, cb); 96 | return; 97 | } 98 | 99 | cga.travel.falan.toMineStore(null, ()=>{ 100 | cga.walkList([ 101 | [8, 9], 102 | ], (r)=>{ 103 | var equipped = cga.getEquipItems(); 104 | putdownEquipments(()=>{ 105 | 106 | var needRepair = []; 107 | 108 | cga.getInventoryItems().filter((item)=>{ 109 | if(repairFilter(item)){ 110 | needRepair.push({ 111 | itemid : item.itemid, 112 | itempos : item.pos, 113 | count : 1 114 | }); 115 | } 116 | }); 117 | 118 | repairLoop(needRepair, ()=>{ 119 | putupEquipments(equipped, ()=>{ 120 | cb(null); 121 | }); 122 | }); 123 | }); 124 | }); 125 | }); 126 | }, 127 | loadconfig : (obj, cb)=>{ 128 | return true; 129 | }, 130 | inputcb : (cb)=>{ 131 | cb(null); 132 | } 133 | }; 134 | 135 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/子插件/打卡.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var thisobj = { 5 | prepare : (cb)=>{ 6 | 7 | var playerinfo = cga.GetPlayerInfo(); 8 | if(!(playerinfo.punchclock > 0 && !playerinfo.usingpunchclock)){ 9 | cb(null); 10 | return; 11 | } 12 | 13 | if(cga.getTeamPlayers().length){ 14 | cga.DoRequest(cga.REQUEST_TYPE_LEAVETEAM); 15 | setTimeout(thisobj.prepare, 1000, cb); 16 | return; 17 | } 18 | 19 | var mapname = cga.GetMapName(); 20 | if(mapname == '法兰城') 21 | { 22 | cga.travel.falan.toStone('W1', ()=>{ 23 | cga.walkList([ 24 | [73, 60, '职业公会'], 25 | [11, 10], 26 | ], ()=>{ 27 | cga.TurnTo(11, 8); 28 | cga.AsyncWaitNPCDialog((err, dlg)=>{ 29 | if(dlg.options == 12){ 30 | cga.ClickNPCDialog(4, -1); 31 | cga.AsyncWaitNPCDialog(()=>{ 32 | cga.walkList([ 33 | [9, 24, '法兰城'], 34 | [63, 79], 35 | ], cb); 36 | }); 37 | } else { 38 | cb(new Error('没有卡时,无法打卡')); 39 | } 40 | }); 41 | }) 42 | }); 43 | return 44 | } 45 | 46 | cga.travel.falan.toCastleClock((r)=>{ 47 | cb(null); 48 | }); 49 | }, 50 | loadconfig : (obj, cb)=>{ 51 | return true; 52 | }, 53 | inputcb : (cb)=>{ 54 | cb(null); 55 | } 56 | }; 57 | 58 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/子插件/换龙角.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var openbox = ()=>{ 5 | var box = cga.findItem('加强补给品'); 6 | if(box != -1){ 7 | cga.AsyncWaitNPCDialog(()=>{ 8 | cga.ClickNPCDialog(4, 0); 9 | setTimeout(openbox, 1500); 10 | }); 11 | cga.UseItem(box); 12 | } 13 | } 14 | 15 | var waitArray = [ 16 | { 17 | mapname:'肯吉罗岛', 18 | pos:[475, 208], 19 | cb : ()=>{ 20 | if(cga.getItemCount('龙角') >= 30){ 21 | cga.TurnTo(475, 208); 22 | cga.AsyncWaitNPCDialog((err, dlg)=>{ 23 | if(dlg && dlg.message.indexOf('非常好') >= 0){ 24 | cga.ClickNPCDialog(32, 0); 25 | cga.AsyncWaitNPCDialog(()=>{ 26 | cga.ClickNPCDialog(1, 0); 27 | }); 28 | } 29 | else if(dlg && dlg.message.indexOf('滚开') >= 0){ 30 | openbox(); 31 | } 32 | else if(dlg && dlg.message.indexOf('新的增援') >= 0){ 33 | cga.ClickNPCDialog(32, 0); 34 | cga.AsyncWaitNPCDialog(()=>{ 35 | cga.ClickNPCDialog(32, 0); 36 | cga.AsyncWaitNPCDialog(()=>{ 37 | cga.ClickNPCDialog(32, 0); 38 | cga.AsyncWaitNPCDialog(()=>{ 39 | cga.ClickNPCDialog(1, 0); 40 | 41 | }); 42 | }); 43 | }); 44 | } 45 | else if(dlg && dlg.message.indexOf('哦?不错') >= 0){ 46 | cga.ClickNPCDialog(32, 0); 47 | cga.AsyncWaitNPCDialog(()=>{ 48 | cga.ClickNPCDialog(1, 0); 49 | }); 50 | } 51 | }); 52 | } 53 | else if(cga.getItemCount('加强补给品') > 0); 54 | { 55 | openbox(); 56 | } 57 | 58 | setTimeout(cga.waitForMultipleLocation, 5000, waitArray); 59 | return true; 60 | } 61 | } 62 | ]; 63 | 64 | module.exports = { 65 | init : ()=>{ 66 | cga.waitForMultipleLocation(waitArray); 67 | }, 68 | loadconfig : (obj, cb)=>{ 69 | return true; 70 | }, 71 | inputcb : (cb)=>{ 72 | cb(null); 73 | } 74 | }; -------------------------------------------------------------------------------- /通用挂机脚本/子插件/掉魂自动招魂.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var thisobj = { 5 | prepare : (cb)=>{ 6 | if(cga.GetPlayerInfo().souls == 0){ 7 | cb(null); 8 | return; 9 | } 10 | 11 | if(cga.getTeamPlayers().length){ 12 | cga.DoRequest(cga.REQUEST_TYPE_LEAVETEAM); 13 | setTimeout(thisobj.prepare, 1000, cb); 14 | return; 15 | } 16 | 17 | cga.travel.falan.toStone('C', ()=>{ 18 | cga.walkList([ 19 | [41, 14, '法兰城'], 20 | [153, 29, '大圣堂的入口'], 21 | [14, 7, '礼拜堂'], 22 | [12, 19], 23 | ], ()=>{ 24 | cga.TurnTo(12, 17); 25 | cga.AsyncWaitNPCDialog((err, dlg)=>{ 26 | if(dlg.message && dlg.message.indexOf('我将为你取回') >= 0) 27 | { 28 | cga.ClickNPCDialog(4, 0); 29 | cga.AsyncWaitNPCDialog((err, dlg)=>{ 30 | if(dlg.message && dlg.message.indexOf('不够') >= 0){ 31 | throw new Error('招魂钱不够!'); 32 | } 33 | 34 | cb(null); 35 | }); 36 | } 37 | else 38 | { 39 | cb(null); 40 | } 41 | }); 42 | }); 43 | }); 44 | }, 45 | think : (ctx)=>{ 46 | if(cga.GetPlayerInfo().souls != 0) 47 | { 48 | ctx.result = 'logback_forced'; 49 | ctx.reason = '掉魂自动招魂'; 50 | } 51 | }, 52 | loadconfig : (obj, cb)=>{ 53 | return true; 54 | }, 55 | inputcb : (cb)=>{ 56 | cb(null); 57 | } 58 | }; 59 | 60 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/子插件/监听回补.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | var callsupply = false; 4 | 5 | module.exports = { 6 | prepare : (cb)=>{ 7 | if(callsupply){ 8 | console.log('已经回补,强制取消回补状态') 9 | callsupply = false; 10 | } 11 | cb(null); 12 | }, 13 | init : ()=>{ 14 | cga.waitTeammateSay((player, msg)=>{ 15 | 16 | if(msg.indexOf('需要回补') >= 0 && global.getMainPlugin().getDangerLevel() > 0){ 17 | callsupply = true; 18 | } 19 | 20 | return true; 21 | }); 22 | }, 23 | think : (ctx)=>{ 24 | if(callsupply) 25 | { 26 | if(global.getMainPlugin().getDangerLevel() > 0) 27 | { 28 | callsupply = false; 29 | ctx.result = 'supply'; 30 | ctx.reason = '监听回补'; 31 | } 32 | else 33 | { 34 | console.log('不在危险区域,强制取消回补状态') 35 | callsupply = false; 36 | } 37 | } 38 | }, 39 | loadconfig : (obj, cb)=>{ 40 | return true; 41 | }, 42 | inputcb : (cb)=>{ 43 | cb(null); 44 | } 45 | }; -------------------------------------------------------------------------------- /通用挂机脚本/子插件/监听防沉迷.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | var callsupply = false; 4 | 5 | module.exports = { 6 | prepare : (cb)=>{ 7 | cb(null); 8 | }, 9 | init : ()=>{ 10 | cga.waitSysMsg((msg)=>{ 11 | 12 | if(msg.indexOf('您已经进入疲劳游戏时间') >= 0 || msg.indexOf('您已进入不健康游戏时间') >= 0){ 13 | cga.LogOut(); 14 | } 15 | 16 | return true; 17 | }); 18 | }, 19 | loadconfig : (obj, cb)=>{ 20 | return true; 21 | }, 22 | inputcb : (cb)=>{ 23 | cb(null); 24 | } 25 | }; -------------------------------------------------------------------------------- /通用挂机脚本/子插件/自动换线.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var thisobj = { 5 | prepare : (cb)=>{ 6 | if(cga.IsInGame()) 7 | { 8 | if(thisobj.serverIndex != undefined && thisobj.serverIndex != cga.GetMapIndex().index2)//初始线路不等于当前线路,则修改线路并登出 9 | { 10 | console.log('当前线路与设定不一致,修改线路!'); 11 | console.log('当前线路:'+cga.GetMapIndex().index2+'线'); 12 | console.log('预期线路:'+thisobj.serverIndex+'线'); 13 | cga.gui.LoadAccount({ 14 | server : thisobj.serverIndex, 15 | }, (err, result)=>{ 16 | //登出并换线 17 | console.log('登出!'); 18 | cga.LogOut(); 19 | }) 20 | } 21 | } 22 | cb(null); 23 | }, 24 | translate : (pair)=>{ 25 | 26 | if(pair.field == 'serverIndex'){ 27 | pair.field = '服务器线路'; 28 | pair.value = pair.value; 29 | pair.translated = true; 30 | return true; 31 | } 32 | 33 | return false; 34 | }, 35 | loadconfig : (obj, cb)=>{ 36 | if(obj.serverIndex >= 1 && obj.serverIndex <= 10) 37 | { 38 | thisobj.serverIndex = obj.serverIndex; 39 | configTable.serverIndex = obj.serverIndex; 40 | } 41 | if(thisobj.serverIndex === undefined){ 42 | console.error('读取配置:服务器线路失败!'); 43 | return false; 44 | } 45 | 46 | return true; 47 | }, 48 | inputcb : (cb)=>{ 49 | var sayString = '【自动换线】请选择使用的服务器线路(1~10,0代表当前线路):'; 50 | cga.sayLongWords(sayString, 0, 3, 1); 51 | cga.waitForChatInput((msg, index)=>{ 52 | if(index !== null && index >= 0 && index <= 10){ 53 | if(index == 0) 54 | index = cga.GetMapIndex().index2; 55 | 56 | configTable.serverIndex = index; 57 | thisobj.serverIndex = index; 58 | 59 | var sayString2 = '当前已选择:[' + thisobj.serverIndex + ']线。'; 60 | cga.sayLongWords(sayString2, 0, 3, 1); 61 | 62 | cb(null); 63 | 64 | return false; 65 | } 66 | 67 | return true; 68 | }); 69 | } 70 | }; 71 | 72 | module.exports = thisobj; -------------------------------------------------------------------------------- /通用挂机脚本/子插件/说话防掉线.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | var callsupply = false; 4 | 5 | var timer = ()=>{ 6 | cga.SayWords('', 0, 3, 1); 7 | 8 | setTimeout(timer, 60000); 9 | } 10 | 11 | module.exports = { 12 | init : ()=>{ 13 | setTimeout(timer, 60000); 14 | }, 15 | loadconfig : (obj, cb)=>{ 16 | return true; 17 | }, 18 | inputcb : (cb)=>{ 19 | cb(null); 20 | } 21 | }; -------------------------------------------------------------------------------- /通用挂机脚本/子插件/队员卖石.js: -------------------------------------------------------------------------------- 1 | var cga = global.cga; 2 | var configTable = global.configTable; 3 | 4 | var waitArray = [ 5 | { 6 | mapname:'工房', 7 | pos:[21, 23], 8 | cb : ()=>{ 9 | if(cga.isTeamLeaderEx()) 10 | return false; 11 | 12 | cga.TurnTo(21, 23); 13 | cga.sellStone(function(){ 14 | cga.SayWords('卖石完毕...', 0, 3, 1); 15 | setTimeout(cga.waitForMultipleLocation, 5000, waitArray); 16 | }); 17 | return true; 18 | } 19 | }, 20 | { 21 | mapname:'矮人城镇', 22 | pos:[122, 110], 23 | cb : ()=>{ 24 | if(cga.isTeamLeaderEx()) 25 | return false; 26 | 27 | cga.TurnTo(122, 110); 28 | cga.sellStone(function(){ 29 | cga.SayWords('卖石完毕...', 0, 3, 1); 30 | setTimeout(cga.waitForMultipleLocation, 5000, waitArray); 31 | }); 32 | return true; 33 | } 34 | }, 35 | { 36 | mapname:'里谢里雅堡', 37 | pos:[30, 77], 38 | cb : ()=>{ 39 | if(cga.isTeamLeaderEx()) 40 | return false; 41 | 42 | cga.TurnTo(30, 77); 43 | cga.sellStone(function(){ 44 | cga.SayWords('卖石完毕...', 0, 3, 1); 45 | setTimeout(cga.waitForMultipleLocation, 5000, waitArray); 46 | }); 47 | return true; 48 | } 49 | } 50 | ]; 51 | 52 | module.exports = { 53 | init : ()=>{ 54 | cga.waitForMultipleLocation(waitArray); 55 | }, 56 | loadconfig : (obj, cb)=>{ 57 | return true; 58 | }, 59 | inputcb : (cb)=>{ 60 | cb(null); 61 | } 62 | }; -------------------------------------------------------------------------------- /飞碟摆摊治疗.js: -------------------------------------------------------------------------------- 1 | var cga = require(process.env.CGA_DIR_PATH_UTF8+'/cgaapi')(function(){ 2 | 3 | var originalPos = cga.GetMapXY(); 4 | var originalDir = cga.GetPlayerInfo().direction; 5 | 6 | if(cga.GetMapName() != '里谢里雅堡') 7 | { 8 | console.error('提示:飞碟摆摊只能在里谢里雅堡使用!'); 9 | } 10 | 11 | var skill = cga.findPlayerSkill('治疗'); 12 | 13 | if(!skill) 14 | { 15 | console.error('提示:没有治疗技能!'); 16 | } 17 | 18 | var loop = ()=>{ 19 | 20 | if(skill) 21 | { 22 | var requiremp = 25 + skill.lv * 5; 23 | 24 | //补魔 25 | if (cga.GetPlayerInfo().mp < requiremp){ 26 | cga.walkList([ 27 | [34, 89], 28 | ], ()=>{ 29 | cga.turnTo(35, 88); 30 | setTimeout(()=>{ 31 | cga.walkList([ 32 | [originalPos.x, originalPos.y], 33 | ], ()=>{ 34 | cga.turnDir(originalDir); 35 | loop(); 36 | }); 37 | }, 3000); 38 | }) 39 | 40 | return; 41 | } 42 | } 43 | //寻找队伍里带拐杖的玩家 44 | 45 | var teamplayers = cga.getTeamPlayers(); 46 | 47 | var index = -1; 48 | 49 | for(var i in teamplayers){ 50 | if(teamplayers[i].injury){ 51 | index = i; 52 | break; 53 | } 54 | } 55 | 56 | //找到了 57 | if(skill && index != -1) 58 | { 59 | cga.StartWork(skill.index, skill.lv-1); 60 | cga.AsyncWaitPlayerMenu((err, players)=>{ 61 | 62 | if(players){ 63 | for(var i in players){ 64 | if(players[i].name == teamplayers[index].name){ 65 | 66 | cga.AsyncWaitUnitMenu((err, units)=>{ 67 | cga.AsyncWaitWorkingResult(()=>{ 68 | loop(); 69 | }); 70 | cga.UnitMenuSelect(0); 71 | }); 72 | cga.PlayerMenuSelect(i); 73 | break; 74 | } 75 | } 76 | return; 77 | } 78 | 79 | setTimeout(loop, 1000); 80 | }); 81 | return; 82 | } 83 | 84 | //说话防掉线 85 | cga.SayWords('', 0, 3, 1); 86 | setTimeout(loop, 1000); 87 | } 88 | 89 | loop(); 90 | }); -------------------------------------------------------------------------------- /高速遇敌.js: -------------------------------------------------------------------------------- 1 | var cga = require(process.env.CGA_DIR_PATH_UTF8+'/cgaapi')(function(){ 2 | var xy = cga.GetMapXY(); 3 | var dir = cga.getRandomSpaceDir(xy.x, xy.y); 4 | cga.freqMove(dir); 5 | }); --------------------------------------------------------------------------------