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



Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
 Create list of ports 
Author Message
1st Sergeant
User avatar

Joined: Thu May 15, 2008 3:13 pm
Posts: 33
Unread post Create list of ports
I am wondering if it is possible to have twxproxy be able to create a text file that lists sector numbers of a specific port type I am requesting. For example, if I want to list the BBB ports, it would dump the sector numbers into a list like the following:

1234
5678
9012
3456

I would like to be able to figure this out as I can stream this output into a designed worksheet we use when we play the game. I realize that SWATH does this with it's Port locator option, but I rather use ZOC and TWXProxy.

Thanks for any help or insight.

_________________
Harkov

Silently exploring the galaxy one sector at a time.


Sat Aug 30, 2008 12:23 pm
Profile
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: Create list of ports
What? No way, completely impossible... ROTFLOL

Yea, you can, quite trivial infact...

Something like:
Code:
# -------------------------------------
setVar $class_to_find 1
# -------------------------------------

setVar $file_to_write GAMENAME & "-ports_list.txt"
delete $file_to_write

setVar $idx 11
while ($idx <= SECTORS)
    if (PORT.EXISTS[$idx] > 0)
        if (PORT.CLASS[$idx] = $class_to_find)
            write $file_to_write $idx
        end
    end
    add $idx 1
end

# -------------------------------------


And just put in whatever class port you want. You could also mod it to use BUYORG and BUYEQUIP instead if you want, customize as needed.

_________________
May the unholy fires of corbomite ignite deep within the depths of your soul...

1. TWGS server @ twgs.navhaz.com
2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads
3. Open IRC chat @ irc.freenode.net:6667 #twchan
4. Parrothead wrote: Jesus wouldn't Subspace Crawl.

*** SG memorial donations via paypal to: dpocky68@booinc.com
Image


Sat Aug 30, 2008 2:18 pm
Profile ICQ WWW
1st Sergeant
User avatar

Joined: Thu May 15, 2008 3:13 pm
Posts: 33
Unread post Re: Create list of ports
Thank you. I can see it was something relatively easy. I'm working my head around some basic simple scripts to understand how to script, etc.

Appreciate you taking time to answer my question.

_________________
Harkov

Silently exploring the galaxy one sector at a time.


Sat Aug 30, 2008 3:21 pm
Profile
1st Sergeant
User avatar

Joined: Thu May 15, 2008 3:13 pm
Posts: 33
Unread post Re: Create list of ports
Ok now another question. How do I make a menu where the script asks me what class to dump to text? I'd like to be able to specify on the fly when I need particular data.

It can be simple, like press this key for SSS, this key for BBB, etc. Is it easier to create it that way, or easier to have the player input the type of port to dump to file?

_________________
Harkov

Silently exploring the galaxy one sector at a time.


Sat Aug 30, 2008 6:39 pm
Profile
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: Create list of ports
Menus require more work, you'll need to work thru most of that yourself in order to get what you're looking for.

There's a script command ref at:
http://www.navhaz.com/files/script.html

Combined w/ the scripts in pack 2 you can figure out how the menus work. You can either use the standard menu system or make your own ansi menus. I typically just make an ansi menu, better control, but that's up to you.

_________________
May the unholy fires of corbomite ignite deep within the depths of your soul...

1. TWGS server @ twgs.navhaz.com
2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads
3. Open IRC chat @ irc.freenode.net:6667 #twchan
4. Parrothead wrote: Jesus wouldn't Subspace Crawl.

*** SG memorial donations via paypal to: dpocky68@booinc.com
Image


Sat Aug 30, 2008 7:51 pm
Profile ICQ WWW
1st Sergeant
User avatar

Joined: Thu May 15, 2008 3:13 pm
Posts: 33
Unread post Re: Create list of ports
Thanks for the script reference. It answered a few more questions I had and made it easy for me to create a few little scripts to get the hang of the helper.

Again, appreciate you taking time to give direction.

_________________
Harkov

Silently exploring the galaxy one sector at a time.


Sat Aug 30, 2008 8:17 pm
Profile
Lieutenant Commander
User avatar

Joined: Sun Jan 29, 2006 3:00 am
Posts: 800
Location: Iowa
Unread post Re: Create list of ports
Code:
# -------------------------------------
setVar $class_to_find 1
# -------------------------------------
  :start
echo ansi_4 & "*Input class to find*"
echo ansi_3 & "1 " & ansi_6 & "BBS*"
echo ansi_3 & "2 " & ansi_6 & "BSB*"
echo ansi_3 & "3 " & ansi_6 & "SBB*"
echo ansi_3 & "4 " & ansi_6 & "SSB*"
echo ansi_3 & "5 " & ansi_6 & "SBS*"
echo ansi_3 & "6 " & ansi_6 & "BSS*"
echo ansi_3 & "7 " & ansi_6 & "SSS*"
echo ansi_3 & "8 " & ansi_6 & "BBB*"
getconsoleinput $class_to_find singlekey
   If $class_to_find < 1 or $class_to_find > 9
      echo ansi_15 "** Invalid Entry* "
      goto :start
   End




setVar $file_to_write GAMENAME & "-ports_list.txt"
delete $file_to_write

setVar $idx 11
while ($idx <= SECTORS)
    if (PORT.EXISTS[$idx] > 0)
        if (PORT.CLASS[$idx] = $class_to_find)
            write $file_to_write $idx
        end
    end
    add $idx 1
end

# -------------------------------------


simple menu?? ..too simple I suppose.

_________________
#+++
The early bird may get the worm, but the second mouse gets the cheese.
#---


