Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Inputting into another program (C/C++)

Name: Anonymous 2007-01-12 9:16

So, how do you do it? I'm trying to create a NetHack character generator, but for that I need my program to input text into it in a predetermined way. Everything I read about interprocess/interprogram communication is far too complex for what I need, I'd rather start slowly and then go building up the concepts. Finally, cheating is not my main concern here (changing the source would be much easier), learning is, so don't go crazy because I asked!

Name: Anonymous 2007-01-12 11:20

>>2
First of all, thanks for the reply. The specifics:
*It's text-based (command prompt in my case)
*I don't mind exiting (it's necessary, actually)
*I want to send everything blindly

This should be easy, then? You don't have to do everything, give me some help and I'll try to walk with my own legs!

About the other cheating solutions, yes, I agree, they're easier. But communicating with another program seems to be an useful concept to grasp, so I'm trying to kill two birds with one stone. The problem is everything I could find about it was based on client/server programming. I'd like to start slow, with something like this. If you provide some info and I understand this (seemingly simple) case, I may tackle the rest later.

>>3
I'm on Windows (sorry, I thought this was simple and the platform wouldn't matter).
I was going for something different than that. Since nethack saves the game when you exit, I wanted to input the number of characters to be generated, let's say 100. Then, the program would run nethack, generate, exit, rename the savefile, run, generate, exit, rename... 100 times. Then I'd select the best savefile and use it. I was planning on writing the statistics of each character generated in a text file, but for that the program would need to read the prompt, so I don't know how much that would complicate things.

Either way is fine by me. Pick the one you consider the easiest and tell me how to do it!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List