Goto page Previous  1, 2 Public Macros Your Mission if you choose to accept-Mez, radius adds remezz
Reply
I can pritty much figure out how to add something, like a mob to the ini list, but how would you make it check against the list for the mob?

Use the Ini TLO.

${Ini[filename,section,key,default]} returns a string.

Macro
More +
/if (${Ini[mezzimunemobs.ini,${Zone.ID},${Target.DisplayName},NULL].Find[${Target.DisplayName}]}) {
| stuff to do, or not do, if ${Target.DisplayName} has an entry in the ini file
}


The NULL is implied by default even if you don't specify it.
Wed Jun 06, 2012 9:31 pm
Senior Project Member
Uggg
ok been playing with a test macro:

Macro
More +

#event addini "You say, 'add'"


Sub Main

:start
/if (${Ini[MobList.ini,${Zone.ID},${Target.DisplayName},NULL].Find[${Target.DisplayName}]}) {
/echo this is a match
/delay 2s
}
/goto :start

/return

Sub Event_addini(line)
/ini "MobList.ini" "${Zone.ID}" "${Target}" ""
/return

to try to understand how to use ${Ini}
and
/ini

I can type in MQ2 /ini "Moblist.ini" "ImmuneList" "AKewKey" "${Target}" and get the result of what I have targeted put into an ini file but that is for a single entry.
I see in the:
Macro
More +

(${Ini[MobList.ini,${Zone.ID},${Target.DisplayName},NULL].Find[${Target.DisplayName}]})

what is being done but not sure what values in the /ini command is being used to create the entries.
Sorry, hard to understand when your not 100% sure how it works. I can make sence of it just not sure how it is done (sucks not ever righting code before and trying to figure it out)
it's funny, when that light bulb comes on you feel so stupid for seeing how simple it actualy is... but it is untill that light bulb finaly comes on that the problem seems alot more complex then what it actualy is.
Thu Jun 07, 2012 3:41 pm
Your test macro uses ${Target.DisplayName} to check for the /echo but places mobs in the ini using ${Target}. The echo won't fire because the two should give different results for the same mob.


/ini "MobList.ini" "${Zone.ID}" "${Target}" ""


Using "" for a value might be telling MQ2 to delete that key rather than place it there with an empty value (INI file maintenance). Try putting something, anything not an empty string, there.
Thu Jun 07, 2012 7:43 pm
Senior Project Member
Sorry. I haven't been paying enough attention.

Both the ${Ini[]} and /ini commands are extremely versatile. They can do a whole lot, but they also have to match. I haven't been giving examples that match.

The following are examples of matching ${Ini[]} and /ini commands (crossing my fingers this time).

Macro
More +
/ini "MobList.ini" "${Zone.ID}" "${Target.DisplayName}" "${Target.DisplayName}"
/delay 1s
/if (${Ini[MobList.ini,${Zone.ID},${Target.DisplayName},NULL].Find[${Target.DisplayName}]}) {
        /echo ${Target.DisplayNasme} appears in MobList.ini
}



Macro
More +
/ini "MobList.ini" "${Zone.ID}" "${Target.DisplayName}" "blahblahblah"
/delay 1s
/if (${Ini[MobList.ini,${Zone.ID}].Find[${Target.DisplayName}]}) {
        /echo ${Target.DisplayNasme} appears in MobList.ini
}


Macro
More +
/ini "MobList.ini" "${Zone.ID}" "${Target.DisplayName}" "blahblahblah"
/delay 1s
/if (${Ini[MobList.ini,${Zone.ID},${Target.DisplayName},NULL].EQUAL[NULL]}) {
        /echo ${Target.DisplayNasme} is safe to mez because it doesn't appear in MobList.ini
} else {
        /echo ${Target.DisplayName} appears in MobList.ini
}


Play around with echo statements to see what the ${Ini[]} command will return.
/echo ${Ini[MobList.ini]}
/echo ${Ini[MobList.ini, ${Zone.ID}]}
/echo ${Ini[MobList.ini, ${Zone.ID}, ${Target.CleanName}]}
/echo ${Ini[MobList.ini, ${Zone.ID}, ${Target.CleanName}, NULL]}
/echo ${Ini[MobList.ini, ${Zone.ID}, ${Target.Name}, NULL]}
Fri Jun 08, 2012 12:17 am
Senior Project Member
EURICA!
Ok found what works. Using the Ini coding and playing around with it, I have found I think a perfect combanation to play around with in the main enchanter macro.
The way this is it does 2 things:

