魔蜂钓鱼相关
有没有钓鱼相关的魔蜂函数和宏,想写一个自动钓鱼省得每次钓鱼还得另外开软件,同时也避免有些服登录器检测。
但是找了很久没有一点线索,大佬提供
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);
}
}
}
魔蜂也能被检测的!!!!! feixia5693 发表于 2021-6-1 05:03 PM
using System;
using System.Collections.Generic;
using System.Linq;
你这 是什么东东?:funk: kevinchow 发表于 2021-6-1 09:30 PM
魔蜂也能被检测的!!!!!
BEE是插件 检测不到的
但是如果解锁器过于老旧,就容易被检测
简而言之 检测是解锁器 不是插件 GameObject=CS.UnityEngine.GameObject
Resources=CS.UnityEngine.Resources
Vector3=CS.UnityEngine.Vector3
Physics=CS.UnityEngine.Physics
Camera=CS.UnityEngine.Camera
Input=CS.UnityEngine.Input
functiondj()
print(123123)
end
--存老鼠的表
tables={}
local timer=0
functionstart()
bt=GameObject.Find("Button"):GetComponent(typeof(CS.UnityEngine.UI.Button))
bt.onClick:AddListener(dj)
for i = 1, 5 do
for j = 1, 5 do
localitems=CS.UnityEngine.Resources.Load("Cube")
localinstante=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)
localhitpoint=Camera.main:ScreenPointToRay(Input.mousePosition)
print(hitpoint)
localok,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
--随机地洞
localt=tables
--生成老鼠在随机一个地洞里
localprefab=CS.UnityEngine.Resources.Load("mouse")
localinstanteprefab=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
这个是打地鼠的源码,也许钓鱼有可以参考的代码 -----------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 的钓鱼源码,也许可以借鉴下,等有空了研究下 我想问下眼就好了吗?魔蜂能不能用 看起来很厉害的样子啊~~ 大佬写一个能导入的代码啊
页:
[1]
2