You can use chatGPT to write code for you. I am seeing more and more that people are using this for roll20 character sheet code. I have this to say about that:
Don’t do it!
Really, just don’t. There is a good reason for this. Let me explain.
ChatGPT and other AI programs are big right now, and will only get more effective. They can be good for many things, even programming. But not Roll20.
Large Language Models like ChatGPT rely on there being a lot of code examples existing online. And by a lot, I mean literally millions of examples. Many millions. This does exist for most popular coding languafes, but it simply does not exist – and will never exist – for Roll20.
You might say, well Roll20 just uses HTML, CSS, and JavaScript, and there is a lot of that code online – but this actually makes AI worse!
You see, Roll20 uses customised versions of those languages. The HTML and JavaScript code you’ll find online is not the same as the code you need for Roll20. If you ask ChatGPT for code on how to do something, it will give code that will work on other websites – but it won’t work on Roll20, and the construction of that code will be so wrong, it will lead you astray when trying to adapt it for Roll20.
I’ve already seen people posting examples to the Roll20 of GPT code, and being confused over why it isn’t working. In time, AI will continue to get better at constructing code generally. But it won’t get better at Roll20 – because it depends on the vast number of code samples online, and the Roll20 userbase and code samples for it will never grow enough to be useful to Large Language Models.
Conclusion
AI can be useful for many things, not not this. For working code, look at the roll20 wiki or this site (which is designed for code newbies). Steer well clear of chatGPT – you’ll end up having to redo everything and then look at those sites anyway. If you don’t know how to do sometheing, ask on the Forums – people will be happy to help.