Two macro questions

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
Zandel
Giant
Posts: 133
Joined: Thu May 13, 2010 1:52 pm

Two macro questions

Post by Zandel »

Using MapTool Version: 1.3.b91
First question:
Is there a way to dynamically set a variable name? The use case is as follows:
I have a number of token properties labeled SkillnameAdds where skill name will vary for each property. I have another property called LastUsedSkill. I want to get the specific value in the appropriate SkillnameAdds based on the value of LastUsedSkill.

Second question:
Is there away to append the notes? I see the setNotes function, but it seems to overwrite what's there.

Thanks so much

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Two macro questions

Post by Full Bleed »

Zandel wrote: First question:
Is there a way to dynamically set a variable name? The use case is as follows:
I have a number of token properties labeled SkillnameAdds where skill name will vary for each property. I have another property called LastUsedSkill. I want to get the specific value in the appropriate SkillnameAdds based on the value of LastUsedSkill.
Yes, there is a way.

Something like this:

Code: Select all

[h: skillName = LastUsedSkill]
[h: skillValue = eval(skillName+"Adds")]
Is there away to append the notes? I see the setNotes function, but it seems to overwrite what's there.
It may just be easier to double click the tokens and edit the notes there. But I think someone (Aliasmask I think) made a drop-in for editing notes around here somewhere... I believe I've used it as a base for editing notes in my framework, but I've hacked it up something fierce to suit my particular needs so I don't know what use it would be now.

In short you display the notes using getNotes() in a text area, edit the notes there, then setNotes().
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Zandel
Giant
Posts: 133
Joined: Thu May 13, 2010 1:52 pm

Re: Two macro questions

Post by Zandel »

Thanks for the help!

Zandel
Giant
Posts: 133
Joined: Thu May 13, 2010 1:52 pm

Re: Two macro questions

Post by Zandel »

So I am not trying to do the reverse of what I asked above. I am trying to update a specific token property, specified by another token property.

I have a property called BlessedSkill

I want to set the "Skill"Temp Property for the skill in the BlessedSkill Property back to 0 when I cancel the Bless

So for example if BlessedSkill contains Taunt, I want to set TauntTemp to 0, if it contains Dodge, I want to set DodgeTemp to 0.

I tried this

Code: Select all

[h: eval(BlessedSkill+"Temp") = 0]
But it does not seem to update the appropriate skill to 0.

Is there a way to do this?

Thanks


Zandel
Giant
Posts: 133
Joined: Thu May 13, 2010 1:52 pm

Re: Two macro questions

Post by Zandel »

That did the trick thanks!

Post Reply

Return to “Macros”