Skip to content

Commit

Permalink
Multiple eve client support, stage 1
Browse files Browse the repository at this point in the history
  • Loading branch information
emist committed Jul 8, 2011
1 parent 2c65fc0 commit 493ddce
Show file tree
Hide file tree
Showing 11 changed files with 554 additions and 47 deletions.
43 changes: 43 additions & 0 deletions Bot.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 27 additions & 10 deletions Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@

namespace Eryan
{
public partial class Bot
public partial class Bot
{

Thread botThread;
WindowHandler bot;
WindowHandler bot;

private delegate void clientWindowDelegate(ClientWindow cw);
//Thread[] botWindowThreads = new Thread[20];
//WindowHandler[] bots = new WindowHandler[20];

Expand All @@ -27,24 +28,35 @@ public Bot()

}

public override bool Equals(object obj)
{
return obj is Bot && this == (Bot)obj;
}

private void Program_Load(object sender, EventArgs e)
{
//CreateBot();
}




public Thread CreateBot()
public void initializeBot(ClientWindow cw)
{
botThread = new Thread(new ParameterizedThreadStart(ShowForm));

//botThread = new Thread(new ParameterizedThreadStart(SpawnForm));
bot = new WindowHandler();
botThread.Start(bot);
return botThread;
bot.bringToFront();
bot.setTopLevel(false);
bot.setVisible(true);
bot.setFormBorderStyle(FormBorderStyle.None);
bot.setDockStyle(DockStyle.Fill);


cw.addControlToTab(bot);
//botThread.Start(bot);

}

public WindowHandler getBot()
public WindowHandler getHandle()
{
return bot;
}
Expand All @@ -54,7 +66,12 @@ public uint getPid()
return bot.getPid();
}

public void ShowForm(object firm)
public Thread getThread()
{
return botThread;
}

public void SpawnForm(object firm)
{
Application.Run(firm as Form);
}
Expand Down
120 changes: 120 additions & 0 deletions Bot.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
47 changes: 30 additions & 17 deletions Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,64 @@ namespace Eryan
{
static class Eryan
{

/// <summary>
/// The main entry point for the application.
/// </summary>
///





public static void SpawnForm(object firm)
{
Application.Run(firm as Form);
}

[STAThread]
static void Main()
{



Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);


Bot bot1 = new Bot();
ClientWindow cWindow = new ClientWindow();
Thread ClientThread = new Thread(new ParameterizedThreadStart(SpawnForm));
ClientThread.Start(cWindow);

Point location = new Point();

Bot bot1 = cWindow.createBot();

Thread bot1Thread = bot1.CreateBot();
while (bot1 == null)
Thread.Sleep(100);

//WindowHandler BotHandle = bot1.getHandle();

Point location = new Point();

WindowHandler BotHandle = bot1.getBot();
/*
while (bot1Thread.IsAlive)
while (true)
{
//bot1.getKeyBoard().sendKeyPresses("HelloWorld", 100, 600);
//bot1.getMouse().moveMouse(new Point(30, 30));
if (bot1 != null)
{
if (BotHandle.getMouse().cursorDistance(new Point(750, 900)) > 5)
BotHandle.getMouse().move(new Point(750, 900));
else
BotHandle.getMouse().move(new Point(500, 600));
if (BotHandle.getMouse().cursorDistance(new Point(750, 900)) > 5)
BotHandle.getMouse().move(new Point(750, 900));
else
BotHandle.getMouse().move(new Point(500, 600));


Console.WriteLine("Bot1 pid: " + bot1.getPid());
Console.WriteLine("Bot1 pid: " + bot1.getPid());
}
*/


System.Threading.Thread.Sleep(1000);
}
//}


}

Expand Down
Loading

0 comments on commit 493ddce

Please sign in to comment.