I make a bot program and i want to send some keyboard keys between some interval of time.
this is the code in my thread. I have recorded: "F" click then wait 4 sec then "S","A","Q" clicks. The problem is that the time (4 sec) is waited and then all the latter's pop up in their order "fsaq"...
public void Run()
{
Thread.Sleep(3000);
for (int i = 0; i <= Form.BotEvents.Items.Count - 1; i++)
{
string[] EventText = Form.BotEvents.Items[i].ToString().Split(' ');
if (EventText[2] == "Time")
{
Thread.Sleep(Convert.ToInt32(EventText[3]));
}
else
{
SendKey(EventText[3]);
}
Thread.Sleep(100);
}
Run();
}