LDON Enchanter Script Question

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

User avatar
driftinsupra
Official loudmouth
Official loudmouth
Posts: 212
Joined: Tue Jan 28, 2003 9:25 pm

LDON Enchanter Script Question

Post by driftinsupra » Wed Jan 28, 2004 12:12 am

Ok I just finally broke down and got myself some LDON. What I decided to wrok on now is as an enchanter I want to make a script that could basically do every group function that I will need to be in a ldon group. As of right now my chanter is only lvl 30 so I dont know if the demands will change or not but right now my main use is to mez when pulls go shitty. The first problem I have run into is how to gather a list of mobs that are attacking the main that arent the mob that he is attacking. My problem is that I just really dont know how to target the wya that I need to. Any siggestions?

Gumby
a ghoul
a ghoul
Posts: 99
Joined: Sat Jan 24, 2004 5:27 pm

Post by Gumby » Wed Jan 28, 2004 1:26 am

Will leave ya to do the grunt work as it's good exercise for learning to script, but the functionality you need is best implemented with an alert list and $searchspawn. Alert list will keep tab of spawn id's, then you can $ss against it for mobs not on the alert list (noalert flag).

G

User avatar
driftinsupra
Official loudmouth
Official loudmouth
Posts: 212
Joined: Tue Jan 28, 2003 9:25 pm

Post by driftinsupra » Thu Jan 29, 2004 7:14 pm

Ok to be honest I really dont know how to use /alert lists or $spawnsearch. The most indepth macro I have made was my bazaar ones but I have yet to deal with macroing like this before. I tried to play with animation to see which mob was fighting and which wasnt since I figured that way I could determine who was attcking and then mez all bu the one that the ma was attacking. The problem is that $targte(animation) returns several different values which is making that part difficult. What I would really like to do is to maybe put all the mobs that are are in a given radius around me on a list (maybe the alert list...not sure how that works yet but I am gonna give it a shot) then find the ones that are attacking and who they are attacking. Obviously I would wanna mez the ones that are attacking the healer or any other casters then mez all the ones that arent the one the ma is fighting. My question is how would I organize that into the /alert list and how would I determine who they are attacking? I got most of the rest of the script written as how to follow through group through the dungeon (was very difficult by the way) and how to keep all the members buffed and whatnot. All I gotta do now is add a few other features and the featur to mez and I will have a very powerful chanter ldon script..Just need a little help here.

User avatar
driftinsupra
Official loudmouth
Official loudmouth
Posts: 212
Joined: Tue Jan 28, 2003 9:25 pm

Post by driftinsupra » Thu Jan 29, 2004 7:22 pm

ok from looking through the manual a little more....would this work to generat a list or mobs within my range?

Code: Select all

/target range 0 500 no alert 1
/alert add 1 $target(name)
I know this obviously has to be played with a little, but in theory that should add all the mbos within that range to an alert list without having the same mob on it multiple times correct?

Also when a mob dies is his name taken off the alert list? How would that work?

User avatar
driftinsupra
Official loudmouth
Official loudmouth
Posts: 212
Joined: Tue Jan 28, 2003 9:25 pm

Post by driftinsupra » Thu Jan 29, 2004 10:33 pm

Anyone wanna toss some advice my way? Please?

Gumby
a ghoul
a ghoul
Posts: 99
Joined: Sat Jan 24, 2004 5:27 pm

Post by Gumby » Fri Jan 30, 2004 3:13 am

driftinsupra wrote:Anyone wanna toss some advice my way? Please?
Grin, the forums get a bit slow later in the day in terms of people reading and responding... from reading some of the previous posts on these forums I found out that /target gets sent to the server whereas $searchspawn does not; doing a lot of /targets may flag you as a script user. Since I made the recommendation you go this route I'll do ya one better: here's a subroutine that I wrote to simply count mobs in a radius. It's not a long walk to do other things (add debuff/mez for example in the /if n @CountID!=0 code segment) with it too but it shows $searchspawn and /alert usage:

