vusd / p5bot

p5.js twitterbot
https://twitter.com/vusd_mddn342_16
0 stars 2 forks source link

Ability to remember variables on refresh #6

Open carlgordon64 opened 7 years ago

carlgordon64 commented 7 years ago

If the framework was extended to have some kind of memory caching ability it allow us to explore more advanced concepts. for example if there was a player in the sketch with a health bar it would be great if the sketch remembered what the health was set to last time the code refreshed. I think this would let us craft a procedural narrative that would tell a story over time rather than just returning procedural results each time. Edit\ I think this would need some kind of database connection, if they sketch was sending variables to an external database rather than within itself the values wouldn't get reset on refresh. Might be possible with PHP, MySQLi or Rails

bryanlohjy commented 7 years ago

This is great. It's simple but a powerful idea. Being able to have posts relate to each other will allow for more complex and engaging bots. Currently, FireBase is a good workaround for this on an individual basis. It'd be cool to see it implemented to the whole user framework.

Taylor-Bryant commented 7 years ago

I completely agree with this, I think having the ability to store data across tweets would let us do some very interesting things, as Bryan said the idea is simple but simple ideas like this can have the most impact due to how versatile they can be and how it is applied

EmperorJack commented 7 years ago

I am totally in favour of this. Though a web server would be the best choice for the infrastructure of this bot framework another good alternative for the current setup would be a kind of map / key value store. Each person would have their own personal file on the class server, this data would be passed to the bot when it is executed by the p5bot (perhaps as JSON) and then reads can occur. The bot would be able to write back to it by storing data in the html where the p5bot would read it into the stored file, adding new entries and overwriting any existing content.