• 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.

Anyone have working source for MQ2Reward ? (1 Viewer)

spyderz68

Member
Joined
Oct 15, 2005
RedCents
327¢
I've got my Autotask plugin almost finished but I'm having a hell of a time with automatically claiming the reward since /notify doesn't work in that window. Does anyone have a working copy of this plug I can scavenge or a working idea on how to click the reward?

Sypderz68
 
Rich (BB code):
// PLUGIN_API is only to be used for callbacks.  All existing callbacks at this time
// are shown below. Remove the ones your plugin does not use.  Always use Initialize
// and Shutdown for setup and cleanup, do NOT do it in DllMain.

#include "../MQ2Plugin.h"

PreSetup("MQ2Reward");

VOID AutoReward(PSPAWNINFO pChar, PCHAR szLine);
VOID AcceptReward(CXWnd *pWnd);

CHAR szBuffer[MAX_STRING] = {0};

bool debug = false;

// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
   DebugSpewAlways("Initializing MQ2Reward");
   AddCommand("/reward",AutoReward);
}

// Called once, when the plugin is to shutdown
PLUGIN_API VOID ShutdownPlugin(VOID)
{
   DebugSpewAlways("Shutting down MQ2Reward");
   RemoveCommand("/reward");
}

VOID AutoReward(PSPAWNINFO pChar, PCHAR szLine)
{
   CHAR szArg1[MAX_STRING] = {0};
   CHAR szArg2[MAX_STRING] = {0};

   GetArg(szArg1, szLine, 1);

   int arg1 = atoi(szArg1) - 1;

   CHAR cxStr[MAX_STRING] = {0};
   CXStr Str;

   if (arg1 < 0) {
      sprintf(szBuffer, "Illegal option index: '%s'.", szArg1);
      WriteChatColor(szBuffer,USERCOLOR_DEFAULT);
      return;
   }

   CHAR descr[MAX_STRING] = {0};
   sprintf(descr, "option index: %s", szArg1);

   if (debug) {
      sprintf(szBuffer, "Trying to find reward at %s.", descr);
      WriteChatColor(szBuffer,USERCOLOR_DEFAULT);
   }

    //             Parent                               TabWindow           PageTemplate
   CXWnd *pWnd1 = (CXWnd*)FindMQ2Window("RewardSelectionWnd")->pFirstChildWnd->pFirstChildWnd;
   
   BOOL found = false;
   while (pWnd1) {
      if (((PCSIDLWND)pWnd1)->Show) {

         CListWnd *pListOpt = (CListWnd*)((CSidlScreenWnd*)(pWnd1->GetChildItem("RewardSelectionOptionList")));
         pListOpt->SetCurSel(arg1);

         AcceptReward(pWnd1);
         found = true;
      }

      pWnd1 = (CXWnd*)pWnd1->pNextSiblingWnd;
   }

   if ( ! found )
   {
      sprintf(szBuffer, "Could not find reward at %s.", descr);
      WriteChatColor(szBuffer,USERCOLOR_DEFAULT);
   }
}

VOID AcceptReward(CXWnd *pWnd)
{
   if (debug) {
      WriteChatColor("Clicking 'Select Option' button.",USERCOLOR_DEFAULT);
   }

   CXWnd *pButton = pWnd->GetChildItem("RewardSelectionChooseButton");
   CXRect rect = pButton->GetScreenRect();
   CXPoint pt = rect.CenterPoint();
   pButton->HandleLButtonDown(&pt,0);
   pButton->HandleLButtonUp(&pt,0);
}
 
Anyone have working source for MQ2Reward ?

Users who are viewing this thread

Back
Top