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

Text that shouldn't be there #24

Closed Aeroxia closed 6 years ago

Aeroxia commented 6 years ago

https://i.gyazo.com/78e7fe79549cdf1914550b6b627ab1f5.png

@move_obj thief East-West Passage

And so on, not sure if there's anything I can do about it

ava-cassiopeia commented 6 years ago

Interesting. I can include some regex to clear those out, but I've never seen this before. This looks like Zork; are you using a special version of Zork?

Aeroxia commented 6 years ago

Yeah, it's Zork. I don't believe it's a special version. It's the .z5 from here:

http://ifdb.tads.org/viewgame?id=0dbnusxunq7fw5ro

It's working in terminal with dfrotz without the extra @ stuff.

ava-cassiopeia commented 6 years ago

Hmm, yeah, let me see if I can reproduce this with this file.

ava-cassiopeia commented 6 years ago

image

So, this is what I see with the latest version of the bot, and the Zork 1 .z5 file from that link you sent. I can't reproduce the issue.

What's your setup? OS version? dfrotz version? discord-frotz version?

ava-cassiopeia commented 6 years ago

Was there any other steps you took that might cause it to start outputting that stuff?

Aeroxia commented 6 years ago

I don't think I did anything too crazy, but I'm not real confident working with Linux (easily may have done something wrong). I'm running "Linux Mint 18.2 Sonya" (32bit, cinnamon version), in a VM (Oracle VM VirtualBox), from http://www.osboxes.org/linux-mint/

node v6.11.3 dfrotz v2.44 discord-frotz 0.12.2

ava-cassiopeia commented 6 years ago

Huh, I have no idea what's up. Do you start seeing those weird @ messages as soon as you start playing Zork, or does it happen after a few commands?

Aeroxia commented 6 years ago

Right from the start

https://i.gyazo.com/282cdd4ffc3e4335978d876eaf879c40.png

Aeroxia commented 6 years ago

Googled and played around a bit, I see what it's doing but not why.

If you do: dfrotz -o zork1.z5

It does the same thing. "Watch object movement" it's calling it.

Edit: Maybe something weird happened in the make process, a debug setting or something because I don't know what I'm doing?

ava-cassiopeia commented 6 years ago

So, this is the line that actually spawns the dfrotz process:

this.game.child = spawn('dfrotz', ["-m", gameConfig.path]);

The only thing we're passing it is -m (other than the path to the game file) so that the output is easier to read.

Aeroxia commented 6 years ago

Using -m gave me the object stuff too, doesn't without

ava-cassiopeia commented 6 years ago

Can you try to use this branch of the code to run your bot?

To use the branch instead of the version you npm i -g installed, use the following steps:

  1. Uninstall the global bot with npm remove -g discord-frotz
  2. Clone the repo into a temporary place with git clone https://github.com/aeolingamenfel/discord-text-adventure-bot.git
  3. cd into the new folder and checkout the bad-output branch with git checkout bad-output
  4. Install node deps npm i
  5. Link the command globally by running npm link
  6. go to wherever you have your discord-frotz.config.json file and run discord-frotz and see if you're still seeing it

Let me know how that goes. I changed the flag on that branch to use a different dfrotz flag for plaintext.

Aeroxia commented 6 years ago

Haha, might have been easier to just change that one letter manually. (Especially since I don't have git installed in there, I downloaded the zip from the site.)

It works, I don't see anything out of place.

https://i.gyazo.com/c0b3e2edff8c21b50a986e6979a8e23c.png

Really curious what -m means, dfrotz doesn't seem to mention it.

ava-cassiopeia commented 6 years ago

Ha, that's fair. It was literally a single char change lol. I'm not 100% sure either, actually. I believe @TheSofox was the one that found that switch. It seems fine to just use the -p switch instead though, so I'm going to clean up the code a little and release a new version with that switch instead of the -m version.

Aeroxia commented 6 years ago

Sounds good!

ava-cassiopeia commented 6 years ago

Alright, I just deployed v0.12.3 of the bot (which includes that update) to NPM. Go ahead and update however you want, and let me know if the bot works as intended. It seems to be working fine on my end.

If so, I'll close this issue! Also, thank you for finding this issue!

Aeroxia commented 6 years ago

Yep, still all good~

Thanks for the instructions btw, I would have had trouble there (despite downloading it differently).

ava-cassiopeia commented 6 years ago

Absolutely! I figured I'd err on the side of caution and outline it in case you weren't familiar with some of the stuff to do.

And cool, if you see it again, feel free to open this issue again. For now, I'm gonna close it.