Register for your free account! | Forgot your password?

Go Back   elitepvpers > General Gaming > General Gaming Discussion
You last visited: Today at 09:58

  • Please register to post and access all features, it's quick, easy and FREE!

 

Need help to create qs bot (C#)

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2011
Posts: 31
Received Thanks: 1
Need help to create qs bot (C#)

the qs bot people gave me isnt that perfect i wanna try to do a better one but i counter a problem...
there is a command in C# Sendkeys class - Send or SendWait.
i tried use that but it only press the specific char only if im focused in the textbox someone know why? please...
is there any other command that press a keystroke?

i dont care if u will help me with other language



tronsy is offline  
Old   #2
 
elite*gold: 0
Join Date: Apr 2011
Posts: 506
Received Thanks: 183
1 . Whats a qs bot ? Edit : Now I know it !

2. I dont really understand your Problem send wait is the time before the programm sends the command ?


[X]Diesel is offline  
Old   #3
 
elite*gold: 0
Join Date: May 2011
Posts: 31
Received Thanks: 1
it suppose send a keystroke to the application it focused...
here is my code:
i did that only if FT_client is focused send a keystroke with the Senkeys method:


using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Windows.Forms;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Diagnostics;
using System.Timers;
using System.Runtime.InteropServices;
using System.IO;
using System.Net;
using System.Net.Mail;
using Microsoft.Win32;

using System.Security.Principal;

namespace WindowsInput
{
class Program
{
public static Process[] ft = Process.GetProcessesByName("FT_Client");
public static bool check=false;
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("User32")]
private static extern int SetForegroundWindow(IntPtr hwnd);
[DllImport("User32")]
private static extern IntPtr GetForegroundWindow();

public static Boolean checkProcesses(Process[] z)
{

IntPtr k = GetForegroundWindow();//get the focused process handle

foreach (Process p in z)
{
if (k.Equals(p.MainWindowHandle))
{
return true;

}
}
return false;
}

public static void OnTimedEvent(object source, EventArgs e)
{
if (checkProcesses(ft))
{
/*SetForegroundWindow(ft.MainWindowHandle);*/
SendKeys.SendWait("W");
InputSimulator.SimulateKeyPress(VirtualKeyCode.SPA CE);
InputSimulator.SimulateKeyPress(VirtualKeyCode.VK_ W);
}
}

static void Main(string[] args)
{

IntPtr p = ft[0].MainWindowHandle;
System.Timers.Timer timer;
timer = new System.Timers.Timer();
timer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
timer.AutoReset = true;
timer.Interval = 5000;
timer.Start();
Application.Run();
GC.KeepAlive(timer);


}
}
}




it sends the key like "W" or whatever but only if im in the texbox in fantasy tennis or in the loby somehow it doest really press w when im in lifewoods tring to use qs...i mean it send the key "w" but it doesnt press w...

it has a timer with interval i can change it to whatever i want ( its in miliseconds - 1000 mil = 1 second)

nobody can help me? i thought we have programmers here...
tronsy is offline  
Old   #4
 
elite*gold: 0
Join Date: Apr 2011
Posts: 506
Received Thanks: 183
Ja now I understand your Problem . Then you must wait a little bit . This Section is very little ( Bad english I mean that here are not so many Users :'D ) . You must wait ! I think any Coder comes online and then he can help you !


[X]Diesel is offline  
Old   #5
 
elite*gold: 0
Join Date: May 2011
Posts: 31
Received Thanks: 1
well i tried to talk with the producer of the qs bot here
he doesnt wanna share with me his code...

if i will solve this problem it will be easy to do the rest.. i will do qs bot for all the maps...


tronsy is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
{Help} To create PNJ
Good evening, I want to know how to create an NPC (seller) to sell the item (pana, stone exp ...) thank you in advance for your help.
1 Replies - Shaiya
[help]How do I create an NPC to PM / GM
Anybody know how I create an NPC that delivers the salary GM / PM If anyone can help me thank you. If it is not possible, pelomenos deliver the...
2 Replies - EO PServer Hosting
create lc help pls
i need a guide to create the server,the forum have?
1 Replies - Last Chaos
is possible to create a hack to create items +7
How can I create a hack to create items +7
25 Replies - Dekaron



All times are GMT +2. The time now is 09:58.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2017 elitepvpers All Rights Reserved.