Code: Select all

Sub MobCount(LocalRange)
   /declare MobCounter local
   /declare CountID local

   /alert clear 7
   /alert add 7 id -1
   /varset MobCounter 0
   :NextCount
      /varset CountID $searchspawn(npc,radius:@LocalRange,zradius:50,noalert:7)
      /if n @CountID!=0 {
         /alert add 7 id @CountID
         /varadd MobCounter 1
         /goto :NextCount
      }
/return @MobCounter
Hope this helps to get ya started,

G

Gumby
a ghoul
a ghoul
Posts: 99
Joined: Sat Jan 24, 2004 5:27 pm

Post by Gumby » Fri Jan 30, 2004 4:05 am

Ah hrm, y'all get a double post because I completely missed one of the messages in the topic.

Ok limitations of alert lists AFAIK.

1) You cannot list out what ID's are in the alert list.

2) You cannot modify the alert list runtime without clearing it and rebuilding it. (I call MobCount repeatedly during the course of a script).

For what you want to do you're going to go beyond where most scripts I'm aware of go... but then again most currently available are v1 ports which were designed around some limitations that went away with v2 is my understanding. I don't know where genbot is in terms of enchanter capabilities, someone'll probably chime in on that and maybe looking at it can be of assistance.

I'd approach it like this generically for a first round:

1) Figure out the classes in the group, know your MT.

2) Assist off the MT, and possibly off tanks, and add the mob ID(s) they're engaged with to an exclusion list (probably just add them to the mezzed mobs alert list directly for simplicities sake in the first round of your code)

3) do a similar $ss and /alert routine like I posted in MobCount to mez the remainder.

