horsehead Posted February 17, 2011 Author Share Posted February 17, 2011 anyone can give me some help with the question of the topic name? Link to comment Share on other sites More sharing options...
Keebler Elf Posted February 17, 2011 Share Posted February 17, 2011 Can you explain what you want better. Do you want the program to open another window and press f1\. Is the window already opened. Also what is this for. I could most likely make it for you, depending what its for. Link to comment Share on other sites More sharing options...
horsehead Posted February 17, 2011 Author Share Posted February 17, 2011 so i mean that the bot should focus on a window and i want to use a another window. I want to have i because i want to play a game with my friend and so my support char can heal him everytime and i can kill grind with him. Link to comment Share on other sites More sharing options...
Keebler Elf Posted February 17, 2011 Share Posted February 17, 2011 Since any macro I make would end up useing your mouse on you, there would end up being a slight freeze in your ability to use your mouse. I could make it though so that you could run the program. It switches windows and presses f1 then switches back. Would prob end up messing with less then a half second of your time if the game is not fullscreen. Link to comment Share on other sites More sharing options...
zdearborn Posted February 17, 2011 Share Posted February 17, 2011 I wroote this keypress simulator a while ago (might be better methods out there, but it works :P):it's in c#```using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runtime.InteropServices;using System.Diagnostics;using System.Threading;namespace Simulator{ class Program { const UInt32 WM_KEYDOWN = 0x0100; const int VK_F1 = 0x70; [DllImport("user32.dll")] static extern bool PostMessage(IntPtr hWnd, UInt32 Msg, int wParam, int lParam); [STAThread] static void Main(string[] args) { Console.Title = "Keypress Simulator"; Console.WriteLine("Enter the name of the program you wish to send simulated keypresses to (case sensitive): "); string proName = Console.ReadLine(); Console.WriteLine("start keypress simulator? (y/n)"); string input = Console.ReadLine(); int i = 2; if (input == "y") { while (true) { Process[] processes = Process.GetProcessesByName(proName); foreach (Process proc in processes) { PostMessage(proc.MainWindowHandle, WM_KEYDOWN, VK_F1, 0); } // randomize send time int randomA = 10000; // milliseconds int randomB = 30000; // milliseconds Random rand = new Random(); int random; random = rand.Next(randomA, randomB); Thread.Sleep(random); Console.WriteLine("executed at {0} ({1})", random.ToString(), i.ToString()); i++; } } } }}``` Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now