Page 1 of 1

iterating through characters

Posted: Fri May 08, 2015 8:09 pm
by ibslug
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

Re: iterating through characters

Posted: Fri May 08, 2015 9:49 pm
by dewey2461
Are you running EQBCS and Netbots ?

Re: iterating through characters

Posted: Fri May 08, 2015 9:52 pm
by PeteSampras
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

Re: iterating through characters

Posted: Fri May 08, 2015 10:00 pm
by ibslug
dewey2461 wrote:Are you running EQBCS and Netbots ?

Yes on both counts.

Re: iterating through characters

Posted: Fri May 08, 2015 10:11 pm
by ibslug
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.

Re: iterating through characters

Posted: Fri May 08, 2015 10:45 pm
by PeteSampras
I had an error there too =x

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

should be:

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

Re: iterating through characters

Posted: Sat Jan 17, 2026 7:33 am
by xyilla

Re: iterating through characters

Posted: Sat Jan 17, 2026 7:34 am
by xyilla

Re: iterating through characters

Posted: Sat Jan 17, 2026 7:35 am
by xyilla