 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
TraxMate Master Cheater
Reputation: 0
Joined: 01 Mar 2008 Posts: 363
|
Posted: Sun Oct 26, 2008 7:44 am Post subject: [C++] Auto Pot (MapleStory) [Solved] |
|
|
I'm making an auto pot for my bot. It works perfectly in fullscreen maple but not in windowed. | Code: | void AutoPot()
{
while(true)
{
HWND hWnd = FindWindow(_T("MapleStoryClass"), _T("MapleStory"));
HDC hdc = GetDC(hWnd);
COLORREF hpPot = GetPxl(hdc, 252, 588);
COLORREF mpPot = GetPxl(hdc, 350, 589);
BYTE hpR, mpR, hpG, mpG, hpB, mpB;
hpR = GetRValue(hpPot), hpG = GetGValue(hpPot), hpB = GetBValue(hpPot);
mpR = GetRValue(mpPot), mpG = GetGValue(mpPot), mpB = GetBValue(mpPot);
if(hpR == 190, hpG == 188, hpB == 189)
PostMsg(MapleWnd, WM_KEYDOWN, 0x23, (MapVirtualKey(0x23, 0) << 16));
else if(mpR == 173, mpG == 178, mpB == 173)
PostMsg(MapleWnd, WM_KEYDOWN, 0x41, (MapVirtualKey(0x41, 0) << 16));
Sleep(100);
}
} | I don't know why it's not working in windowed mode. In my eyes this should work in windowed mode withput preblems .
Last edited by TraxMate on Mon Oct 27, 2008 3:39 am; edited 1 time in total |
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Sun Oct 26, 2008 8:01 am Post subject: |
|
|
because i think maplestory changes the colours in different modes apparently, test the colours
_________________
|
|
| Back to top |
|
 |
