Log People

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

yoda
orc pawn
orc pawn
Posts: 19
Joined: Thu Feb 12, 2004 6:44 pm

Log People

Post by yoda » Tue Mar 09, 2004 3:57 pm

OK, Going to need some help with this. I am trying to come up with some code that will keep a log of the names of people that have sent you a tell and if that person sends you another tell, it will /return.

This is what I have done so far, but pretty sure it is not going to work...wondering if I can get some help or advice on what I am missing or don't know...

Thanks in advance!

The following obviously isn't all the code but the pertaining code:

Code: Select all

#chat tell 

Sub Main 

	/declare PeopleArray array 
	/declare PeopleCount global 

	/varset PeopleCount 0

/return

Sub Event_Chat(ChatType,Sender,ChatText) 

	/declare Counter local 

	/varset PeopleArray(PeopleCount)

	/for Counter 0 to 49
        	/if "@Sender == PeopleArray(@Counter) /return 
    	/next Counter 

	/varadd PeopleCount 1
        
    } 
/return

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Tue Mar 09, 2004 7:09 pm

Not sure exactly what you are trying to do but this might give you some of the missing pieces:

Code: Select all

#turbo 50
#chat tell 

Sub Main 

   /declare PeopleArray array 
   /declare PeopleCount global 
   /varset PeopleCount 0 

   :MainLoop
   /doevents
   /delay 0
   /goto :MainLoop

/return 

Sub Event_Chat(ChatType,Sender,ChatText) 
   /declare Counter local 
   /varset Counter 0

   :CheckLoop
   /if "@Sender"=="@PeopleArray(@Counter)" {
       /return ALREADY_EXISTS
   } else if "@PeopleArray(@Counter)"=="UNDEFINED-ARRAY-ELEMENT" {
       /goto :BreakOut
   }
   /varadd Counter 1
   /goto :CheckLoop

   :BreakOut 
   /varset PeopleArray(@Counter) "@Sender"
   /varadd PeopleCount 1 
/return ADDED

EQ_Nutzer
a lesser mummy
a lesser mummy
Posts: 36
Joined: Tue Dec 23, 2003 2:39 pm

Post by EQ_Nutzer » Wed Mar 10, 2004 3:43 am

You could use that for some interesting applications... Think beyond the ordinary... ;)