Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Macro Mule API issues

I installed the macro mule (mm) api script which I and my players really like.  However, mm keeps the multi-world calendar (mwc) and the supernote (sn) scripts from working once they are installed. I have disabled mm and both mwc and sn run as advertised.  As soon as I turn the mm api back on, both quite working.  I am not sure why, though both mwc and sn were installed after mm.  Has anyone else run into this problem?  If so, how did you fix it?
1671293647
timmaugh
Forum Champion
API Scripter
When you say Macro Mule script ... Which script are you talking about?
It's a script called MacroMule.  You have to install it manually as it's not on the one-click list.
1671296554
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Frimus Games! Do you have a link to it? Or better, a thread where the author talks about it?
I'm pretty sure they're referencing the API script I created for the 5E Universal Statblock MacroMule , and yes there is definitely an issue with it, and I'm pretty sure it's because of how I have everything in the on("ready") event, instead of done in any kind of better way that requires more understanding of how to properly code in Javascript.   I simply modified    Marco R's script   for creating a   Loot Macro Mule  to create a Macro Mule character of my own... but I'm sure there are best practices that weren't taken into account when I changed things. I've noticed that if my MacroMule script is before any other scripts, those scripts don't work correctly - I'm guessing because it's not passing along any code that it doesn't use correctly when it's done with it or something.  I honestly don't know how/why that would be that way, so that's just based on my limited understanding of javascript. I've found that scripts will work if I delete the MacroMule and re-add it as the last script in my list.
1671303988
timmaugh
Forum Champion
API Scripter
It could also be that subsequent scripts require an empty line between one script and the next. You'll see a lot of scripts include a line at the bottom just to accommodate that. I've unintentionally sidelined a script or ten by losing that line along the way of some testing or development. >D
Thank you all for your response. Jarren is correct - I am using his MacroMule script noted above, in his comments. I deleted the script and reinstalled as suggested.  That has fixed my issue noted above. Thanks again, everyone, for taking the time to send me a response.
timmaugh said: It could also be that subsequent scripts require an empty line between one script and the next. You'll see a lot of scripts include a line at the bottom just to accommodate that. I've unintentionally sidelined a script or ten by losing that line along the way of some testing or development. >D Haha that’s exactly the kind of thing that I have no idea about. I’ll make that change when I get a chance and see if it fixedly the issues I’ve seen as well! (In addition to some other updates I’ve been intending to make with the overall MacroMule setup). 
keithcurtis said: Hi Frimus Games! Do you have a link to it? Or better, a thread where the author talks about it? Sorry for the delay.&nbsp; Holidays took over. The link is here:&nbsp; <a href="https://app.roll20.net/forum/post/11001807/d-and-d-5e-universal-statblock-macro-mule-for-npcs-and-pcs/?pageforid=11001810#post-11001810" rel="nofollow">https://app.roll20.net/forum/post/11001807/d-and-d-5e-universal-statblock-macro-mule-for-npcs-and-pcs/?pageforid=11001810#post-11001810</a> And the actual script here:&nbsp; <a href="https://github.com/kinchj/Roll20API/blob/main/D&amp;D%205E%20Macro%20Mule" rel="nofollow">https://github.com/kinchj/Roll20API/blob/main/D&amp;D%205E%20Macro%20Mule</a>
1672685894
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It looks like there is a timeout set on the on('ready',) event. on('ready',setTimeout(()=&gt;{ ... },0)); Not sure why, or if this fix will actually mess anything up. But this seems to clear up the issue. Change the first line of the MM script to: on('ready',()=&gt;{ and the last line to }); I think it was timing out its on ready event before anything else could fire.
1672768326

Edited 1672768412
I was trying to implement this code that The Aaron mentions in this thread, but I think I misunderstood how to use it correctly. I've adjusted the code on GitHub to remove the setTimeout() portion.