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

The code to create menus in swath
https://mail.black-squirrel.com/viewtopic.php?f=15&t=18280
Page 1 of 1

Author:  Cerne [ Thu Dec 21, 2006 11:30 pm ]
Post subject: 

I have a lot of public scripts. One of the things I like about Cherokee's Public Script Pack is that when I added them to swath, they created their own sub-menu (the combat pack didn't do that but oh well).  They are all .cts so I cannot see the code for the sub-menu function.

Does anyone know the code of which I am speaking?

Cernnunos

Author:  Oso [ Thu Dec 21, 2006 11:58 pm ]
Post subject: 

Here's the best way to deal with that-
create subfolders in your script folder and it when you reload your scripts in SWATH, it will create submenus.

Hope this helps.

Author:  Cerne [ Fri Dec 22, 2006 12:09 am ]
Post subject: 

Actually that works to do the menus but any script that uses an include or calls another script wont work. (since it looks for the include off the root script directory as do the calls from one script for another)

I want all of the scripts to stay in the scripts directory because that creates less problems in the long run.

Author:  Oso [ Fri Dec 22, 2006 12:49 am ]
Post subject: 

I've never had a problem with the includes.
I have my scripts separated by authors (thanks to all you out there) and I've never had a script not work.

Author:  Cerne [ Fri Dec 22, 2006 1:20 am ]
Post subject: 

Try running Oz's ptrade best script from inside directory while all your ck scripts are in a ck directory.

Cernnunos

Author:  Oso [ Fri Dec 22, 2006 1:27 am ]
Post subject: 

I leave the ck ones in the script directory, as SWATH automatically separates those.

Author:  Cerne [ Fri Dec 22, 2006 2:12 am ]
Post subject: 

Thanks for your input but actually I found a post of Sing's on Vulcan from August 2005

Here it is in case others want to do use the info as well
------------------------------------------------------------ -----------------
Subdirectories show up different, swath[/b] also has "author coding" that you can change in the swath[/b].cfg file. This allows you to assign an author's name to a prefix.












  <TWXProxy[/b]>


    <MenuKey>$</MenuKey>


    <ScriptDirectory>C:\games\tradewars\twxproxy[/b]\scripts</ScriptDirectory>


    <MenuFilters>


      <SubMenu prefix="1_">Pack 1</SubMenu>


      <SubMenu prefix="2_">Pack 2</SubMenu>


      <SubMenu prefix="_ck">Cherokee</SubMenu>


    </MenuFilters>


  </TWXProxy[/b]>








SubMenu prefix... etc, etc.




_________________
Shoo! No signature here! Muhahaha!


http://www.navhaz.com

Author:  Oso [ Fri Dec 22, 2006 2:33 am ]
Post subject: 

Thanks for digging that up.
It will be very useful.

Author:  Cerne [ Fri Dec 22, 2006 2:55 am ]
Post subject: 

It is totally sweet. ~370 scripts I can access without scrolling.

Cernnunos


PS then you have to edit all the swath triggers that have been set up. (and save the file so we dont have to redo all the work on the next install. LOL)

Author:  Singularity [ Fri Dec 22, 2006 4:49 am ]
Post subject: 

Ya, that can be pretty nice. Mine's a mess, laff... like 2k scripts all over the place. I use rexx menus to sort my important stuff.

Author:  Cerne [ Fri Dec 29, 2006 12:44 am ]
Post subject: 

Sing, do you have so many because you write some "on the fly" to perform some repetitive task?

Cernnunos

Author:  Zentock [ Fri Dec 29, 2006 3:17 am ]
Post subject: 

We usually end up with so many because we make a script
for a particular use, or set of circumstances and because
we made it we cant bring ourselves to throw it away.

Even though we may not use it again.

ALSO when we make them we keep them to make even bigger scripts that make use of the prior script.

WELL, at least thats the reasons why i have so many : )

Author:  Singularity [ Fri Dec 29, 2006 4:56 am ]
Post subject: 

Well, good example was HHT. I needed a way to torp people from a tpad so I wrote an anticipation torper. Then I realized there was a few improvements I could make so I made another ver. Then I realized there were a half dozen patterns I needed to make, so I made one for each. By the time I was done I was so fed-up with the mess that I made one completely from scratch that did all of the things the old ones did but w/ menu options. So there I had like 7 scripts... and I'll never use but one of them. Never-the-less that final one was very well polished and had experience from the previous ones to make it better.

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