![]() |
|
|
#10 |
|
中级会员
![]() ![]() ![]() ![]() ![]() ![]()
注册: 08年07月03日
帖子: 139
声望力: 19
声望:
14
![]() 现金:104两梁山币
资产:304两梁山币
致谢数: 0
获感谢文章数:0
获会员感谢数:0 |
回复: MUSH417 xlqy各门派综合机器人
function OnNtFightWho() g_nt_fight_who = g_nt_fight_who + 1 if g_nt_fight_who > 5 then g_nt_fight_who = 0 EnableTriggerGroup("pfm", false) EnableTriggerGroup("nt_find", false) EnableTriggerGroup("nt_fight", false) EnableTriggerGroup("renwu_end", false) GoDzRightnow() else if g_nt_bian == false then cmdSender:Add("@5;fight "..guai_id) end end end function pfm() --if yy_fire == true then -- cmdSender:Add("zscast2") --end target_id = guai_id g_dzing = false --g_pfm() g_pfmwhat = g_pfm if cmdSender:Len() == 0 then cmdSender:Add("exert") end end function hbpfm() --if yy_fire == true then -- cmdSender:Add("zscast2") --end target_id = "robber" g_dzing = false g_pfmwhat = g_pfm if cmdSender:Len() == 0 then cmdSender:Add("exert") end end function OnExert() if g_pfmwhat ~= nil then g_pfmwhat() end end function nt_pfm() --if yy_fire == true then -- cmdSender:Add("zscast2") --end target_id = guai_id g_dzing = false --g_nt_pfm() g_pfmwhat = g_nt_pfm if cmdSender:Len() == 0 then cmdSender:Add("exert") end end function OnFollowGuai(name, output, wildcards) local tmp = wildcards[1] guaimiss = 0 g_findtime = 1 cmdSender:Add("#w- ") if tmp == guai_name and renwu ~= "护镖" then cmdSender:Add("hp") if renwu == "叛将" then cmdSender:Add("{;enforce max;enchant max;wear all;}") else cmdSender:Add("enforce max;enchant max;wear all") end EnableTriggerGroup("find",false) EnableTriggerGroup("follow",false) EnableTriggerGroup("pfm", true) EnableTriggerGroup("renwu_end",true) if renwu == "NT" then g_findtime = 0 --AppendToNotepad(myid.."_log", os.date("%X").."找到NT怪\r\n") EnableTriggerGroup("follow",false) EnableTriggerGroup("autokillnpc",true) cmdSender:Add("#t- follow;#t+ autokillnpc;look;kill yao guai") else pfm() EnableTimer("pfm", true) ResetTimer("pfm") end end end function GoDzRightnow() InitTimer() InitTrigger() EnableTriggerGroup("fly", true) g_FlyTo="stone" g_dzing=true g_in_renwu = false g_AfterFly="hp;i;score;@20;tuo armor;set no_teach dz"; if (mp == "将军府") then g_AfterFly = g_AfterFly..";l magic box" end g_AfterCastEsc="fly stone" EnableTriggerGroup("dz",true) EnableTriggerGroup("fly",true) cmdSender:Add("surrender;ec;ef;fly stone") end function GoDz() InitTimer() InitTrigger() EnableTriggerGroup("fly", true) g_FlyTo="stone" g_dzing=true g_in_renwu = false g_AfterFly="hp;i;score;@20;tuo armor;set no_teach dz"; if (mp == "将军府") then g_AfterFly = g_AfterFly..";l magic box" end g_AfterCastEsc="fly stone" EnableTriggerGroup("dz",true) EnableTriggerGroup("fly",true) cmdSender:Add("surrender;ec;ef;fly stone") end function OnHereNoGuaiId(name, output, wildcards) local tid = wildcards[1] if tid == guai_id then guaimiss = guaimiss + 1 if guaimiss > 3 then if renwu == "李靖" then cmdSender:Add("kquest") return end if renwu == "NT" then --renwu = "NT完成" OnRenwuEnd() return end if renwu == "门派" then renwu = "门派完成" OnRenwuEnd() return end if renwu == "逃犯" then renwu = "逃犯完成" OnRenwuEnd() end if renwu == "叛将" then InitTrigger() EnableTriggerGroup("renwu_end",false) EnableTriggerGroup("pfm", false) EnableTriggerGroup("nt_find", false) EnableTriggerGroup("nt_fight", false) EnableTimer("nt_pfm", false) EnableTimer("pfm", false) cmdSender:Clear() cmdSender:Add(g_unwield_all) g_FlyTo = "changan" g_AfterFly = "@20;set no_teach dowhat" EnableTriggerGroup("fly", true) cmdSender:Add("i;hp;score;surrender;ec;ef;fly changan") return end renwu = "任务完成" OnRenwuEnd() end end end function OnLijingKilled() if renwu == "李靖" then renwu = "李靖完成" g_li_success = g_li_success + 1 UpdateStatus() OnRenwuEnd() end end function OnMpKilled() if renwu == "门派" then renwu = "门派完成" OnRenwuEnd() end end --function OnCheckLijingKilled() -- renwu = "李靖完成" -- OnRenwuEnd() --EnableTriggerGroup("pfm",false) --EnableTimer("pfm", false) --cmdSender:Add("@10;kquest") --end function OnCheckArmor() if (g_checkset == 1 ) then armor = armor + 1 end end --四百八十三文钱 (coin) --六百三十四两银子 (silver) --一千一百三十八两黄金 (gold) --避水咒 (bishui zhou) --【大雪山地图】 (xueshan map) --〖东海仙山图〗 (eastsea map) digit_map = { ["一"] = 1, ["二"] = 2, ["三"] = 3, ["四"] = 4, ["五"] = 5, ["六"] = 6, ["七"] = 7, ["八"] = 8, ["九"] = 9, ["十"] = 10, ["零"] = 0, } -- 超过一万就返回10000 function chinese_to_number(chinese_str) local qian = 0 local bai = 0 local shi = 0 local ge = 0 --Note(chinese_str) if string.find(chinese_str, "万") then return 10000 else t1,t2 = string.find(chinese_str, "千") if t1 ~= nil and t2 ~= nil then if t1 == 1 then qian = 0 else qian = digit_map[string.sub(chinese_str, t1-2, t1 - 1)] end end t1,t2 = string.find(chinese_str, "百") if t1 ~= nil and t2 ~= nil then if t1 == 1 then bai = 0 else bai = digit_map[string.sub(chinese_str, t1 -2 , t1 - 1)] end end t1,t2 = string.find(chinese_str, "十") if t1 ~= nil and t2 ~= nil then if t1 == 1 then shi = 1 else shi = digit_map[string.sub(chinese_str, t1 -2 , t1 - 1)] end if t2 == chinese_str:len() then ge = 0 else ge = digit_map[string.sub(chinese_str, t2 + 1 , t2 + 2)] end else t1,t2 = string.find(chinese_str, "零") if t1 ~= nil and t2 ~= nil then ge = digit_map[string.sub(chinese_str, t2 + 1, t2 + 2)] else ge = digit_map[chinese_str] end end if qian == nil then qian = 0 end if bai == nil then bai = 0 end if shi == nil then shi = 0 end if ge == nil then ge = 0 end --Note(qian.."千") --Note(bai.."百") --Note(shi.."十") --Note(ge.."个") --Note(qian * 1000 + bai * 100 + shi * 10 + ge) return (qian * 1000 + bai * 100 + shi * 10 + ge) end end function OnCheckBagStart() EnableTriggerGroup("checkbag", true) g_needsword = true g_needaxe = true g_sealcounts = 0 end function OnCheckBagEnd() if g_needsword then Note("sword:no") else Note("sword:yes") end Note("seal:"..g_sealcounts) EnableTriggerGroup("checkbag", false) end function OnCheckBag(name, output, wildcards) if wildcards[2] == "Sword" or wildcards[2] == "sword" then g_needsword = false return end if wildcards[2] == "Lumber axe" or wildcards[2] == "lumber axe" then g_needaxe = false return end if wildcards[2] == "Paper seal" then g_sealcounts = chinese_to_number(string.gsub(wildcards[1], "张桃符纸", "")) return end end -- \s+(\S+) \((coin|silver|gold|xueshan map|eastsea map)\)$ function OnCheckOtherSets(name, output, wildcards) if g_checkset == 1 then if wildcards[2] == "bishui zhou" then g_bishuizhou = 1 return end if wildcards[2] == "xueshan map" then g_map_xueshan = 1 return end if wildcards[2] == "magic box" then g_needbag = false return end if wildcards[2] == "eastsea map" then g_map_penglai = 1 return end if wildcards[2] == "Lumber axe" then g_needaxe = false return end if wildcards[2] == "rose" then g_rose = chinese_to_number(string.gsub(wildcards[1], "朵野蔷薇", "")) return end if wildcards[2] == "gold" then g_gold = chinese_to_number(string.gsub(wildcards[1], "两黄金", "")) return end if wildcards[2] == "silver" then g_silver = chinese_to_number(string.gsub(wildcards[1], "两银子", "")) end if wildcards[2] == "coin" then g_coin = chinese_to_number(string.gsub(wildcards[1], "文钱", "")) return end if wildcards[2] == "tenthousand-cash" then g_tenthousand_cash = chinese_to_number(string.gsub(wildcards[1], "张一万两银票", "")) --Note(g_tenthousand_cash) return end if wildcards[2] == "thousand-cash" then g_thousand_cash = chinese_to_number(string.gsub(wildcards[1], "张一千两银票", "")) return end --六十八包金创药 (jinchuang yao) if wildcards[2] == "jinchuang yao" then g_yao_counts = chinese_to_number(string.gsub(wildcards[1], "包金创药", "")) return end --二十颗灵芝 (ling zhi) if wildcards[2] == "ling zhi" then g_zhi_counts = chinese_to_number(string.gsub(wildcards[1], "颗灵芝", "")) return end --一百颗混元丹 (hunyuan dan) if wildcards[2] == "hunyuan dan" then g_dan_counts = chinese_to_number(string.gsub(wildcards[1], "颗混元丹", "")) return end --十九支人参 (ren shen) if wildcards[2] == "ren shen" then g_shen_counts = chinese_to_number(string.gsub(wildcards[1], "支人参", "")) return end else end end function OnCheckWeapon(name, output, wildcards) if (g_checkset == 1 ) then if wildcards[2] == "axe" then weapon_axe = true return end if wildcards[2] == "sword" then weapon_sword = true return end if wildcards[2] == "dagger" then weapon_dagger = true return end if wildcards[2] == "fork" then weapon_fork = true return end if wildcards[2] == "spear" then weapon_spear = true return end if wildcards[2] == "stick" then weapon_stick = true return end if wildcards[2] == "blade" then weapon_blade = true return end if wildcards[2] == "xiao" then weapon_xiao = true return end if wildcards[2] == "hammer" then weapon_hammer = true return end if wildcards[2] == "ling" then weapon_ling = true return end if wildcards[2] == "rake" then weapon_rake = true return end if wildcards[2] == "muqin" then weapon_muqin = true return end if wildcards[2] == "staff" then weapon_staff = true return end if wildcards[2] == "whip" then weapon_whip = true return end end end function OnPanjiangAllOk() renwu = "叛将完成" pan_jiang = "" pan_jiang_id = "" pan_jiang_place = "" end function OnPanjiangKilled() g_pj_killed = g_pj_killed + 1 UpdateStatus() renwu = "叛将" OnRenwuEnd() end function OnPanjiangGet(name, output, wildcards) cmdSender:Add("@30") if wildcards[1] == "魔枪" then cmdSender:Add("drop mo qiang") else if wildcards[1] == "妖刀" then cmdSender:Add("drop yao dao") else if wildcards[1] == "仙剑" then cmdSender:Add("drop xian jian") else if wildcards[1] == "神锤" then cmdSender:Add("drop shen chui") else if wildcards[1] == "霹雳棍" then cmdSender:Add("drop pili gun") else if wildcards[1] == "除魔锏" then cmdSender:Add("drop chumo mace") else if wildcards[1] == "鬼斧" then cmdSender:Add("drop gui fu") else if wildcards[1] == "行军丹" then cmdSender:Add("eat dan") else if wildcards[1] == "天魔琴" then cmdSender:Add("drop tianmo qin") else if wildcards[1] == "情丝" then cmdSender:Add("drop qing si") else if wildcards[1] == "神叉" then cmdSender:Add("drop shen cha") else if wildcards[1] == "黄金战甲" then cmdSender:Add("drop gold armor") else if wildcards[1] == "佛杖" then cmdSender:Add("drop fo zhang") else --AppendToNotepad(myid.."_log", output.."\r\n") end end end end end end end end end end end end end end function OnRenwuEnd() InitTrigger() EnableTriggerGroup("renwu_end",false) EnableTriggerGroup("pfm", false) EnableTriggerGroup("nt_find", false) EnableTriggerGroup("nt_fight", false) EnableTimer("nt_pfm", false) EnableTimer("pfm", false) cmdSender:Clear() cmdSender:Add(g_unwield_all) if renwu == "李靖完成" then cmdSender:Add("kquest") end cmdSender:Add("@30;surrender") cmdSender:Add("#w- ") g_findagain = false if g_findtime > 1 then --AppendToNotepad(myid.."_log", "找到并完成了:"..guai_place.."/"..guai_name.."("..guai_id..")".."\r\n") end cmdSender:Add("set no_teach end") end function OnSetEnd() g_in_renwu = false if g_jianding ~= "" then cmdSender:Add(g_jianding) g_jianding = "" end if g_getcounts > 0 then EnableTriggerGroup("itemget", true) getj = 1 for geti = 1,g_getcounts do cmdSender:Add("get "..g_getlist[getj]) getj = getj + 1 end g_getcounts = 0 g_getlist = {} end if g_bianid ~= "" or g_needbian then cmdSender:Add("bian;@50") end if renwu == "叛将" then cmdSender:Add("xishi spirit;remove all;"..g_unwield_all..";#t+ ask_pj;ganying") else if renwu == "叛将完成" then cmdSender:Add("xishi spirit") else end if renwu == "逃犯完成" then if mp == "南海普陀山" or mp == "将军府" or mp == "神农谷" then cmdSender:Add("get silver from corpse;get sword from magic box;"..g_unwield_all..";wield sword;cut corpse;unwield sword;put sword in magic box") else cmdSender:Add("get silver from corpse;"..g_unwield_all..";unwield whip;unwield whip 2;wield sword;cut corpse;unwield sword") end g_FlyTo = "changan" g_AfterFly = "#4 n;give toulu to xue rengui" cmdSender:Add("#t+ fly;fly changan") else cmdSender:Add("set wimpy 30;set last_action quit n") cmdSender:Add("set no_teach godz") end end end function OnNTKilled() if renwu == "NT" then renwu = "NT完成" g_nt_success = g_nt_success + 1 --AppendToNotepad(myid.."_log", os.date("%X").."NT完成\r\n") UpdateStatus() if g_nt_type == "擒" then cmdSender:Add("out") end local msg = " 完成 "..g_nt_type.."/"..g_nt_level..guai_name.."/"..guai_place.."/"..g_nt_mp --AppendToNotepad(myid.."_log", os.date("%X")..msg.."\r\n") OnRenwuEnd() end end function OnNtDie(name, output, wildcards) if renwu == "NT" and guai_name == wildcards[1] then cmdSender:Add("get baoshi from corpse") if g_nt_type ~= "杀" then g_nt_errkill = g_nt_errkill + 1 local msg = " 误杀 "..g_nt_type.."/"..g_nt_level..guai_name.."/"..guai_place.."/"..g_nt_mp --AppendToNotepad(myid.."_log", os.date("%X")..msg.."\r\n") renwu = "NT完成" OnRenwuEnd() UpdateStatus() end else if renwu == "逃犯" and guai_name == wildcards[1] then renwu = "逃犯完成" OnRenwuEnd() UpdateStatus() end end end function hb_matched() if renwu == "护镖" then g_find = 1 end end function OnHbFail() EnableTriggerGroup("find", false) --AppendToNotepad(myid.."_log", "护镖找错:"..guai_place.."/"..g_hbline.."\r\n") cmdSender:Add("drop paper") g_findagain = false for i = 1, 10 do DeleteTrigger("hbmatch"..i) end g_hbmatch_times = 0 g_hb_matchs = 0 GoDzRightnow() end function OnHbCancel() g_hb_failure = g_hb_failure + 1 UpdateStatus() end --[[function OnSayHbInfo(name, output, wildcards) Note("start find biao...") renwu = "护镖" guai_place = wildcards[1] set_hbmatch(wildcards[2]) place_id() go_place() end ]] --方寸perform function jjf_pfm() if renwu == "叛将" then if string.find(guai_name, "方寸判将") then cmdSender:Add("hp;follow "..target_id..";remove shield;remove shield 2;wield axe;wield axe 2;wield all;wear all;jiali max;surrender;ec;ef;kill "..target_id..";"..zhuanshiperform..";perform sanban;unwield axe;unwield axe 2;remove shield;remove shield 2;wield spear;wield spear 2;wield all;wear all;perform tiancheng;unwield spear;unwield spear 2;unwield dagger;unwield dagger 2") else cmdSender:Add("hp;follow "..target_id..";remove shield;remove shield 2;wield axe;wield axe 2;wield all;wear all;jiali max;surrender;ec;ef;kill "..target_id..";"..g_race_spe..";"..zhuanshiperform..";perform sanban;unwield axe;unwield axe 2;remove shield;remove shield 2;wield spear;wield spear 2;wield all;perform qiangjian;wear all;perform tiancheng;perform meihua;unwield spear;unwield spear 2;unwield dagger;unwield dagger 2") end else --cmdSender:Add("hp;follow "..target_id..";remove shield;remove shield 2;wield axe;wield axe 2;wield all;wear all;jiali max;surrender;ec;ef;kill "..target_id..";"..g_race_spe..";"..zhuanshiperform..";perform sanban;unwield axe;unwield axe 2;remove shield;remove shield 2;wield spear;wield spear 2;wield all;perform qiangjian;wear all;perform tiancheng;perform meihua;unwield spear;unwield spear 2;unwield dagger;unwield dagger 2") cmdSender:Add("hp;follow "..target_id..";jiali max;remove shield;remove shield 2;wield axe;wield axe 2;wield all;surrender;ec;ef;{;kill "..target_id..";"..g_race_spe..";"..zhuanshiperform..";perform sanban;unwield axe;unwield axe 2;wield spear;wield spear 2;perform qiangjian;wear all;perform tiancheng;perform meihua;};unwield spear;unwield spear 2;unwield dagger;unwield dagger 2") end end --普陀perform function putuo_pfm() if renwu == "叛将" then if string.find(guai_name, "方寸判将") then cmdSender:Add("hp;follow "..target_id..";remove shield;jiali max;wield staff;wield dagger;wear all;jiali max;surrender;ec;ef;kill "..target_id..";"..shushan_busy_pfm..";"..zhuanshiperform..";perform pudu;unwield staff;unwield dagger") else cmdSender:Add("hp;follow "..target_id..";remove shield;jiali max;wield staff;wield dagger;wear all;jiali max;surrender;ec;ef;kill "..target_id..";"..shushan_busy_pfm..";"..zhuanshiperform..";perform pudu;unwield staff;unwield dagger") end else cmdSender:Add("hp;follow "..target_id..";remove shield;jiali max;wield staff;wield dagger;wear all;jiali max;surrender;ec;ef;kill "..target_id..";"..shushan_busy_pfm..";"..zhuanshiperform..";perform pudu;unwield staff;unwield dagger") end end |
|
|
|