Arrays, cleanup question.

Third party software discussion goes here.
eustace11
Posts: 66

Re: Arrays, cleanup question.

Post#11 » Sun Apr 09, 2017 1:36 pm

Thank you very much for that. I'll take a seriously in-depth look at it. This has been an extensive learning experience for me, and I'm still having trouble adapting myself personally to controlling 6 characters at once via direct commands, events, and variables.

eustace11
Posts: 66

Re: Arrays, cleanup question.

Post#12 » Sun Apr 09, 2017 1:47 pm

moguay wrote:Capture the moment to make a heal, not required an array.
You need to check quickly all the group and extract only the priority.

For exemple you can classify by hp and cast it by priority if found

Below just a draft code :

Code: Select all

/varset lower70 int local 70
/varset lower70toon string local
/varset lower50 int local 50
/varset lower70toon string local

/for x 0 to ${Group.Members}
    if ${Group.Member[x].PctHPs} > 50 && ${Group.Member[x].PctHPs} < ${lower90}) {
        /varset lower70 ${Group.Member[x].PctHPs}
        /varset lower70toon ${Group.Member[x]}
    }
    if ${Group.Member[x].PctHPs} < ${lower50}) {
        /varset lower50 ${Group.Member[x].PctHPs}
        /varset lower50toon ${Group.Member[x]}
    }   
/next x

/if (${Spawn[pc ${lower50toon}].ID}) { casting 50hp... }
/if ({Spawn[pc ${lower70toon}].ID}) { casting 70hp... }


Code: Select all

/if ( ${Group.Member[0].PctHPs}<=75 && ${Group.Member[1].PctHPs}<=75 && ${Group.Member[2].PctHPs}<=75 && ${Group.Member[3].PctHPs}<=75 && ${Group.Member[4].PctHPs}<=75 && ${Group.Member[5].PctHPs}<=75 ) {
   /casting "5270" -maxtries|5
   } else {
   /echo returning to main
   /delay 1
   }
   /return


as well as

Code: Select all

