For Handlers/Chat.cs put:
Code:
#region Automation
case "aimbot":
{
if (Command.Length >= 2)
{
switch (Command[1])
{
case "stop":
{
Automation.Automation.Going.Remove(CSocket.Client.ID);
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[Aimbot] Aimbot thread stopped.", Struct.ChatType.Top));
break;
}
default:
{
string Name = Command[1].ToString();
int wType = int.Parse(Command[2]);
foreach (ClientSocket CSock in Nano.ClientPool.Values)
{
if (CSock.Client.Name == Name)
{
Character Aim = CSock.Client;
Dictionary<ClientSocket, Character> Objective = new Dictionary<ClientSocket, Character>();
Objective.Add(CSocket, Aim);
if (Automation.Automation.Aimbots.ContainsKey(CSocket.Client.ID))
Automation.Automation.Aimbots.Remove(CSocket.Client.ID);
Automation.Automation.Aimbots.Add(CSocket.Client.ID, Objective);
Automation.Automation.LastAimbot = CSocket.Client.ID;
Automation.Automation.LastAimSID = wType;
if (!Automation.Automation.Going.Contains(CSocket.Client.ID))
Automation.Automation.Going.Add(CSocket.Client.ID);
new Thread(Automation.Automation.AimBot).Start();
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[Aimbot] Aimbot thread started, use `/aimbot stop` to kill it.", Struct.ChatType.Top));
}
}
break;
}
}
}
break;
}
#endregion Automation
Code:
using System;
using CoEmu_v2_GameServer.Connections;
using CoEmu_v2_GameServer.Entities;
using CoEmu_v2_GameServer.Calculations;
using CoEmu_v2_GameServer.Handlers;
using System.Threading;
using System.Collections.Generic;
using CoEmu_v2_GameServer.Packets;
using CoEmu_v2_GameServer.Structs;
namespace CoEmu_v2_GameServer.Automation
{
public class Automation
{
public static Dictionary<int, Dictionary<ClientSocket, Character>> Aimbots = new Dictionary<int, Dictionary<ClientSocket, Character>>();
public static int LastAimbot;
public static int LastAimSID;
public static List<int> Going = new List<int>();
public static void AimBot()
{
Dictionary<ClientSocket, Character> Object = Aimbots[LastAimbot];
foreach (KeyValuePair<ClientSocket, Character> CSobj in Object)
{
ClientSocket CSocket = CSobj.Key;
Character Aim = CSobj.Value;
int SkillID = (LastAimSID == 1 ? 1045 : 1046);
if (SkillID == 1045 && !CSocket.Client.Skills.ContainsKey(1045))
{
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[Aimbot] You must learn FastBlade first.", Struct.ChatType.Top));
break;
}
if (SkillID == 1046 && !CSocket.Client.Skills.ContainsKey(1046))
{
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[Aimbot] You must learn ScentSword first.", Struct.ChatType.Top));
break;
}
while (Going.Contains(CSocket.Client.ID))
{
if (CSocket.Client.CurrentStam >= 22)
{
if (!Nano.ClientPool.ContainsKey(Aim.ID))
{
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[Aimbot] User logged off, seizing thread.", Struct.ChatType.Top));
break;
}
else if (!Aim.Dead)
{
if ((int)Aim.Map == (int)CSocket.Client.Map)
{
if (Calculation.InRange(CSocket.Client.X, CSocket.Client.Y, Aim.X, Aim.Y, 9))
{
Handler.NoTargetMagic(CSocket, SkillID, Aim.X, Aim.Y);
}
}
else
{
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[Aimbot] Aimbot cannot track characters not in your map.", Structs.Struct.ChatType.Top));
break;
}
}
}
Thread.Sleep(1000);
}
break;
}
Thread.CurrentThread.Abort();
}
}
}
EDIT: By the way, at the top of chat.cs you may wanna add
Code:
using CoEmu_v2_GameServer.Automation;






