Search found 426 matches

by Irrlicht
Wed Jan 02, 2019 8:06 pm
Forum: MapTool
Topic: MapTool not getting the proper settings?
Replies: 4
Views: 390

Re: MapTool not getting the proper settings?

I confirm, it worked, thanks again.

Thread bookmarked for future reference.
by Irrlicht
Sat Dec 29, 2018 9:43 pm
Forum: MapTool
Topic: MapTool not getting the proper settings?
Replies: 4
Views: 390

Re: MapTool not getting the proper settings?

Thanks, next session is Jan 2, I'll see if I can do it that day.
by Irrlicht
Sat Dec 29, 2018 3:53 pm
Forum: MapTool
Topic: MapTool not getting the proper settings?
Replies: 4
Views: 390

MapTool not getting the proper settings?

Alright, this issue is ancient and I've overcome it many times, but once again I have no idea how. On my home pc, MapTool (v. 1.4.0.4) runs perfectly with all the macros I made. I launch it through a .bat file you guys here helped me with a long time ago. It contains the following: set STACK=4M set ...
by Irrlicht
Sat May 12, 2018 9:42 am
Forum: Macros
Topic: Sorting json object by values
Replies: 7
Views: 454

Re: Sorting json object by values

Yep, that's the way I wrote that so I can have my keys in alphabetical order. If you want to sort the object by value and reorder the keys then you can create an array of objects and use the normal json.sort on it then rebuild the object. [H: myObj = '{"12":5,"8":9,"21":3}'] [H: myArray = "[]"] [H,...
by Irrlicht
Fri May 11, 2018 1:13 pm
Forum: Macros
Topic: Sorting json object by values
Replies: 7
Views: 454

Re: Sorting json object by values

Ah, clear, thanks. Now, looking at it in haste, from what I understand, it gets the fields and sorts them in an array, then uses that array to retrieve the respective values and create an object. But that object is sorted by fields and not values. I have a half-idea on how to make it work, but I'm n...
by Irrlicht
Thu May 10, 2018 2:35 pm
Forum: Macros
Topic: Sorting json object by values
Replies: 7
Views: 454

Re: Sorting json object by values

Thanks for the reply, but I'm not sure how to make it work...

I pasted that code in a macro on a Lib token, and in onCampaignLoad I defined the function "json.sortObjByVal".

Yet, even after reloading, I get:
"Old definition for function json.sortObjByValdoes not exist"

What's wrong?
by Irrlicht
Thu May 10, 2018 8:35 am
Forum: Macros
Topic: Sorting json object by values
Replies: 7
Views: 454

Sorting json object by values

I have a json object with "numeric" (so to say) keys, associated to actual numeric values; example: {"12":5,"8":9,"21":3} Since json.sort only works with arrays, how can I order it so that they go from the key with the highest value to the lowest? For the example, the desired result would be: {"8":9...
by Irrlicht
Sat Nov 11, 2017 9:12 pm
Forum: Macros
Topic: Regex help
Replies: 4
Views: 506

Re: Regex help

Uhm, I'm unable to make it work, using a variable in which token notes are stored as mentioned above...
by Irrlicht
Fri Nov 10, 2017 2:01 pm
Forum: Macros
Topic: Regex help
Replies: 4
Views: 506

Re: Regex help

I'm on the run now, but at a quick glance, I think the latter is most akin to what I need.

I didn't intend to use inputs, but to get the text into a variable (actually, pasting the text in a token's notes and retrieving those token notes).
by Irrlicht
Fri Nov 10, 2017 12:37 pm
Forum: Macros
Topic: Regex help
Replies: 4
Views: 506

Regex help

I know there's a RegEx thread just below, but I didn't want to invade someone else's thread. I need a bit of help, since I'm getting confused with regex here... I have magic items stat blocks, from which I only want to extract name and price. Possibly, with multiple items at once, not just one each ...
by Irrlicht
Sat Jul 29, 2017 5:13 pm
Forum: Macros
Topic: Library token property value doesn't always return
Replies: 6
Views: 538

Re: Library token property value doesn't always return

I'm not sure where you put that code, but on a normal macro, it would suffice to do: [h: retrievedBaseDiff = getLibProperty("BaseDiff", "Lib:Utility")] [h, if(retrievedBaseDiff == 0): retrievedBaseDiff = ""] [r: retrievedBaseDiff]
by Irrlicht
Wed Jul 19, 2017 11:25 pm
Forum: Macros
Topic: How can I change the order of tokens with the same init val?
Replies: 7
Views: 771

Re: How can I change the order of tokens with the same init

Then sort initiative, and after it's sorted I take the values again to trim them with floor(), so that the Initiative panel only shows the normal results with no decimals but the order is kept. Nifty idea to trim after sorting... didn't think I could do that. I use the method Alias mentions above.....
by Irrlicht
Sun Jul 16, 2017 2:39 pm
Forum: Macros
Topic: Lowest common multiple and greatest common divisor
Replies: 2
Views: 442

Lowest common multiple and greatest common divisor

I see there aren't built-in functions for this, so what would you advise to make macros where you can calculate lowest common multiple and greatest common divisor from lists of numbers (possibly with virtually unlimited lists... within reason, of course... I know throwing in a list of a thousand num...
by Irrlicht
Sun Jul 16, 2017 2:34 pm
Forum: Macros
Topic: How can I change the order of tokens with the same init val?
Replies: 7
Views: 771

Re: How can I change the order of tokens with the same init

For extreme initiative sorting, I do this: [h: random_roll = 1d10000] [h: setInitiative(eval(getInitiative()) + (token_init_bonus * 0.00001) + (token_Dex * 0.000000001) + (random_roll * 0.00000000000001))] (So, in case of ties, the highest initiative bonus goes first; if there's still a tie, the hig...
by Irrlicht
Thu Apr 13, 2017 6:48 am
Forum: Macros
Topic: Quick Help
Replies: 2
Views: 464

Re: Quick Help

I don't know what bar.Temp-Full is and where it is from (Bag of Tricks? It looks like a function name, and funtions don't work like that), so I can't say what's wrong with it. What I can say for sure is that "TempHP / TempHP" is *always* 1, so maybe you want to change the formula or just u...

Go to advanced search