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 .
×

Conflict between Macros and API

Hi everybody, created this script to get lives' markers from existing API on("change:graphic", function(obj) { if(obj.get("bar3_max") === "") return; //HP > 75% if( obj.get("bar3_value") > obj.get("bar3_max") * 0.75) { obj.set({ status_bluemarker: true }); } else{ obj.set({ status_bluemarker: false }) } //75% > HP > 50% if( obj.get("bar3_max") * 0.75 >= obj.get("bar3_value") && obj.get("bar3_value") >= obj.get("bar3_max") * 0.50 ) { obj.set({ status_greenmarker: true }); } else{ obj.set({ status_greenmarker: false }) } //50% > HP > 25% if( obj.get("bar3_max") * 0.50 > obj.get("bar3_value") && obj.get("bar3_value") >= obj.get("bar3_max") * 0.25 ) { obj.set({ status_brownmarker: true }); } else{ obj.set({ status_brownmarker: false }) } //HP < 25% if( obj.get("bar3_max") * 0.25 >= obj.get("bar3_value") && obj.get("bar3_value") >= obj.get("bar3_max") * 0.01 ) { obj.set({ status_redmarker: true }); } else{ obj.set({ status_redmarker: false }) } //Dead status if(obj.get("bar3_value") <= 0) { obj.set({ status_dead: true }); } else { obj.set({ status_dead: false }); } }); It works very well, but each time, a macros is used, this error message os generated: /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v ^ TypeError: Object Mady Sory attaque KrikLa avec ses Épées d'Assassins: has no method 'splitArgs' at handleInput (evalmachine.<anonymous>:206:39) at eval ( And the script is disabled . Can you guys help me with this one ?
1451575758
Lithl
Pro
Sheet Author
API Scripter
You have some other script in the campaign which is attempting to make use of  splitArgs , and you do not have splitArgs installed. Considering the error is happening in a function named handleInput, it's probably one of my scripts, but the error you've posted is not occurring in the script you posted.
Yup, the issue was about a status marker script, now it works very well, thanks man. going to read about this splitArgs thanx a lot