LUACN论坛

 找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
热搜: YJWOW MagicStone BoL
查看: 1517|回复: 8

[wowbee] 魔蜂钓鱼相关

[复制链接]
发表于 2021-6-1 15:14:28 | 显示全部楼层 |阅读模式
有没有钓鱼相关的魔蜂函数和宏,想写一个自动钓鱼
省得每次钓鱼还得另外开软件,同时也避免有些服登录器检测。

但是找了很久没有一点线索,大佬提供

回复

使用道具 举报

 楼主| 发表于 2021-6-1 17:03:50 | 显示全部楼层
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FishBot3._3._5a
{
    public class Lua
    {
        private readonly Hook _wowHook;
        public Lua(Hook wowHook)
        {
            _wowHook = wowHook;
        }

        public void DoString(string command)
        {
            if (_wowHook.Installed)
            {
                // Allocate memory
                IntPtr doStringArgCodecave = _wowHook.Memory.AllocateMemory(Encoding.UTF8.GetBytes(command).Length + 1);
                // Write value:
                _wowHook.Memory.WriteBytes(doStringArgCodecave, Encoding.UTF8.GetBytes(command));

                // Write the asm stuff for Lua_DoString
                var asm = new[]
                {
                    "mov eax, " + doStringArgCodecave,
                    "push 0",
                    "push eax",
                    "push eax",
                    //"mov eax, " + ( (uint) Offsets.FrameScript__Execute + _wowHook.Process.BaseOffset()) , // Lua_DoString
                    "mov eax, " + ( (uint) Offsets.FrameScript__Execute ), // Lua_DoString
                    "call eax",
                    "add esp, 0xC",
                    "retn"
                };
                // Inject
                _wowHook.InjectAndExecute(asm);
                // Free memory allocated
                _wowHook.Memory.FreeMemory(doStringArgCodecave);
            }
        }

        internal string GetLocalizedText(string localVar)
        {
            if (_wowHook.Installed)
            {
                IntPtr Lua_GetLocalizedText_Space = _wowHook.Memory.AllocateMemory(Encoding.UTF8.GetBytes(localVar).Length + 1);

                // If you building for MoP or higher then you need to use
                // ClntObjMgrGetActivePlayerObj = Memory.MainModule.BaseAddress + new IntPtr(0xADDRESS);   
                // FrameScript__GetLocalizedText = Memory.MainModule.BaseAddress + new IntPtr(0xADDRESS);   

                _wowHook.Memory.Write<byte>(Lua_GetLocalizedText_Space, Encoding.UTF8.GetBytes(localVar), false);

                String[] asm = new String[]
                {
                    "call " + (uint) Offsets.ClntObjMgrGetActivePlayerObj,
                    "mov ecx, eax",
                    "push -1",
                    "mov edx, " + Lua_GetLocalizedText_Space + "",
                    "push edx",
                    //"call " + ((uint) Offsets.FrameScript__GetLocalizedText + _wowHook.Process.BaseOffset()) ,
                    "call " + ((uint) Offsets.FrameScript__GetLocalizedText) ,
                    "retn",
                };

                string sResult = Encoding.UTF8.GetString(_wowHook.InjectAndExecute(asm));

                // Free memory allocated
                _wowHook.Memory.FreeMemory(Lua_GetLocalizedText_Space);
                return sResult;
            }
            return "WoW Hook not installed";
        }

        public void SendTextMessage(string message)
        {
            //DoString(string.Format("SendChatMessage(\"" + message + "\", \"EMOTE\", nil, \"General\")"));

            DoString("RunMacroText('/me " + message + "')");
        }

        public void CastSpellByName(string spell)
        {
            var debuff = 0.0; // Spell must be cast

            // Check if the spell must be cast because its debuff has worn off
            if (spell == "Icy Touch")
            {
                debuff = DebuffRemainingTime("Frost Fever");
            }

            if (debuff > 0.5)
                return;

            // Check if spell is ready, if not skip this spell
            DoString("start, duration, enabled = GetSpellCooldown('" + spell + "')");
            var result = GetLocalizedText("duration");

            if (result != "0")
                return;
                       
            DoString(string.Format("CastSpellByName('{0}')", spell));
            SendTextMessage("Casting: " + spell);
        }

        public double DebuffRemainingTime(string debuffName)
        {
            var luaStr = string.Format("name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = UnitAura('target','{0}',nil,'HARMFUL')", debuffName);
            DoString(luaStr);
            var result = GetLocalizedText("expirationTime");

            if (result == "")
                return 0;

            DoString("time = GetTime()");
            var currentTime = GetLocalizedText("time");

            double timeInSeconds = double.Parse(result) - double.Parse(currentTime);

            if (timeInSeconds < 0)
                return 0;

            return timeInSeconds;
        }

        public void ctm(float x, float y, float z, ulong guid, int action, float precision, IntPtr playerBaseAddress)
        {
            // Offset:
            uint CGPlayer_C__ClickToMove = 0x727400;

            // Allocate Memory:
            IntPtr GetNameVMT_Codecave = _wowHook.Memory.AllocateMemory(0x3332);
            IntPtr Pos_Codecave = _wowHook.Memory.AllocateMemory(0x4 * 3);
            IntPtr GUID_Codecave = _wowHook.Memory.AllocateMemory(0x8);
            IntPtr Angle_Codecave = _wowHook.Memory.AllocateMemory(0x4);

            // Write value:
            _wowHook.Memory.Write<UInt64>(GUID_Codecave, guid);
            _wowHook.Memory.Write<float>(Angle_Codecave, precision);
            _wowHook.Memory.Write<float>(Pos_Codecave, x);
            _wowHook.Memory.Write<float>(Pos_Codecave + 0x4, y);
            _wowHook.Memory.Write<float>(Pos_Codecave + 0x8, z);

            try
            {
                // BOOL __thiscall CGPlayer_C__ClickToMove(WoWActivePlayer *this, CLICKTOMOVETYPE clickType, WGUID *interactGuid, WOWPOS *clickPos, float precision)
                _wowHook.Memory.Asm.Clear();

                _wowHook.Memory.Asm.AddLine("mov edx, [" + Angle_Codecave + "]");
                _wowHook.Memory.Asm.AddLine("push edx");

                _wowHook.Memory.Asm.AddLine("push " + Pos_Codecave);
                _wowHook.Memory.Asm.AddLine("push " + GUID_Codecave);
                _wowHook.Memory.Asm.AddLine("push " + action);

                _wowHook.Memory.Asm.AddLine("mov ecx, " + playerBaseAddress);
                _wowHook.Memory.Asm.AddLine("call " + CGPlayer_C__ClickToMove);
                _wowHook.Memory.Asm.AddLine("retn");

                _wowHook.Memory.Asm.InjectAndExecute((uint)GetNameVMT_Codecave);
            }
            catch { }

            _wowHook.Memory.FreeMemory(GetNameVMT_Codecave);
            _wowHook.Memory.FreeMemory(Pos_Codecave);
            _wowHook.Memory.FreeMemory(GUID_Codecave);
            _wowHook.Memory.FreeMemory(Angle_Codecave);
        }
    }
}
回复 支持 反对