1st
It will check for the mobs name in the ini. If it isn't there it will continue without any [MQ] messages or errors. I played around with different ways to do it and most of the other ways I tried would either give off an error if the mob wasn't in the list or keep repeating a [MQ] of NULL or something.

2nd
ok figures.. daughter calls and I lose my train of thought. Um I guess the other thing was I figured out how to edit the /ini code to make the list how ever I want.

Point is I think this bit of code, now that I understand it better, helps greatly in NOT trying to mezz mobs that are immune. Also I thought about adding a "MaxLevel" to the code so it doesn't try mezzing mobs that resist because they are just to high level. I will play around with it when I have it this perfected some.

New Code:
Macro
More +

#turbo


#include Spell_routines.inc
#turbo 40
#chat say


#event test  "#*#test#*#"


Sub Main

:start
/doevent
/if (${Ini[MobList.ini,${Zone.ID}].Find[${Target.DisplayName}]}) {
/echo The ${Target} is listed
}
/delay 1s
/goto :start

/return

Sub Event_test(Line)
/ini "MobList.ini" "${Zone.ID}" "${Target.DisplayName}" "ImmuneToMezz"
/return


This was for the test code... now to just apply it to the Echanter code and start testing.
Fri Jun 08, 2012 11:09 am
In failure lies success
Well after a few posts that I have deleted about my loop I was trying to create I decided to scrap it. It did what it was suppose to do but when there where no mobs in range it would get stuck then if mobs meeting the critiria were in range it would still be stuck. I tried many different ways to write it but just couldn't get it. After another post on another forum I am a member of from someone with a little more technical expertice then I, I see I was on the right track with what I was trying to create but this snippet is much better written then what I was trying to come up with. I don't take credit for this one but it was written to solve this loop topic.

Macro
More +

#include spell_routines.inc

Sub Main
  /declare MobID[150] int outer
  /declare j int outer
  /declare k int outer
  /declare NumMobs int outer 1
  /declare MobAdded int outer 0
  /declare MobRadius int outer 50
  :loop
    /delay 1
    /if (${NearestSpawn[1,NPC zradius 20].Distance}>${MobRadius} && ${NumMobs}>1) {
      /bc Reseting NumMobs = 1
      /varset NumMobs 1
    }
   
    /if (${NearestSpawn[1,NPC zradius 20].Distance}>${MobRadius}) /goto :loop
  /for k 1 to ${SpawnCount[NPC radius ${MobRadius} zradius 20]}
    /varset MobAdded 0
   
    /for j 1 to ${NumMobs}
      /if (${MobID[${j}]}==${NearestSpawn[${k},NPC zradius 20 radius ${MobRadius}].ID}) /varset MobAdded 1
    /next j
    /if (!${MobAdded}) {
      /tar id ${NearestSpawn[${k},NPC zradius 20 radius ${MobRadius}].ID}
      /delay 20 ${Target.ID}==${NearestSpawn[${k},NPC zradius 20 radius ${MobRadius}].ID}
      /if (${Target.PctHPs}>90) {
      /echo I have ${Target} targeted
      /delay 2s
      |/echo ${castReturn}
      |/if (${castReturn.Equal[CAST_SUCCESS]}) {
      | /varcalc NumMobs ${NumMobs}+1
      | /varset MobID[${NumMobs}] ${Target.ID}
      |  /bc Added [+y+]${Target.ID}
      |}
      }
     }
  /next k
    /target clear
  /goto :loop
/return


I have edited it a little for testing. It works exactly the way I'm needing it to. My /if conditions can be added to it easily and if you get out of range it just stops targeting. If you get back into range it continues to cycle. PLUS it is a loop in it's self so it should be able to be merged into an existing macro.
I will continue the editing and testing and will post results....

UPDATE
Ok after a many fail, fail, fail and fail.. I finaly found something that works.

Macro
More +

#include spell_routines.inc

