Skip to content
TORNLIFE More

OC discord bot Pseudo code

Started by PERK_Ryan [3356606] on in Tools & Userscripts.

3 replies · 83 views · thread synced · 3 days ago · View on torn.com
About this thread

Posts archived: 4 / 4 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
4
Discussion span
→
People posting
2
Likes on archived posts
5
Authority score
34 / 100
Historical score
14 / 100
Story score
27 / 100
Engagement score
46 / 100
PERK_Ryan [3356606]

I am trying to make some logic for my OC script. I'm hoping this with improve my thought process by writing it out. And if someone comes along to help me even better. 

 

I currently have a data base in Google sheets for current member CPR and OC role influence.

 

Current Pseudo Code

1. Code within github

2. Uses render to have discord bot

3. Uses uptimerobot to keep render online

4. Discord bot has several commands

4.1 OC command

4.1.1 bot checks faction available api call for open positions and crimes finishing soon ~4 hrs

4.1.2 bot checks members not in OC

4.1.2.1 check members >1 day activity and filter them from sorting Logic

4.1.3 with list of open positions and available members start sorting Logic

4.1.4 create discord message with link to crime ID for members.

4.1.4.1 include role name and item requirements.

4.1.4.2 sends message as direct message as well?

4.1.5 sends message if crimes are needed within 3 hrs and which levels based on CPR.

 

 

OC sorting Logic

1. have a list of OC's
1.1 have position influence rate
1.2 have needed CPR for good success rate
2. Have list of members
2.1 list of crimes/roles with member CPR.

3. Need to direct who goes where.
3.1 how many crimes to number of people?
3.1.1 Sizes vary between 3-6. 
3.1.2 Maybe only allow staging 1 crime for every 6 people?
3.2 order depending based on level since higher level crimes matter more.

3.3 members with highest CPR in the highest influence role go first.

3.3.1 if 2+ crime staging need to make sure second+ person is in the next crime and not wasted on second highest influence role of first crime.

3.4 some crimes allow lower CPR members (lvl 7 & lvl 4's)

3.4.1 maybe randomize between the people available? Or cycle somehow?

 

mavri [2402357]

> data base

> in Google sheets 

God no, please, use an actual database :p 

 

> 2. Uses render to have discord bot

> 3. Uses uptimerobot to keep render online

You could try using something like Oracle's free tier to host it, I'd advise against doing such hacky things

 

And as for general advice, before starting to work on this I'd recommend you get familiar with all the technical bits first (language, external packages, database, hosting etc.) so you can fully dedicate yourself to the logic, not the things around it.

PERK_Ryan [3356606]

I'll keep in mind using oracle once I'm done with the actual meat and potatoes like you said. But you are right I don't understand the full bits around it all but this little experiment has broadened my knowledge a bit which I enjoy.

 

What would you suggest for an actual database?

 

 

mavri [2402357]

I personally use PostgreSQL with an ORM on top of it (usually PrismaORM or DrizzleORM), but you could use SQLite, really depends on the mood lol.