using System;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
namespace AntRadar
{
public class AntRadar : Core
{
// Archege uses Y Bottom = 0;
// Radar uses Y Top = 0;
public static string GetPluginAuthor()
{
return "XantX";
}
public static string GetPluginVersion()
{
return "1.0.0.0";
}
public static string GetPluginDescription()
{
return "ant's Radar Plugin";
}
private Form f;
private Label label;
private Thread formThread;
System.Windows.Forms.Timer t = new System.Windows.Forms.Timer();
int WIDTH = 600;
int HEIGHT = 600;
int HAND = 150;
int u; //in degree
int cx, cy; //center of the circle
int x, y; //HAND coordinate
int tx, ty, lim = 20;
double myLastX, myLastY;
Bitmap bmp;
Graphics g;
private System.Windows.Forms.PictureBox pictureBox1;
Double rOriginX;
Double rOriginY;
Double rOriginZ;
Creature creature = null;
int doodX;
int doodY;
double myPrevX = 0;
double myPrevY = 0;
double prevAngle = 90;
// Create font and brush.
Font drawFont = new Font("Courier", 11);
SolidBrush drawBrush = new SolidBrush(Color.White);
Skill skill = null;
ToolBarButton tbb1 = new ToolBarButton();
ToolBarButton tbb2 = new ToolBarButton();
ToolBarButton tbb3 = new ToolBarButton();
ToolBarButton tbb4 = new ToolBarButton();
ToolBarButton tbb5 = new ToolBarButton();
ToolBarButton tbb6 = new ToolBarButton();
ToolBarButton tbb7 = new ToolBarButton();
ToolBarButton tbb8 = new ToolBarButton();
ToolBarButton tbb9 = new ToolBarButton();
ToolBarButton tbb10 = new ToolBarButton();
ToolBarButton tbb11 = new ToolBarButton();
ToolBarButton tbb12 = new ToolBarButton();
ToolBarButton tbb13 = new ToolBarButton();
ToolBarButton tbb14 = new ToolBarButton();
ToolBarButton tbb15 = new ToolBarButton();
ToolBarButton tbb16 = new ToolBarButton();
ToolBarButton tbb17 = new ToolBarButton();
ToolBarButton tbb18 = new ToolBarButton();
ToolBarButton tbb19 = new ToolBarButton();
ToolBarButton tbb20 = new ToolBarButton();
Pen p = new Pen(Color.Green, 1f);
Pen p2 = new Pen(Color.Red, 2f);
Pen p3 = new Pen(Color.Blue, 3f);
private void InitializeForm()
{
f = new Form();
f.Width = 500;
f.Height = 500;
f.Text = "ant's Archeage Radar";
f.FormBorderStyle = FormBorderStyle.Sizable;
f.MaximizeBox = false;
f.MinimizeBox = false;
f.TopMost = true;
pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(pictureBox1)).BeginInit();
f.SuspendLayout();
//
// pictureBox1
//
pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
pictureBox1.Location = new System.Drawing.Point(0, 0);
pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new System.Drawing.Size(WIDTH, HEIGHT);
pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
pictureBox1.TabIndex = 0;
pictureBox1.TabStop = false;
pictureBox1.MouseWheel += new System.Windows.Forms.MouseEventHandler(PicBox_MouseWheel);
//
// Form1
//
f.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
f.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
f.ClientSize = new System.Drawing.Size(WIDTH-14, HEIGHT - 75);
f.Controls.Add(pictureBox1);
f.Name = "Ant Radar";
f.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
f.Text = "Ant Radar";
((System.ComponentModel.ISupportInitialize)(pictureBox1)).EndInit();
f.ResumeLayout(false);
//create Bitmap
bmp = new Bitmap(WIDTH + 1, HEIGHT + 1);
//background color
f.BackColor = Color.Black;
//center
cx = WIDTH / 2;
cy = HEIGHT / 2;
//initial degree of HAND
u = 0;
//timer
t.Interval = 250; //in millisecond
t.Tick += new EventHandler(this.t_Tick);
t.Start();
pictureBox1.Click += PBox_Click;
ToolBar toolBar1 = new ToolBar();
tbb1.Text = "Mine Ore";
tbb2.Text = "Chop Trees";
tbb3.Text = "Mobs";
tbb4.Text = "Everything - Debug";
tbb5.Text = "Hide Text";
tbb6.Text = "Fixed World";
tbb7.Text = "Player - Friendly";
tbb8.Text = "Player - Enemy";
tbb9.Text = "Harvest Plants";
tbb10.Text = "Trade Packs";
tbb11.Text = "Thunderstruck";
tbb12.Text = "Fishing Schools";
tbb13.Text = "Sunken Treasure Chest";
tbb14.Text = "Butcher Animals";
tbb1.Style = ToolBarButtonStyle.ToggleButton;
tbb2.Style = ToolBarButtonStyle.ToggleButton;
tbb3.Style = ToolBarButtonStyle.ToggleButton;
tbb4.Style = ToolBarButtonStyle.ToggleButton;
tbb5.Style = ToolBarButtonStyle.ToggleButton;
tbb6.Style = ToolBarButtonStyle.ToggleButton;
tbb7.Style = ToolBarButtonStyle.ToggleButton;
tbb8.Style = ToolBarButtonStyle.ToggleButton;
tbb9.Style = ToolBarButtonStyle.ToggleButton;
tbb10.Style = ToolBarButtonStyle.ToggleButton;
tbb11.Style = ToolBarButtonStyle.ToggleButton;
tbb12.Style = ToolBarButtonStyle.ToggleButton;
tbb13.Style = ToolBarButtonStyle.ToggleButton;
tbb14.Style = ToolBarButtonStyle.ToggleButton;
toolBar1.Buttons.Add(tbb1);
toolBar1.Buttons.Add(tbb2);
toolBar1.Buttons.Add(tbb3);
toolBar1.Buttons.Add(tbb4);
toolBar1.Buttons.Add(tbb5);
toolBar1.Buttons.Add(tbb6);
toolBar1.Buttons.Add(tbb7);
toolBar1.Buttons.Add(tbb8);
toolBar1.Buttons.Add(tbb9);
toolBar1.Buttons.Add(tbb10);
toolBar1.Buttons.Add(tbb11);
toolBar1.Buttons.Add(tbb12);
toolBar1.Buttons.Add(tbb13);
toolBar1.Buttons.Add(tbb14);
f.Controls.Add(toolBar1);
}
public Skill getDoodadSkill(DoodadObject dood){
Skill sk = null;
if(dood != null){
foreach(var obj in dood.getUseSkills()){
sk = obj;
}
}
return sk;
}
private void PicBox_MouseWheel(object sender, MouseEventArgs e)
{
if (e.Delta < 0)
{
ZoomIn();
}
else
{
ZoomOut();
}
}
private void ZoomIn()
{
pictureBox1.Width = Convert.ToInt32(pictureBox1.Width * 0.5);
pictureBox1.Height = Convert.ToInt32(pictureBox1.Height * 0.5);
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
}
/// <summary>
/// Make the PictureBox dimensions smaller to effect the Zoom.
/// </summary>
/// <remarks>Minimum 5 times smaller</remarks>
private void ZoomOut()
{
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
pictureBox1.Width = Convert.ToInt32(pictureBox1.Width / 0.5);
pictureBox1.Height = Convert.ToInt32(pictureBox1.Height / 0.5);
}
public void PBox_Click(object sender, EventArgs e)
{
Point cursorPos = f.PointToClient(Cursor.Position);
//Double z = getZFromHeightMap(cursorPos.X + rOriginX, cursorPos.Y + rOriginY);
//MoveTo(cursorPos.X + rOriginX, cursorPos.Y + rOriginY, z);
//Thread.Sleep(250);
// HARDCODED
cursorPos.X -= WIDTH / 2;
cursorPos.Y -= HEIGHT / 2;
cursorPos.X /= 2;
cursorPos.Y /= 2;
//Log(cursorPos.X.ToString());
//Log(cursorPos.Y.ToString());
// Not sure how to get the correct Z position
SetMapPos((rOriginX + cursorPos.X),(rOriginY - cursorPos.Y),me.Z);
//Log((cursorPos.X + me.X).ToString() + " " + (cursorPos.Y + me.Y).ToString());
}
public void drawOre()
{
foreach(var dood in getDoodads())
{
skill = getDoodadSkill(dood);
if(skill != null && (skill.name == "Mine Ore"))
{
drawWorldDot(dood.X,dood.Y,dood.Z,dood.name,Color.Blue);
}
}
}
public void drawTrees()
{
foreach(var dood in getDoodads())
{
skill = getDoodadSkill(dood);
if(skill != null && (skill.name == "Chop Tree"))
{
drawWorldDot(dood.X,dood.Y,dood.Z,dood.name,Color.Blue);
}
}
}
public void drawPlants()
{
foreach(var dood in getDoodads())
{
skill = getDoodadSkill(dood);
if(skill != null && (skill.name.Contains("Gather")))
{
drawWorldDot(dood.X,dood.Y,dood.Z,dood.name,Color.Blue);
}
}
}
public void drawAnimals()
{
foreach(var dood in getDoodads())
{
skill = getDoodadSkill(dood);
if(skill != null && (skill.name.Contains("Butcher")))
{
drawWorldDot(dood.X,dood.Y,dood.Z,dood.name,Color.Blue);
}
}
}
public void drawThunderStruck()
{
foreach(var dood in getDoodads())
{
if (dood.name.Contains("Thunderstuck"))
{
drawWorldDot(dood.X, dood.Y, dood.Z , dood.name, Color.Blue);
}
}
}
public void drawFishes()
{
foreach(var dood in getDoodads())
{
if (dood.name.Contains("Schooling"))
{
drawWorldDot(dood.X, dood.Y, dood.Z , dood.name, Color.Blue);
}
}
}
public void drawTradePacks()
{
string [] TradePacks = {"Arcum Iris",
"Falcorth",
"Hasla",
"Mahadevi",
"Perinoor",
"Rookborne",
"Silent Forest",
"Solis",
"Tigerspine",
"Villanelle",
"Windscour",
"Ynystere",
"Cinderstone",
"Dewstone",
"Gweonid",
"Halcyona",
"Hellswamp",
"Lilyut",
"Marianople",
"Sanddeep",
"Solzreed",
"Two Crowns",
"White Arden",
"Iron Pack",
"Fabric Pack",
"Lumber Pack",};
foreach(var dood in getDoodads())
{
foreach (string s in TradePacks)
{
if (dood.name.Contains(s))
{
drawWorldDot(dood.X, dood.Y, dood.Z , dood.name + " z: " + dood.Z, Color.Blue);
}
}
}
}
public void drawSunken()
{
foreach(var dood in getDoodads())
{
if (dood.name.Contains("Treasure"))
{
drawWorldDot(dood.X, dood.Y, dood.Z , dood.name, Color.Blue);
}
}
}
public void drawAllObjects()
{
foreach(var dood in getDoodads())
{
//if (dood.name.Contains("Clipper")) = harpoonclipper / cannon clipper
//if (dood.name.Contains("Seat")) = rowboat
drawWorldDot(dood.X, dood.Y, dood.Z , dood.name, Color.Blue);
}
}
public void drawWorldDot(double x, double y, double z, String text, Color color)
{
double relx,rely,relz;
relx = x - rOriginX;
rely = y - rOriginY;
relz = z - me.Z;
double scale = WIDTH / 400 * 0.8;
relx *= scale;
rely *= scale;
relz *= scale;
// + "[" + x.ToString() + "," + y.ToString() + "," + z.ToString() + "]"
drawDot(cx + (int)relx , cy + -(int)rely ,text,color);
}
public void drawDot(int x, int y, String text, Color color)
{
p2.Color = color;
g.DrawEllipse(p2, x, y, 2, 2);
if (tbb5.Pushed)
g.DrawString("", drawFont, drawBrush, x - (6 * (text.Count()/2)), y);
else
g.DrawString(text, drawFont, drawBrush, x - (6 * (text.Count()/2)), y);
}
public void drawCreatures()
{
foreach(var obj in getCreatures())
{
if(obj.type == BotTypes.Npc)
{
drawWorldDot(obj.X,obj.Y,obj.Z,obj.name,Color.Orange);
}
}
}
public void drawFriendlies()
{
foreach(var obj in getCreatures())
{
if(obj.type == BotTypes.Player && obj.factionId == me.factionId)
{
drawWorldDot(obj.X,obj.Y,obj.Z,obj.name,Color.Aquamarine);
}
}
}
public void drawEnemies()
{
foreach(var obj in getCreatures())
{
if(obj.type == BotTypes.Player && obj.factionId != me.factionId)
{
drawWorldDot(obj.X,obj.Y,obj.Z,obj.name,Color.Red);
//Log(obj.factionId.ToString());
// 103 113 109
}
}
}
public void drawSelf()
{
drawWorldDot(me.X, me.Y, me.Z, "Me", Color.White);
// draw the line in which you are looking
double diffy, diffx, angle;
diffx = me.X - myLastX;
diffy = me.Y - myLastY;
angle = Math.Atan2(diffy,diffx);
double vx,vy;
if (angle != 0)
{
vx = Math.Cos(angle);
vy = Math.Sin(angle);
prevAngle = angle;
}
else
{
vx = Math.Cos(prevAngle);
vy = Math.Sin(prevAngle);
}
vx *= 75;
vy *= 75;
myLastX = me.X;
myLastY = me.Y;
g.DrawLine(p3,new Point(cx + (int)(me.X - rOriginX),cy - (int)(me.Y - rOriginY)),new Point((int)(cx+vx + (int)(me.X - rOriginX)),(int)(cy-vy) - (int)(me.Y - rOriginY)));
}
public void drawNSEW()
{
//draw perpendicular line
g.DrawLine(p, new Point(cx, 0), new Point(cx, HEIGHT)); // UP-DOWN
g.DrawLine(p, new Point(0, cy), new Point(WIDTH, cy)); //LEFT-RIGHT
drawDot(cx,HEIGHT-25,"S",Color.Green);
drawDot(cx,0,"N",Color.Green);
drawDot(WIDTH-25,cy,"E",Color.Green);
drawDot(0,cy,"W",Color.Green);
}
private void t_Tick(object sender, EventArgs e)
{
// check if player is in game world - not confirm that it will prevent the crash
if (me == null || me.name == "")
{
return;
}
if (!tbb6.Pushed)
{
rOriginX = me.X;
rOriginY = me.Y;
rOriginZ = me.Z;
}
//Log(angle(me.target, me).ToString());
g = Graphics.FromImage(bmp);
g.Clear(Color.Black);
drawNSEW();
drawSelf();
if(tbb4.Pushed)
{
drawAllObjects();
pictureBox1.Image = bmp;
g.Dispose();
return;
}
if(tbb1.Pushed)
{
drawOre();
}
if(tbb2.Pushed)
{
drawTrees();
}
if(tbb3.Pushed)
{
drawCreatures();
}
if(tbb7.Pushed)
{
drawFriendlies();
}
if(tbb8.Pushed)
{
drawEnemies();
}
if(tbb9.Pushed)
{
drawPlants();
}
if(tbb10.Pushed)
{
drawTradePacks();
}
if(tbb11.Pushed)
{
drawThunderStruck();
}
if(tbb12.Pushed)
{
drawFishes();
}
if(tbb13.Pushed)
{
drawSunken();
}
if(tbb14.Pushed)
{
drawAnimals();
}
//load bitmap in picturebox1
pictureBox1.Image = bmp;
g.Dispose();
}
private void RunForm()
{
try
{
InitializeForm();
Console.WriteLine("InitializeForm done");
Application.Run(f);
}
catch (Exception error)
{
Log(error.ToString());
}
}
public void PluginStop()
{
try
{
if (f != null)
{
f.Invoke(new Action(() => f.Close()));
f.Invoke(new Action(() => f.Dispose()));
}
if (formThread.ThreadState == System.Threading.ThreadState.Running)
{
formThread.Abort();
formThread.Join();
}
}
catch (Exception error)
{
Log("Ant Radar Exited");
}
}
public void PluginRun()
{
Log("Start Of Ant Radar");
formThread = new Thread(RunForm);
formThread.SetApartmentState(ApartmentState.STA);
formThread.Start();
while (true)
Thread.Sleep(100);
}
}
}
is there any way to zoom in\out ?
the far distance not always needed
i have try to add this option but need help:
Can't get this to compile correctly keeps giving errors. Can anyone paste there working one in code form here
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
namespace AntRadar
{
public class AntRadar : Core
{
// Archege uses Y Bottom = 0;
// Radar uses Y Top = 0;
public static string GetPluginAuthor()
{
return "XantX";
}
public static string GetPluginVersion()
{
return "1.0.0.0";
}
public static string GetPluginDescription()
{
return "ant's Radar Plugin";
}
private Form f;
private Label label;
private Thread formThread;
System.Windows.Forms.Timer t = new System.Windows.Forms.Timer();
int WIDTH = 600;
int HEIGHT = 600;
int HAND = 150;
int u; //in degree
int cx, cy; //center of the circle
int x, y; //HAND coordinate
int tx, ty, lim = 20;
double myLastX, myLastY;
Bitmap bmp;
Graphics g;
private System.Windows.Forms.PictureBox pictureBox1;
Double rOriginX;
Double rOriginY;
Double rOriginZ;
Creature creature = null;
int doodX;
int doodY;
double myPrevX = 0;
double myPrevY = 0;
double prevAngle = 90;
double scaleMap = 1;
bool FormIsOpen = true;
// Create font and brush.
Font drawFont = new Font("Courier", 11);
SolidBrush drawBrush = new SolidBrush(Color.White);
Skill skill = null;
ToolBarButton tbb1 = new ToolBarButton();
ToolBarButton tbb2 = new ToolBarButton();
ToolBarButton tbb3 = new ToolBarButton();
ToolBarButton tbb4 = new ToolBarButton();
ToolBarButton tbb5 = new ToolBarButton();
ToolBarButton tbb6 = new ToolBarButton();
ToolBarButton tbb7 = new ToolBarButton();
ToolBarButton tbb8 = new ToolBarButton();
ToolBarButton tbb9 = new ToolBarButton();
ToolBarButton tbb10 = new ToolBarButton();
ToolBarButton tbb11 = new ToolBarButton();
ToolBarButton tbb12 = new ToolBarButton();
ToolBarButton tbb13 = new ToolBarButton();
ToolBarButton tbb14 = new ToolBarButton();
ToolBarButton tbb15 = new ToolBarButton();
ToolBarButton tbb16 = new ToolBarButton();
ToolBarButton tbb17 = new ToolBarButton();
ToolBarButton tbb18 = new ToolBarButton();
ToolBarButton tbb19 = new ToolBarButton();
ToolBarButton tbb20 = new ToolBarButton();
Pen p = new Pen(Color.Green, 1f);
Pen p2 = new Pen(Color.Red, 2f);
Pen p3 = new Pen(Color.Blue, 3f);
private void InitializeForm()
{
f = new Form();
f.Width = 500;
f.Height = 500;
f.Text = "ant's Archeage Radar";
f.FormBorderStyle = FormBorderStyle.Sizable;
f.MaximizeBox = false;
f.MinimizeBox = false;
f.TopMost = true;
pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(pictureBox1)).BeginInit();
f.SuspendLayout();
//
// pictureBox1
//
pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
pictureBox1.Location = new System.Drawing.Point(0, 0);
pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new System.Drawing.Size(WIDTH, HEIGHT);
pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
pictureBox1.TabIndex = 0;
pictureBox1.TabStop = false;
//
// Form1
//
f.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
f.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
f.ClientSize = new System.Drawing.Size(WIDTH-14, HEIGHT - 75);
f.Controls.Add(pictureBox1);
f.Name = "Ant Radar";
f.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
f.Text = "Ant Radar";
((System.ComponentModel.ISupportInitialize)(pictureBox1)).EndInit();
f.ResumeLayout(false);
//create Bitmap
bmp = new Bitmap(WIDTH + 1, HEIGHT + 1);
//background color
f.BackColor = Color.Black;
//center
cx = WIDTH / 2;
cy = HEIGHT / 2;
//initial degree of HAND
u = 0;
//timer
t.Interval = 250; //in millisecond
t.Tick += new EventHandler(this.t_Tick);
t.Start();
pictureBox1.Click += PBox_Click;
ToolBar toolBar1 = new ToolBar();
tbb1.Text = "Mine Ore";
tbb2.Text = "Chop Trees";
tbb3.Text = "Mobs";
tbb4.Text = "Everything - Debug";
tbb5.Text = "Hide Text";
tbb6.Text = "Fixed World";
tbb7.Text = "Player - Friendly";
tbb8.Text = "Player - Enemy";
tbb9.Text = "Harvest Plants";
tbb10.Text = "Trade Packs";
tbb11.Text = "Thunderstruck";
tbb12.Text = "Fishing Schools";
tbb13.Text = "Sunken Treasure Chest";
tbb14.Text = "Butcher Animals";
tbb15.Text = "Zoom 4x";
tbb1.Style = ToolBarButtonStyle.ToggleButton;
tbb2.Style = ToolBarButtonStyle.ToggleButton;
tbb3.Style = ToolBarButtonStyle.ToggleButton;
tbb4.Style = ToolBarButtonStyle.ToggleButton;
tbb5.Style = ToolBarButtonStyle.ToggleButton;
tbb6.Style = ToolBarButtonStyle.ToggleButton;
tbb7.Style = ToolBarButtonStyle.ToggleButton;
tbb8.Style = ToolBarButtonStyle.ToggleButton;
tbb9.Style = ToolBarButtonStyle.ToggleButton;
tbb10.Style = ToolBarButtonStyle.ToggleButton;
tbb11.Style = ToolBarButtonStyle.ToggleButton;
tbb12.Style = ToolBarButtonStyle.ToggleButton;
tbb13.Style = ToolBarButtonStyle.ToggleButton;
tbb14.Style = ToolBarButtonStyle.ToggleButton;
tbb15.Style = ToolBarButtonStyle.ToggleButton;
toolBar1.Buttons.Add(tbb1);
toolBar1.Buttons.Add(tbb2);
toolBar1.Buttons.Add(tbb3);
toolBar1.Buttons.Add(tbb4);
toolBar1.Buttons.Add(tbb5);
toolBar1.Buttons.Add(tbb6);
toolBar1.Buttons.Add(tbb7);
toolBar1.Buttons.Add(tbb8);
toolBar1.Buttons.Add(tbb9);
toolBar1.Buttons.Add(tbb10);
toolBar1.Buttons.Add(tbb11);
toolBar1.Buttons.Add(tbb12);
toolBar1.Buttons.Add(tbb13);
toolBar1.Buttons.Add(tbb14);
toolBar1.Buttons.Add(tbb15);
f.Controls.Add(toolBar1);
f.FormClosed += new FormClosedEventHandler(Form1_FormClosed);
}
public Skill getDoodadSkill(DoodadObject dood){
Skill sk = null;
if(dood != null){
foreach(var obj in dood.getUseSkills()){
sk = obj;
}
}
return sk;
}
public void PBox_Click(object sender, EventArgs e)
{
Point cursorPos = f.PointToClient(Cursor.Position);
//Double z = getZFromHeightMap(cursorPos.X + rOriginX, cursorPos.Y + rOriginY);
//MoveTo(cursorPos.X + rOriginX, cursorPos.Y + rOriginY, z);
//Thread.Sleep(250);
// HARDCODED
cursorPos.X -= WIDTH / 2;
cursorPos.Y -= HEIGHT / 2;
cursorPos.X /= 2;
cursorPos.Y /= 2;
//Log(cursorPos.X.ToString());
//Log(cursorPos.Y.ToString());
// Not sure how to get the correct Z position
SetMapPos((rOriginX + cursorPos.X),(rOriginY - cursorPos.Y),me.Z);
//Log((cursorPos.X + me.X).ToString() + " " + (cursorPos.Y + me.Y).ToString());
}
public void drawOre()
{
foreach(var dood in getDoodads())
{
skill = getDoodadSkill(dood);
if(skill != null && (skill.name == "Mine Ore"))
{
drawWorldDot(dood.X,dood.Y,dood.Z,dood.name,Color.Blue);
}
}
}
public void drawTrees()
{
foreach(var dood in getDoodads())
{
skill = getDoodadSkill(dood);
if(skill != null && (skill.name == "Chop Tree"))
{
drawWorldDot(dood.X,dood.Y,dood.Z,dood.name,Color.Blue);
}
}
}
public void drawPlants()
{
foreach(var dood in getDoodads())
{
skill = getDoodadSkill(dood);
if(skill != null && (skill.name.Contains("Gather")))
{
drawWorldDot(dood.X,dood.Y,dood.Z,dood.name,Color.Blue);
}
}
}
public void drawAnimals()
{
foreach(var dood in getDoodads())
{
skill = getDoodadSkill(dood);
if(skill != null && (skill.name.Contains("Butcher")))
{
drawWorldDot(dood.X,dood.Y,dood.Z,dood.name,Color.Blue);
}
}
}
public void drawThunderStruck()
{
foreach(var dood in getDoodads())
{
if (dood.name.Contains("Thunderstuck"))
{
drawWorldDot(dood.X, dood.Y, dood.Z , dood.name, Color.Blue);
}
}
}
public void drawFishes()
{
foreach(var dood in getDoodads())
{
if (dood.name.Contains("Schooling"))
{
drawWorldDot(dood.X, dood.Y, dood.Z , dood.name, Color.Blue);
}
}
}
public void drawTradePacks()
{
string [] TradePacks = {"Arcum Iris",
"Falcorth",
"Hasla",
"Mahadevi",
"Perinoor",
"Rookborne",
"Silent Forest",
"Solis",
"Tigerspine",
"Villanelle",
"Windscour",
"Ynystere",
"Cinderstone",
"Dewstone",
"Gweonid",
"Halcyona",
"Hellswamp",
"Lilyut",
"Marianople",
"Sanddeep",
"Solzreed",
"Two Crowns",
"White Arden",
"Iron Pack",
"Fabric Pack",
"Lumber Pack",};
foreach(var dood in getDoodads())
{
foreach (string s in TradePacks)
{
if (dood.name.Contains(s))
{
drawWorldDot(dood.X, dood.Y, dood.Z , dood.name + " z: " + dood.Z, Color.Blue);
}
}
}
}
public void drawSunken()
{
foreach(var dood in getDoodads())
{
if (dood.name.Contains("Treasure"))
{
drawWorldDot(dood.X, dood.Y, dood.Z , dood.name, Color.Blue);
}
}
}
public void drawAllObjects()
{
foreach(var dood in getDoodads())
{
//if (dood.name.Contains("Clipper")) = harpoonclipper / cannon clipper
//if (dood.name.Contains("Seat")) = rowboat
drawWorldDot(dood.X, dood.Y, dood.Z , dood.name, Color.Blue);
}
}
public void drawWorldDot(double x, double y, double z, String text, Color color)
{
double relx,rely,relz;
relx = x - rOriginX;
rely = y - rOriginY;
relz = z - me.Z;
double scale = WIDTH / 600 * 0.8 * scaleMap;
relx *= scale;
rely *= scale;
relz *= scale;
// + "[" + x.ToString() + "," + y.ToString() + "," + z.ToString() + "]"
drawDot(cx + (int)relx , cy + -(int)rely ,text,color);
}
public void drawDot(int x, int y, String text, Color color)
{
p2.Color = color;
g.DrawEllipse(p2, x, y, 2, 2);
if (tbb5.Pushed)
g.DrawString("", drawFont, drawBrush, x - (6 * (text.Count()/2)), y);
else
g.DrawString(text, drawFont, drawBrush, x - (6 * (text.Count()/2)), y);
}
public void drawCreatures()
{
foreach(var obj in getCreatures())
{
if(obj.type == BotTypes.Npc)
{
drawWorldDot(obj.X,obj.Y,obj.Z,obj.name,Color.Orange);
}
}
}
public void drawFriendlies()
{
foreach(var obj in getCreatures())
{
if(obj.type == BotTypes.Player)
{
//&& obj.factionId == me.factionId
if (me.factionId == 109 || me.factionId == 113) // if im east
{
if (obj.factionId == 109 || obj.factionId == 113)
drawWorldDot(obj.X,obj.Y,obj.Z,obj.name,Color.Aquamarine);
}
else if (me.factionId == 101 || me.factionId == 103) // im a west player thus draw
{
if ((obj.factionId == 101 || obj.factionId == 103))
drawWorldDot(obj.X,obj.Y,obj.Z,obj.name,Color.Aquamarine);
}
}
}
}
public void drawEnemies()
{
foreach(var obj in getCreatures())
{
if(obj.type == BotTypes.Player)
{
//&& obj.factionId == me.factionId
if (me.factionId == 109 || me.factionId == 113) // if im east
{
if (obj.factionId == 101 || obj.factionId == 103)
drawWorldDot(obj.X,obj.Y,obj.Z,obj.name,Color.Red);
}
else if (obj.factionId == 101 || obj.factionId == 103) // im a west player thus draw
{
if (obj.factionId == 109 || obj.factionId == 113)
drawWorldDot(obj.X,obj.Y,obj.Z,obj.name,Color.Red);
}
}
}
}
public void drawSelf()
{
drawWorldDot(me.X, me.Y, me.Z, "Me", Color.White);
// draw the line in which you are looking
double diffy, diffx, angle;
diffx = me.X - myLastX;
diffy = me.Y - myLastY;
angle = Math.Atan2(diffy,diffx);
double vx,vy;
if (angle != 0)
{
vx = Math.Cos(angle);
vy = Math.Sin(angle);
prevAngle = angle;
}
else
{
vx = Math.Cos(prevAngle);
vy = Math.Sin(prevAngle);
}
vx *= 75;
vy *= 75;
myLastX = me.X;
myLastY = me.Y;
g.DrawLine(p3,new Point(cx + (int)(me.X - rOriginX),cy - (int)(me.Y - rOriginY)),new Point((int)(cx+vx + (int)(me.X - rOriginX)),(int)(cy-vy) - (int)(me.Y - rOriginY)));
}
public void drawNSEW()
{
//draw perpendicular line
g.DrawLine(p, new Point(cx, 0), new Point(cx, HEIGHT)); // UP-DOWN
g.DrawLine(p, new Point(0, cy), new Point(WIDTH, cy)); //LEFT-RIGHT
drawDot(cx,HEIGHT-25,"S",Color.Green);
drawDot(cx,0,"N",Color.Green);
drawDot(WIDTH-25,cy,"E",Color.Green);
drawDot(0,cy,"W",Color.Green);
}
private void t_Tick(object sender, EventArgs e)
{
// check if player is in game world - not confirm that it will prevent the crash
if (me == null || me.name == "")
{
return;
}
Log(me.factionId.ToString());
if (!tbb6.Pushed)
{
rOriginX = me.X;
rOriginY = me.Y;
rOriginZ = me.Z;
}
//Log(angle(me.target, me).ToString());
g = Graphics.FromImage(bmp);
g.Clear(Color.Black);
drawNSEW();
drawSelf();
if(tbb4.Pushed)
{
drawAllObjects();
pictureBox1.Image = bmp;
g.Dispose();
return;
}
if(tbb1.Pushed)
{
drawOre();
}
if(tbb2.Pushed)
{
drawTrees();
}
if(tbb3.Pushed)
{
drawCreatures();
}
if(tbb7.Pushed)
{
drawFriendlies();
}
if(tbb8.Pushed)
{
drawEnemies();
}
if(tbb9.Pushed)
{
drawPlants();
}
if(tbb10.Pushed)
{
drawTradePacks();
}
if(tbb11.Pushed)
{
drawThunderStruck();
}
if(tbb12.Pushed)
{
drawFishes();
}
if(tbb13.Pushed)
{
drawSunken();
}
if(tbb14.Pushed)
{
drawAnimals();
}
if(tbb15.Pushed)
{
scaleMap = 4;
}
else
{
scaleMap = 1;
}
//load bitmap in picturebox1
pictureBox1.Image = bmp;
g.Dispose();
}
private void RunForm()
{
try
{
InitializeForm();
Console.WriteLine("InitializeForm done");
Application.Run(f);
}
catch (Exception error)
{
Log(error.ToString());
}
}
public void PluginStop()
{
try
{
if (f != null)
{
f.Invoke(new Action(() => f.Close()));
f.Invoke(new Action(() => f.Dispose()));
}
if (formThread.ThreadState == System.Threading.ThreadState.Running)
{
formThread.Abort();
formThread.Join();
}
}
catch (Exception error)
{
Log("Ant Radar Exited");
}
}
void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
// Do something
//PluginStop();
FormIsOpen = false;
}
public void PluginRun()
{
Log("Start Of Ant Radar");
formThread = new Thread(RunForm);
formThread.SetApartmentState(ApartmentState.STA);
formThread.Start();
while (FormIsOpen)
Thread.Sleep(100);
}
}
}
OMG I love this radar
I can confirm it works with trade packs, sunken treasure, trees, ore
Request: Don't show plants and trees on scarecrow plots
Ok sorry here noob to AA bot I got only for the radar but I don't know what to do with the ( Get the code -> Pastebin.com ) thing do I put it on a notepad and rename it? Is there a guide out here to help me with this all I need to do is do it one time and I can learn
Glad you like it.
Working on your request.
is there any way you can make the map rotate instead of the pointer?
public void drawCreatures()
{
foreach(var obj in getCreatures().Where( x => (x.type == BotTypes.Npc)))
{
drawWorldDot(obj.X,obj.Y,obj.Z,obj.name,Color.Orange);
}
}
public void drawFriendlies()
{
foreach(var obj in getCreatures().Where( x => (x.type == BotTypes.Player && isAlly(x))))
{
drawWorldDot(obj.X,obj.Y,obj.Z,obj.name,Color.Aquamarine);
}
}
public void drawEnemies()
{
foreach(var obj in getCreatures().Where( x => (x.type == BotTypes.Player && isEnemy(x))))
{
drawWorldDot(obj.X,obj.Y,obj.Z,obj.name,Color.Red);
}
}