This would work well to a point; to get beyond this you get to do a lot of custom work which probably was impossible in v1, and they're things I haven't attempted yet (unless someone enterprising and better at real coding than I am wants to take a whack at removing at least limitation #1 for alert lists hehe). It probably quickly gets outside of the scope of this forum; maybe take it to PM's. I'd also be interested in seeing what you came up with for the zone navigation and other things though I keep intending to try ml's advpath. I'm fundamentally lazy and I have to recode my toons in the near future for LDoN among other things :).

G

dman
a hill giant
a hill giant
Posts: 181
Joined: Fri Dec 05, 2003 12:54 pm

Post by dman » Fri Jan 30, 2004 9:07 am

This thread may help you as well, not much difference code wise from selecting for mezzing or debuffing mobs in camp. http://macroquest2.com/phpBB2/viewtopic ... highlight=

User avatar
driftinsupra
Official loudmouth
Official loudmouth
Posts: 212
Joined: Tue Jan 28, 2003 9:25 pm

Post by driftinsupra » Fri Jan 30, 2004 1:39 pm

Appreicate the help....I think I got some good ideas to go off now. One questions though:

Ok for the life of me I cannot figure out a way to determine what group memeber each mob is attacking first. I was thinking using radius around a member of the group but I see to many possibilities where this could be inacurate. The reason I would like to do this is so that when I start a mez cycle, I target the mobs that might might be targeting weaker members (aka casters) first. I have almost got it so I know weather or not they are attacking but I have no idea how to figure out who.

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Fri Jan 30, 2004 2:01 pm

This is something very difficult to find out. You could assist every mob to see what their target is but this would take a lot of time considering that you have to query the server every time. You would have to put a fairly long timeout for the query since you could be getting mobs that have no target yet (not agrod). You would also have to target each and every mob in order to assist off them. There would be a lot of traffic to and from the server that in case you're paranoid you would worry about.

The only other solution I can think of is to use $spawn(heading) to find out the direction that the mob is facing and together with it's loc and some math find out what pc's are in it's path. This is probably the same information you would use visually when you're playing the enchanter yourself so if you put a bit (a lot) of work into this it could probably work quite well.

Gumby
a ghoul
a ghoul
Posts: 99
Joined: Sat Jan 24, 2004 5:27 pm

Post by Gumby » Fri Jan 30, 2004 2:41 pm

driftinsupra wrote:Appreicate the help....I think I got some good ideas to go off now. One questions though:

Ok for the life of me I cannot figure out a way to determine what group memeber each mob is attacking first. I was thinking using radius around a member of the group but I see to many possibilities where this could be inacurate. The reason I would like to do this is so that when I start a mez cycle, I target the mobs that might might be targeting weaker members (aka casters) first. I have almost got it so I know weather or not they are attacking but I have no idea how to figure out who.
Don't imo.

As the previous poster stated it's going to be a pain in the ass and very time consuming since to reliably get /assist targets you have to insert delays.

Doing this when there's a bunch of mobs are around is simply wasting time; worse, situations in big pulls are so fluid anyway that you might be halfway through the checking and the cleric busts out an emergency SL on the tank and is jumped by half the mobs you already checked.

Find the targets, mez them ASAP. You can't do everything playing a chanter as a human on overpulls (I know this much from having played a chanter occasionally, and even from gimp CCing on my regular toon); trying to make this functionality part of an uber bot, good luck =/. What it boils down to is let the other party members do their jobs... if a caster's getting whacked, ok a healer will heal them; if a healer's getting whacked, another healer will heal them; if you only have a single healer, then melees need to be trying to get them off of the healer till you can mez. Failing all that you evac or wipe. Happens to real toons no matter how godlike they happen to be, it'll happen to botted ones too.

At some point coding robustness has to take precedence over features... if you can figure out a way to both reliably and quickly do this then by all means go for it, but I think you're trying to get something which covers few situations for a whole lot of investment in time. Maybe if your were to get everything else solid would I suggest you go for it, but until then, the rest of the functionality's going to be more important.

G

User avatar
driftinsupra
Official loudmouth
Official loudmouth
Posts: 212
Joined: Tue Jan 28, 2003 9:25 pm

Post by driftinsupra » Fri Jan 30, 2004 2:41 pm

ok quick question...when using search spawn can you do a noalert using 2 alert lists?

User avatar
driftinsupra
Official loudmouth
Official loudmouth
Posts: 212
Joined: Tue Jan 28, 2003 9:25 pm

Post by driftinsupra » Fri Jan 30, 2004 3:23 pm

ok ran into what looks to be a big problem.The only way I can find to find out if something is attacking is to use $target(animation) which means I will have to go through and target every mob which I can do but might set off some flags. Is there any other way to see if a mob is fighting without using $target?

User avatar
driftinsupra
Official loudmouth
Official loudmouth
Posts: 212
Joined: Tue Jan 28, 2003 9:25 pm

Post by driftinsupra » Fri Jan 30, 2004 3:28 pm

This script would probably work but at the same time it would require me targeting alot of mobs which will prolly throw some flags. It is just some basic mod of Gumby's script.

Code: Select all

#turbo

Sub Main
   /declare CountID local 
   
   /alert clear 7 
   /alert add 7 id -1 
   /assist MainTankHere
   /alert add 7 id $target(id)
   :NextCount 
      /varset CountID $searchspawn(npc,radius:200,zradius:50,noalert:7) 
      /if n @CountID!=0 { 
         /alert add 7 id @CountID 
         /target id @CountID
         /if n $target(animation)==5 /call cast Enthrall
	 /if n $target(animation)==7 /call cast Enthrall
	 /if n $target(animation)==8 /call cast Enthrall
	 /if n $target(animation)==13 /call cast Enthrall
	 /if n $target(animation)==44 /call cast Enthrall
         /goto :NextCount 
      } 
/return
 

Miseaujeu
a lesser mummy
a lesser mummy
Posts: 32
Joined: Mon Nov 24, 2003 6:25 pm

Post by Miseaujeu » Fri Jan 30, 2004 3:44 pm

Driftin,
as long as you keep your radius low -- I wouldn't worry too much about the targeting of too many mobs : but then you might miss some casters away from the fray. That balance is what you'll have to fine tune to your liking.

-M