Welcome, Guest. Please login or register.
Did you miss your activation email?
November 26, 2024, 04:28:59 am *

Login with username, password and session length
Pages: [1]
Print
Author Topic: Dislike WTS/WTB/Auctions in OOC? Wish they were in /auction? Solution Inside  (Read 4936 times)
L0stman
Full Member
***
Posts: 106


View Profile
« on: November 21, 2010, 02:44:39 pm »

Hey folks,

I have created a simple MQ2 plugin that will look for anyone using text that signals auction or merchant activities in ooc and modifies the text to move it to /auction.  It is made in such a way that it allows the normal eq filters to work fine (keeping auction in its own chat window).

Reason for the plugin:  Its a daily thing that there are people selling really great things. They sell them, though, sometimes in OOC and sometimes in Auction.  If this was a "WTB _____" that was hit every 10 minutes everything would be fine - lately, however, its been a 10-15 line live action auction that we get treated to.  Makes the OOC Channel almost worthless (more so than it is).  I have separate windows for OOC and Auction and this plugin lets me keep things segregated so OOC is normal chat with anything buy/sell related in Auction.

This has been tested in Seeds of Destruction MQ2 client and it works fine.  I have not tested the compile for the Titanium client but I cannot see that there would be an issue here.  (If you test it and it works, speak up).

Source code is provided in the zip file (as well as compiled dlls) so you can either compile it yourself or trust in the compiled dll.  Either option is available to you.

To load the plugin, copy it to your mq2 directory with the dlls in it.  Then, in mq2, type /plugin mq2chatutilities.  You should see "Plugin mq2chatutilities loaded"

I have read through the rules and I sincerely do not believe this would cause the wrath of Hunter as it does not automate anything and gives no player an advantage besides keeping their ooc clear of clutter.  Hunter - if this is against the rules, I apologize and would like you to delete this post.

Code:
// MQ2ChatUtilities.cpp : Defines the entry point for the DLL application.
//

// 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("MQ2ChatUtilities");

// This is called every time EQ shows a line of chat with CEverQuest::dsp_chat,
// but after MQ filters and chat events are taken care of.
PLUGIN_API DWORD OnIncomingChat(PCHAR Line, DWORD Color)
{
   
    if (strstr(Line," says out of character, "))
    {
        char lowerString[MAX_STRING];
        ZeroMemory(lowerString,MAX_STRING);
        strcpy(lowerString,Line);
        strlwr(lowerString);

        if (strstr(lowerString,"wtb") ||
                strstr(lowerString,"wts") ||
                strstr(lowerString,"wtt") ||
                strstr(lowerString,"selling") ||
                strstr(lowerString,"buying") ||
                strstr(lowerString,"trading for") ||
                strstr(lowerString,"price check") ||
                strstr(lowerString,"pc") ||
               (strstr(lowerString,"last call") && strstr(Line,"\x12")) ||
               (strstr(lowerString,"going once") && strstr(Line,"\x12")) ||
               (strstr(lowerString,"going twice") && strstr(Line,"\x12")) ||
               (strstr(lowerString," pst ") && strstr(Line,"\x12")) ||
               (strstr(lowerString," co ") && strstr(Line,"\x12")) ||
               (strstr(lowerString,"co") && strstr(lowerString,"k ") && strstr(Line,"\x12")) ||
               (strstr(lowerString,"offer") && strstr(Line,"\x12")) ||
               (strstr(lowerString,"offer") && strstr(Line,"\x12")) ||
               (strstr(lowerString,"sold") && strstr(Line,"\x12"))
               )
        {
            Color = USERCOLOR_AUCTION;
           
            // Get the "Person" performing an action.
            char szTemp[MAX_STRING];
            GetArg(szTemp,Line,1);

            // Put in our new auctions text.
            static char auctionText[12]=" auctions, ";

            // Get rest of line.
            char restOfLine[MAX_STRING];
            ZeroMemory(restOfLine,MAX_STRING);
           
            int foundLine = 0;
            int j = 0;
            for(int i = 0; i < abs((int)strlen(Line)); i++)
            {
                if(foundLine)
                {
                    restOfLine[j] = Line[i];
                    j++;
                }
                else
                {
                    if (Line[i] == '\'')
                    {
                        foundLine = 1;
                        i--;
                    }
                }
            }
           
            sprintf(Line,"%s%s %s",szTemp,auctionText,restOfLine);
            dsp_chat_no_events(Line,USERCOLOR_AUCTION, 1);
            return 1;
        }
    }
   
    return 0;
}
Logged
Balthor2
Guest
« Reply #1 on: November 21, 2010, 08:53:50 pm »

I have several of these I wrote or rewrote. Its nice to be able to use a plugin to do the job of a broken filter or because of the reason you listed.
Logged
Pages: [1]
Print
Jump to:  

Recent

Stats

Members
  • Total Members: 6156
  • Latest: Rin1
Stats
  • Total Posts: 65127
  • Total Topics: 5066
  • Online Today: 370
  • Online Ever: 8678
  • (December 19, 2022, 02:32:09 pm)
Users Online
Users: 0
Guests: 220
Total: 220
TinyPortal v1.0 beta 4 © Bloc