simple co bot

12/02/2010 13:57 koio#1
i created a smal programm for autositting

i wrote this programm
Code:
using System;
using System.Runtime.InteropServices;
using System.Drawing;
using System.Windows.Forms;

namespace SimulateKeyPress
{
    class Form1 : Form
    {
        private Button button1 = new Button();

        [STAThread]
        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new Form1());
        }

        public Form1()
        {
            button1.Location = new Point(10, 10);
            button1.TabIndex = 0;
            button1.Text = "Click to Find co";
            button1.AutoSize = true;
            button1.Click += new EventHandler(button1_Click);

            this.DoubleClick += new EventHandler(Form1_DoubleClick);
            this.Controls.Add(button1);
        }

        // Get a handle to an application window.
        [DllImport("USER32.DLL", CharSet = CharSet.Unicode)]
        public static extern IntPtr FindWindow(string lpClassName,
            string lpWindowName);

        // Activate an application window.
        [DllImport("USER32.DLL")]
        public static extern bool SetForegroundWindow(IntPtr hWnd);

        // Send a series of key presses to the co application.
        private void button1_Click(object sender, EventArgs e)
        {

            IntPtr coHandle = FindWindow(null, "[Conquer Online]");

            // Verify that co is a running process.
            if (coHandle == IntPtr.Zero)
            {
                MessageBox.Show("CO is not running.");
                return;
            }

            // Make co the foreground application and send it 
            // a set of calculations.
            SetForegroundWindow(coHandle);
            SendKeys.SendWait("^"+"s");
        }

        // Send a key to the button when the user double-clicks anywhere 
        // on the form.
        private void Form1_DoubleClick(object sender, EventArgs e)
        {

            SendKeys.Send("{ENTER}");
        }
    }
}
my problem is that the programm sends the key to all programms that are active. If i chose now the conquer window nothing happens. can someone help me how to send the key to the conquer window
12/02/2010 14:48 gorgone#2
why u don t use autoit .. is much easy to use and if u know vb.net are sooo similar :))

[Only registered and activated users can see links. Click Here To Register...]

autostig is simple to use and is made to send key press and all kind of similar event
12/02/2010 16:34 koio#3
with autoit i have the same problem
12/02/2010 23:56 gorgone#4
in autoit .. use

SEND to send key

the special key like RETURN use {RETURN} the {

u can detect mouse positions and coordinate of windows

try to look

$coordinate_conquer = WinGetPos("[active]")

and send

send("{F6}")
MouseClick('Right')
12/03/2010 06:59 lilmhakz123#5
is this c++?
12/03/2010 13:42 gorgone#6
no is autoit more easy to program then normal c# or borland c++
12/03/2010 23:28 koio#7
is it workinf with you??
i tryed it with send("{F1}") and nothing happens
12/06/2010 14:00 gorgone#8
first u need to focus the process and windows where u want press F1

then u need a good debugs on ur application i fixed all skill of my fire taos

with f1 and Right click .. sleep(500) or more meanwhile a press ond click to cast a spell

show me the code i ll help u

sample

Func UseHPskill()
if $SpecialHP = 100 then
send("{F6}")
MouseClick('Right')
sleep(400)
send("{F5}")
MouseClick('Right')
sleep(400)
send("{F5}")
MouseClick('Right')
sleep(600)
send("{F4}")
; MouseClick('Right')
endif
EndFunc
12/07/2010 14:28 janvier123#9
Reportet at 12.07.2010 - 2:30 PM
-multiple post (please use the "Edit-Button")
Quote:
doubleposting, or pushing up really old topics is not allowed and ends up in an infraction / a warning
Please read the [Only registered and activated users can see links. Click Here To Register...]
12/07/2010 17:56 Syst3m_W1z4rd#10
Quote:
Originally Posted by ChingChong23 View Post
fuck off and get a life, if all you do is look for people double posting.
AGREE

The dude have done that in all his post almost.
Is annoying to look at and is really pissed and he should report him self for spamming, because he don't write 1 useful post -.-
His nuthing, then a skid.

:bandit:
12/11/2010 12:30 zap_xlib#11
I tested your code using Mono and it worked great!. I set the in game HotKey to Ctrl+S and did:

> dmcs Filename.cs

> mono Filename.exe

It worked great!... i should say. I wonder how it failed to work for you...