Sub Main
  /declare MobID[150] int outer
  /declare j int outer
  /declare k int outer
  /declare NumMobs int outer 1
  /declare MobAdded int outer 0
  /declare MobRadius int outer 50
  /declare MATank int outer Backbreaker
  /declare MezzSpell  string outer Entrance
 
  :loop
   
    /delay 1
    /if (${NearestSpawn[1,NPC zradius 20].Distance}>${MobRadius} && ${NumMobs}>1) {
      /bc Reseting NumMobs = 1
      /varset NumMobs 1
    }
   
   
   
    /if (${NearestSpawn[1,NPC zradius 20].Distance}>${MobRadius}) /goto :loop
  /for k 1 to ${SpawnCount[NPC radius ${MobRadius} zradius 20]}
    /varset MobAdded 0
   
    /squelch /alert clear 1
    /assist ${MATank}
    /squelch /alert add 1 id ${Target.ID}
    /squelch /target clear
     
    /for j 1 to ${NumMobs}
      /if (${MobID[${j}]}==${NearestSpawn[${k},NPC zradius 20 radius ${MobRadius}].ID}) /varset MobAdded 1
    /next j
   
   
    /if (!${MobAdded}) {
      /tar id ${NearestSpawn[${k},NPC zradius 20 radius ${MobRadius}].ID}
      /delay 20 ${Target.ID}==${NearestSpawn[${k},NPC zradius 20 radius ${MobRadius} noalert 1].ID}
      /if (${Target.PctHPs}>90) {
     
  :animationcheck
      /if (${Target.Animation}==32 || ${Target.Animation}==26 || ${Target.Animation}==72 || ${Target.Animation}==71 || ${Target.Animation}==17 || ${Target.Animation}==104) /goto :aftermez
     
  :inicheck
      /if (${Ini[MobList.ini,${Zone.ID}].Find[${Target.DisplayName}]}) /goto :aftermez
 
  :meztarget
      /call cast "${MezzSpell}" gem5 5s
      /if (${Macro.Return.Equal[CAST_SUCCESS]}) {
        /gsay > %t < Is MEZZED!
        /goto :aftermez
        }
      /if (${Macro.Return.Equal[CAST_RESISTED]}) {
        /call cast "${MezzSpell}" gem5 3s
        /if (${Macro.Return.Equal[CAST_SUCCESS]}) /goto :aftermez
        /if (${Macro.Return.Equal[CAST_RESISTED]}) {
            /call cast "${MezzSpell}" gem5 3s
            /if (${Macro.Return.Equal[CAST_SUCCESS]}) /goto :aftermez
            /if (${Macro.Return.Equal[CAST_RESISTED]}) {
                /gsay > %t < RESISTED to many times, CAN'T BE MEZZED!
                /squelch /alert add 1 id ${Target.ID}
                }
               }
              }
      /if (${Macro.Return.Equal[CAST_INTERRUPTED]}) {
        /gsay HELP! I'm being interupted!
        }

      /if (${Macro.Return.Equal[CAST_IMMUNE]}) {
        /ini "MobList.ini" "${Zone.ID}" "${Target.DisplayName}" "ImmuneToMezz"
        /gsay ${Target.DisplayName} was IMMUNE to Mezz adding to list.
        }
       
       }
      }
     }
  :aftermez
  /next k

  /goto :loop
/return