使用道具 举报

发表于 2021-6-1 21:30:12 | 显示全部楼层
魔蜂也能被检测的!!!!!
回复 支持 反对

使用道具 举报

发表于 2021-6-1 22:50:16 | 显示全部楼层
feixia5693 发表于 2021-6-1 05:03 PM
using System;
using System.Collections.Generic;
using System.Linq;

你这 是什么东东?
回复 支持 反对

使用道具 举报

发表于 2021-6-2 23:02:50 | 显示全部楼层
kevinchow 发表于 2021-6-1 09:30 PM
魔蜂也能被检测的!!!!!

BEE是插件 检测不到的
但是如果解锁器过于老旧,就容易被检测

简而言之 检测是解锁器 不是插件
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-6-3 15:39:34 | 显示全部楼层
GameObject=CS.UnityEngine.GameObject
Resources=CS.UnityEngine.Resources
Vector3=CS.UnityEngine.Vector3
Physics=CS.UnityEngine.Physics
Camera=CS.UnityEngine.Camera
Input=CS.UnityEngine.Input
function  dj()
    print(123123)
end
--存老鼠的表
tables={}
local timer=0
function  start()
    bt=GameObject.Find("Button"):GetComponent(typeof(CS.UnityEngine.UI.Button))
    bt.onClick:AddListener(dj)
    for i = 1, 5 do
        for j = 1, 5 do
            local  items=CS.UnityEngine.Resources.Load("Cube")
            local  instante=GameObject.Instantiate(items)
            --地洞之间的间隔
            instante.transform.position=CS.UnityEngine.Vector3(i*5,2.588,j*5)
            --地洞的大小
            instante.transform.localScale=CS.UnityEngine.Vector3(3,0.1,3)
            --把地洞存入表中
            table.insert(tables,instante)
        end
    end
