View unanswered posts | View active topics It is currently Wed Apr 29, 2026 8:58 am



Reply to topic  [ 7 posts ] 
 Distance Calculation 
Author Message
Gunnery Sergeant
User avatar

Joined: Tue Apr 15, 2008 8:57 am
Posts: 29
Unread post Distance Calculation
Is there a way to easily query TWX or SWATH for a listing of sectors that are X hops away from sector Y?

Thanks,
Thunder


Wed Sep 17, 2008 8:26 pm
Profile
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: Distance Calculation
Swath has the ability in the sector finder. TWXproxy can do it with the GetNearestWarps command, but that takes more work.

_________________
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


Wed Sep 17, 2008 9:19 pm
Profile ICQ WWW
Gunnery Sergeant
User avatar

Joined: Tue Apr 15, 2008 8:57 am
Posts: 29
Unread post Re: Distance Calculation
Singularity wrote:
Swath has the ability in the sector finder. TWXproxy can do it with the GetNearestWarps command, but that takes more work.


I don't see anything in the sector finder relating to distance. Am I missing something?


Wed Sep 17, 2008 9:40 pm
Profile
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: Distance Calculation
Hrm, thought it did... guess not. Seems that's the port finder. Guess TWXproxy is the only way.

_________________
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


Wed Sep 17, 2008 11:50 pm
Profile ICQ WWW
Chief Warrant Officer
User avatar

Joined: Sun Jan 20, 2008 5:15 am
Posts: 142
Unread post Re: Distance Calculation
There is an indirect way to get the info you want from Swath using the Sector Finder. Run a query that will return all the sectors in the universe for example, all sectors with 1 or more warps. Then you can click on the column header for distance to sort the list by distance. Be forewarned - this will take a while to run and sort.


Thu Sep 18, 2008 8:43 am
Profile
Gunnery Sergeant
User avatar

Joined: Tue Apr 15, 2008 8:57 am
Posts: 29
Unread post Re: Distance Calculation
Scrat wrote:
There is an indirect way to get the info you want from Swath using the Sector Finder. Run a query that will return all the sectors in the universe for example, all sectors with 1 or more warps. Then you can click on the column header for distance to sort the list by distance. Be forewarned - this will take a while to run and sort.


Ahh, good idea!


Thu Sep 18, 2008 8:49 am
Profile
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post Re: Distance Calculation
Here is the trivial way in TWX:
Code:
setVar $starting STARDOCK
setVar $distance 5
setVar $i 1
while ($i <= SECTORS)
   getDistance $thisDistance $starting $i
   if ($thisDistance = $distance)
      echo "*" $i
   end
   add $i 1
end
And the more astute way:
Code:
echo "*What is the starting sector?"
getConsoleInput $starting
echo "*What is the desired distance?"
getConsoleInput $distance
getNearestWarps $array $starting
setVar $lastDistance 0
setVar $i 1
while ($i <= $array) and ($lastDistance <= $distance)
   getDistance $lastDistance $starting $array[$i]
   if ($lastDistance = $distance)
      echo "*" $array[$i]
   end
   add $i 1
end
echo "*Complete.*"
Scripts are your friend.

+EP+

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


Fri Sep 19, 2008 11:03 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

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