View unanswered posts | View active topics It is currently Tue Apr 21, 2026 8:01 pm



Reply to topic  [ 1 post ] 
 Scripting: TWX Windows 
Author Message
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Scripting: TWX Windows
TWX windows are handy when you are doing something and the screen
is moving too fast to read easily, or you are wanting to monitor
the results of a script (see proEcolonizer21 for an example of this).

Creating TWX windows is a fairly simple thing to do so:

setVar $hitSector "1432" // setup bogus hit
setVar $nearFig "1232" // setup bogus nearest fig
Window myWindow 300 275 "TWX Window Example" ONTOP
# | | | | |- set the window on top
# | | | Window Title
# | | Vertical size of the window
# | Horizontal size of the window
# Window name - use to set the contents in. Can be whatever best identifies what you are doing.

setVar $windowContent " Fighter hit: " & $hitSector & "*" // setup var for the window
// & used to join the information

# adding another line to our windowContent var - you have to end it with a "*"
setVar $windowContent $windowContent & " Nearest fig: " & $hitSector & "*"

setWindowContents myWindow $windowContent // set the window contents to our var
# | |- Variable
# Name we set for the window above
waitfor "³Turns" // waiting on you to hit / (thanks to LoneStar for that tip)

# I believe the proper name for what the & does is concatenation <sp>, but join is easier
# to spell.

Yes, you can scroll your data as it comes in, but it requires a bit more work. To
scroll it back, requires a lot more work. You will have to setup arrays to have it
scroll and then manipulate the array position. Since I am keeping this as basic as
possible for people new to scripting/programming it is a bit beyond that I think. If
you are wanting to scroll the information, let me know and I will post an example.

The above all in one shot so you can play:

setVar $hitSector "1432"
setVar $nearFig "1232"
Window myWindow 500 275 "TWX Window Example" ONTOP
setVar $windowContent " Fighter hit: " & $hitSector & "*"
setVar $windowContent $windowContent & " Nearest fig: " & $hitSector & "*"
setWindowContents myWindow $windowContent
waitfor "³Turns"

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Wed Nov 26, 2008 10:49 pm
Profile ICQ
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.