| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| Create list of ports https://mail.black-squirrel.com/viewtopic.php?f=15&t=20929 |
Page 1 of 2 |
| Author: | Harkov [ Sat Aug 30, 2008 12:23 pm ] |
| Post subject: | 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. |
|
| Author: | Singularity [ Sat Aug 30, 2008 2:18 pm ] |
| Post subject: | 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. |
|
| Author: | Harkov [ Sat Aug 30, 2008 3:21 pm ] |
| Post subject: | 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. |
|
| Author: | Harkov [ Sat Aug 30, 2008 6:39 pm ] |
| Post subject: | 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? |
|
| Author: | Singularity [ Sat Aug 30, 2008 7:51 pm ] |
| Post subject: | 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. |
|
| Author: | Harkov [ Sat Aug 30, 2008 8:17 pm ] |
| Post subject: | 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. |
|
| Author: | Crosby [ Sat Aug 30, 2008 8:36 pm ] |
| Post subject: | 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. |
|
| Author: | Promethius [ Sat Aug 30, 2008 10:35 pm ] |
| Post subject: | 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. |
|
| Author: | ElderProphet [ Sat Aug 30, 2008 11:50 pm ] |
| Post subject: | 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+ |
|
| Author: | Harkov [ Sun Aug 31, 2008 12:09 pm ] |
| Post subject: | 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. |
|
| Author: | Promethius [ Sun Aug 31, 2008 4:34 pm ] |
| Post subject: | 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 |
|
| Author: | Thrawn [ Sun Aug 31, 2008 5:35 pm ] |
| Post subject: | 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. |
|
| Author: | mob [ Sun Aug 31, 2008 6:06 pm ] |
| Post subject: | 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 |
|
| Author: | Harkov [ Sun Aug 31, 2008 9:09 pm ] |
| Post subject: | 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. |
|
| Author: | Thrawn [ Mon Sep 01, 2008 7:41 pm ] |
| Post subject: | 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. |
|
| Page 1 of 2 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|