www.ClassicTW.com
https://www.classictw.com/

SWATH scripts since 2003
https://www.classictw.com/viewtopic.php?f=15&t=31905
Page 1 of 3

Author:  kjkrum [ Sat Jul 23, 2011 3:24 am ]
Post subject:  SWATH scripts since 2003

I'm super stoked about playing TW again. I may not be able to sleep tonight. :lol:

I got SWATH installed in WINE, including a JRE so I can run Java scripts. Everything seems to be working great. (I'm also running TWGS.) I took a look at the Javadoc for the SWATH scripting API, and some powerful features have been added since I last played.

But the scripts I published in 2003 are still among the newest ones in the official script library. Everyone seems to be writing for TWX these days. Have any players published updated SWATH script packs? I'm particularly interested in how people might be making use of UserDefinedDaemons.

Author:  LoneStar [ Sat Jul 23, 2011 7:31 am ]
Post subject:  Re: SWATH scripts since 2003

Attached is a ZIP of all the scripts that I have.. very few of them are scripts that I wrote. But. The real treat are the MANY script that Mind Dagger wrote. I studied his scripts and programming at the very start.

I eventually moved to TWX scripting, as running scripts in swath can be very slow and painful.

Attachments:
File comment: JAVA Scripts writen by the Mighty Mind Dagger
SWATH.zip [514.33 KiB]
Downloaded 725 times

Author:  kjkrum [ Sat Jul 23, 2011 7:24 pm ]
Post subject:  Re: SWATH scripts since 2003

SWATH in WINE seems to be decently fast, but we're probably talking about speed differences beneath the realm of human perception.

I really hope gameops embrace the delays JP wrote into the newer versions of TWGS, so that people with slower computers, helpers, and connections can compete on a level playing field. Scripting itself never removed the human element; certain aspects of the game just became a competition of script writing instead of a competition of fast typing. But when winning comes down to the performance difference between two helpers, it's no longer interesting.

Author:  ElderProphet [ Sat Jul 23, 2011 9:30 pm ]
Post subject:  Re: SWATH scripts since 2003

Is that Krumwiede? You exited TW about the time I started, in 2003, but I corresponded with you some trying to learn breadth first searches. Welcome back bro, and thanks for the help way back when.

+EP+

Author:  kjkrum [ Sun Jul 24, 2011 1:28 am ]
Post subject:  Re: SWATH scripts since 2003

Yep, that's me. I played as Mongoose.

Author:  Vid Kid [ Sun Jul 24, 2011 2:20 am ]
Post subject:  Re: SWATH scripts since 2003

Welcome back Mongoose
:)

Author:  mob [ Sun Jul 24, 2011 8:14 am ]
Post subject:  Re: SWATH scripts since 2003

Glad to see ole players coming back with some new intrest! Welcome back!

Author:  LoneStar [ Sun Jul 24, 2011 9:02 am ]
Post subject:  Re: SWATH scripts since 2003

kjkrum wrote:
SWATH in WINE seems to be decently fast, but we're probably talking about speed differences beneath the realm of human perception.


You're Welcome :wink:

Author:  kjkrum [ Sun Jul 24, 2011 12:59 pm ]
Post subject:  Re: SWATH scripts since 2003

I'm intrigued by that TargetingDaemon. Wish I had the source to that. Probably top secret though, huh?

I'm kind of bewildered right now, simultaneously learning all the new features of the script API and the new strategies and tactics of the game. Give me a minute, maybe I'll come out with some cool scripts. :mrgreen:

Author:  Singularity [ Sun Jul 24, 2011 1:33 pm ]
Post subject:  Re: SWATH scripts since 2003

Swath is fun to learn, but the TWXproxy offers a much faster and easier scripting language. There's a lot you can do in it that you cannot do in Swath. If you're going to get back into script writing, you might want to invest your time into TWXproxy scripting instead. You will get more done if you do.

Author:  kjkrum [ Sun Jul 24, 2011 1:41 pm ]
Post subject:  Re: SWATH scripts since 2003

What's something you can do in TWX that you can't do in SWATH?

Author:  Master Blaster [ Sun Jul 24, 2011 2:03 pm ]
Post subject:  Re: SWATH scripts since 2003

Yes. I am an avid Swath user. I would love to know what TWX can do that Swath cannot?

BTW, Welcome back Mongoose. I remember you from the olden days (lol)

Author:  Singularity [ Sun Jul 24, 2011 2:30 pm ]
Post subject:  Re: SWATH scripts since 2003

kjkrum wrote:
What's something you can do in TWX that you can't do in SWATH?


Write a script that waits for a fig, mine, or limpet hit. Then finds out if there's an adjacent fig to that hit, then pwarps there. In TWXproxy this is a very easy thing to do, it's about 50 lines of code, or with a supporting fig DB (figsec parm, for example), it's about 20 lines of code.

Next, write a script that goes thru the DB and finds bubbles. Filters out those that are not figged, then sorts them by size. About 100 lines of code.

Finally, write a twarp gridder that bursts as fast as TWXproxy can. When given a list of sectors it should find the nearest figged sector, figure out the course, twarp there, grid out to the target sector, twarp off, all in a burst. It should also be able to call saveme as soon as a problem is seen (unable to move, torped, IG, podded, etc).

In TWXproxy, all of these are easy to write. The twarp gridder is more involved, but that's the point. In twxproxy, complex projects scale better. Java works great for small scripts, but complex projects do not scale very well. I'm not saying you can't write them in Java, I'm just saying it will take 10x the amount of work and will still never be as fast.

Author:  kjkrum [ Sun Jul 24, 2011 3:37 pm ]
Post subject:  Re: SWATH scripts since 2003

I think some of the built-in commands in SWATH wait for prompts before sending things, so that introduces delays. But there's no reason you can't burst out your own strings if you know exactly what you want to do.

Author:  Singularity [ Sun Jul 24, 2011 4:10 pm ]
Post subject:  Re: SWATH scripts since 2003

kjkrum wrote:
I think some of the built-in commands in SWATH wait for prompts before sending things, so that introduces delays. But there's no reason you can't burst out your own strings if you know exactly what you want to do.


Yea, you can. Just try using it in application for a while, you'll see what I mean.

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