Sat Aug 30, 2008 8:36 pm
Profile ICQ YIM
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Re: Create list of ports
Simple is good. I would probably add a check to see which ports have a fig down, and add that as an option to the menu. Sector parameters would work nicely.

_________________
               / Promethius / Enigma / Wolfen /

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


Sat Aug 30, 2008 10:35 pm
Profile ICQ
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post Re: Create list of ports
Unfortunately, the menu scripting in TWX isn't very intuitive. I've always found it difficult and clunky, so I'll generally opt for a simple menu like Crosby's example. Menus make the script choices easy to navigate from the user side, but they can take up so many lines that the code itself is harder to read.

Good luck with the scripting,
+EP+

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Sat Aug 30, 2008 11:50 pm
Profile WWW
1st Sergeant
User avatar

Joined: Thu May 15, 2008 3:13 pm
Posts: 33
Unread post Re: Create list of ports
Simple is always good ;)

After reading up on the page Singularity provided, I managed to create a simple menu. Thanks Crosby for your example; it taught me to use different colors.

Starting to get the hang of this scripting. Wonder if I can make a script to turn on my coffee. lol

Thanks all for the help and direction.

_________________
Harkov

Silently exploring the galaxy one sector at a time.


Sun Aug 31, 2008 12:09 pm
Profile
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Re: Create list of ports
Harkov wrote:
Simple is always good ;)

After reading up on the page Singularity provided, I managed to create a simple menu. Thanks Crosby for your example; it taught me to use different colors.

Starting to get the hang of this scripting. Wonder if I can make a script to turn on my coffee. lol

Thanks all for the help and direction.


Don't have one for the coffee, but from way back: viewtopic.php?f=14&t=12568&p=105638&hilit=defense+script#p105638

_________________
               / Promethius / Enigma / Wolfen /

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


Sun Aug 31, 2008 4:34 pm
Profile ICQ
Commander
User avatar

Joined: Fri Aug 20, 2004 2:00 am
Posts: 1801
Location: Outer Rims
Unread post Re: Create list of ports
Promethius wrote:
Harkov wrote:
Simple is always good ;)

After reading up on the page Singularity provided, I managed to create a simple menu. Thanks Crosby for your example; it taught me to use different colors.

Starting to get the hang of this scripting. Wonder if I can make a script to turn on my coffee. lol

Thanks all for the help and direction.


Don't have one for the coffee, but from way back: viewtopic.php?f=14&t=12568&p=105638&hilit=defense+script#p105638


That was a good one Promethius. I'm afraid our (Daala and I) copy of that script runs somewhat longer, having 4 kids already and our 5th is due in October. She wants me to add the changediaper.ts script to it.

_________________
-Thrawn

But risk has always been an inescapable part of warfare.

--

Knight to Queen's Bishop 3


Sun Aug 31, 2008 5:35 pm
Profile
Boo! inc.
User avatar

Joined: Sat Oct 09, 2004 2:00 am
Posts: 865
Location: USA
Unread post Re: Create list of ports
Thrawn wrote:
...having 4 kids already and our 5th is due in October. She wants me to add the changediaper.ts script to it.


You might want to recheck your script, has a unexpected loop. I know after having twins just a few days ago I definitly commented out that one:

#:datenight
#if ($glassesofwine > 2)
# goto :bubblebath
# else
# goto :mythbusters
# halt
#end

_________________
“The object of war is not to die for your corp but to make the other bastard die for his.”

Boo! inc.


Sun Aug 31, 2008 6:06 pm
Profile
1st Sergeant
User avatar

Joined: Thu May 15, 2008 3:13 pm
Posts: 33
Unread post Re: Create list of ports
Lol, thanks for the laugh.

Ok now here is my next issue. I'm trying to see if a script can acually pull a list of sectors in a bubble to a text file. I notice in SWATH that it will list the gates and then the bubble sectors. I'd like to dump it in a text file similar to the port one I have worked on. Now in twxproxy it has the option to export a bubble list and a deadend list. In the bubble list, it lists sectors and the second number I assume is the distance to Stardock, or is it depth? The deadend lists just sector numbers. Is there a way to have a script dump a list of sectors in a bubble to text? I would assume that this would also rely on my database and any bubbles I've encountered. I also am curious if same script can allow player to input depth of the bubble.

_________________
Harkov

Silently exploring the galaxy one sector at a time.


Sun Aug 31, 2008 9:09 pm
Profile
Commander
User avatar

Joined: Fri Aug 20, 2004 2:00 am
Posts: 1801
Location: Outer Rims
Unread post Re: Create list of ports
Harkov wrote:
Lol, thanks for the laugh.

Ok now here is my next issue. I'm trying to see if a script can acually pull a list of sectors in a bubble to a text file. I notice in SWATH that it will list the gates and then the bubble sectors. I'd like to dump it in a text file similar to the port one I have worked on. Now in twxproxy it has the option to export a bubble list and a deadend list. In the bubble list, it lists sectors and the second number I assume is the distance to Stardock, or is it depth? The deadend lists just sector numbers. Is there a way to have a script dump a list of sectors in a bubble to text? I would assume that this would also rely on my database and any bubbles I've encountered. I also am curious if same script can allow player to input depth of the bubble.


Use the deadend option in TWXProxy to dump sector numbers into a text file. If you are using this to match with your port search, then I know from my experience and usage of this data that you will want the deadend text list. The bubble list is a pain with that second integer listed for any data parsing.

_________________
-Thrawn

But risk has always been an inescapable part of warfare.

--

Knight to Queen's Bishop 3


Mon Sep 01, 2008 7:41 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 24 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 25 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.