Quick question regarding text output to an IRC server

A forum for the general posts relating to MacroQuest. *DEPRECATED: This forum is no longer in public use, but remains here for your reading pleasure. Enjoy

Moderator: MacroQuest Developers

Zamiel
orc pawn
orc pawn
Posts: 17
Joined: Tue Sep 07, 2004 12:52 am

Quick question regarding text output to an IRC server

Post by Zamiel » Fri Dec 10, 2004 6:36 pm

I searched a bit and couldn't really find anything. I probably deserved to be slapped in the face for posting this, but oh well. =p

What I am looking for is a _plugin_, not a macro, to output all text recieved by the EverQuest client to an IRC server, both from the normal window and the MQ window if possible. I am thinking I would need to mod MQ2IRC to do this, or something. =\

I need a plugin for this and not a macro because I am running various macros on the computer that needs the text outputted.

I guess I could add a subroutine of some sort to the macros that I am running, but then I would likely have to deal with bugs, decreased stability, or an decrease in macro/computer speed.

Does such a plugin / MQ2IRC mod exist?

Or am I being really noob and missing something that MQ2IRC already incorporates?

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Fri Dec 10, 2004 6:55 pm

Pretty sure MQ2Telnet does something real similar. Never used it though, so not 100% sure
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

Zamiel
orc pawn
orc pawn
Posts: 17
Joined: Tue Sep 07, 2004 12:52 am

Post by Zamiel » Fri Dec 10, 2004 7:45 pm

I already tried setting up a local telnet server and encountered difficulties. =\

IRC is a much cleaner way of doing this and I am not very familiar with telnet.

In addition, I want to have this going on more than one character at a time and I'm not familiar with a way to partitian off the text within telnet, whereas in IRC I could have each character on a seperate channel.

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Post by ieatacid » Fri Dec 10, 2004 8:49 pm

OnIncomingChat

Zamiel
orc pawn
orc pawn
Posts: 17
Joined: Tue Sep 07, 2004 12:52 am

Post by Zamiel » Sat Dec 11, 2004 2:09 am

... Obviously OnIncomingChat is used to do this, but unfortunately, I have zero C or C++ programming experience. But if you wanted me to try and do it myself, here is my pitiful attempt. =p

Code: Select all

#include "../MQ2Plugin.h"


PreSetup("MQ2IRCOutput");

PLUGIN_API DWORD OnIncomingChat(PCHAR Line, DWORD Color)
{
	 
   if (MQ2Globals::gGameState != GAMESTATE_INGAME) 
      return 0; 

	HideDoCommand(GetCharInfo(),"/i say $Line",FromPlugin);
}
I know $Line isn't anything. That is just where I want the string output to go, obviously. Should I be using strstr? Somehow I know I'm not even close here. ><
Last edited by Zamiel on Sat Dec 11, 2004 5:48 pm, edited 1 time in total.

User avatar
fice
a hill giant
a hill giant
Posts: 187
Joined: Thu Jul 17, 2003 3:28 pm

Post by fice » Sat Dec 11, 2004 10:07 am

Code: Select all

#include "../MQ2Plugin.h"


PreSetup("MQ2IRCOutput");

PLUGIN_API DWORD OnIncomingChat(PCHAR Line, DWORD Color)
{
	if (gGameState != GAMESTATE_INGAME) return 0; 
	CHAR Temp[MAX_STRING]={0};
	sprintf(Temp,"/i say %s",Line);
	HideDoCommand(GetCharInfo(),Temp,FromPlugin);
}

i don't know if you would have to strip any other code from the eq text, but that should work i think! also don't forget to add plugin initialization and shutdown

Zamiel
orc pawn
orc pawn
Posts: 17
Joined: Tue Sep 07, 2004 12:52 am

Post by Zamiel » Sat Dec 11, 2004 5:46 pm

Thanks fice, but I can't seem to compile that for some reason. =\

Code: Select all

--------------------Configuration: MQ2IRCOutput - Win32 Release--------------------
Compiling...
MQ2IRCOutput.cpp
C:\Documents and Settings\James\Desktop\MQ2-20041208a\MQ2IRCOutput\MQ2IRCOutput.cpp(21) : error C2664: 'HideDoCommand' : cannot convert parameter 1 from 'struct EQData::_CHARINFO *' to 'struct EQData::_SPAWNINFO *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.

MQ2IRCOutput.dll - 1 error(s), 0 warning(s)
I'm using VC++ 6.0.

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Sat Dec 11, 2004 6:09 pm

Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Post by ieatacid » Sat Dec 11, 2004 8:33 pm

Code: Select all

HideDoCommand((PSPAWNINFO)pCharSpawn,Temp,FromPlugin);

User avatar
fice
a hill giant
a hill giant
Posts: 187
Joined: Thu Jul 17, 2003 3:28 pm

Post by fice » Sun Dec 12, 2004 7:55 pm

actually the problem is that HideDoCommand takes a pointer to spawninfo as argument, not a pointer to charinfo =p i had never used that function ever

what i would do is

Code: Select all

HideDoCommand(GetCharInfo()->pSpawn,Temp,FromPlugin);

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Post by ieatacid » Sun Dec 12, 2004 8:16 pm

actually the problem is that HideDoCommand takes a pointer to spawninfo as argument
Which is what I posted.

Zamiel
orc pawn
orc pawn
Posts: 17
Joined: Tue Sep 07, 2004 12:52 am

Post by Zamiel » Mon Dec 20, 2004 8:57 pm

Thanks fice!