ava-cassiopeia / discord-text-adventure-bot

A bot for Discord to play text adventure games in Discord
ISC License
45 stars 7 forks source link

Messed up formatting on responses. #5

Closed JiFish closed 7 years ago

JiFish commented 7 years ago

Hi! Great bot. I've been looking for something just like this.

I've been getting some screwed up formatting in my responses. I was wondering if this is something fixable.

Some examples:

JiFish - Today at 6:09 PM
$look
frotz-botBOT - Today at 6:09 PM
look
1
West of House
You are standing in an open field west of a white house, with a boarded front
oor.
There is a small mailbox here.
>
JiFish - Today at 6:09 PM
$w
frotz-botBOT - Today at 6:09 PM
w
Forest       5
Forest
This is a forest, with trees in all directions. To the east, there appears to besunlight.
>
$take
frotz-botBOT - Today at 6:11 PM
take
dWhat do you want to take?
>

Other the the obvious issues, I'm not sure if repeating your command and the ">" prompt is intentional or part of my issue. If either of those are, is there a way to exclude those?

I don't mind dipping in to the code if required, but I would appreciate some pointers.

JiFish commented 7 years ago

Other options I have looked at use Dumb Frotz to ease issues with getting the output from frotz. I wonder if that is an option here?

ava-cassiopeia commented 7 years ago

Hm, dumb frotz might be exactly what I was after, as parsing the output of Frotz directly is a pain. I'll look into patching that in! Thanks for the info!

JiFish commented 7 years ago

Glad it was helpful.

JiFish commented 7 years ago

With two small changes 826aee283bde9d0858be7966beb6c27491fe257e I was able to get it to use dfrotz and solve my formatting issue.

It might be possible to do something smarter with the output, but this works for me.

dfrotz example

ava-cassiopeia commented 7 years ago

Sweet! I'll definitely patch that in. I wanna do a bit more cleaning of it though. Probably don't need the >, and can probably parse out the score and moves into something a little nicer.

Thanks so much for your help with this!

JiFish commented 7 years ago

Thank you for adding this.