iterating through characters

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

ibslug
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sat Oct 06, 2012 12:35 am

iterating through characters

Post by ibslug » Fri May 08, 2015 8:09 pm

Hi all. I'm looking for a little advice from someone smarter than me. :smile:

I have gotten reasonably decent at 'fixing up' existing macros to make them work for me, but I'm not extremely strong at creating my own macros. I recently came up with an idea for a macro that I wanted to try to create, but I don't know how best to approach it (assuming it's even possible).

Basically, I have a group of characters (all running the same macro) who each have the same clicky item. I want one group member to click it whenever certain conditions are met, and then have a different character click each time the condition is met subsequently. I don't wan't all of them to click it at once.

In other words:
- Condition is met, warrior clicks his clicky. Nobody else does.
- Condition is met a few minutes later, and this time cleric uses their clicky.
- Once more the condition is met, now the bard clicks, etc.
- When all the group members have used the clicky it returns to the first char and repeats.

Can anyone suggest a method for doing something like this? Obviously I need a way to distinguishing whose turn it is, and somehow keep characters all on the same page without them getting mixed up. My first guess was that I'd need some sort of array, and then a subroutine to read from it whenever the conditions are met, and iterate through? I'm just not too sure.

Please forgive my ignorance; as I said I'm by no means a great coder. I appreciate any input, even if it's just telling me that it's impossible. :P

dewey2461
Contributing Member
Contributing Member
Posts: 1759
Joined: Sun Apr 17, 2005 1:53 am

Re: iterating through characters

Post by dewey2461 » Fri May 08, 2015 9:49 pm

Are you running EQBCS and Netbots ?

PeteSampras
a snow griffon
a snow griffon
Posts: 322
Joined: Sat Dec 15, 2007 8:56 pm

Re: iterating through characters

Post by PeteSampras » Fri May 08, 2015 9:52 pm

Via eqbc and a master controller.

Code: Select all

/declare tClickTimer timer outer
/declare iLastClick int outer

/if (!${tClickTimer}) /call ClickTimerCheck

Sub ClickTimerCheck
/varset tClickTimer 60s
/if (${i}==0) {
    /useitem "ClickyName"
    } else {
   /bct ${Group.Member[${i}]}
   }
/if (${i}==${Group.GroupSize}) /varset i 0
/return

ibslug
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sat Oct 06, 2012 12:35 am

Re: iterating through characters

Post by ibslug » Fri May 08, 2015 10:00 pm

dewey2461 wrote:Are you running EQBCS and Netbots ?

Yes on both counts.

ibslug
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sat Oct 06, 2012 12:35 am

Re: iterating through characters

Post by ibslug » Fri May 08, 2015 10:11 pm

PeteSampras wrote:Via eqbc and a master controller.

Code: Select all

/declare tClickTimer timer outer
/declare iLastClick int outer

/if (!${tClickTimer}) /call ClickTimerCheck

Sub ClickTimerCheck
/varset tClickTimer 60s
/if (${i}==0) {
    /useitem "ClickyName"
    } else {
   /bct ${Group.Member[${i}]}
   }
/if (${i}==${Group.GroupSize}) /varset i 0
/return

Cool, thank you. This gives me something to consider. I hadn't thought of using a master and issuing commands, though it does seem like an obvious way to keep track of things in retrospect.

PeteSampras
a snow griffon
a snow griffon
Posts: 322
Joined: Sat Dec 15, 2007 8:56 pm

Re: iterating through characters

Post by PeteSampras » Fri May 08, 2015 10:45 pm

I had an error there too =x

/bct ${Group.Member[${i}]}

should be:

/bct ${Group.Member[${i}]} //useitem "clicky name"