Jamlegend C++ Bot



  • Hab mein Bot auch noch mal Verbessert, das Problem mit dem heller werden besteht noch.
    Dafür ist das Problem mit den Effekten behoben und er unterstützt jetzt auch Strum(mehr oder wenniger).

    Download Bot:
    http://www.file-upload.net/download-1683611/JamLegend-Bot.exe.html

    Source auf an Frage.

    Vllt. mach ich ihn in nächster Zeit fertig, der Bot von foofel tut ja sowieso bei den meisten.



  • ein bot der guitar jam kann wär gut 😃

    aber ich glaube wenn du die function die foofel benutzt nimmst dann würde der besser funktionieren (auf jeden fall bei mir) dazu dann einfach noch die oberfläche ...damit es nicht nur in opera funktioniert.



  • drachlen schrieb:

    ich probiere mich einfach mal selbst dran...^^
    könnte mir denn vielleicht einer von euch sagen wie man einen bestimmten pixel auf die farbe kontrolieren kann und wenn die farbe sich verändert eine bestimmte taste drückt??

    das wär ja eigentlich auch alles was ich für so einen bot bräuchte.

    😃

    Danke

    Komm ein bischen selbstständigkeit könntest du auch mal an den tag legen, hast ja sogar gesagt das du es probieren willst also machs auch. Alles was du brauchst steht schon in sourcecode.



  • So, hab jetzt die Similar Funktion von foofle genommen und es tut (zumindest beim Normal-Modus) bis auf Hold alles perfekt.

    Weil Hold nicht wirklich richtig funktioniert, kann mans deaktivieren.
    Source wieder auf Anfrage, keine Lust das hoch zu laden wenns eh keiner will.

    Download:
    http://www.file-upload.net/download-1685966/JamLegend-Bot.exe.html



  • oh scheiße schon wieder der hat den irgend wie zwei mal geschickt als ich auf vorschau geklickt hab 😞



  • so ich hab jetz ma nen bot auf strum gemacht
    der besteht jetz aus zwei teilen der erste teil strumt die noten und der zweite macht die hammer ons
    der erste ist genau der gleiche wie der von foofel nur das er noch enter ranhängt..
    und der zweite teil da wurde eigentlich nur die rgb farben verändert (die weiße farbe in den boobles (hammer ons))
    aber so perfekt sind die nicht hier ma die codes
    das ist der für das strumen erste teil :

    #include "stdafx.h"
    #include <windows.h>
    #include <iostream> 
    #include <vector> 
    #include <utility>
    #pragma comment(lib, "winmm.lib")
    
    #define VK_1 0x31 
    #define VK_2 0x32 
    #define VK_3 0x33 
    #define VK_4 0x34 
    #define VK_5 0x35 
    
    struct Vector2D 
    { 
        Vector2D() {} 
        Vector2D(float x, float y) 
        { 
            this->x = x; 
            this->y = y; 
        } 
        float x, y; 
    }; 
    
    struct Vector3D 
    { 
        Vector3D() {} 
        Vector3D(float x, float y, float z) 
        { 
            this->x = x; 
            this->y = y; 
            this->z = z; 
        } 
        float x, y, z; 
    }; 
    
    struct Button 
    { 
        Button(COLORREF c, COLORREF hc, Vector2D p, Vector2D hp, int k) 
        { 
            color = c; 
            holdColor = hc; 
            pos = p; 
            holdPos = hp; 
            locktime = 0; 
            down = false; 
            key = k; 
        } 
    
        COLORREF color; 
        COLORREF holdColor; 
    
        Vector2D pos; 
        Vector2D holdPos; 
        unsigned long locktime; 
        bool down; 
        int key; 
    }; 
    
    class Window 
    { 
    public: 
        Window() 
        { 
            hDC = CreateDC(_T("DISPLAY"), NULL, NULL, NULL); 
            hWnd = FindWindow(_T("OperaWindowClass"), NULL); 
            Init(); 
            Run(); 
        } 
    
        ~Window() 
        { 
            DeleteDC(hDC); 
        } 
    private: 
        COLORREF GetColor(Vector2D pos, int rows , int cols) 
        { 
            Vector3D rgb; 
            int counter = 0; 
    
            if (rows == 0 || cols == 0) 
            { 
                return GetPixel(hDC, (int)pos.x, (int)pos.y); 
            } 
    
            // row oder col == 1 -> -1, 0, 1, == 2 -> -2, -1, 0, 1, 2 
            for (int y = -cols; y <= cols; y++) 
            { 
                for (int x = -rows; x <= rows; x++) 
                { 
                    COLORREF color = GetPixel(hDC, (int)pos.x + x, (int)pos.y + y); 
    
                    rgb.x += GetRValue(color); 
                    rgb.y += GetGValue(color); 
                    rgb.z += GetBValue(color); 
    
                    counter++; 
                } 
            } 
    
            rgb.x /= counter; 
            rgb.y /= counter; 
            rgb.z /= counter; 
    
            return RGB(rgb.x, rgb.y, rgb.z); 
        } 
    
        void Init() 
        { 
            buttons.push_back(Button(RGB(255, 236, 136), RGB(255, 247, 51),  Vector2D(549, 480), Vector2D(552, 465), VK_1)); // gelb 
            buttons.push_back(Button(RGB(236, 148, 255), RGB(246, 96, 254),  Vector2D(589, 480), Vector2D(592, 465), VK_2)); // lila 
            buttons.push_back(Button(RGB(198, 255, 130), RGB(201, 255, 50),  Vector2D(629, 480), Vector2D(632, 465), VK_3)); // grün 
            buttons.push_back(Button(RGB(255, 146, 134), RGB(255, 97, 100),  Vector2D(669, 480), Vector2D(672, 465), VK_4)); // rot 
            buttons.push_back(Button(RGB(151, 211, 247), RGB(146, 246, 255), Vector2D(711, 480), Vector2D(712, 465), VK_5)); // blau 
        } 
    
        bool IsColorSimilar(COLORREF c1, COLORREF c2, int maxDistance) 
        { 
            byte r1 = GetRValue(c1); 
            byte r2 = GetRValue(c2); 
    
            byte g1 = GetGValue(c1); 
            byte g2 = GetGValue(c2); 
    
            byte b1 = GetBValue(c1); 
            byte b2 = GetBValue(c2); 
    
            // größer dem kleineren und kleiner dem größeren 
            if (r1 <= Clamp(r2 + maxDistance, 0, 255) && 
                r1 >= Clamp(r2 - maxDistance, 0, 255) && 
    
                g1 <= Clamp(g2 + maxDistance, 0, 255) && 
                g1 >= Clamp(g2 - maxDistance, 0, 255) && 
    
                b1 <= Clamp(b2 + maxDistance, 0, 255) && 
                b1 >= Clamp(b2 - maxDistance, 0, 255)) 
            { 
                return true; 
            } 
            return false; 
        } 
    
        bool HasToHold(Button &b) 
        { 
            COLORREF lineColor = GetColor(b.holdPos, 0, 0); 
    
            if (IsColorSimilar(lineColor, b.holdColor, 60)) 
            { 
                return true; 
            } 
    
            return false; 
        } 
    
        void Run() 
        { 
            // better sleep 
            timeBeginPeriod(1); 
    
            while (true) 
            { 
                for(size_t i = 0; i < buttons.size(); i++) 
                { 
                    Button &b = buttons[i]; 
    
                    COLORREF targetColor = GetColor(b.pos, 2, 1); 
    
                    bool isSimilar = IsColorSimilar(targetColor, b.color, 30); 
    
                    if (isSimilar && !b.down/* && (b.locktime + 90) < timeGetTime() */) 
                    { 
                        keybd_event(b.key, 0, 0, 0)
    
                        ;keybd_event(0xD, 0, 0, 0); 
                        b.down = true; 
                        b.locktime = timeGetTime(); 
                    } 
                    else if(!isSimilar && b.down && /*(b.locktime + 50) < timeGetTime() && */!HasToHold(b)) 
                    { 
                        keybd_event(0xD, 0, KEYEVENTF_KEYUP, 0); 
                        keybd_event(b.key, 0, KEYEVENTF_KEYUP, 0);                    
                        b.down = false; 
                    } 
                } 
    
              Sleep (10);
            } 
        } 
    
        int Clamp(int val, int min, int max) 
        { 
            return max(min, min(val, max)); 
        } 
    
        HDC hDC; 
        HWND hWnd; 
        std::vector<Button> buttons; 
    }; 
    
    int _tmain(int argc, _TCHAR* argv[]) 
    { 
        Window wnd; 
        return 0; 
    }
    

    und das ist der zweite für die hammer ons:

    #include "stdafx.h"
    #include <windows.h>
    #include <iostream> 
    #include <vector> 
    #include <utility>
    #pragma comment(lib, "winmm.lib")
    
    #define VK_1 0x31 
    #define VK_2 0x32 
    #define VK_3 0x33 
    #define VK_4 0x34 
    #define VK_5 0x35 
    
    struct Vector2D 
    { 
        Vector2D() {} 
        Vector2D(float x, float y) 
        { 
            this->x = x; 
            this->y = y; 
        } 
        float x, y; 
    }; 
    
    struct Vector3D 
    { 
        Vector3D() {} 
        Vector3D(float x, float y, float z) 
        { 
            this->x = x; 
            this->y = y; 
            this->z = z; 
        } 
        float x, y, z; 
    }; 
    
    struct Button 
    { 
        Button(COLORREF c, COLORREF hc, Vector2D p, Vector2D hp, int k) 
        { 
            color = c; 
            holdColor = hc; 
            pos = p; 
            holdPos = hp; 
            locktime = 0; 
            down = false; 
            key = k; 
        } 
    
        COLORREF color; 
        COLORREF holdColor; 
    
        Vector2D pos; 
        Vector2D holdPos; 
        unsigned long locktime; 
        bool down; 
        int key; 
    }; 
    
    class Window 
    { 
    public: 
        Window() 
        { 
            hDC = CreateDC(_T("DISPLAY"), NULL, NULL, NULL); 
            hWnd = FindWindow(_T("OperaWindowClass"), NULL); 
            Init(); 
            Run(); 
        } 
    
        ~Window() 
        { 
            DeleteDC(hDC); 
        } 
    private: 
        COLORREF GetColor(Vector2D pos, int rows , int cols) 
        { 
            Vector3D rgb; 
            int counter = 0; 
    
            if (rows == 0 || cols == 0) 
            { 
                return GetPixel(hDC, (int)pos.x, (int)pos.y); 
            } 
    
            // row oder col == 1 -> -1, 0, 1, == 2 -> -2, -1, 0, 1, 2 
            for (int y = -cols; y <= cols; y++) 
            { 
                for (int x = -rows; x <= rows; x++) 
                { 
                    COLORREF color = GetPixel(hDC, (int)pos.x + x, (int)pos.y + y); 
    
                    rgb.x += GetRValue(color); 
                    rgb.y += GetGValue(color); 
                    rgb.z += GetBValue(color); 
    
                    counter++; 
                } 
            } 
    
            rgb.x /= counter; 
            rgb.y /= counter; 
            rgb.z /= counter; 
    
            return RGB(rgb.x, rgb.y, rgb.z); 
        } 
    
        void Init() 
        { 
            buttons.push_back(Button(RGB(220, 220, 220), RGB(260, 260, 260),  Vector2D(549, 480), Vector2D(552, 465), VK_1)); // gelb 
            buttons.push_back(Button(RGB(220, 220, 220), RGB(260, 260, 260),  Vector2D(589, 480), Vector2D(592, 465), VK_2)); // lila 
            buttons.push_back(Button(RGB(220, 220, 220), RGB(260, 260, 260),  Vector2D(629, 480), Vector2D(632, 465), VK_3)); // grün 
            buttons.push_back(Button(RGB(220, 220, 220), RGB(260, 260, 260),  Vector2D(669, 480), Vector2D(672, 465), VK_4)); // rot 
            buttons.push_back(Button(RGB(220, 220, 220), RGB(260, 260, 260),  Vector2D(711, 480), Vector2D(712, 465), VK_5)); // blau 
        } 
    
        bool IsColorSimilar(COLORREF c1, COLORREF c2, int maxDistance) 
        { 
            byte r1 = GetRValue(c1); 
            byte r2 = GetRValue(c2); 
    
            byte g1 = GetGValue(c1); 
            byte g2 = GetGValue(c2); 
    
            byte b1 = GetBValue(c1); 
            byte b2 = GetBValue(c2); 
    
            // größer dem kleineren und kleiner dem größeren 
            if (r1 <= Clamp(r2 + maxDistance, 0, 255) && 
                r1 >= Clamp(r2 - maxDistance, 0, 255) && 
    
                g1 <= Clamp(g2 + maxDistance, 0, 255) && 
                g1 >= Clamp(g2 - maxDistance, 0, 255) && 
    
                b1 <= Clamp(b2 + maxDistance, 0, 255) && 
                b1 >= Clamp(b2 - maxDistance, 0, 255)) 
            { 
                return true; 
            } 
            return false; 
        } 
    
        bool HasToHold(Button &b) 
        { 
            COLORREF lineColor = GetColor(b.holdPos, 0, 0); 
    
            if (IsColorSimilar(lineColor, b.holdColor, 60)) 
            { 
                return true; 
            } 
    
            return false; 
        } 
    
        void Run() 
        { 
            // better sleep 
            timeBeginPeriod(1); 
    
            while (true) 
            { 
                for(size_t i = 0; i < buttons.size(); i++) 
                { 
                    Button &b = buttons[i]; 
    
                    COLORREF targetColor = GetColor(b.pos, 2, 1); 
    
                    bool isSimilar = IsColorSimilar(targetColor, b.color, 30); 
    
                    if (isSimilar && !b.down/* && (b.locktime + 90) < timeGetTime() */) 
                    { 
                        keybd_event(b.key, 0, 0, 0); 
                        // press enter at the same time 
                        //keybd_event(0xD, 0, 0, 0); 
                        b.down = true; 
                        b.locktime = timeGetTime(); 
                    } 
                    else if(!isSimilar && b.down && /*(b.locktime + 50) < timeGetTime() && */!HasToHold(b)) 
                    { 
                        //keybd_event(0xD, 0, KEYEVENTF_KEYUP, 0); 
                        keybd_event(b.key, 0, KEYEVENTF_KEYUP, 0);                    
                        b.down = false; 
                    } 
                } 
              Sleep (9);
    
            } 
        } 
    
        int Clamp(int val, int min, int max) 
        { 
            return max(min, min(val, max)); 
        } 
    
        HDC hDC; 
        HWND hWnd; 
        std::vector<Button> buttons; 
    }; 
    
    int _tmain(int argc, _TCHAR* argv[]) 
    { 
        Window wnd; 
        return 0; 
    }
    

    der ausgelesene rgb wert für die hammer ons war (240,240,240)
    also hab ich sie einfach ma zu
    rgb(220, 220, 220) rgb(260, 260, 260)
    gemacht sollte ich das anders machen??

    wenn ihr noch tipps zum verbessern habt dann schreibt. 😃



  • kann mir jemand den teil der strummt so machen das er auch die choords machen kann also mehrere aufeinmal ?? wäre total nett hab mich schon die ganze zeit dran versucht... doch kiregs einfach nicht gebacken



  • Was willst du am ende überhaupt damit machen? Nur so aus neugier, ich mein es war ganz interessant zum gucken obs einfach geht aber jetzt is irgendwie die luft raus ^^



  • naja ich würd halt einfach gern nen bot der auch strummen kann ...
    und viele highscore haben ^^



  • wer mir ihn so um ändern kann bzw einen neuen machen kann der halt auch strummen kann würde auch geld von mir bekommen



  • 1280x1024 firefox
    tabs on always
    fullscreen

    queue.h
    
    struct Queue {
    
    	int key1;
    	int key2;
    	int key3;
    	int key4;
    	int key5;
    	int delay;
    	int tickid;
    	int type;
    };
    
    jlbot.cpp
    // jam legend bot (2.0)
    // drachlen@gmail.com
    
    #include "stdafx.h"
    #include "queue.h"
    #include <stdio.h>
    #include <string>
    #include <iostream>
    #include <sstream>
    #include <math.h>
    #include "Windows.h"
    #include <WinAble.h>
    using std::string;
    using namespace std;
    
    int returnTotal(int x, int y, HDC hdc)
    {
    
    	int pixel;
    	int pixR;
    	int pixG;
    	int pixB;
    	int total;
    
    	pixel = GetPixel( hdc, x, y );
    
    	pixR = GetRValue(pixel);
    	pixG = GetGValue(pixel);
    	pixB = GetBValue(pixel);
    
    	total = pixR+pixG+pixB;
    
    	return total;
    
    }
    
    int checkStreak( HDC hdc )
    {
    
    	//153 153 153 612 612 153 612 153
    	if( returnTotal(247,253, hdc) < 155 &&
    		returnTotal(253,246, hdc) < 155 &&
    		returnTotal(249,253, hdc) < 155 && 
    		returnTotal(250,252, hdc) > 155 &&
    		returnTotal(322,245, hdc) > 155 &&
    		returnTotal(321,250, hdc) < 155 &&
    		returnTotal(320,255, hdc) > 155 &&
    		returnTotal(326,261, hdc) < 155 )
    	{
    
    		return 0; // streak is 0
    
    	} else {
    
    		return 1; // streak is greater than 0
    
    	}
    
    	return 0;
    
    }
    
    int readNote( int note, HDC hdc )
    {
    
    	int baseX = 535;
    	int baseY = 494;
    
    	int total;
    
    	switch(note)
    	{
    
    		case 1:
    			baseX = 535;// SUSTAIN/NOTE TYPE: 551 (baseX + 16)
    		break;
    
    		case 2:
    			baseX = 575;//591
    		break;
    
    		case 3:
    			baseX = 615;//631
    		break;
    
    		case 4:
    			baseX = 655;//671
    		break;
    
    		case 5:
    			baseX = 695;//etc
    		break;
    
    		default:
    			baseX = 535;
    		break;
    
    	}
    
    	//baseX = baseX-8;
    
    	total = returnTotal( baseX, baseY, hdc);
    
    	if( total > 400 )
    	{
    
    		// note detected, what kind of note?
    		// check if it's a non-strum note
    		// baseX + 16 is the coordinate for note type
    		// baseX + 16 and baseY-17, baseY-19, baseY-21 to check sustain
    
    		//what kind of note is this?
    		if( returnTotal( baseX + 16, baseY, hdc) > 700 )
    		{
    
    			//non strum note
    			//check the streak. is it 0?
    			// If the streak is 0, then we have to strum this non-strum note.
    			// if it's greater than 0, we don't have to strum
    
    			if( checkStreak(hdc) == 0 )
    			{
    
    				return 1;//1 // treat this as a note with strum
    
    			} else {
    
    				return 3; // note without strum
    
    			}
    
    		} else {
    
    			//this is a strum note:
                return 1;
    
    		}
    
    	}
    
    	//couldn't find a note
    	return 0;
    }
    
    void sendKey(char ch, int state)
    {
    
    	if(state == 1)
    	{
    
    		INPUT input[2];
    		::ZeroMemory(input, sizeof(input));
    		input[0].type = input[1].type = INPUT_KEYBOARD;
    		input[0].ki.wVk  = input[1].ki.wVk = ch;
    		//input[1].ki.dwFlags = KEYEVENTF_KEYUP;
    		::SendInput(2, input, sizeof(INPUT));
    
    	} else {
    
    		INPUT input[2];
    		::ZeroMemory(input, sizeof(input));
    		input[0].type = input[1].type = INPUT_KEYBOARD;
    		input[0].ki.wVk  = input[1].ki.wVk = ch;
    		input[1].ki.dwFlags = KEYEVENTF_KEYUP;
    		::SendInput(2, input, sizeof(INPUT));
    
    	}
    
    }
    
    void releaseNote( int key )
    {
    
    	switch( key )
    	{
    
    		case 1:
    
               // sendKey(0x31, 1);
    			//Sleep(1);
    			sendKey(0x31, 0);
    
    		break;
    
    		case 2:
    
                //sendKey(0x32, 1);
    			//Sleep(1);
    			sendKey(0x32, 0);
    
    		break;
    
    		case 3:
    
               // sendKey(0x33, 1);
    			//Sleep(1);
    			sendKey(0x33, 0);
    
    		break;
    
    		case 4:
    
               // sendKey(0x34, 1);
    		//	Sleep(1);
    			sendKey(0x34, 0);
    
    		break;
    
    		case 5:
    
               // sendKey(0x35, 1);
    			//Sleep(1);
    			sendKey(0x35, 0);
    
    		break;
    
    		default:// ??
    
    		break;
    
    	}
    
    }
    
    void pressNote( int key )
    {
    
    	switch( key )
    	{
    
    		case 1:
    
    			sendKey(0x31, 1);
    
    		break;
    
    		case 2:
    
    			sendKey(0x32, 1);
    
    		break;
    
    		case 3:
    
    			sendKey(0x33, 1);
    
    		break;
    
    		case 4:
    
    			sendKey(0x34, 1);
    
    		break;
    
    		case 5:
    
    			sendKey(0x35, 1);
    
    		break;
    
    		default:// ??
    
    		break;
    
    	}
    
    }
    
    void doTap( int key )
    {
    
    	switch( key )
    	{
    
    		case 1:
    
    			sendKey(0x31, 0);
    			//Sleep(1);
    			sendKey(0x31, 1);
    
    		break;
    
    		case 2:
    
    			sendKey(0x32, 0);
    			//Sleep(1);
    			sendKey(0x32, 1);
    
    		break;
    
    		case 3:
    
    			sendKey(0x33, 0);
    			//Sleep(1);
    			sendKey(0x33, 1);
    
    		break;
    
    		case 4:
    
    			sendKey(0x34, 0);
    			//Sleep(1);
    			sendKey(0x34, 1);
    
    		break;
    
    		case 5:
    
    			sendKey(0x35, 0);
    			//Sleep(1);
    			sendKey(0x35, 1);
    
    		break;
    
    		default:// ??
    
    		break;
    
    	}
    
    }
    
    void main()
    {
    
    	int dispc = 0;
    
    	/*
    
    			function: readNote( [1-5] );
    			returns the following:
    			0, no note
    			1, note with strum
    			2, note with strum and with sustain
    			3, note without strum
    			4, note without strum, with sustain
    
    			---
    
    			notes will not be released until a new note needs to be pressed
    			the held note will be based on the lowest note in the queue
    
    	*/
    
    	HDC hdc = GetDC(NULL);
    
    	Queue queue[30000];
    	int queueBottom = 0;
    	int queueIndex = 0;
    	int tick = 0;
    
    	int run = 0;
    
    	int queueLoop=0;
    
    	int delay1=0;
    	int delay2=0;
    	int delay3=0;
    	int delay4=0;
    	int delay5=0;
    
    	int lastHeld1 = 0;
    	int lastHeld2 = 0;
    	int lastHeld3 = 0;
    	int lastHeld4 = 0;
    	int lastHeld5 = 0;
    
    	int foundNote = 0;
    
    	int indexQueue = 0;
    
    	//
    	//modify these to tweak for specific songs
    	/////////////////
        int varDelay = 67;
    	int betweenDelay = 74;
    	int indexQueueInt = 104;
    	int replaymode = 1;
    
    	int indexUp = 0;
    
    	///////////
    	//
    
    		int waitNext = 0;
    		int f5waitNext = 0;
    		int nextSong=0;
    		int pixR,pixG,pixB,pixel;
    		int f5wait=0;
    
    		INPUT input[2];
    
    	///////////
    
    	while(1)
    	{
    
    		///////////////////////////////////////////
    		////////////////////////////////////////////
    
    		/// JAM LEGEND BOT V1.0 CODE FOR PLAYING NEXT SONG:::
    
    		if(waitNext > 0)
    		{
    
    			waitNext--;
    
    		}
    
    		if(f5waitNext > 0)
    		{
    
    			f5waitNext--;
    
    		}
    
    		nextSong = GetPixel(hdc, 552, 420);
    		pixR = GetRValue(nextSong);
    		pixG = GetGValue(nextSong);
    		pixB = GetBValue(nextSong);
    
    		if(pixR == 9 && pixG == 121 && pixB == 201 && run == 1 && f5waitNext == 0)
    		{
    
    			nextSong = GetPixel(hdc, 553, 420);
    			pixR = GetRValue(nextSong);
    			pixG = GetGValue(nextSong);
    			pixB = GetBValue(nextSong);
    
    			if(pixR == 0 && pixG == 171 && pixB == 222 && run == 1)
    			{
    
    				if(f5wait == 0 && f5waitNext == 0)
    				{
    
    					f5waitNext = 750;
    					f5wait = 1;
    
    				}
    
    				if(f5wait == 1 && f5waitNext == 0)
    				{
    
    					f5wait = 2;
    					f5waitNext=1500;
    
    				}
    
    				if(f5wait == 2 && f5waitNext == 0)
    				{
    
    					f5wait=0;
    					f5waitNext = 700;
    
    					sendKey(0x74, 1);
    					//Sleep(1);
    					sendKey(0x74, 0);
    
    				}
    
    			}
    
    		}
    
    		nextSong = GetPixel(hdc, 750, 420);
    		pixR = GetRValue(nextSong);
    		pixG = GetGValue(nextSong);
    		pixB = GetBValue(nextSong);
    
    		if(pixR == 100 && pixG == 255 && pixB == 100 && run == 1 && f5waitNext == 0)
    		{
    
    			if(f5wait == 0)
    			{
    
    				f5waitNext = 1500;
    				f5wait = 1;
    
    			}
    
    			if(f5wait == 1 && f5waitNext == 0)
    			{
    
    				f5wait = 2;
    				f5waitNext=1300;
    
    			}
    
    			if(f5wait == 2 && f5waitNext == 0)
    			{
    
    				f5wait=0;
    				f5waitNext = 1300;
    
    				sendKey(0x74, 1);
    				Sleep(2);
    				sendKey(0x74, 0);
    
    				Sleep(8000);
    
    			}
    
    		}
    
    		nextSong = GetPixel(hdc, 460, 440);
    		pixR = GetRValue(nextSong);
    		pixG = GetGValue(nextSong);
    		pixB = GetBValue(nextSong);
    
    		if( (pixR > 240 && pixG > 240 && pixB > 240) && (run == 1 && waitNext == 0) )
    		{
    
    			::ZeroMemory(input, sizeof(input));
    			input[0].type = input[1].type = INPUT_MOUSE;
    			input[0].mi.dx = input[1].mi.dx = 37040; //23650 { center
    			input[0].mi.dy = input[1].mi.dy = 28020; // 9500 { center
    			input[1].mi.dwFlags = (MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE | MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP);
    			::SendInput(2, input, sizeof(INPUT));
    
    			Sleep(2500);
    
    		}
    
    		nextSong = GetPixel(hdc, 485, 512);
    		pixR = GetRValue(nextSong);
    		pixG = GetGValue(nextSong);
    		pixB = GetBValue(nextSong);
    		//34.34.34
    
    		if( ( (pixR == 34 && pixG == 34 && pixB == 34) || ( pixR == 33 && pixG == 33 && pixB == 33 ) ) && (run == 1 && waitNext == 0) )
    		{
    
    			Sleep(2500);
    
    			nextSong = GetPixel(hdc, 544, 522);//544,522
    			pixR = GetRValue(nextSong);
    			pixG = GetGValue(nextSong);
    			pixB = GetBValue(nextSong);
    			//255.255.255
    
    			if(pixR == 255 && pixG == 255 && pixB == 255 && run == 1)
    			{
    
    				//600,510
    				if(replaymode==1)
    				{
    
    					printf("replay mode\n");
    
    					/*::ZeroMemory(input, sizeof(input));
    					input[0].type = input[1].type = INPUT_MOUSE;
    					input[0].mi.dx = input[1].mi.dx = 32040; //23650 { center
    					input[0].mi.dy = input[1].mi.dy = 36000; //9500 { center
    					input[1].mi.dwFlags = (MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE | MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP );
    					::SendInput(2, input, sizeof(INPUT));*/
    
    					::ZeroMemory(input, sizeof(input));
    					input[0].type = input[1].type = INPUT_MOUSE;
    					input[0].mi.dx = input[1].mi.dx = 29040; //23650 { center
    					input[0].mi.dy = input[1].mi.dy = 36000; // 9500 { center
    					input[1].mi.dwFlags = (MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE | MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP);
    					::SendInput(2, input, sizeof(INPUT));
    
    				}else{
    
    					::ZeroMemory(input, sizeof(input));
    					input[0].type = input[1].type = INPUT_MOUSE;
    					input[0].mi.dx = input[1].mi.dx = 34040; //23650 { center
    					input[0].mi.dy = input[1].mi.dy = 32000; //9500 { center
    					input[1].mi.dwFlags = (MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE | MOUSEEVENTF_LEFTDOWN);
    					::SendInput(2, input, sizeof(INPUT));
    
    					::ZeroMemory(input, sizeof(input));
    					input[0].type = input[1].type = INPUT_MOUSE;
    					input[0].mi.dx = input[1].mi.dx = 34040; //23650 { center
    					input[0].mi.dy = input[1].mi.dy = 32000; // 9500 { center
    					input[1].mi.dwFlags = (MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE | MOUSEEVENTF_LEFTUP);
    					::SendInput(2, input, sizeof(INPUT));
    
    				}
    
    				Sleep(2500);
    
    				printf("sddf");
    
    				queueBottom = 0;
    				queueIndex = 1;
    
    				tick=0;
    
    				Sleep(1000);
    
    				::ZeroMemory(input, sizeof(input));
    				input[0].type = input[1].type = INPUT_MOUSE;
    				input[0].mi.dx = input[1].mi.dx = 24040; //23650 { center
    				input[0].mi.dy = input[1].mi.dy = 28020; //9500 { center
    				input[1].mi.dwFlags = (MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE);
    				::SendInput(2, input, sizeof(INPUT));
    
    				::ZeroMemory(input, sizeof(input));
    				input[0].type = input[1].type = INPUT_MOUSE;
    				input[0].mi.dx = input[1].mi.dx = 24040; //23650 { center
    				input[0].mi.dy = input[1].mi.dy = 28020; // 9500 { center
    				input[1].mi.dwFlags = (MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE);
    				::SendInput(2, input, sizeof(INPUT));
    				printf("second click\n");
    
    				waitNext = 10500;
    
    			}
    
    		}
    
    		nextSong = GetPixel(hdc, 555, 348);
    		pixR = GetRValue(nextSong);
    		pixG = GetGValue(nextSong);
    		pixB = GetBValue(nextSong);
    		//34.34.34
    
    		if(pixR == 173 && pixG == 250 && pixB == 39 && run == 1 && waitNext == 0)
    		{
    
    			printf("next song waitNext = 0 \n");
    
    			nextSong = GetPixel(hdc, 595, 350);
    			pixR = GetRValue(nextSong);
    			pixG = GetGValue(nextSong);
    			pixB = GetBValue(nextSong);
    			//255.255.255
    
    			Sleep(2500);
    
    			if(run == 1)
    			{
    
    				//600,510
    
    				::ZeroMemory(input, sizeof(input));
    				input[0].type = input[1].type = INPUT_MOUSE;
    				input[0].mi.dx = input[1].mi.dx = 34040; //23650 { center
    				input[0].mi.dy = input[1].mi.dy = 22020; //9500 { center
    				input[1].mi.dwFlags = (MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE | MOUSEEVENTF_LEFTDOWN);
    				::SendInput(2, input, sizeof(INPUT));
    
    				::ZeroMemory(input, sizeof(input));
    				input[0].type = input[1].type = INPUT_MOUSE;
    				input[0].mi.dx = input[1].mi.dx = 34040; //23650 { center
    				input[0].mi.dy = input[1].mi.dy = 22020; // 9500 { center
    				input[1].mi.dwFlags = (MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE | MOUSEEVENTF_LEFTUP);
    				::SendInput(2, input, sizeof(INPUT));
    
    				Sleep(5);
    
    				queueBottom = 0;
    				queueIndex = 2;
    				indexUp = 0;
    
    				if( lastHeld1 == 1 )
    				{
    
    					releaseNote( 1 );
    					lastHeld1=0;
    
    				}
    
    				if( lastHeld2 == 1 )
    				{
    
    					releaseNote( 2 );
    					lastHeld2=0;
    
    				}
    
    				if( lastHeld3 == 1 )
    				{
    
    					releaseNote( 3 );
    					lastHeld3=0;
    
    				}
    
    				if( lastHeld4 == 1 )
    				{
    
    					releaseNote( 4 );
    					lastHeld4=0;
    
    				}
    
    				if( lastHeld5 == 1 )
    				{
    
    					releaseNote( 5 );
    					lastHeld5=0;
    
    				}
    
    				Sleep(10);
    
    				::ZeroMemory(input, sizeof(input));
    				input[0].type = input[1].type = INPUT_MOUSE;
    				input[0].mi.dx = input[1].mi.dx = 14040; //23650 { center
    				input[0].mi.dy = input[1].mi.dy = 28020; //9500 { center
    				input[1].mi.dwFlags = (MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE);
    				::SendInput(2, input, sizeof(INPUT));
    
    				::ZeroMemory(input, sizeof(input));
    				input[0].type = input[1].type = INPUT_MOUSE;
    				input[0].mi.dx = input[1].mi.dx = 14040; //23650 { center
    				input[0].mi.dy = input[1].mi.dy = 28020; // 9500 { center
    				input[1].mi.dwFlags = (MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE);
    				::SendInput(2, input, sizeof(INPUT));
    
    				waitNext = 10050;
    
    			}
    
    		}
    
    		////////////////////////////////////////////////////////////////////////////////////////
    		////////////////////////////////////////////////////////////////////////////////////////
    		////////////////////////////////////////////////////////////////////////////////////////
    		////////////////////////////////////////////////////////////////////////////////////////
    		////////////////////////////////////////////////////////////////////////////////////////
    		////////////////////////////////////////////////////////////////////////////////////////
    		//////////////////////////////////////////// ////////////////////////////////////////////
    		// END OLD CODE
    		////////////////////////////////////////////////////////////////////////////////////////
    		////////////////////////////////////////////////////////////////////////////////////////
    		////////////////////////////////////////////////////////////////////////////////////////
    
    		Sleep(0.5);
    
    		if( run == 1 )
    		{
    
    			tick++;
    
    			if( ( (indexUp == 1) && 
    				( queue[queueBottom].key1 != queue[queueBottom+1].key1 ||
    				  queue[queueBottom].key2 != queue[queueBottom+1].key2 ||
    				  queue[queueBottom].key3 != queue[queueBottom+1].key3 || 
    				  queue[queueBottom].key4 != queue[queueBottom+1].key4 || 
    				  queue[queueBottom].key5 != queue[queueBottom+1].key5 )
    				 ))
    			{
    
    				indexUp = 0;
    
    				if( lastHeld1 == 1)
    				{
    
    					releaseNote( 1 );
    
    				}
    
    				if( lastHeld2 == 1 )
    				{
    
    					releaseNote( 2 );
    
    				}
    
    				if( lastHeld3 == 1 )
    				{
    
    					releaseNote( 3 );
    
    				}
    
    				if( lastHeld4 == 1 )
    				{
    
    					releaseNote( 4 );
    
    				}
    
    				if( lastHeld5 == 1 )
    				{
    
    					releaseNote( 5 );
    
    				}
    
    				//Sleep(1);
    
    				if( queue[queueBottom].key1 == 1 )
    				{
    
    					pressNote( 1 );
    
    					lastHeld1 = 1;
    
    				} else {
    
    					lastHeld1 = 0;
    
    				}
    
    				if( queue[queueBottom].key2 == 1 )
    				{
    
    					pressNote( 2 );
    					lastHeld2 = 1;
    
    				} else {
    
    					lastHeld2 = 0;
    
    				}
    
    				if( queue[queueBottom].key3 == 1 )
    				{
    
    					pressNote( 3 );
    					lastHeld3 = 1;
    
    				} else {
    
    					lastHeld3 = 0;
    
    				}
    
    				if( queue[queueBottom].key4 == 1 )
    				{
    
    					pressNote( 4 );
    					lastHeld4 = 1;
    
    				} else {
    
    					lastHeld4 = 0;
    
    				}
    
    				if( queue[queueBottom].key5 == 1 )
    				{
    
    					pressNote( 5 );
    					lastHeld5 = 1;
    
    				} else {
    
    					lastHeld5 = 0;
    
    				}
    
    			}
    
    			for( queueLoop=queueBottom; queueLoop<queueIndex; queueLoop++ )
    			{
    
    				if( queue[queueLoop].delay > 0 )
    				{
    
    					queue[queueLoop].delay--;
    
    				}
    
    				if( queue[queueLoop].delay == 23 )
    				{
    
    					if( queue[queueLoop].type == 0 )
    					{
    
    						//send strum
    						printf("strum\n");
    
    						sendKey(VK_RETURN, 1);
    						//Sleep(1);
    						sendKey(VK_RETURN, 0);
    
    					} else {
    
    						if( checkStreak( hdc ) == 0 )
    						{
    
    							// this note was queued as a non-strummed note,
    							// but a note must have been missed and now it must be strummed
    
    							//send strum
    							//printf("strum\n");
    
    							sendKey(VK_RETURN, 1);
    							//Sleep(1);
    							sendKey(VK_RETURN, 0);
    
    						} else {
    
    							//release note and re-press note (non-strummed)
    
    							//printf("note non strum\n");
    
    							if( queue[queueLoop].key1 == 1 )
    							{
    
    								doTap( 1 );
    
    							}
    
    							if( queue[queueLoop].key2 == 1 )
    							{
    
    								doTap( 2 );
    
    							}
    
    							if( queue[queueLoop].key3 == 1 )
    							{
    
    								doTap( 3 );
    
    							}
    
    							if( queue[queueLoop].key4 == 1 )
    							{
    
    								doTap( 4 );
    
    							}
    
    							if( queue[queueLoop].key5 == 1 )
    							{
    
    								doTap( 5 );
    
    							}
    
    							//sendKey(VK_RETURN, 1);
    							//Sleep(1);
    							//sendKey(VK_RETURN, 0);
    
    						}
    
    					}
    
    				}
    
    				if( queue[queueLoop].delay == 0 )
    				{
    
    					queue[queueLoop].key1 = 0;
    					queue[queueLoop].key2 = 0;
    					queue[queueLoop].key3 = 0;
    					queue[queueLoop].key4 = 0;
    					queue[queueLoop].key5 = 0;
    
    					queue[queueLoop].tickid = 0;
    					queue[queueLoop].type = 0;
    
    					queueBottom++;
    
    				}
    
    			}
    
    			//reset delays
    
    			if( delay1 > 0 )
    			{
    
    				delay1--;
    
    			}
    
    			if( delay2 > 0 )
    			{
    
    				delay2--;
    
    			}
    
    			if( delay3 > 0 )
    			{
    
    				delay3--;
    
    			}
    
    			if( delay4 > 0 )
    			{
    
    				delay4--;
    
    			}
    
    			if( delay5 > 0 )
    			{
    
    				delay5--;
    
    			}
    
    			//first note
    
    			//note with strum
    			if( readNote(1, hdc) == 1 && delay1 == 0)
    			{
    
    				delay1 = 100;
    				queue[queueIndex].delay = varDelay;
    				queue[queueIndex].key1 = 1;
    				queue[queueIndex].tickid = tick;
    				queue[queueIndex].type = 0;
    				foundNote = 1;
    
    			}
    
    			//note without strum
    			if( readNote(1, hdc) == 3 && delay1 == 0)
    			{
    
    				delay1 = 100;
    				queue[queueIndex].delay = varDelay;
    				queue[queueIndex].key1 = 1;
    				queue[queueIndex].tickid = tick;
    				queue[queueIndex].type = 1;
    				foundNote = 1;
    
    			}
    
    			//second note
    
    			//note with strum
    			if( readNote(2, hdc) == 1 && delay2 == 0)
    			{
    
    				delay2 = betweenDelay;
    				queue[queueIndex].delay = varDelay;
    				queue[queueIndex].key2 = 1;
    				queue[queueIndex].tickid = tick;
    				queue[queueIndex].type = 0;
    				foundNote = 1;
    
    			}
    
    			//note without strum
    			if( readNote(2, hdc) == 3 && delay2 == 0)
    			{
    
    				delay2 = betweenDelay;
    				queue[queueIndex].delay = varDelay;
    				queue[queueIndex].key2 = 1;
    				queue[queueIndex].tickid = tick;
    				queue[queueIndex].type = 1;
    				foundNote = 1;
    
    			}
    
    			//third note
    
    			//note with strum
    			if( readNote(3, hdc) == 1 && delay3 == 0)
    			{
    
    				delay3 = betweenDelay;
    				queue[queueIndex].delay = varDelay;
    				queue[queueIndex].key3 = 1;
    				queue[queueIndex].tickid = tick;
    				queue[queueIndex].type = 0;
    				foundNote = 1;
    
    			}
    
    			//note without strum
    			if( readNote(3, hdc) == 3 && delay3 == 0)
    			{
    
    				delay3 = betweenDelay;
    				queue[queueIndex].delay = varDelay;
    				queue[queueIndex].key3 = 1;
    				queue[queueIndex].tickid = tick;
    				queue[queueIndex].type = 1;
    				foundNote = 1;
    
    			}
    
    			//fourth note
    
    			//note with strum
    			if( readNote(4, hdc) == 1 && delay4 == 0)
    			{
    
    				delay4 = betweenDelay;
    				queue[queueIndex].delay = varDelay;
    				queue[queueIndex].key4 = 1;
    				queue[queueIndex].tickid = tick;
    				queue[queueIndex].type = 0;
    				foundNote = 1;
    
    			}
    
    			//note without strum
    			if( readNote(4, hdc) == 3 && delay4 == 0)
    			{
    
    				delay4 = betweenDelay;
    				queue[queueIndex].delay = varDelay;
    				queue[queueIndex].key4 = 1;
    				queue[queueIndex].tickid = tick;
    				queue[queueIndex].type = 1;
    				foundNote = 1;
    
    			}
    
    			//fifth note
    
    			//note with strum
    			if( readNote(5, hdc) == 1 && delay5 == 0)
    			{
    
    				delay5 = betweenDelay;
    				queue[queueIndex].delay = varDelay;
    				queue[queueIndex].key5 = 1;
    				queue[queueIndex].tickid = tick;
    				queue[queueIndex].type = 0;
    				foundNote = 1;
    
    			}
    
    			//note without strum
    			if( readNote(5, hdc) == 3 && delay5 == 0)
    			{
    
    				delay5 = betweenDelay;
    				queue[queueIndex].delay = varDelay;
    				queue[queueIndex].key5 = 1;
    				queue[queueIndex].tickid = tick;
    				queue[queueIndex].type = 1;
    				foundNote = 1;
    
    			}
    
    			if( foundNote == 1 )
    			{
    
    				indexQueue = indexQueueInt;
    				foundNote = 0;
    
    			}
    
    			if(indexQueue == 1 )
    			{
    
    				queueIndex++;
    				indexUp=1;
    
    			}
    
    			if( indexQueue > 0 )
    			{
    
    				indexQueue--;
    
    			}
    
    			//checkStreak(hdc);
    
    			/*if(dispc>0)
    			{
    
    				dispc--;
    
    			}
    
    			if( (readNote(1, hdc) > 0 || readNote(2, hdc) > 0 || readNote(3, hdc) > 0 || readNote(4, hdc) > 0 || readNote(5, hdc) > 0) && (run == 1) && (dispc==0) )
    			{
    
    				printf("%d|%d|%d|%d|%d\n", readNote(1, hdc), readNote(2, hdc), readNote(3, hdc), readNote(4, hdc), readNote(5, hdc) );
    
    				dispc=105;
    
    			}*/
    
    		}
    
    		if( ( GetAsyncKeyState(VK_F8) ) )
    		{
    
    			run = 1;
    
    		}
    
    		if( ( GetAsyncKeyState(VK_F9) ) )
    		{
    
    			run = 0;
    
    		}
    
    	}
    	return;
    }
    

Anmelden zum Antworten