📄 func.cs
字号:
namespace WoWBot
{
using Microsoft.VisualBasic.CompilerServices;
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
using WoWBot.My;
public class func
{
private const int b = 0x20000;
public const int WM_KEYDOWN = 0x100;
public const int WM_KEYUP = 0x101;
public const int WM_LBUTTONDOWN = 0x201;
public const int WM_LBUTTONUP = 0x202;
public const uint WM_MOUSEMOVE = 0x200;
public const int WM_RBUTTONDOWN = 0x204;
public const int WM_RBUTTONUP = 0x205;
public static object btf(object data, object start)
{
return (float) Math.Truncate((double) BitConverter.ToSingle((byte[]) data, Conversions.ToInteger(start)));
}
public static object btr(object data, object start)
{
double num2 = BitConverter.ToSingle((byte[]) data, Conversions.ToInteger(start));
num2 = (num2 * 180.0) / 3.1415926535897931;
int num = (int) Math.Round(Math.Round(num2, 3, MidpointRounding.AwayFromZero));
return Convert.ToInt32(Math.Truncate(new decimal(num)));
}
public static object cleardonnees()
{
MyProject.Forms.Main.PlayerName.Text = "- - -";
MyProject.Forms.Main.PlayerHealth.Text = "- - -";
MyProject.Forms.Main.PlayerLevel.Text = "- - -";
MyProject.Forms.Main.PlayerMana.Text = "- - -";
MyProject.Forms.Main.PlayerExp.Text = "- - -";
MyProject.Forms.Main.PlayerHealthBar.Value = 0;
MyProject.Forms.Main.PlayerExpBar.Value = 0;
MyProject.Forms.Main.PlayerManaBar.Value = 0;
return 0;
}
public static object clicdroit()
{
mouse_event(8L, 0L, 0L, 0L, 0L);
mouse_event(0x10L, 0L, 0L, 0L, 0L);
return 0;
}
public static object clicgauche()
{
mouse_event(2L, 0L, 0L, 0L, 0L);
mouse_event(4L, 0L, 0L, 0L, 0L);
return 0;
}
public static object exp(object data)
{
decimal d = new decimal((((double) BitConverter.ToInt32((byte[]) data, 0)) / ((double) BitConverter.ToInt32((byte[]) data, 4))) * 100.0);
string str2 = Conversions.ToString(BitConverter.ToInt32((byte[]) data, 0));
string str = Conversions.ToString(BitConverter.ToInt32((byte[]) data, 4));
string str3 = Conversions.ToString(Math.Truncate(d));
return ("Experience: " + str2 + "/" + str + " (" + str3 + "%)");
}
public static object expper(object data)
{
return Conversions.ToString((double) ((((double) BitConverter.ToInt32((byte[]) data, 0)) / ((double) BitConverter.ToInt32((byte[]) data, 4))) * 100.0));
}
[DllImport("user32", EntryPoint="FindWindowA", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
public static extern int FindWindow([MarshalAs(UnmanagedType.VBByRefStr)] ref string lpClassName, [MarshalAs(UnmanagedType.VBByRefStr)] ref string lpWindowName);
[DllImport("user32", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
public static extern long GetCursorPos(object lpPoint);
[DllImport("user32", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
public static extern long GetForegroundWindow();
[DllImport("kernel32", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
public static extern int GetTickCount();
[DllImport("user32.dll", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
public static extern int GetWindowRect(int hwnd, ref RECT lpRect);
public static object int32(object data, object start)
{
return Conversions.ToString(BitConverter.ToInt32((byte[]) data, Conversions.ToInteger(start)));
}
public static object itc(object data)
{
return Conversions.ToString(BitConverter.ToChar((byte[]) data, 0));
}
public static object its(object @int)
{
return Conversions.ToString(@int);
}
[DllImport("user32", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
public static extern void keybd_event(byte bVk, byte bScan, long dwFlags, long dwExtraInfo);
public static object LoadSettings()
{
try
{
StreamReader reader = new StreamReader(Application.StartupPath + @"\Config\Account.ini");
MyProject.Forms.Advanced.Show();
MyProject.Forms.Advanced.Visible = false;
string str = reader.ReadLine();
string str2 = reader.ReadLine();
string str4 = reader.ReadLine();
string str3 = reader.ReadLine();
reader.Close();
if (str3 == "True")
{
MyProject.Forms.Advanced.Relog.Checked = true;
}
MyProject.Forms.Advanced.AccountLogin.Text = str;
MyProject.Forms.Advanced.AccountPassword.Text = str2;
MyProject.Forms.Advanced.RelogTime.Text = str4;
reader.Close();
try
{
StreamReader reader3 = new StreamReader(Application.StartupPath + @"\Config\Window.ini");
MyProject.Forms.Main.Text = reader3.ReadToEnd();
reader3.Close();
}
catch (Exception exception1)
{
ProjectData.SetProjectError(exception1);
Exception exception = exception1;
ProjectData.ClearProjectError();
}
if (System.IO.File.Exists("Config/key.ini"))
{
StreamReader reader4 = new StreamReader("Config/key.ini");
MyProject.Forms.Config.Licence.Text = reader4.ReadToEnd();
MyProject.Forms.Config.Licence.Text = MyProject.Forms.Config.Licence.Text.Replace("\r\n", "");
reader4.Close();
MyProject.Forms.Config.SaveKey.Checked = true;
Config.verifkey();
}
StreamReader reader2 = new StreamReader(Application.StartupPath + @"\Data\BlackListNAME.ini");
MyProject.Forms.Config.BlackListName.Text = reader2.ReadToEnd();
reader2.Close();
}
catch (Exception exception3)
{
ProjectData.SetProjectError(exception3);
Exception exception2 = exception3;
ProjectData.ClearProjectError();
}
return 0;
}
public static object logmsg(string text)
{
StreamWriter writer = new StreamWriter(Application.StartupPath + "Log.txt");
writer.WriteLine(text + "\r\n");
writer.Close();
if (text.ToString().Contains("DEBUG"))
{
if (MyProject.Forms.Config.DebugEnable.Checked && (Main.lastmsg != text))
{
MyProject.Forms.Main.Log.AppendText(text + "\r\n");
Main.lastmsg = text;
}
return 0;
}
if (Main.lastmsg != text)
{
MyProject.Forms.Main.Log.AppendText(text + "\r\n");
Main.lastmsg = text;
}
return 0;
}
public static long MakeLong(int LoWord, int HiWord)
{
return (long) ((HiWord * 0x10000) + LoWord);
}
public static int MakeLParam(int LoWord, int HiWord)
{
return ((HiWord << 0x10) | (LoWord & 0xffff));
}
public static void memFloat(object process, object address, object data, object offset)
{
data = BitConverter.GetBytes(Conversions.ToSingle(Operators.AddObject(btf(RuntimeHelpers.GetObjectValue(data), 0), offset)));
mem.Poke((Process) process, Conversions.ToInteger(address), (byte[]) data);
}
[DllImport("user32")]
public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);
[DllImport("user32", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
public static extern long MoveWindow(long hwnd, long x, long y, long nWidth, long nHeight, long bRepaint);
public static object negativeAngle(object angle)
{
if (Operators.ConditionalCompareObjectLess(angle, 0, false))
{
angle = Operators.AddObject(angle, 6.2831853071795862);
}
return angle;
}
public static void oldWait(int MilsecToWait)
{
int num = GetTickCount() + MilsecToWait;
while (GetTickCount() < num)
{
Application.DoEvents();
}
}
public static object oldWait(object milsec)
{
Sleep(Conversions.ToInteger(milsec));
return 0;
}
public static object percent(object min, object max)
{
if (BitConverter.ToInt32((byte[]) min, 0) > 1)
{
return Conversions.ToString((double) ((((double) BitConverter.ToInt32((byte[]) min, 0)) / ((double) BitConverter.ToInt32((byte[]) max, 0))) * 100.0));
}
return Conversions.ToString(0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -