Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2016-06-26 18:21:23

SmittyW
Member
Joined: 2015-03-13
Posts: 2,085

Waiting for replies

How would you wait for a chat reply (or string return) by a player in ee?

like if a bot asked you "How many biscuits would you like?"
how would you wait for a player to answer?

Offline

#2 2016-06-26 18:23:24, last edited by Koya (2016-06-27 20:24:48)

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: Waiting for replies

Mark the user as answering a question, also assign a question ID; if you get a chat message from a user and they are marked as answering first check if the answer is valid and if it is unmark the player and then parse the answer to the question ID.


Edit: solution below v http://forums.everybodyedits.com/viewto … 62#p609857


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#3 2016-06-26 18:53:06

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,853

Re: Waiting for replies

^ Yeah. That sums it up.

You could also ask the user, but still have them respond in command format. That seems a lot easier for our beginner users who follow tutorials.

"How many biscuits?"
"!biscuits 20"

Probably should actually keep to a command format, or at least "!answer 20" / "!20" so you don't mistakenly grab the user's discussion with someone else.

Offline

#4 2016-06-26 19:27:02, last edited by Koya (2016-06-26 19:29:02)

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: Waiting for replies

hummerz5 wrote:

Probably should actually keep to a command format, or at least "!answer 20" / "!20" so you don't mistakenly grab the user's discussion with someone else.

With natural language communication to the bot, not needing it in a command format (but accepting it) is nice to use; if you are asked "How many biscuits?" and you said "Haii" to someone - it's easy to see that that is not a number and would be ignored, checks will have to be made to see if the answer given comprises of just a number of a number with some form of "biscuits".

Google uses https://github.com/tensorflow/models/tr … /syntaxnet, which is available in Python and PlayerIO is available in Python; it seems that a natural language bot could appear here in an awful language.


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#5 2016-06-26 19:49:08

SmittyW
Member
Joined: 2015-03-13
Posts: 2,085

Re: Waiting for replies

I won't need to parse something that complicated. They'll all be "yes", "no", or number questions. My problem was that the answer was required for the game (bot) to progress. I used a while loop with an awaited task delay to pause the thread until a "yes" or "no" was received. I realized that wasn't a good solution so I divided my methods to prevent using these loops. The problem now is that I don't want having so many methods for different questions and I need a simple way of knowing which question I'm replying "yes" to.

Offline

#6 2016-06-26 19:50:10

Zumza
Member
From: root
Joined: 2015-02-17
Posts: 4,656

Re: Waiting for replies

Sorry, where can I find the python version of Player.IO?


Everybody edits, but some edit more than others

Offline

#7 2016-06-26 19:58:37

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: Waiting for replies

Zumza wrote:

Sorry, where can I find the python version of Player.IO?

http://forums.everybodyedits.com/viewto … 01#p589201

SmittyW wrote:

I won't need to parse something that complicated. They'll all be "yes", "no", or number questions. My problem was that the answer was required for the game (bot) to progress. I used a while loop with an awaited task delay to pause the thread until a "yes" or "no" was received. I realized that wasn't a good solution so I divided my methods to prevent using these loops. The problem now is that I don't want having so many methods for different questions and I need a simple way of knowing which question I'm replying "yes" to.

*working on something for you*


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

Wooted by:

#8 2016-06-26 22:12:54

Tomahawk
Forum Mod
From: UK
Joined: 2015-02-18
Posts: 2,847

Re: Waiting for replies

It would probably be best to have the players answer to the bot using it's name, using the tab thing. Avoids possible misunderstandings.


One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.

Offline

#9 2016-06-26 23:11:17

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,853

Re: Waiting for replies

so many methods for different questions

that reminds me. The one C# video I watched on youtube talked about predicates or something. Where you pass code-ish statements into the function so instead of 50 functions, you just have the predicate (delegate?)

Sadly I forgot everything useful to you now.

and it looks like koya's on the case so gl

Offline

#10 2016-06-26 23:33:13, last edited by Koya (2016-06-27 00:22:04)

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: Waiting for replies

hummerz5 wrote:

it looks like koya's on the case so gl

It's done but just making it perfect and adaptable.

It's made completely separate to PlayerIO and player classes, it will be able to be used freely with whatever wrappers you have.

nksb1x
In which the answer could have been answered hours later.
Questions and answers loaded from a linked JSON file.

Working on permitting various variable types for answers.


pmn1Cs
I haven't forgotten to delete the question entry after being checked.

questions.json

Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

Wooted by:

#11 2016-06-27 01:21:42, last edited by Koya (2016-06-27 20:29:14)

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: Waiting for replies

Sorted: https://github.com/koya-io/Everybody-Ed … on-Handler
Program.cs: https://github.com/koya-io/Everybody-Ed … Program.cs
qquestion.json: https://github.com/koya-io/Everybody-Ed … stion.json

If there's something I missed, please be sure to say - I'm not completely awake so I may have.

Note, this is still not entirely complete - I will need to sort out answer validation so that you can easily have error correction

if (pq.validate(username, ans)) {
    pq.delete(username);
}
else 
{
    /*User did not give a valid answer - will allow user to answer again or you can pm the user to say that the answer is not valid*/
}

Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

Wooted by: (2)

#12 2016-06-27 07:42:00

Srna
Member
Joined: 2015-02-26
Posts: 220

Re: Waiting for replies

Very nice job Koya!

Offline

#13 2016-06-27 17:55:27, last edited by SirJosh3917 (2016-06-27 17:58:02)

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