This bit of code works well.
It will cycle through targets, Mezz any that meets the conditions, Not mezz mobs that meets those conditions and remezzes mobs if they break mez. Right now you can adjust the range and MobHPs (won't mezz if HPs are under but you can adjust how you want that to work as well) and other things.

There is only one thing I haven't been able to figure out so far. How to make the tanks target an exception to mezzing. I have been playing with the /alert command. I can check what target is the tanks target easy enough. just not adding the alert conditions in the right place I think. Not real familuar yet with the alert. For now if the mob gets under 90% HPs she won't try to mezz it. That would work in most cases except of you have DS on or have done damage to other mobs which I'm a little iffy about.
Sat Jun 09, 2012 2:04 pm
Ok I think I got it!
Ok, After some work I finaly got it.
It does everything you need it to do as far as mezzing from what I can see. I have been running it through some testing. I still have not taken it into the field for major testing, only stuff in an easy areas so far. BUT so far it's working great. Now keep in mind I usualy start my macros when I get where I'm going and/or am ready to start fighting. It may or maynot mez stuff that wonders into it's radius. Still haven't gotten that far on testing yet. That is why I have it's radius low, but it can be adjusted as needed. I have started incorperaiting it into my echanters main code as an event. I may change this though I will play around with it. Not sure if I like it running all the time due to the fact it "may" mez things that just wonder into it's radius. If I set it as an event where someone in the group says "mez" then I only have to set up a simple hot butting for it and hit it when I need things mezzed. I can also set up an event to run this when it detects a mez broken which would be nice also.
Anyway, I figured out how to make it check Tanks (or assists or group members) target. I figured out how to use NetBots. Handy little plugin. The only thing you have to change is this part:
Macro
More +

:CheckTanksTarget
      /if (${Target.ID}==${NetBots[Backbreaker].TargetID}) /goto :aftermez

Need to change "Backbreaker" to who ever you want that will be fighting the mobs.

This is the working product so far:
Enchanter Mez
Macro
More +

#include spell_routines.inc

Sub Main
  /declare MobID[150] int outer
  /declare j int outer
  /declare k int outer
  /declare NumMobs int outer 1
  /declare MobAdded int outer 0
  /declare MobRadius int outer 50
  /declare MATank int outer Backbreaker
  /declare MezzSpell  string outer Entrance



  :loop
   
    /delay 1
    /if (${NearestSpawn[1,NPC zradius 20].Distance}>${MobRadius} && ${NumMobs}>1) {
      /bc Reseting NumMobs = 1
      /varset NumMobs 1
    }  
   
    /if (${NearestSpawn[1,NPC zradius 20].Distance}>${MobRadius}) /goto :loop
  /for k 1 to ${SpawnCount[NPC radius ${MobRadius} zradius 20]}
    /varset MobAdded 0
 
   
    /for j 1 to ${NumMobs}
      /if (${MobID[${j}]}==${NearestSpawn[${k},NPC zradius 20 radius ${MobRadius}].ID}) /varset MobAdded 1
    /next j
   
   
    /if (!${MobAdded}) {
      /tar id ${NearestSpawn[${k},NPC zradius 20 radius ${MobRadius}].ID}
      /delay 20 ${Target.ID}==${NearestSpawn[${k},NPC zradius 20 radius ${MobRadius}].ID}
      /if (${Target.PctHPs}>90) {
  :CheckTanksTarget
      /if (${Target.ID}==${NetBots[Backbreaker].TargetID}) /goto :aftermez
 
  :animationcheck
      /if (${Target.Animation}==32 || ${Target.Animation}==26 || ${Target.Animation}==72 || ${Target.Animation}==71 || ${Target.Animation}==17 || ${Target.Animation}==104 || ${Target.Animation}==18) /goto :aftermez
     
  :inicheck
      /if (${Ini[MobList.ini,${Zone.ID}].Find[${Target.DisplayName}]}) /goto :aftermez
 
  :meztarget
      /call cast "${MezzSpell}" gem5 5s
      /if (${Macro.Return.Equal[CAST_SUCCESS]}) {
        /gsay > %t < Is MEZZED!
        /goto :aftermez
        }
      /if (${Macro.Return.Equal[CAST_RESISTED]}) {
        /call cast "${MezzSpell}" gem5 3s
        /if (${Macro.Return.Equal[CAST_SUCCESS]}) /goto :aftermez
        /if (${Macro.Return.Equal[CAST_RESISTED]}) {
            /call cast "${MezzSpell}" gem5 3s
            /if (${Macro.Return.Equal[CAST_SUCCESS]}) /goto :aftermez
            /if (${Macro.Return.Equal[CAST_RESISTED]}) {
                /gsay > %t < RESISTED to many times, CAN'T BE MEZZED!
                /squelch /alert add 1 id ${Target.ID}
                }
               }
              }
      /if (${Macro.Return.Equal[CAST_INTERRUPTED]}) {
        /gsay HELP! I'm being interupted!
        }

      /if (${Macro.Return.Equal[CAST_IMMUNE]}) {
        /ini "MobList.ini" "${Zone.ID}" "${Target.DisplayName}" "ImmuneToMezz"
        /gsay ${Target.DisplayName} was IMMUNE to Mezz adding to list.
        }
       
       }
      }
     }
  :aftermez
  /next k

  /goto :loop

/return


Have fun =)
Fri Jun 15, 2012 6:20 am
Goto page Previous  1, 2 Public Macros Your Mission if you choose to accept-Mez, radius adds remezz
Reply