A better way to make /assist work

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

eqjoe
a grimling bloodguard
a grimling bloodguard
Posts: 984
Joined: Sat Sep 28, 2002 12:26 pm

A better way to make /assist work

Post by eqjoe » Wed Aug 13, 2003 9:54 pm

I need a rock solid way to make my /assist work. Currently, I simply do an /assist, /pause /attack. Sometimes the /assist does not work for various reasons and making the /pause longer is slowing down my scripts. So... my idea is to create an event that does the /assist and then compares the target id to the target id of the toon being assisted. So, I want to setup an event that triggers on a group say "Assist me <targetID>" and have the script parse the group say text and save the target ID to a variable. Any ideas on how to do that?

Doodman
a ghoul
a ghoul
Posts: 124
Joined: Thu Jan 02, 2003 12:07 pm

Post by Doodman » Thu Aug 14, 2003 11:44 am

What about something like:

Code: Select all

/varset v1 $target(id)
/assist
:loop
/if $target(id)==$v1 {
  /delay 3
  /goto loop
}
/attack
My syntax is probably a little off, but you get the idea.

eqjoe
a grimling bloodguard
a grimling bloodguard
Posts: 984
Joined: Sat Sep 28, 2002 12:26 pm

Post by eqjoe » Fri Aug 15, 2003 12:11 am

Ok.. but how do I get the target ID from the toon that I am assisting? That is the question. I need to pass the target id from one toon running a macro to another. My idea is to pass that information in group chat. My question is if anyone has an idea how to do that.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Aug 15, 2003 4:56 am

Yes, you use the chat event. There are plenty of examples around. This is so easy I'm wondering why you are asking. Am I missing something?

At some point, maybe after some taunts and damage, you make the MT do "/g attack $target(id)"

UNTESTED (needs " fix up):

Code: Select all

#chat group
#define MT "toon1"

...

sub event_chat
/if "$p0"=="group" {                | if group say
    /if "$p1"==MT {                   | and said by main tank
        /if "$left(6,"$p2")"=="attack" {   | and starts with attack
            /target id $int($right($strlen($p2)-6,$p2))
        }
    }
}
/return

Shin Noir
a ghoul
a ghoul
Posts: 90
Joined: Tue Aug 05, 2003 8:18 pm

Post by Shin Noir » Fri Aug 15, 2003 6:54 am

Ok, off the top of my head and what I think your problem is...

you're trying to
1) Constantly assist a target checking for a new target when invoked.

Code: Select all

#event INC "Noir tells the group, Incoming'" |Change to INC msg start
|Variables used:
|v0 = Used to set your current target's id.


|event_INC will only be ran when the text above is sent
sub event_INC
/call FindAssist
/return

sub FindAssist
/press f1 |Select Self to clear any targets
/doevents
/varset v0 $target(id) |Set your ID as $v0
:CheckAgain
  /assist Noir | Change Noir to the guy you want to assist
  /doevents
  |If Target isn't 0 (none) or yourself, you found a new target!
  /if $target(id)!=$v0 /if $target(id)!=0 /goto :FoundTarget
  /goto :CheckAgain
:FoundTarget
/attack on
/return

Even with turbo on the code above shouldn't lag you at all. The only big downside to the code above is that if you were to manually control this character you wouldn't be able to target anything without it overriding the /assist code and attack it. This will definitely make the sucker assist though. ;) pause is evil.. /doevents is good, /delay if absolutely neccessary is good too. Also having timers set that count down so the above isn't an infinite loop is a bonus too...

Doodman
a ghoul
a ghoul
Posts: 124
Joined: Thu Jan 02, 2003 12:07 pm

Post by Doodman » Fri Aug 15, 2003 11:00 am

you may want to look in to using events instead of delays. Each song should have some text that is output when it completes its "casting". When that text is displayed is usually the optimal time to stop it and start the next.
Is there a reason you need a specific target ID? Can't you just /assist your other char like stated above?

I guess I did miss that in my macro, try this:

Code: Select all

/press f1
/varset v1 $target(id)
:loop
/if $target(id)==$v1 {
  /assist myotherchar
  /delay 3
  /goto loop
}
/attack
I, personally, would avoid sending tells/group with the targets ID in it. It is very obvious, if the GM looks at your chatbuffer or the logs on the server, that you are cheating. Just my paranoia coming through.

eqjoe
a grimling bloodguard
a grimling bloodguard
Posts: 984
Joined: Sat Sep 28, 2002 12:26 pm

Post by eqjoe » Fri Aug 15, 2003 5:03 pm

dont_know_at_all wrote:Yes, you use the chat event. There are plenty of examples around. This is so easy I'm wondering why you are asking. Am I missing something?
I was hoping that it is possable to parse a user defined event triggered in group say.

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Fri Aug 15, 2003 6:13 pm

uh.... yeah. RTFM. #chat <channel> and parse the string you get when it's triggered... about user defined events, I'm not entirely sure, but you can make a macro to test it easily enough... I assume you mean a #event "tells the group, 'something here'"

(btw, what if they tell the group, in an unknown toungue?)

eqjoe
a grimling bloodguard
a grimling bloodguard
Posts: 984
Joined: Sat Sep 28, 2002 12:26 pm

Post by eqjoe » Tue Aug 19, 2003 11:14 pm

Ok... got it working.

Code: Select all

#chat group 
#define MT "toon1" 


sub Main
	:start

	/doevents
	/goto :start	
	


/return



sub Event_chat 
/if "$p0"=="group" {                
	/if "$p1"==MT 	{                   	
		/if "$left(6,"$p2")"=="attack" {  
			/varset v1 $int($calc($strlen("$p2")-7))
                 	/target id $right($v1,"$p2")
        	} 
    	} 
} 

/g %t is my target

/return 
I am still thinking about coding an "out of band" solution.

Thanks for all the replies, ideas and help

Be well and stuff....