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

Two Scripts Won't Work at the Same Time

Hi there, folks. This is my first time posting here, so I'm not sure what information you need, but the gist is that I have two API scripts that work on their own, but not when both are enabled. I'm guessing it's because both of them change the status markers, but I'm ignorant enough that I don't know how to begin troubleshooting. It would make sense to merge the two scripts in question, but I don't know enough about java to pull that off. God knows I've tried, but I can't seem to manage it. Thanks for any help you can provide.
1514661321
The Aaron
Pro
API Scripter
Knowing WHICH two scripts would be a good place to start. =D
well you could post the codes of the two API's in code boxes or link to each one... if there from the same person maybe even Pm them and ask if they could merge them. it maybe that one already does the parts of the other just phrased diferently. 
So... you guys aren't psychic then. Noted. Here's a link to both codes. Sorry about forgetting that the first time. Apparently making a post while glaring through one bloodshot eye isn't the ideal method. I should also note that the base scripts are original to Heilemann, but I see he hasn't been active in a while. Thanks again.
1514687521
vÍnce
Pro
Sheet Author
Justin T. Thurn said: So... you guys aren't psychic then. Noted. LOLOLOL  I literally laughed out loud.  I needed that today.  Thanks
1514693963
The Aaron
Pro
API Scripter
Those look like slightly different versions of the same script. Are you getting an error or just not getting expected behavior?  The scripts mage some assumptions about attribute names and are case sensitive, do you have Weary instead of weary?
1514694036
The Aaron
Pro
API Scripter
OHHH!  I bet you are right. It’s likely toggling the marker on, then immediately off, or something similar. 
1514699345

Edited 1514699427
Hey again, The Aaron said: Are you getting an error or just not getting expected behavior? If one or the other is enabled, it works just fine with no errors reported. If both are on, nothing happens at all. Not even an error. They are very similar, which is another reason why I'd love to merge them. Heilemann has a merged script (sort of), but it also yields a result of two things: 1. bup, 2. kis. When I try to do that I get more of the same. The key seems to be the part where it triggers to change the "weary" attribute: if (endurance.get('current') < fatigue.get('current')) { weary.set('current', 'weary'); I say that because setting the markers always works. I've figured out enough to do that (fine, I'm a big, fat liar who hasn't figured out anything, but whatever). It's only when I try to trigger a change in attribute that I run into problems. I've tried various things and gotten a couple of different results, but I don't know how helpful any of it would be to you. So, maybe just start being psychic..? (How many forum posts do you need to get that?) Thanks again. Also, Vince said: I literally laughed out loud. I needed that today. Thanks I'm always happy to help.
Justin T. Thurn said: So... you guys aren't psychic then. Noted. Here's a link to both codes. Sorry about forgetting that the first time. Apparently making a post while glaring through one bloodshot eye isn't the ideal method. I should also note that the base scripts are original to Heilemann, but I see he hasn't been active in a while. Thanks again. A common mistake you are confusing Psychic with psychotic, after a few years of wrestling with these things.
al e. said: A common mistake you are confusing Psychic with psychotic, after a few years of wrestling with these things. By Gandalf's eyebrows, that must mean I've come to the right place. Also, I managed to merge the scripts. I don't know how exactly except that I tried using the second script as the backbone instead of the first. There's probably a more elegant way to do it, but at least it works. Result here . This is the first positive encounter I've had in any forum. I really appreciate the warm welcome and Aaron's confirmation that I was on the right track.
1514841615
GiGs
Pro
Sheet Author
API Scripter
Well done, and you include simple, instructive documentation in the script header, which is great. Something I wish more scripters would do.
1514873242
The Aaron
Pro
API Scripter
Cheers!  Well done!