Sign in or Sign up

My C++ Auto-Clicker
Started by Dox


Rate this topic
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5


6 posts in this topic
Dox Offline
Cyber Security Student
***


Contributor
Posts: 414
Threads: 125
Joined: Mon Oct 2017
Reputation: 6

CZPoints: 134 CZP
OnFireContributor
10-12-2017, 06:13 PM -
#1
Code:
// Carbon's otuA-rekcilC - https://twitter.com/DoxingMethod - Contact me
#include <iostream>
#include <windows.h>
#include <stdlib.h>

using namespace std;

const float INTERVAL = 49;

void getMousePos (long&, long&);
void printMenu (HWND, char []);

int main ()
{
    SetConsoleTitle("Carbon's rekcilC");
    
    static bool isClickerOn = false;    
    
    while (!GetAsyncKeyState(VK_F8))
    {
        HWND hwnd;
        char str[50] = "Minecraft Client";
        
        printMenu(hwnd, str);
        cout << ((isClickerOn == false) ? "otuA-rekcilC is: [OFF]" : "otuA-rekcilC is: [ON]") << endl;    
        
        static long xPos = 0, yPos= 0;
            
        if (GetAsyncKeyState(VK_F4))
        {              
                isClickerOn = ((isClickerOn == true) ? false : true);
                
                while (isClickerOn == true)
                {
                    if (GetAsyncKeyState(VK_F6))
                    {
                        isClickerOn = false;
                        break;
                    }
                    else
                    {    
                        printMenu(hwnd, str);
                        cout << ((isClickerOn == false) ? "otuA-rekcilC is: [OFF]" : "otuA-rekcilC is: [ON]") << endl;
                        mouse_event(MOUSEEVENTF_LEFTDOWN, xPos, yPos, 0, 0);
                        mouse_event(MOUSEEVENTF_LEFTUP, xPos, yPos, 0, 0);
                        Sleep(INTERVAL);    
                    }       
                }
        }    
            
        Sleep(600);
    }

}

void getMousePos (long &x, long &y)
{
    POINT p;
    GetCursorPos(&p);
    
    x = p.x;
    y = p.y;
    
    GetCursorPos(&p);
    if (p.x != x && p.y != y)
    {
        x = p.x;
        y = p.y;
        cout << x << ", " << y << endl;
    }    
}

void printMenu (HWND hwnd, char str[])
{
    system("cls");
        
    cout << "==================================" << endl
         << "==\tDoxingMethod's otuA-rekcilC\t==" << endl
         << "==================================" << endl;
        
    hwnd = FindWindow(NULL, str);
    
    cout << "\nTarget window is: '" << str << "'"<< endl;
    if (hwnd != NULL)
        cout << "Target status: [FOUND]" << endl;
    else
        cout << "Target status: [NOT FOUND]" << endl;
        
    cout << "--------------------------------------" << endl      
         << "\nPress F4 to start otuA-gnikcilC" << endl
         << "Press F8 to exit\n" << endl
         << "--------------------------------------" << endl;
        
    cout << "\nClicking interval is: " << INTERVAL/1000 << "s" << endl;  
}

//This is just a simple line of strings <3
//Expect changes!
//It's in reverse to stop string finders from finding the Reversed word to this file...
//<3
You may see that the words "Auto" and "Clicker" are reversed. This is to bypass some means of a screen share. 
Anyway have fun! <3
Contact E-Mail: [email protected]
BTC Address: 1JmJrbmQn4Bg24r68bSyZ7TxNZGad3iPWM
Zens Offline
Junior Member
**


Registered
Posts: 23
Threads: 3
Joined: Sat Sep 2017
Reputation: 0

CZPoints: 3 CZP
10-13-2017, 08:58 AM -
#2
You should stop those bad habit --> using a namespace
[Image: WAhuMDL.png]
Dox Offline
Cyber Security Student
***


Contributor
Posts: 414
Threads: 125
Joined: Mon Oct 2017
Reputation: 6

CZPoints: 134 CZP
OnFireContributor
10-13-2017, 04:14 PM -
#3
(10-13-2017, 08:58 AM)Zens Wrote: You should stop those bad habit --> using a namespace

Errrr... What? What's wrong with me sharing my work? Nice to see some hate xd.
Contact E-Mail: [email protected]
BTC Address: 1JmJrbmQn4Bg24r68bSyZ7TxNZGad3iPWM
deadeye Offline
Programmer
***


Registered
Posts: 247
Threads: 19
Joined: Sat Apr 2017
Reputation: 2

CZPoints: 28 CZP
HQMember
10-13-2017, 10:52 PM -
#4
(10-13-2017, 04:14 PM)Dox Wrote:
(10-13-2017, 08:58 AM)Zens Wrote: You should stop those bad habit --> using a namespace

Errrr... What? What's wrong with me sharing my work? Nice to see some hate xd.

That's not hate, he is just trying to tell you how you could improve your code by not using " using namespace std".
[Image: cw2gsbi.png]

Discord: deadeye#7164

Disclaimer: I have no idea what I'm talking about.
Zens Offline
Junior Member
**


Registered
Posts: 23
Threads: 3
Joined: Sat Sep 2017
Reputation: 0

CZPoints: 3 CZP
10-14-2017, 05:17 AM -
#5
Yes, i did. Well using "using namespace std;" is not good
[Image: WAhuMDL.png]
Dox Offline
Cyber Security Student
***


Contributor
Posts: 414
Threads: 125
Joined: Mon Oct 2017
Reputation: 6

CZPoints: 134 CZP
OnFireContributor
10-14-2017, 11:12 AM -
#6
Fairs. Not very good at C++. Might need to work on this then. :/
Contact E-Mail: [email protected]
BTC Address: 1JmJrbmQn4Bg24r68bSyZ7TxNZGad3iPWM
[IDLE]Epic Offline
Programmers
***


IDLE
Posts: 147
Threads: 20
Joined: Thu Apr 2017
Reputation: 7

CZPoints: 0 CZP
Contributor
10-22-2017, 07:57 PM -
#7
(10-14-2017, 11:12 AM)Dox Wrote: Fairs. Not very good at C++. Might need to work on this then. :/

good job on your release, even tho using namespace std; is not good, you still did a good job.
it works that is what the main point was.
[Image: PMBDPha.png]




Users browsing this thread: 1 Guest(s)