Newbie needs guidance on macro that reacts to tells

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

jbond
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sat Mar 13, 2004 8:09 pm

Newbie needs guidance on macro that reacts to tells

Post by jbond » Sat Mar 13, 2004 8:21 pm

I want to write a macro with an exceedingly simple concept. I want my computer to beep or to alert me when someone (anyone) has sent me a tell. I see the /beep command for that.

What I am not getting is, if I use the feature in game that all tells go to a separate window, how I can determine that a tell has happened. If I were not using the tell windows, I think I would just look for text that says "soandso tells you". But using the tell window, the only preface to the tell message is the character's name followed by a colon.

So is there some other trigger that I can look for that idicates a tell has been sent? Any help appreciated.

bonehand
a lesser mummy
a lesser mummy
Posts: 48
Joined: Tue Feb 17, 2004 5:16 pm

Post by bonehand » Sat Mar 13, 2004 9:39 pm

Pretty simple really...

The /doevent command and the built in event structure will automatically do much of the work for you.

Code: Select all

#turbo 50

#chat tell

Sub Main
  :Loop
    /doevents
  /goto :Loop
/return

Sub Event_Chat
  /if "@Param0"=="TELL" {
    /beep
    /echo Tell from @Param1 said @Param2
  }
/return

NewB6987
a lesser mummy
a lesser mummy
Posts: 51
Joined: Tue Dec 30, 2003 1:02 pm

Post by NewB6987 » Sun Mar 14, 2004 6:43 am

I know not everyone likes other programs mentioned, but on this one ,EQWatcher is the way to go. IF you would like it will read what the person sent you as well. My personal favorite part of it is that it wants when mobs are about to gate ( time to Bash Gating ) and when Invis is going to drop ( even if it is before the timer is up ). I use it to keep track of who I buffed and how long I have left before each buff wears off.

All it does is reads your log File, so no interfearence with MQ2

Zazoot
a hill giant
a hill giant
Posts: 163
Joined: Sat Feb 07, 2004 11:02 am

Post by Zazoot » Mon Mar 15, 2004 11:02 am

you may want to use ~~ instead of == for the tells so that it will take a keyword/etc from a sentence

jbond
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sat Mar 13, 2004 8:09 pm

Post by jbond » Mon Mar 15, 2004 12:29 pm

