cheesenibbles123 / OliverbotPublic

Oliverbot files
MIT License
1 stars 0 forks source link

1st 2nd and 3rd place on ;quiz income #4

Closed GRektK closed 3 years ago

GRektK commented 3 years ago

Solution

A small nitpick with ;quiz income is you can get cheated out of winning if two people know the answer. There should be a 1st, 2nd, and 3rd place winner earning 5, 3, and 1 coins respectively. The easiest way to implement that, IMO, is to delete any message containing the answer to the current quiz and have the bot say:

@ name#xxxx correctly answered 1st/2nd/3rd, and has earned themselves g GC! There is/are n second(s) remaining!

where name#xxxx represents the users discord username+tag, 1st/2nd/3rd represents the place they got, g represents the number of coins they earned, and n represents the number of seconds left to answer. If time runs out and no one answers correctly, you can have it display as it does currently. If one or two people get it right and time runs out or if 3 people get it right you can have it display:

Time is up, @ name#xxxx0(,( and) @ name#xxxx1)(, and @ name#xxxx2) got the correct answer!

where name#xxxx0 is the first place finish and so on.

Alternatives:

You could just not do it and be gay

Additional context:

Relevant quiz where Medtek answered a quarter of a second before me. Also, I recognize that you can abuse windows notifications to get an edge here as we have previously discussed, however you can often google the answers as well so cheating can already occur and abusing notifications would award even less coins than the full 5 if you cheat with the current system.

Further reading:

I was inspired by Skribbl.io, a web based drawing game that uses a similar system, although they also factor in the time taken to get the correct answer. This is largely unnecessary for your purposes as their game is more competitive.

cheesenibbles123 commented 3 years ago

I've implemented a basic setup that should allow this to work correctly. You can test it using ;quiz test. Right now you wont get income through it, but if the normal method works, then I can replace the current function, and it'll work with income.

image

Each question has it's own maxAttempts value which could make it interesting. Even though they count as max correct guesses, and not attempts per se atm.

cheesenibbles123 commented 3 years ago

System works and is now implemented fully.