Re: Waiting for replies

SmittyW wrote:

I won't need to parse something that complicated. They'll all be "yes", "no", or number questions. My problem was that the answer was required for the game (bot) to progress. I used a while loop with an awaited task delay to pause the thread until a "yes" or "no" was received. I realized that wasn't a good solution so I divided my methods to prevent using these loops. The problem now is that I don't want having so many methods for different questions and I need a simple way of knowing which question I'm replying "yes" to.

I think you mean that you're in EE, and with tons of players (lets assume) and each at a different question. This is what I draw from the text.
I would have a player class with all my stuff in it, then have the question ID they're on, and also have a " List<string> Answers " filled with their answers.
Then I'd have a Question class, which has the question " public string Text ", and what type of answer.
Then outside of those classes in the main class, I'd have a " Dictionary<int, Question> Questions " filled with all the questions.
Then when you recieve the "say" message, I'd find the player, use " Questions[player.QuestionOn] ", and run through the checks, which checks if the answer is in the proper format, then add their answer to their Answers " player.Answers.Add((string)m[1]); ", advance the question number " player.QuesitonOn++; ", and ask the next question " bot.Say("say", "/pm " + player.Username + " " + Questions[player.QuestionOn].Text); "

Is this what you mean SmittyW?

Offline

#14 2016-06-27 19:37:06

SmittyW
Member
Joined: 2015-03-13
Posts: 2,085

Re: Waiting for replies

Yes, that's pretty much what Koya did.

Offline

#15 2016-06-27 20:18:39, last edited by Koya (2016-06-27 20:26:10)

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: Waiting for replies

SmittyW wrote:

Yes, that's pretty much what Koya did.

Not quite, I didn't make a player class as I wanted to completely separate it from any wrapper that anyone else is using vanilla, physics or another.

Questions stored in a list of Asked in playerQuestions, questions and answers loaded in from QAManager.

The questions can be set up, asked and answered completely separately.

@ninjasupeatsninja
Scroll up for my solution


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#16 2016-06-27 21:13:30

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

Re: Waiting for replies

Koya wrote:
SmittyW wrote:

Yes, that's pretty much what Koya did.

Not quite, I didn't make a player class as I wanted to completely separate it from any wrapper that anyone else is using vanilla, physics or another.

Questions stored in a list of Asked in playerQuestions, questions and answers loaded in from QAManager.

The questions can be set up, asked and answered completely separately.

@ninjasupeatsninja
Scroll up for my solution

I saw your code, I just didn't see it interact with PlayerIO anywhere, so I figured that it was just a client-side question asker.
Now I realize it's kinda a dll

Offline

#17 2016-06-28 00:36:42

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: Waiting for replies

ninjasupeatsninja wrote:

Now I realize it's kinda a dll

Literally opened up bots and programming to see you say "its a dll" in every freaking topic. stop with the dll talk bro, not everything is a dll


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

Wooted by: (4)

#18 2016-06-28 11:43:34

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: Waiting for replies

Xfrogman43 wrote:
ninjasupeatsninja wrote:

Now I realize it's kinda a dll

Literally opened up bots and programming to see you say "its a dll" in every freaking topic. stop with the dll talk bro, not everything is a dll

Following is an assumption, sorry if people are offended by this:
Often when you learn something new (for example the term DLL) all by yourself you sometimes are a bit proud to know what it is, and try to apply that as often as possible, though sadly using it too much.
I know I do it myself at times, like when I learned this new Dutch (cus I'm Dutch) word, I just tried to manipulate conversations so I could use that word for whatever strange reason.
Long story short: The DLL stuff will pass in a week,

Offline

Wooted by: (2)

#19 2016-06-28 14:18:41

Tomahawk
Forum Mod
From: UK
Joined: 2015-02-18
Posts: 2,847

Re: Waiting for replies

EE is a dll.


One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.

Offline

Wooted by:

#20 2016-06-28 15:53:37

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

Re: Waiting for replies

Xfrogman43 wrote:
ninjasupeatsninja wrote:

Now I realize it's kinda a dll

Literally opened up bots and programming to see you say "its a dll" in every freaking topic. stop with the dll talk bro, not everything is a dll

den3107 wrote:
Xfrogman43 wrote:
ninjasupeatsninja wrote:

Now I realize it's kinda a dll

Literally opened up bots and programming to see you say "its a dll" in every freaking topic. stop with the dll talk bro, not everything is a dll

Following is an assumption, sorry if people are offended by this:
Often when you learn something new (for example the term DLL) all by yourself you sometimes are a bit proud to know what it is, and try to apply that as often as possible, though sadly using it too much.
I know I do it myself at times, like when I learned this new Dutch (cus I'm Dutch) word, I just tried to manipulate conversations so I could use that word for whatever strange reason.
Long story short: The DLL stuff will pass in a week,

I'm sorry, I've always associated something that does some stuff ( such as a class that makes your bot teleport everywhere randomly ) with a DLL, partly because since I like to compile all my code into DLLs for usage, that other people do, which is a stupid assumption to make, since people have different opinions. Now that I've actually googled them instead of go off of what I thought it was, I think I might be a little better off.

tl;dr: actually googled the terms instead of go based off of what I thought it was; I might be better off now.

Offline

Wooted by: (2)
SirJosh39171467125617610209

Board footer

Powered by FluxBB

[ Started around 1732212778.1374 - Generated in 0.117 seconds, 12 queries executed - Memory usage: 1.75 MiB (Peak: 2.02 MiB) ]