Search found 1124 matches
- Thu Aug 25, 2011 8:25 pm
- Forum: Macros
- Topic: Variable types problem: String and number - Involving roll()
- Replies: 21
- Views: 1510
Re: Variable types problem: String and number - Involving ro
I take it you manually copy/paste those strings into the parameters of libProps? Is there a way to view the properties contents of a saved token outside of MapTool? If there is, you could export a spreadsheet as a .csv using ; as a delimiter. Someone could write a (very) simple program that parses t...
- Thu Aug 25, 2011 7:50 pm
- Forum: Macros
- Topic: Variable types problem: String and number - Involving roll()
- Replies: 21
- Views: 1510
Re: Variable types problem: String and number - Involving ro
Also, if variable1 is not 1 (true), then your output will error because you didn't define the variables being used. I know this, was trying to keep the code short, but left out that I defined it as false beforehand. A useful function is varsFromStrProp which will quickly define a string prop list l...
- Thu Aug 25, 2011 7:12 pm
- Forum: Macros
- Topic: Variable types problem: String and number - Involving roll()
- Replies: 21
- Views: 1510
Re: Variable types problem: String and number - Involving ro
Sorry had too much in my head at the time, I meant table(). I still can't get my head around this, let me post some more: Lib:Weapons Parameter Pistol | damageDie=6;damageDieQuantity=1;damageDieModifier=2 [h: weaponLookup = getProperty("Pistol", "Lib:Weapons")] <!-- Not u...
- Thu Aug 25, 2011 4:40 pm
- Forum: Macros
- Topic: Variable types problem: String and number - Involving roll()
- Replies: 21
- Views: 1510
Re: Variable types problem: String and number - Involving ro
It's up to you which method to use, but imagine the overhead just to make a roll when getting 3 values (times,sides,mod) which will only be complicated with advanced modifiers. ie, will you ever have to deal with 1d6 + 2 - 1d3 No, I'll only ever be rolling xdy + z in this rule system. Using the MT ...
- Thu Aug 25, 2011 10:42 am
- Forum: Macros
- Topic: Variable types problem: String and number - Involving roll()
- Replies: 21
- Views: 1510
Re: Variable types problem: String and number - Involving ro
in this case a json might be better. Seems to involve far more lines of text for what I'm trying to do, unless I'm using them wrongly. I'm still struggling with them to be honest, using getStrProp is much easier and more natural to me, so if you could please complete the below code perhaps I can un...
- Thu Aug 25, 2011 4:40 am
- Forum: Macros
- Topic: Variable types problem: String and number - Involving roll()
- Replies: 21
- Views: 1510
Variable types problem: String and number - Involving roll()
If I use: [h: damageRollText = 1d6+2] [h: damageRoll = roll(damageRollText)] [r: damageRoll] damageRoll rolls 1d6 and adds 2, however if I use: Table Weapons: 1 | name=Sword;damage=1d6+2 [h: weaponTable = table("Weapons", 1)] [h: damageRollText = getStrProp(weaponTable, "damage")...
- Wed Aug 24, 2011 8:30 pm
- Forum: Macros
- Topic: How to store information?
- Replies: 6
- Views: 428
Re: How to store information?
[h: '<!---- getting Token IDs ---->'] [h: Source = getImpersonated()] [h: Target = getSelected()] [h: '<!---- getting Token Property values ---->'] [h: sourceDex = getProperty("Dexterity", Source)] [h: targetDex = getProperty("Dexterity&quo...
- Wed Aug 24, 2011 4:59 pm
- Forum: Macros
- Topic: How to store information?
- Replies: 6
- Views: 428
Re: How to store information?
Thanks for the advice but I'm still struggling, showing you my code will probably help. Get Stats (Global) [h, if(hasImpersonated()): activeId = getImpersonated(); activeId = getSelected()] [h: arraySelf = json.set("","ID",activeId,"Dex",getProperty("Dexterity"...
- Wed Aug 24, 2011 3:21 pm
- Forum: Macros
- Topic: How to store information?
- Replies: 6
- Views: 428
How to store information?
I want to store information to be used later, e.g. saving a token's property to be used in a macro at a later date - specifically I'm trying to use the click-based targeting from http://www.lmwcs.com/rptools/wiki/Forms_tutorial#Click-based_Target_selection . I've been reading studying and testing js...
- Tue Aug 23, 2011 7:13 pm
- Forum: Macros
- Topic: Is there a function for isInteger or similar? Also, Case of?
- Replies: 13
- Views: 574
Re: Is there a function for isInteger or similar? Also, Case
Input automatically parses a number entry in an input box as a number, not a string? That was unexpected, and rather funny. I'm so used to defining the fields of every paramater, I assumed that a text input box would output "0" not 0.
- Tue Aug 23, 2011 5:38 pm
- Forum: Macros
- Topic: Is there a function for isInteger or similar? Also, Case of?
- Replies: 13
- Views: 574
Re: Is there a function for isInteger or similar? Also, Case
I unfortunately edited the macro which had the problem so cannot post it. I removed the abort near the top, only leaving an abort in the default section like so: [h: input=input] [h: output=0] [switch(input), code: case "0": {[output=0] Case 0! }; default: {[abort(output)] }] yet I'd still...
- Tue Aug 23, 2011 3:44 pm
- Forum: Macros
- Topic: Is there a function for isInteger or similar? Also, Case of?
- Replies: 13
- Views: 574
Re: Is there a function for isInteger or similar? Also, Case
Ah, arrays. I was wondering what on earth these json things are which I've been reading about. Trying to claw my way back into working practice as a coder after a decade absence. I've noticed a peculiar function when using code "nests", making it appear to me that the macro is read until t...
- Tue Aug 23, 2011 1:32 pm
- Forum: Macros
- Topic: Is there a function for isInteger or similar? Also, Case of?
- Replies: 13
- Views: 574
Re: Is there a function for isInteger or similar? Also, Case
The code is exactly what I posted as it's pseudo, there's nothing more to it at the moment, just trying to get functionality of it down. Case..Of comes from Delphi I think, and it works like this: Case {Variable} Of 1: output The Variable is 1! 2: output The Variable is 2! 3..4: output the Variable ...
- Tue Aug 23, 2011 11:50 am
- Forum: Macros
- Topic: Is there a function for isInteger or similar? Also, Case of?
- Replies: 13
- Views: 574
Is there a function for isInteger or similar? Also, Case of?
Hello all, I've searched the forums and the documentation wiki, but cannot find anywhere a function which checks if a value is an integer or not. As always, explaining my situation is the best way to get my problem resolved: I have a single text input field, which I want the player to input a number...