:Next2
/if ( ${Group.Member[2].PctHPs}<=80 && ${Group.Member[2].PctHPs}>=70 ) {
   /target ${Group.Member[2]}
   /delay 50
   /gsay Tossing a hot on ${Target.CleanName}
   /casting "Pious Elixir" -maxtries|5
   /delay 5s
   /casting "Harmony of Spirit III" -maxtries|5
   /delay 3s
   } else /if (${Group.Member[2].PctHPs}<=65) {
      /target ${Group.Member[2]}
      /delay 50
      /gsay quickie heal and big heal incoming for ${Target.CleanName}
      /casting "Pious Remedy" -maxtries|3
      /delay 3s
      /casting "9190" -maxtries|3
      /delay 5s
      } else {
         /delay 3
         /goto :Next3


are what I've been using on my cleric in what is, as I have previously stated, a BASIC open circuit(0)-closed circuit(1) /run; /goto; format.

I think part of the mental blockade I'm experiencing with varset is that I still continue to see the binaries as being open/closed electrical circuits as represented by the symbol on your power button. I do admire your sharing this information with me, and am quite obliged by your extension of assistance in this regard.

User avatar
moguay
Posts: 170

Re: Arrays, cleanup question.

Post#13 » Wed Apr 12, 2017 7:03 am

Your are lot of time to rewrite your heal code...
So now, I propose you the same base code, heal of single target by integrating the group heal function

Stay safe, take just a bit of back

Code: Select all

Sub AutoGroupHeal
    | For Group Heal
    /declare autogrouppct int   local   70
    /declare autogroupcount int local   2
    /declare count int local            0
    /declare count70 int local          0
    /declare count100 int local         0
    /declare countquick int local       0

    | For Single Target Heal   
    /declare lower70 int local          70
    /declare lower70toon string local
    /declare lower50 int local          50
    /declare lower70toon string local

    /for x 0 to ${Group.Members}
        /if (${Group.Member[${x}].PctHPs}<=${autogrouppct} && ${Group.Member[${x}].ID}!=NULL && ${Spawn[pc =${Group.Member[${x}].CleanName}].ID}!=NULL && ${Spawn[pc =${Group.Member[${x}].CleanName}].Distance}<=300) {
            /if (${Spawn[pc =${Group.Member[${x}].CleanName}].Distance}<=70) /varcalc count70 ${count70}+1
            /if (${Spawn[pc =${Group.Member[${x}].CleanName}].Distance}<=100) /varcalc count100 ${count100}+1
            /if (${Group.Member[${x}].PctHPs}<=61) /varset countquick ${countquick}+1
            /varcalc count ${count}+1
        }       
        if ${Group.Member[x].PctHPs} > 50 && ${Group.Member[x].PctHPs} < ${lower90}) {
            /varset lower70 ${Group.Member[x].PctHPs}
            /varset lower70toon ${Group.Member[x]}
        }
        if ${Group.Member[x].PctHPs} < ${lower50}) {
            /varset lower50 ${Group.Member[x].PctHPs}
            /varset lower50toon ${Group.Member[x]}
        }   
    /next x

    /if (${count}>=${autogroupcount}) {

        /if (${countquick}>1) {
            | Auto Break Current Casting
            /if (${Me.Casting.ID} || ${Window[TargetWindow].Child[Casting_SpellName].Text.Length} || ${Window[CastingWindow].Open}) /stopcast
            /delay 1s (${Cast.Ready})
            /if (${Me.Moving}) {
                /keypress left
                /keypress right
                /keypress forward
                /keypress back
                /keypress forward
            }
            /if (${Me.Ducking}) /keypress DUCK
        }

        /if ((${Me.Class.Name.Equal[Cleric]} || ${Me.Class.Name.Equal[Paladin]}) && !${Me.Moving}) {
            /if (${count100}>=${autogroupcount}) {
                casting Group Heal 100 range...
            } else /if (${count70}>=${autogroupcount}) {
                casting Group Heal 70 range...
            } else {
                casting Spell Group Heal...
            }
        }

        /if ((${Me.Class.Name.Equal[Shaman]} || ${Me.Class.Name.Equal[Druid]}) && !${Me.Moving}) {
            casting Clicies Group Heal...
        }
       
    } else /if (${Spawn[pc ${lower50toon}].ID}) {
        casting 50hp...
    } else /if (${Spawn[pc ${lower70toon}].ID}) {
        casting 70hp...
    }
/return

eustace11
Posts: 66

Re: Arrays, cleanup question.

Post#14 » Wed Apr 12, 2017 12:11 pm

Right, I'm having trouble understanding both the varsets and what subtypes(?) the TLO's have access to in order to query the situation either for a number or a true/false situation.

What I'm going to have to do, as I've already been doing it sloppily, is really sit down and look at the MQ2 wiki to try and get a better understanding of it.

With that stated, I really appreciate you taking the time to show me your coding samples, although some of it is slightly disorienting even when I compare it to a full macro that other people say works for them.

My ultimate goal here is to have an acolyte level of understanding of the macro functionality of MQ2 in order to play my group of rng, clr, shm, enc, dru, and pal effectively. I'm using to double and triple boxing with eqWindows by using alt-tab and hotkeys. However, learning how to marionette and exchange the information on the fly between six clients at once from a puppetmaster client is going to require some new synaptic bridging on my end.

User avatar
Grey
Posts: 1101

Re: Arrays, cleanup question.

Post#15 » Tue May 23, 2017 12:47 pm

Late to the party but the snip in first post looks like something from one of my older macro.
Hope you figured out whatever you wanted to do but I did want to ask if there was a reason you did not want to utilize NetBots. There is a lot you can do with it. If you ever want to chat one on one and pick my brain then pm me and I can give you a invite to a discord channel.

Return to “Third party software”

Who is online

Users browsing this forum: No registered users and 2 guests