Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
poploco
Beginner


Joined: 14 Oct 2003
Posts: 18
Location: Canada

PostPosted: 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.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: 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.
Reply with quote
poploco
Beginner


Joined: 14 Oct 2003
Posts: 18
Location: Canada

PostPosted: 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.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: 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.
Reply with quote
poploco
Beginner


Joined: 14 Oct 2003
Posts: 18
Location: Canada

PostPosted: Mon Oct 01, 2012 1:51 am   
 
I have checked. It has the value of 1. And @NmsMages has the value of (MAG) Boobybooto
Reply with quote
meddlesome
Wanderer


Joined: 24 Aug 2012
Posts: 70

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net