Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

more than I can chew

by csorensen (Beadle)
on Jul 04, 2000 at 00:51 UTC ( #20938=perlquestion: print w/replies, xml ) Need Help??
csorensen has asked for the wisdom of the Perl Monks concerning the following question:

ok .. so I admit it .. I'm in WAY over my head (gee .. big surprise)

Here's the problem:
There's an mud client which I want to automate. I want to write a program that will pipe commands to the command line of the mud client in response to output from the mud server.

This means that I need a program that will wait for input and react accordingly, in a non-linear fashion.

I'm sure that there are numerous modules that would be helpful but I haven't the foggiest idea which modules they are.

If anyone has some suggestions I would really appreciate it. I'm playing around with ... trying to see if it will help. If there are any other modules that I should be looking at I would really appreciate being told what they are!

Replies are listed 'Best First'.
Re: more than I can chew
by athomason (Curate) on Jul 04, 2000 at 01:05 UTC
    Before you dive into using Perl, I'd take a good hard look at built-in triggering systems in the MUD clients out there, if you can. Most I've used are custom-built already to have the functionality you're looking for. Some (ZMud comes to mind) have pretty powerful scripting languages built in.

    That said, Expect probably is your best bet if you're determined to go with Perl. Build up your trigger list in an array and pass it to $instance->expect. I'd probably structure it to simulate an event-driven app which dispatched subs based on the list return value of expect.

      I checked out the client that you're supposed to use with this particualr mud... it has a really basic scripting system which is strictly linear. The best I can do is create a horibble system of if/then loops.

      I really want to do this in Perl .. the scripting language that's built into this client is soooo lame. A typical loop is constructed with "if <something> then <goto label>". There aren't any triggers .. only a "matchwait" command which cannot accept more than one value at a time.

      what I would really like to do is develop a program that can be used with the existing mud client ..

Re: more than I can chew
by splinky (Hermit) on Jul 04, 2000 at 03:01 UTC
    Just to reiterate what athomason said, is the correct approach. A large part of my job is communicating with external systems via telnet. My older stuff uses, but as I have time, I'm migrating to

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://20938]
Approved by root
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2018-05-26 04:41 GMT
Find Nodes?
    Voting Booth?