Okay I'm writing a Fishing bot for 2Moons. It works great but you have to have it open in order to be able to use it. It uses pixel scanning and keybd_event.
I dont entirely understand SendMessage() but this is my idea
Code:
const BYTE a=VkKeyScan('L');
HWND x=FindWindow(0, _T("2Moons"));
SendMessage(x, keybd_event(VK_SPACE, 0x20, KEYEVENTF_KEYUP, 0),0, 0) ;
SendMessage(x,SetCursorPos(512, 400), 0, 0);
SendMessage(x,keybd_event(a, 0xA6, 0, 0), 0, 0);
SendMessage(x,keybd_event(a, 0xA6, KEYEVENTF_KEYUP, 0), 0, 0);
SendMessage(x,mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0), 0, 0);
EDIT: this code doesnt work... so just look at this as a mock up....
also i would like to know if and how i can scan pixels if the window isnt open... thanks! i love this Forum BTW.