www.ClassicTW.com
https://mail.black-squirrel.com/

Qmodem Pro scripting question
https://mail.black-squirrel.com/viewtopic.php?f=15&t=33088
Page 1 of 1

Author:  SteveH_66 [ Tue Mar 20, 2012 8:50 pm ]
Post subject:  Qmodem Pro scripting question

Hi all, I saw discussion about Qmodem Pro and scripting with it in another thread and it brought back memories of writing scripts for it.

If I remember correctly, you could write some scripts that automated some tasks, but for reaction to events it wasn't much good, as there were no commands that let you easily work with a line from the game to get out trader names or sector numbers and such.

Am I remembering this correctly, or was/are there commands in the scripting language that allow you to get information out of a line from the game like sector numbers?

If there were commands that let you grab a sector number or something from a line from the game, what were they?

Oh, by the way, I found a copy a guy had worked with so that it is even compatible with Windows 7 and 64 bit now. I can post a copy of it, if anyone would be interested in grabbing a copy of it. Or, maybe Helix could add it to his post with the script collections? I know they also have an (I believe) open source fork rewrite of it for Linux systems, I came across that while doing a search for the original Qmodem Pro.

Author:  Helix [ Tue Mar 20, 2012 10:08 pm ]
Post subject:  Re: Qmodem Pro scripting question

Hopefully cruncher or kav can answer that for you. I used procomm and qmodem but only with macros. Then I stopped playing and when I came back it was swath/twx

H

Author:  Cruncher [ Tue Mar 20, 2012 10:16 pm ]
Post subject:  Re: Qmodem Pro scripting question

Helix wrote:
Hopefully cruncher or kav can answer that for you. I used procomm and qmodem but only with macros. Then I stopped playing and when I came back it was swath/twx

H


Maybe Kav. I was TWar, TWHelper, Zoc - now Swath, TWX, Mombot, and sometimes Zoc.

Author:  Kavanagh [ Wed Mar 21, 2012 1:34 am ]
Post subject:  Re: Qmodem Pro scripting question

Man, I hadnt noticed how fast time passes until I tried to answer the question - its almost 15 years since I wrote qmodem. The answer is yes, you can read line(s). You probably have the sample script HOST.QSC, it gives examples. The script command is RECEIVE, if memory serves. You need to declare a string variable first, to which you write the line or part thereof.

In general, open the script menu, type help, help topics, scripting command reference. As usual, the help file sucks.

Its similar to pretty much any other terminal program, you wait for a trigger and then grab the line. I think you can designate X,Y coordinates anywhere on the screen but cant remember, I'll play with it tonight. You can definitely grab the line after the trigger no problem, then use one of the str commands to get the part of the string that is of interest.

It is a great scripting language for TW btw and well worth the time to become proficient in it. Compiled too, so its fast (altho thats not as important as when we ran 2400 baud modems). I use Telix, marginally better at string handling but offhand I cant think of anything that Qmodem cant do that Telix can

Author:  Mongoose [ Wed Mar 21, 2012 12:39 pm ]
Post subject:  Re: Qmodem Pro scripting question

Hey, all you peeps who use or used these old helpers... could you do me a favor and post some screenshots? I'll use them on the wiki for articles about the helpers.

Author:  Kavanagh [ Wed Mar 21, 2012 2:07 pm ]
Post subject:  Re: Qmodem Pro scripting question

SteveH_66 wrote:
Hi all, I saw discussion about Qmodem Pro ...

If there were commands that let you grab a sector number or something from a line from the game, what were they?



The following will grab the sector number ( last 3 lines, ignore - they send the grabbed string on corp ss to check that it worked, useful first time you run the script, then delete it:
dim sectnum as string
SEND "i";
waitfor "Current Sector :"
receive sectnum
SEND "'";
SEND sectnum;
SEND "^M";


Here is the display that the above generates:
Command [TL=00:00:00]:[571] (?=Help)? : I
<Info>

Trader Name : Civilian kav2
Rank and Exp : 0 points, Alignment=0 Neutral
Corp # 1, General Products
Ship Name : The Merchant Marines
Ship Info : IonStream Merchant Cruiser Ported=0 Kills=0
Date Built : 06:45:29 PM Thu Mar 21, 2024
Turns to Warp : 3
Current Sector : 571
Turns left : 1000
Total Holds : 20 - Empty=20
Fighters : 30
Credits : 300

Command [TL=00:00:00]:[571] (?=Help)? :

Sub-space radio (0): [<ENTER> for multiple lines]

' 571

Message sent on sub-space channel 0.

Command [TL=00:00:00]:[571] (?=Help)? :



-When the script sees the "Current Sector :" trigger, it assigns the rest of the line to the string variable 'sectnum'. There are faster displays to get the sector number than from the "I" screen, but the above will give you something to play with a bit more.

I cant remember how to read from anywhere on the screen yet, hopefully it will come to me. If you would like help with anything specific please ask.

@Mongoose, I'll dig up a few, would you like some stuff from Trade Wars Assistant (Twassist)?

Author:  Mongoose [ Wed Mar 21, 2012 2:40 pm ]
Post subject:  Re: Qmodem Pro scripting question

Yeah, anything that shows the history of helpers. If you've already got them running, it'll save me a lot of trouble setting up DOSEMU or something to get some screenshots.

Author:  Kavanagh [ Wed Mar 21, 2012 2:44 pm ]
Post subject:  Re: Qmodem Pro scripting question

Mongoose wrote:
Yeah, anything that shows the history of helpers. If you've already got them running, it'll save me a lot of trouble setting up DOSEMU or something to get some screenshots.


Here, or email? you can pm me a web based email addr

Author:  Mongoose [ Wed Mar 21, 2012 3:11 pm ]
Post subject:  Re: Qmodem Pro scripting question

Here's fine.

Author:  Kavanagh [ Sun Mar 25, 2012 3:40 pm ]
Post subject:  Re: Qmodem Pro scripting question

I can't remember nor find how to read from an X,Y position on the screen in Qmodem. Sent Tweety a pm; if it is possible, he will know how to do it, way more Q literate than I.

Author:  Wookie8662 [ Sun Mar 25, 2012 4:00 pm ]
Post subject:  Re: Qmodem Pro scripting question

I have TWHelper and TWAR DOS.
I will try to set them up with Com-IP, and DOSBox, and see what happens.

Author:  Mongoose [ Sun Mar 25, 2012 4:13 pm ]
Post subject:  Re: Qmodem Pro scripting question

Okay, thanks. Kav already sent me some good screens of TWAssist, Qmodem, and Telix, so I don't need those.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/