end
function update()

--相机的射线检测
    if Input.GetMouseButtonDown(0) then
        print(123)
        local  hitpoint=Camera.main:ScreenPointToRay(Input.mousePosition)
        print(hitpoint)
        local  ok,h=Physics.Raycast(hitpoint)
        print(h)
        if ok then
            --点击老鼠进行销毁
            if h.collider.name=="mouse(Clone)" then
                GameObject.Destroy(h.collider.gameObject)
            end
        end
        end
        --几秒生成老鼠
    if timer>=3 then
    --随机地洞
        local  t=tables[math.random(1,#tables)]
        --生成老鼠在随机一个地洞里
        local  prefab=CS.UnityEngine.Resources.Load("mouse")
        local  instanteprefab=GameObject.Instantiate(prefab)
        instanteprefab.transform.position=t.transform.position
        instanteprefab.transform:SetParent(tables.transform,false)
        GameObject.Destroy(instanteprefab,3)
        timer=0
    else
        timer=timer+0.001
    end


end



这个是打地鼠的源码,也许钓鱼有可以参考的代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-6-9 15:51:57 | 显示全部楼层
-----------fish---------


    local function getBobber()
            local BobberName = "鱼漂"
            local Total = ObjectCount(TYPE_GAMEOBJECT)
            local BobberDescriptor = nil
            
            for i = 1, Total,1 do
                    local Object = ObjectWithIndex(i)
                    local ObjectName2 = ObjectName(ObjectPointer(Object))

                    if ObjectName2 == BobberName then
                                    return Object
                    end

            end
    end

    local function isBobbing()
            local animation_offset = 0x1E0
            local bobbing = ObjectField(getBobber(),animation_offset,"short")
            if bobbing == 1 then
                    return true
            else
                    return false
            end
    end

    function FHGoFish()
            local BobberObject = getBobber()
            if BobberObject then
                    if isBobbing() == true then
                            --print("|cffff6060[|r|cFF00FFFFFishbot|cffff6060]|r 一条鱼 !")
                            ObjectInteract(getBobber())
                            return true;
                    end
            else
                    CastSpellByName(tostring(select(1,GetSpellInfo(131474))));
                    return true;
            end
        return false;
    end

    -------------------fish end---------
FH 的钓鱼源码,也许可以借鉴下,等有空了研究下
回复 支持 反对

使用道具 举报

发表于 2021-9-18 10:52:46 | 显示全部楼层
我想问下眼就好了吗?魔蜂能不能用
回复 支持 反对

使用道具 举报

发表于 2021-12-8 14:15:15 | 显示全部楼层
看起来很厉害的样子啊~~
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

小黑屋|手机版|Archiver|LUACN论坛

GMT+8, 2024-4-19 01:57 PM , Processed in 0.331755 second(s), 31 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表