SSCU Extreme Games

Part of the Subspace Continuum network.

Develop, Discuss, Get Help with Pycore,FCcore,Opencore and other bot cores for Subspace and bot development in EG

Moderators: Fc, king, Chineh, Sann

By jream
#514858
I would like to start out by fixing the Bot-EG-Public (I believe that's the one). The one with all the commands for !buy.el
I am hoping this is written in Python.

Here is my solution to fix the bot abuse problems.

Proposal
- 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.
Code: Select all
event 
------------------------
id | title
1  | balling
2  | scramble
3  | etc
Code: Select all
history
------------------------
event_id | last_run
1  | 1410303686
2 |  1410303626
What I would need
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.
By jream
#514859
One other thing to note: I strongly suggest making the PubEvents open sourced on Github or Bitbucket, and then we can fork and do pull requests, and someone can review it easily. This would make life a lot more modern and convenient. The TW core is open sourced. Otherwise, you can create a private BitBucket repo for free and invite me if you want me to contribute.
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Play Extreme Games on Subspace Continuum Today!