creating macro keyboard

dmw2200

New member
Joined
Sep 28, 2018
Messages
2
Programming Experience
3-5
greetings everyone i'm new here
I'm trying to make a macro for a particular game :nonchalance:

The idea depends on checking (color ,coordinates ) :eagerness:
If a specific color is found in the specific coordinates press the keyboard button
and this will be inside loop it's mean will be continue searching until stop this macro manually by shortcut or button :concern:

so i create algorithm and then started writing code but i'm facing problem to how writing code as macro :nevreness:
so for keep my macro recognize (color ,coordinates )or keep checking screen for whole time even keystroke :apologetic:
could you help me to complete this code please?




C#:
using System;using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        bool macrostart = false;




        void check_red_square()
        {
            if (red square) //need to put here coordinate and colors RGP HERE to check on screen
{
                SendKeys.Send("A");
            }
        }


        void check_square_blue()
        {
            if (square blue)) //need to put here coordinate and colors RGP HERE to check on screen
{
                SendKeys.Send("S");
            }
        }


        void check_yellow_circle()
        {
            if (yellow circle) //need to put here coordinate and colors RGP HERE to check on screen
{
                SendKeys.Send("D");
            }
        }


        private void btnStart_Click(object sender, EventArgs e)
        {
            macrostart = true;


            while (macrostart = true)
            {
                check_red_square();
                check_square_blue();
                check_yellow_circle();
            }
        }


        private void btnEnd_Click(object sender, EventArgs e)
        {
            macrostart = false;
        }


    }
}
 
You said that you are writing code to implement an algorithm. How can we help you write code if we don't know what that algorithm is or where you're having an issue implementing it?
 
You said that you are writing code to implement an algorithm. How can we help you write code if we don't know what that algorithm is or where you're having an issue implementing it?

thanks for replay and sorry for that
it will be Keypress Simulation in Games (SendKeys and DirectX) so you can see my algorithm inside start button above
its start from here

C#:
while (macrostart = true)            {
                check_red_square();
                check_square_blue();
                check_yellow_circle();
            }
 
Last edited:
Back
Top Bottom