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

sheet code help.

1743706218
Nylo
Pro
Marketplace Creator
i need to either put code in my sheet that help me select different macros an a roll button, im thinking  1. either a text input for name , followed by a text input where i place my macro , followed by a button that roll whatever is place in the macro input. 2. a dropdown menu where i select different weapons followed by a roll button that execute whatever macro associated with my weapon.
1743731234
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Can you explain more in depth what you are wanting to do? As GiGs likes to say, describe it without using any coding terminology, just the way you would do it at the table.
1743737835
Nylo
Pro
Marketplace Creator
Ok i have scriptcards macros for my weapons , attacks and spells and i need to be able to add them to my custom sheet and roll them from there. 1st i tried to make it with a dropdown menu where i would select my weapon and then roll it but i could not get the button to roll it there were some problems with wether i used javascript or something , anyway it did not roll. Then o remebered that at some point vince made a sheet for me where i could write my own macro in a field and then press the roll button to run that macro etc lik  "sword" /r 1d20 "button" so the fields were by default empty untill i wrote my macro and the button would read the macro field and run it . Now i would actually like to both have option 1 and 2 in my sheet so i could etc press add new item and choose wether it should be an item from the dropmeny or it should pop in the custom macro field
1743753430
vÍnce
Pro
Sheet Author
Hi Nylo, I believe you could use the same "editable macro-text" concept but add on to it. For example;  whatever is in the macro-text field is what will be sent to chat. So you could auto-fill (ie overwrite) that field with a "preset" macro that has been coded into the sheet. Say you have X number of attack macros, use a dropdown selector with those options, pick one, and use a sheetworker to write the preset to that attack row's macro-text field. Each repeating attack row could be setup however your like.  Anything written into the macro-text field would be editable and you could overwrite that again with a preset if you so desired.
1743760598
Nylo
Pro
Marketplace Creator
yes i wanted to make it using the code in the sheet you made back then but unfortunately the game i had the sheet it were not working anymore and the link u send me back then were not either
1743784076

Edited 1743784257
vÍnce
Pro
Sheet Author
I think I recall that (<a href="https://app.roll20.net/forum/permalink/12002857/" rel="nofollow">https://app.roll20.net/forum/permalink/12002857/</a>) Was it this sheet? Someone contacted me recently because they were using it as well... but the background image wasn't working (because I deleted an old outdated branch on my github account)&nbsp; I changed the image to imgur for now and updated to a gist link.&nbsp; It's important to always make a backup of any custom sheet code(images as well) since it's not on the roll20 repo.