Results 1 to 3 of 3

Thread: creating macro keyboard

  1. #1
    .NET Framework
    .NET 4.5
    Join Date
    Sep 2018
    Posts
    2
    Rep Power
    0

    Question creating macro keyboard

    greetings everyone i'm new here
    I'm trying to make a macro for a particular game

    The idea depends on checking (color ,coordinates )
    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

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




    Code:
    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;
            }
    
    
        }
    }

  2. #2
    .NET Framework
    .NET 4.5
    Join Date
    Apr 2011
    Posts
    1,934
    Rep Power
    149
    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?

  3. #3
    .NET Framework
    .NET 4.5
    Join Date
    Sep 2018
    Posts
    2
    Rep Power
    0
    Quote Originally Posted by jmcilhinney View Post
    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

    Code:
    while (macrostart = true)            {
                    check_red_square();
                    check_square_blue();
                    check_yellow_circle();
                }
    Last edited by dmw2200; 09-28-2018 at 8:58 PM.

Similar Threads

  1. Multilingua virtual keyboard
    By dotComex in forum VS.NET General Discussion
    Replies: 2
    Last Post: 05-08-2016, 4:15 AM
  2. How to run external macro in Add-In
    By demcy in forum Add-In Development
    Replies: 0
    Last Post: 02-19-2014, 3:58 AM
  3. Question Excel automation run macro
    By grao in forum Third Party Products
    Replies: 0
    Last Post: 01-14-2014, 6:20 AM
  4. Question Disable working of Keyboard?
    By Tehseen in forum Windows Forms
    Replies: 1
    Last Post: 06-24-2013, 12:47 AM
  5. Moving paint object with keyboard input
    By Qobacha in forum Graphics / GDI+
    Replies: 2
    Last Post: 04-29-2012, 6:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •