|
poploco Beginner
Joined: 14 Oct 2003 Posts: 18 Location: Canada
|
Posted: Sun Sep 30, 2012 10:13 pm
Help with variables please |
Ok so I am trying to build a group breakdown list to report what classes the players in my groups are, and to add that information and their name in a list.
I already have figured out how to add the names to seperate lists... for example:
When I do the breakdown alias to initiate the trigger, first it will reset all variables... an example:
Code: |
#var NmsMages "~|W|~(|BC|MAG|W|~) "
#var CntMages 0 |
This will set the default pre-tag for the Mage list. Then the names of mages will add to it once the trigger identifies X player (or not) as a mage, and adds 1 to the total of mages with the commands:
Code: |
#if %ismember( %4, "Mage") {#var NmsMages %concat( @NmsMages, %1, ", ")}
#if %ismember( %4, "Mage") {#add CntMages 1} |
It adds my player name Bobbybooto to NmsMages just fine, so it's results is "(MAG) Boobybooto"
Then the script does a check. If the number of mages is 1 or more, I want it to add the text "(Mag) Boobybooto" to another var (if 0 then nothing):
Code: |
#if (@CntMages > 0) {} {#var ListFirepower %concat( @ListFirepower @NmsMages, ", ")}
grouptell @ListFirepower |
I thought this would merge the curent ListFirepower with the current @NmsMages and then a comma. The only thing that shows in the group tell
is "(MAG)".
Any help would be appreciated. |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Mon Oct 01, 2012 12:44 am |
You have your #if backwards. If @CntMages is greater than zero, you're doing nothing, and changing ListFirepower if it's not (i.e., zero or less). You need to put your #var command in the true block, not the false block.
|
|
|
|
poploco Beginner
Joined: 14 Oct 2003 Posts: 18 Location: Canada
|
Posted: Mon Oct 01, 2012 12:50 am |
Ok so if you're saying that
Code: |
#if (@CntMages > 0) {} {#var ListFirepower %concat( @ListFirepower @NmsMages, ", ")} |
Should be changed to
Code: |
#if (@CntMages > 0) {#var ListFirepower %concat( @ListFirepower @NmsMages, ", ")} {} |
Now instead of reporting (MAG) it is reporting nothing. |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Mon Oct 01, 2012 1:42 am |
Are you sure @CntMages actually isn't 0? It sounds like your player-identifying trigger isn't firing, or maybe it is but the %ismember check there is failing.
|
|
|
|
poploco Beginner
Joined: 14 Oct 2003 Posts: 18 Location: Canada
|
Posted: Mon Oct 01, 2012 1:51 am |
I have checked. It has the value of 1. And @NmsMages has the value of (MAG) Boobybooto
|
|
|
|
meddlesome Wanderer
Joined: 24 Aug 2012 Posts: 70
|
Posted: Thu Oct 11, 2012 11:47 am |
Forgive my comment. I thought I was in a different forum.
|
|
_________________ Intel Core 2 Quad Q9450 @2.66GHz
MDAC 2.8 SP1 ON WINDOWS XP SP3
Msjet40.dll ver 4.0.9511.0 + Security Bulletin MS08-028
CMUD v237
Order number: **7829 |
|
|
|
|
|