blackmorpheus Expert Cheater
Reputation: 0
Joined: 05 Apr 2008 Posts: 159
|
Posted: Sun Oct 26, 2008 8:01 am Post subject: |
|
|
Have you tried using ClientToScreen();?
void AutoPot()
{
while(true)
{
HWND hWnd = FindWindow(_T("MapleStoryClass"), _T("MapleStory"));
HDC hdc = GetDC(hWnd);
POINT pt[2] = { {252, 588},{350,589} }
ClientToScreen(hWnd, &pt[1]);
COLORREF rgb (hdc, pt[1].x, pt[1].y); // this is wrong, fix it ;D
umm and the rest, i cannot remember try it like this..
|
|
| Back to top |
|
 |
TraxMate Master Cheater
Reputation: 0
Joined: 01 Mar 2008 Posts: 363
|
Posted: Sun Oct 26, 2008 8:23 am Post subject: |
|
|
| Snootae wrote: | because i think maplestory changes the colours in different modes apparently, test the colours
| I don't think it's that. I used Pixels (a program made by me, check binaries.) to see if it was a match and it wasn't because the x/y is not the same in windowed and full :/.
| blackmorpheus wrote: | Have you tried using ClientToScreen();?
void AutoPot()
{
while(true)
{
HWND hWnd = FindWindow(_T("MapleStoryClass"), _T("MapleStory"));
HDC hdc = GetDC(hWnd);
POINT pt[2] = { {252, 588},{350,589} }
ClientToScreen(hWnd, &pt[1]);
COLORREF rgb (hdc, pt[1].x, pt[1].y); // this is wrong, fix it ;D
umm and the rest, i cannot remember try it like this.. | Hmm if you don't remember how could I do? ^^ Never even heard of ClientToScreen :p
|
|
| Back to top |
|
 |
blackmorpheus Expert Cheater
Reputation: 0
Joined: 05 Apr 2008 Posts: 159
|
Posted: Sun Oct 26, 2008 9:56 am Post subject: |
|
|
Alright, try this:
| Code: |
void AutoPot()
{
while(true)
{
HWND hWnd = FindWindow(_T("MapleStoryClass"), _T("MapleStory"));
HDC hdc = GetDC(hWnd);
POINT pt[2] = { {252, 588},{350,589} }
ClientToScreen(hWnd, &pt[1]);
COLORREF hpPot = GetPxl(hdc, pt[1].x, pt[1].y);
ClientToScreen(hWnd, &pt[2]);
COLORREF mpPot = GetPxl(hdc, pt[2].x,pt[2].y);
BYTE hpR, mpR, hpG, mpG, hpB, mpB;
hpR = GetRValue(hpPot), hpG = GetGValue(hpPot), hpB = GetBValue(hpPot);
mpR = GetRValue(mpPot), mpG = GetGValue(mpPot), mpB = GetBValue(mpPot);
if(hpR == 190, hpG == 188, hpB == 189)
PostMsg(MapleWnd, WM_KEYDOWN, 0x23, (MapVirtualKey(0x23, 0) << 16));
else if(mpR == 173, mpG == 178, mpB == 173)
PostMsg(MapleWnd, WM_KEYDOWN, 0x41, (MapVirtualKey(0x41, 0) << 16));
Sleep(100);
}
} |
|
|
| Back to top |
|
 |
TraxMate Master Cheater
Reputation: 0
Joined: 01 Mar 2008 Posts: 363
|
Posted: Sun Oct 26, 2008 10:06 am Post subject: |
|
|
| Stiill not working :/. Could it be that it's only for me that it's not working in windowed mode?
|
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Sun Oct 26, 2008 10:09 am Post subject: |
|
|
i doubt it, find out what the problem is, check if its the wrong spot, or the wrong colours
_________________
|
|
| Back to top |
|
 |
TraxMate Master Cheater
Reputation: 0
Joined: 01 Mar 2008 Posts: 363
|
Posted: Sun Oct 26, 2008 10:26 am Post subject: |
|
|
| Snootae wrote: | | i doubt it, find out what the problem is, check if its the wrong spot, or the wrong colours | It is the wrong spot(atleast according to Pixels.), but how can it be the wrong spot when the pixels should be the same all the time? Even in windowed mode maple is only 800 x 600 pixels. I don't know about the color, will check it now.
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sun Oct 26, 2008 10:31 am Post subject: |
|
|
try get the device context of the entire screen calling GetDC(0).
_________________
Stylo |
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Sun Oct 26, 2008 10:34 am Post subject: |
|
|
bad idea, in case anyone moves it, but i sort of agree since it doesnt currently work, in the long run not great
_________________
|
|
| Back to top |
|
 |
TraxMate Master Cheater
Reputation: 0
Joined: 01 Mar 2008 Posts: 363
|
Posted: Sun Oct 26, 2008 11:03 am Post subject: |
|
|
| 1qaz wrote: | | try get the device context of the entire screen calling GetDC(0). | t works when I do that but then it's like Snootae said, if someone moves the window it stops working. And I have to change the x and y valuse since the borders are there.
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sun Oct 26, 2008 12:25 pm Post subject: |
|
|
WM_MOVE is sent after a window has been moved
on WM_CREATE get the cords of maples window
on WM_MOVE get the cords of new maple position
Find the difference in x,y and add/subtract to the pixel x/y
_________________
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Sun Oct 26, 2008 12:27 pm Post subject: |
|
|
if the shades are differnt, you can always use the "if red at xy" type of function...
_________________
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sun Oct 26, 2008 1:24 pm Post subject: |
|
|
No.
Shades are the same for red all the way across.
The color of red is the same from left to right.
The problem is mp. Cause tehre is a grad. But I got pass that by measuring the grey behind it. Cause they gray is always the same.
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sun Oct 26, 2008 2:31 pm Post subject: |
|
|
in your auto pots thread use this code
i guess it should do the job if the window moved (wrote it on quick reply)
so correct me if i'm wrong
| Code: |
HWND msWnd;
MSG msg;
msWnd = FindWindow(_T("MapleStoryClass"),_T("MapleStory"));
if (msWnd != 0){
GetMessage(&msg,msWnd,0,0);
if (msg.message == WM_MOVE){
int newWndX, newWndY;
newWndX = LOWORD(msg.lParam);
newWndY = HIWORD(msg.lParam);
int x = 0, y = 0;
x = newWndX - oldWndX;
y = newWndY - oldWndY;
xPos += x;
yPos += y;
}
}
|
considering that xPos and yPos are the coords of hp/mp bar
_________________
Stylo |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|