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

Scriptcards Call Mod

I am trying to get a Scriptcard ver. 2.66 to execute another Mod Script. when I try and run the scriptcard: !scriptcard {{ --@eh|list }} The --@eh|list is copied straight from the Wiki. When I run the script I get the error: (From EncounterHelper): Player Keeper of Secrets (John E.) (GM) tried to use the !eh list command. I am the creator of the game and the GM.  Other Scriptcards work. When I try and run the command directly from the Chat !eh list it works fine. Help, what am I doing wrong?
1710100428

Edited 1710103261
vÍnce
Pro
Sheet Author
Hi Hultz, do you have to call the other script from within ScriptCards ?  I'm not familiar with SC's handling for calling other mods...  I know metascripts can do this sort of thing.  Would calling them at the same time from the same macro work? !scriptcard {{ }} !eh list Curious, do you get the same error with just !eh list ?
vÍnce, Curious, do you get the same error with just !eh list ? No I doesn't produce the error the error but I want it from within a Scriptcard, it is a part of a larger script. !scriptcard {{   --#title|Magic Treasure  --iTreasure Table; Click to Select|q;tableName;table name?|TMagic-Item-Table-B|TMagic-Item-Table-C|TMagic-Item-Table-D|TMagic-Item-Table-E|TMagic-Item-Table-F|TMagic-Item-Table-G|TMagic-Item-Table-H|TMagic-Item-Table-I|TTable-I-Magic-Armor --/+[&tableName]| --=MagicItem|[T#[&tableName]] --&MagicItemText|[$MagicItem.tableEntryText] --&MagicItemImg|[$MagicItem.tableEntryImgURL] --/+|[img width=32][&MagicItemImg][/img] [&MagicItemText] --@THandout |Found-Items |&MagicItemText }} I am using an API script that I cobbled together to create and add to a Handout. This API script puts a description of an item in the Descriptions & Notes area of a handout and the actual item in the GM Notes area. When I call !THandout --<handout name> --<Item text>  The Item text is of the form <Text for players = Text for GM only>. Every thing else works great except the call to the API script that I have boiled down to --@eh|list in a test script. Looking at my scriptcard code notice that I am using --i to select a table name. The items in tables are composed of <PlayerText> = <GM Text>
1710111718
vÍnce
Pro
Sheet Author
Definitely beyond my cursory knowledge of SC.&nbsp; I might suggest posting to the current SC thread;&nbsp; <a href="https://app.roll20.net/forum/permalink/11175456/" rel="nofollow">https://app.roll20.net/forum/permalink/11175456/</a> I believe Richard created scriptcards and encounter helper.&nbsp; Perhaps he, or someone else with a deeper knowledge of SC and/or EH mods could shed some light on what could be happening...
Hey Hultz, I am a little confused. Are you saying that your THandout script calls EncounterHelper? One thing to note, you said that your THandout script uses !THandout --Handout --Item. If that's the case then your SC syntax calling it is off. --@THandout|_Found-Items _[&amp;MagicItemText] The double dashes -- in SC Call Mod syntax are replaced with underscores _. Also your string variable for Item text was missing the brackets [&amp;MagicItemText]. I'm confused a little bit about the EncounterHelper bit though. ScriptCards Mod calls are asynchronous so you aren't going to get output. Also, I don't use EncounterHelper much at all but I think it wants GM to send the command and API calls are not sent from a GM so the API user is considered a player. Those can be throwing things off. The above output is from !script {{ --@eh|pagelist }} so the ScriptCards runs and uses sendChat to call encounterhelper which then whispers to the gm the invalid player output.
Joshua N. No my THandout script does not call EncounterHelper. I was just using EncounterHelper in my test setup to try and understand how the SC Call Mod works. Thanks for enlightening me. I am going to do as VÍnce suggests and check out the current SC thread.
Hultz, so when you change the syntax of the above macro to --@THandout|_Found-Items _[&amp;MagicItemText] It still breaks for you? With the above line ScriptCards will send !THandout --Found-Items --&lt;CURRENT_MAGIC_ITEM_TEXT_STRING&gt; which seems to match the syntax you posted. In the ScriptCard you posted that syntax for --@THandout wasn't correct
Thanks Joshua N.
1710865790
timmaugh
Pro
API Scripter
When one script calls another script like this, the resulting message doesn't look (on the backend) the same as a message that was initiated by a human. Specifically, 3 key properties are changed/omitted: .selected =&gt; a script does not have a table presence, so there are never any tokens selected for a script-generated message .playerid =&gt; instead of an actual player's id, this is now 'API' .who&nbsp; &nbsp; &nbsp; &nbsp;=&gt; instead of a player's display name, this is now also 'api' It does strike me as odd that Encounter Helper knows it was you that tried to run the command, but can't/doesn't validate you as a GM. That it knows it was you tells me it's making some connection to you having initiated the ScriptCards message. Still, if it's because the message is lacking one of the above lost/changed properties, you can fix that with SelectManager (part of the MetaScriptToolbox). SelectManager tracks what the state of those 3 properties were at the point that a human initiated a message (ie, the ScriptCards message). Then it can "catch" the outgoing/downstream messages and give the properties back to the message, so it looks to other scripts like the message was created by a human. Install the toolbox, and you'll get SelectManager configured to give back the selected tokens. That's probably not the property that causes the problems, since the other 2 are the ones associated with player identification. My guess would be on the playerid property... so to turn that on, run this command after installing the toolbox: !smconfig +playerid To turn the who property on, run: !smconfig +who Or, to turn them both on at the same time, run: !smconfig +who +playerid (You can turn off any of this functionality again by using a minus sign instead of a plus sign.) After running any of these (or just by running !smconfig), SelectManager should report to you how it's configured. Once it is setup to give back these properties, give your ScriptCards message another try and see if it works for you.
Thanks timmaugh, I'll give it try next week when I have time.