I am hoping this is written in Python.
Here is my solution to fix the bot abuse problems.
- Use SQLite within Python to create a physical file for a Database to store timestamps.
- When the Python Bot is restarted/started, the time it last ran is fetched from the SQLite database.
- The timestamp is no longer locally stored within the Bot Script (Resetting every time you reload it)
- SQLite would be an extremely small database, I can't imagine over 10kb.
- When an event is requested, the Pub Bot would get the current UTC Timestamp and calculate the duration passed to see if an event can run. If there is no record, it will create the first record and the rest will be based on that.
- If the Time has passed and a record can be run again, it will update the last_run time.
** I suggest SQLite for a few reasons: Events can only run 1 at a time, this is a quick and easy look up, i requires no permissions to any real data sources, it requires next to no memory, and it's takes very little space.
If this were to be extensible for future benefits, I would suggest 2 tables which is also quite simple.
event ------------------------ id | title 1 | balling 2 | scramble 3 | etc
history ------------------------ event_id | last_run 1 | 1410303686 2 | 1410303626
1: Send me the code (assuming its open source), or repository (not the generic bot code on google) of the PubBot.
a) I don't need any special permissions on Subspace, I cant test this manually, submit it to whomever and they could test it.
b) You can use winmerge or a program like it to see the code I changed, Im rough estimated around 50 lines at the maximum.
2: I will have possibly one PIP packages to install. I don't know what environment SS uses.
3: What is your server, Microsoft or Linux? Do you have Terminal for PIP access? If not, I can find a way around this in the Python code.