Kick all party member

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

myteam
Noob
Noob
Posts: 8
Joined: 18 Feb 2011, 06:35
Noob?: No

Kick all party member

#1 Post by myteam »

How to kick all party member except yourself?

1) The bot is the party leader but want to clear all of his party member.
2) Party member have random names.

I know we can use:

Code: Select all

do party kick (<party member #>)
But the problem is sometimes you can kick yourself out of the party.

Is there anyway we can detect self (<party member #>) then kick other except that number?

Or is there are more simply method?

I want to avoid recreate party to solve this.
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Kick all party member

#2 Post by EternalHarvest »

In Perl, the following will evaluate to a list of all party member binIDs except yourself:

Code: Select all

grep { $partyUsersID[$i] ne '' && $partyUsersID[$i] ne $accountID } 0 .. @partyUsersID - 1
myteam
Noob
Noob
Posts: 8
Joined: 18 Feb 2011, 06:35
Noob?: No

Re: Kick all party member

#3 Post by myteam »

EternalHarvest wrote:In Perl, the following will evaluate to a list of all party member binIDs except yourself:

Code: Select all

grep { $partyUsersID[$i] ne '' && $partyUsersID[$i] ne $accountID } 0 .. @partyUsersID - 1
Thank you so much for the tips.

But I have a problem to add this to my macro.

Keep getting syntax error.

Can give me some example on how to use this?