• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->
  • Unfortunately, yes, there is a suspension wave happening around the new tlp launch. :'( Please keep regular discussion to Suspension MegaThread and please consider submitting a Suspension report to RG.

Window problem (1 Viewer)

EQManiac

Member
Joined
Jan 29, 2006
RedCents
31¢
I am hoping someone familiar with the window manipulation abilites of MQ2 can help with this.

The goal is simple, click the damn reward selection button in the task reward window.

Sounds easy doesn't it :)

Rich (BB code):
// MQ2Test.cpp : Defines the entry point for the DLL application.
//


#include "../MQ2Plugin.h"
PreSetup("MQ2Test");

CHAR buff[512];

BOOL IsWindowOpen(PCHAR WindowName) 
{ 
   WriteChatColor("IsWindowOpen",111111);
   PCSIDLWND pWnd=(PCSIDLWND)FindMQ2Window(WindowName); 
   if (!pWnd) return false; 
   return (BOOL)pWnd->Show; 
} 

bool ClickIt(CXWnd *pWnd)
{
	if (!pWnd) {
	    WriteChatColor("ClickIt Fail (null pointer)",111111);
		return false;
	}
	
	WriteChatColor("ClickIt",111111);

	DebugTry(CXRect rect=pWnd->GetScreenRect());
	sprintf(buff, "ClickIt - Control \"%s\" being used",pWnd->WindowText->Text);
	WriteChatColor(buff,111111);

	DebugTry(CXPoint pt=rect.CenterPoint());
	sprintf(buff, "ClickIt - Rectangle center point a:%d b:%d",pt.A, pt.B);
	WriteChatColor(buff,111111);
	DebugTry(pWnd->HandleLButtonDown(&pt,0));
	DebugTry(pWnd->HandleLButtonUp(&pt,0));
	WriteChatColor("ClickIt - Click attempted",111111);

	return true;
}


void WinClick(CXWnd *ParentWnd, PCHAR ScreenID, DWORD KeyState) { 
  WriteChatColor("WinClick",111111);
  if(ParentWnd){
	if(CXWnd *ChildWnd=ParentWnd->GetChildItem(ScreenID)) {
		sprintf(buff, "WinClick - Child %s found under window %s",ChildWnd->GetXMLData()->ScreenID, ParentWnd->GetXMLData()->ScreenID);
	    WriteChatColor(buff,111111);
		ClickIt(ChildWnd); 
	} 
  }
} 

VOID AutoReward(PSPAWNINFO pChar, PCHAR szLine) {
	WriteChatColor("Command - AutoReward",111111);
	if (IsWindowOpen("RewardSelectionWnd")) WriteChatColor("Window is open",111111);
    WinClick(FindMQ2Window("RewardSelectionWnd"),"RewardSelectionChooseButton",1);
}

PLUGIN_API VOID InitializePlugin(VOID)
{
	AddCommand("/reward",AutoReward);
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
	RemoveCommand("/reward");
}
 
Why not just use notify?

*edit* And if you're a) Set on using a plugin and b) stuck, then you could always kill human children by using DoCommand() and Evaluate(), which would allow you to actually read the MQ2Data stuff as if the plugin were a macro, then execute a command like the plugin was a macro. Again, actual human will die every time you do, but...like I said, if you get stuck, you get stuck. Let me know if that's the case, I can hook you up with the code you need.
 
Unfortunately the reward window has an "onclick" function and it's a listselect

listselect does not "click" as it forces the UI to "select" it thus avoiding the "onclick" function.

Good luck!

For an easy example of another one with an "onclick' function try setting up your hotkeys using the action window. You have those 6 hotkeys if you click one a window appears which has a list of skills to add to it. Normally clicking on it would select the skill and push it to the hotkey. If you use listselect it will force the UI to select the skill but the window will not close and the skill will not be pushed to the hotkey.
 
Ccomp5950 said:
Unfortunately the reward window has an "onclick" function and it's a listselect

Are you saying in order to click the "Select Option" button, the button has to be treated as a list?

Or are you saying I need to select an item from the list, prior to clicking the button?


From what I can see, the window opens in two ways. When you complete the task, it will pop the window open with the default item preselected. The second way is when you open it manually. In this case an item is not preselected and the user has to select an item prior to clicking.

In either case /notify is unable to perform a click on the "Select Option" (RewardSelectionChooseButton).

The test code above shows the button is located and being used for the click, but the click has no noticeable effect.

If anyone has a working example that would be perfect.
 
No, I was under the impression that the reward window had a list inside of it that you had to select and that was what pushed it through. I've personally not seen it but from my dicussions with WMH and listening in on IRC that is what I had figured it was.

ListSelect does not "click" it only highlights.
 
It does have a list to select various reward options, but when it is opened at the end of a mission by the client, it preselects option one.

Even if you manually click the list option then issue the /notify to press the button, it wont work.

I was hoping someone who played with the window code more may be able to find a work around or fix for it.

Thanks for trying though :)
 
Window problem

Users who are viewing this thread

Back
Top