Bonehand, thank you for the reply. But I was already essentially using that code (I got it from the the EventTest.mac that came with the MQ download and just changed #chat say to #chat tell and then added a /beep command).

However, as I stated in my original post, it doesn't seem to work if you chose to use tell windows. It only works if you have tells going to a "static" chat window. To be specific, if in game you go to Atl+O, General tab, and depress the "Use Tell Windows" button, then this macro code does not seem to work.

Again, I assume (and this is a big time newbie assumption) that it doesn't work b/c MQ is looking for the phrase "soandso tells you" to identify a tell. But when you use the tell window option that text doesn't happen.

Perhaps this is something that can't be done, but I figure there has to be something that lets the EQ client know what is a tell so it can open the new tell window on an incoming tell, and if that something can be itenditified, then that something can be used as a trigger.

Any ideas?

bonehand
a lesser mummy
a lesser mummy
Posts: 48
Joined: Tue Feb 17, 2004 5:16 pm

Post by bonehand » Mon Mar 15, 2004 3:59 pm

I'm sitting here at work without a MQ2 source code folder, so I can't test it and the CVS is being a little shit on my slow dialup; but, you could try running a search using window search for "tells you" in files in the directory and it will spit out the files that match...

Then go into your EQ Log file and see what tells look like when you are using that option. Paste it here and I or others might be able to figure something out.

With a little work you could more than likely do a fix yourself, or bring the offending code onto this or another thread and see what the devs think. You are probably right on the money about it being hard coded one way.

Yes, I was mistaken...I thought you just meant you had tells going to their own window and were afraid it would not work. I've never tried the option you mention...take six months off and I guess you need to retrain a guy.

Even without changing MQ2's source, you could probably set up a chat event to beep every time you saw a colon followed by a space or whatever else might distinguish a tell from other chat...I will check it out if I have time tonight.

bonehand
a lesser mummy
a lesser mummy
Posts: 48
Joined: Tue Feb 17, 2004 5:16 pm

Post by bonehand » Mon Mar 15, 2004 6:17 pm

From MQ2UserVars.cpp

Code: Select all

VOID CheckChatForEvent(PCHAR szMsg)
{
		if ((gMacroBlock) && (!gMacroPause) && (!gbUnload) && (!gZoning)/* && (!gDelayZoning)*/) { 
			CHAR Arg1[MAX_STRING] = {0}; 
			CHAR Arg2[MAX_STRING] = {0}; 
			CHAR Arg3[MAX_STRING] = {0}; 

			if ((strstr(szMsg," tells the guild, '")) && (CHATEVENT(CHAT_GUILD))) { 
				strncpy(Arg1,szMsg,(DWORD)(strstr(szMsg," tells the guild, '")-szMsg)); 
				strcpy(Arg2,strstr(szMsg," tells the guild, '")+19); 
				Arg2[strlen(Arg2)-1]=0; 
				AddEvent(EVENT_CHAT,"guild",Arg1,Arg2,NULL); 
			} else if ((strstr(szMsg," tells the group, '")) && (CHATEVENT(CHAT_GROUP))) { 
				strncpy(Arg1,szMsg,(DWORD)(strstr(szMsg," tells the group, '")-szMsg)); 
				strcpy(Arg2,strstr(szMsg," tells the group, '")+19); 
				Arg2[strlen(Arg2)-1]=0; 
				AddEvent(EVENT_CHAT,"group",Arg1,Arg2,NULL); 
			} else if ((strstr(szMsg," tells you, '")) && (CHATEVENT(CHAT_TELL))) { 
				strncpy(Arg1,szMsg,(DWORD)(strstr(szMsg," tells you, '")-szMsg)); 
				strcpy(Arg2,strstr(szMsg," tells you, '")+13); 
				Arg2[strlen(Arg2)-1]=0; 
				AddEvent(EVENT_CHAT,"tell",Arg1,Arg2,NULL); 
			} else if ((strstr(szMsg," says out of character, '")) && (CHATEVENT(CHAT_OOC))) { 
				strncpy(Arg1,szMsg,(DWORD)(strstr(szMsg," says out of character, '")-szMsg)); 
				strcpy(Arg2,strstr(szMsg," says out of character, '")+25); 
				Arg2[strlen(Arg2)-1]=0; 
				AddEvent(EVENT_CHAT,"ooc",Arg1,Arg2,NULL); 
			} else if ((strstr(szMsg," shouts, '")) && (CHATEVENT(CHAT_SHOUT))) { 
				strncpy(Arg1,szMsg,(DWORD)(strstr(szMsg," shouts, '")-szMsg)); 
				strcpy(Arg2,strstr(szMsg," shouts, '")+10); 
				Arg2[strlen(Arg2)-1]=0; 
				AddEvent(EVENT_CHAT,"shout",Arg1,Arg2,NULL); 
			} else if ((strstr(szMsg," auctions, '")) && (CHATEVENT(CHAT_AUC))) { 
				strncpy(Arg1,szMsg,(DWORD)(strstr(szMsg," auctions, '")-szMsg)); 
				strcpy(Arg2,strstr(szMsg," auctions, '")+12); 
				Arg2[strlen(Arg2)-1]=0; 
				AddEvent(EVENT_CHAT,"auc",Arg1,Arg2,NULL); 
			} else if ((strstr(szMsg," says '")) && (CHATEVENT(CHAT_SAY))) { 
				strncpy(Arg1,szMsg,(DWORD)(strstr(szMsg," says '")-szMsg)); 
				strcpy(Arg2,strstr(szMsg," says '")+7); 
				Arg2[strlen(Arg2)-1]=0; 
				AddEvent(EVENT_CHAT,"say",Arg1,Arg2,NULL); 
			} else if ((strstr(szMsg," says, '")) && (CHATEVENT(CHAT_SAY))) { 
				strncpy(Arg1,szMsg,(DWORD)(strstr(szMsg," says, '")-szMsg)); 
				strcpy(Arg2,strstr(szMsg," says, '")+8); 
				Arg2[strlen(Arg2)-1]=0; 
				AddEvent(EVENT_CHAT,"say",Arg1,Arg2,NULL); 
			} else if ( (strstr(szMsg," tells ")) && (strstr(szMsg,":")) && (strstr(szMsg,", '")) && (CHATEVENT(CHAT_CHAT)) ) {
				strncpy(Arg1,szMsg,(DWORD)(strstr(szMsg," tells ")-szMsg)); 
				strcpy(Arg3,strstr(szMsg," tells ")+7); 
				Arg3[strlen(Arg3)-1]=0; 
				strcpy(Arg2,strstr(Arg3,", '")+3); 
				Arg3[strstr(Arg3,":")-Arg3]=0; 
				AddEvent(EVENT_CHAT,Arg3,Arg1,Arg2,NULL); 
			} else { 
				PEVENTLIST pEvent = pEventList; 
				while (pEvent) { 
					if (strstr(szMsg,pEvent->szMatch)) { 
						AddCustomEvent(pEvent,szMsg); 
					} 
					pEvent = pEvent->pNext; 
				} 
			} 
		} 
}
It's not there, or not properly for your needs. The final else if seems to be looking for something, but it's beyond my comprehension...but does include a colon!

I tried everything I could think of, from searching for colons, to the arrow(->) placed in the log file and nothing seemed to trigger the event except the random ooc or say from my alt that had the exact triggers I programmed in the event. Worse still, was /zapvars wasn't reseting the @Param variables and it just beeped forever =/

Hopefully a dev sees this and helps out.

EQ Log File looks like this when Tell windows are on(if that were to make a difference):
[Mon Mar 15 17:02:45 2004] Logging to 'eqlog.txt' is now *ON*.
[Mon Mar 15 17:03:51 2004] Smokemup -> misti: hey =)
[Mon Mar 15 17:03:52 2004] Misti -> smokemup: AFK Message: brb
So, I'm giving in...after the incesant beep, beep, beep, beep, I'm ready for some Excedrin.

jbond
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sat Mar 13, 2004 8:09 pm

Post by jbond » Tue Mar 16, 2004 10:27 am

Bonehand, I see you went through quite the effort to help out. I certainly appreciate it. At the very least you have verified for me that is not something trivial that I am missing. I think perhaps it is time for me to learn a little C++ and see what I can do. I guess I can't go through life relying on just visual basic (censor: i'm an idiot; please ignore me) any longer. :)

Again, thanks for all your effort.

Oh, BTW, there was another post that sugggested that I use EQWatcher to achieve my goal. It turns out that so far, it is suffering from precisely the same problem. Just FYI.

Zazoot
a hill giant
a hill giant
Posts: 163
Joined: Sat Feb 07, 2004 11:02 am

Post by Zazoot » Sat Mar 20, 2004 6:51 pm

what do you have for your macro so far?