View unanswered posts | View active topics It is currently Mon Apr 20, 2026 11:20 pm



Reply to topic  [ 9 posts ] 
 TWX command question 
Author Message
Boo! inc.
User avatar

Joined: Sat Oct 09, 2004 2:00 am
Posts: 865
Location: USA
Unread post TWX command question
"getCourse" does it use ZTM for data or what? Would it be more accurate pulling from computer?

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

Boo! inc.


Tue Feb 24, 2009 7:27 am
Profile
Commander

Joined: Sun Feb 25, 2001 3:00 am
Posts: 1838
Location: Guam USA
Unread post Re: TWX command question
GetCourse does not always work 100% of time.
Its nice when the ztm is complete and it works right.

But in a pinch I will just use the
cf* destination* q

and trigger or waiton the course you want to check.

_________________
TWGS V2 Vids World on Guam Port 2002
Telnet://vkworld.ddns.net:2002
Discord @ DiverDave#8374
Vid's World Discord

Founding Member -=[Team Kraaken]=- Ka Pla

Image
Winners of Gridwars 2010
MBN Fall Tournament 2011 winners Team Kraaken
Undisputed Champions of 2019 HHT Just for showing up!

The Oldist , Longist Running , Orginal Registered Owner of a TWGS server :
Vids World On Guam


Tue Feb 24, 2009 8:27 am
Profile WWW
Boo! inc.
User avatar

Joined: Sat Oct 09, 2004 2:00 am
Posts: 865
Location: USA
Unread post Re: TWX command question
Yes thank you, that was always a choice also...accurate course plot is important.
Thanks Vid.

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

Boo! inc.


Tue Feb 24, 2009 8:46 am
Profile
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: TWX command question
getCourse uses a ztm, yea. I've not had any problems w/ it, provided I've got a good one.

A computer plot works too, but that'll add some lag to the process. Also remember a CF factors in avoids, so you'll need to clear your avoids.

_________________
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


Tue Feb 24, 2009 8:54 am
Profile ICQ WWW
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1401
Location: Canada
Unread post Re: TWX command question
Favorite routine of mine
Code:
setVar $FROM 1
setVar $TO 100
GetCourse $COURSE $FROM $TO
if ($COURSE = "-1")
  send "^F"&$FROM&"*"&$TO&"**Q"
  waiton ": ENDINTERROG"
  GetCourse $COURSE $FROM $TO
  if ($COURSE = "-1")
     # SEE Note Below (Bottom of this post)
     Echo "**Unable to Plot Course**"
     Halt
  end
end


Note: If you're feelign really adventurous, instead of plotting the course and using GetCourse again, you can use the courseplot code, found in a few of MD's scripts, to parse the course yourself.
On rare occasion I've had problems with getcourse, but i believe it was a data corruption in the Dbase, not the cmd itself.

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.


Tue Feb 24, 2009 9:38 am
Profile ICQ YIM
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Re: TWX command question
Is there a speed advantage or data send advantage in using: send "^F"&$FROM&"*"&$TO&"**Q" over send "^F" $FROM "*" $TO "**Q"

I know the "&" concatinates the information being sent and wondering if that helps prevent fragmentation and gains a speed or reliability advantage.

_________________
               / Promethius / Enigma / Wolfen /

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


Tue Feb 24, 2009 10:00 am
Profile ICQ
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1401
Location: Canada
Unread post Re: TWX command question
Promethius wrote:
Is there a speed advantage or data send advantage in using: send "^F"&$FROM&"*"&$TO&"**Q" over send "^F" $FROM "*" $TO "**Q"

I know the "&" concatinates the information being sent and wondering if that helps prevent fragmentation and gains a speed or reliability advantage.


I use the ampersand as a habbit, I've noticed that alot of the older scripts rarely use the ampersand.. however. There are instances where you not only *need* to use it, but you can't have any spaces either, ie:

"blah" & "blah" vs "blah"&"blah"

If you want to know what I'm refering too, look at MD's routine for Citkill and how it handles ANSI. If you put spaces between the ' " ' and ' & ' it will break the routine 8)

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.


Tue Feb 24, 2009 10:15 am
Profile ICQ YIM
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post Re: TWX command question
getCourse uses warp data that TWX has gained from ZTM, probing, moving around, and data imports. Assuming the warp data is accurate, then getCourse will emulate the course plots in TradeWars. Remember that TW course plots take avoids into account like Sing said, and TWX's getCourse takes into account any avoids that the script has set via the setAvoid command.

A course plot is nothing more than a breadth-first search. Here is what getCourse looks like, as a TWX script:
Code:
clearAllAvoids
:begin
getInput $from "Enter From sector"
echo "*From = " $from
getInput $to "Enter To sector"
echo "*To = " $to
gosub :plot
goto :begin

:plot
echo "*From: " $from ", To: " $to "*"
setArray $que SECTORS
setVar $que[1] $from
setVar $path[$from] $from
setVar $distance[$from] 0
setVar $top 1
setVar $bottom 1
while ($bottom <= $top)
   setVar $focus $que[$bottom]
   if ($focus = $to)
      echo $path[$focus] " (Dist=" $distance[$focus] ")"
      return
   end
   setVar $a 1
   while ($a <= SECTOR.WARPCOUNT[$focus])
      setVar $adjacent SECTOR.WARPS[$focus][$a]
      if ($checked[$adjacent] = 0)
         add $top 1
         setVar $que[$top] $adjacent
         setVar $path[$adjacent] $path[$focus] & " > " & $adjacent
         setVar $distance[$adjacent] ($distance[$focus] + 1)
         setVar $checked[$adjacent] 1
      end
      add $a 1
   end
   add $bottom 1
end
echo "*No Path Found"
return

The getCourse command works perfectly, but it is only as good as the data that it has to work with.

Regards,
+EP+

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


Wed Feb 25, 2009 11:55 pm
Profile WWW
Boo! inc.
User avatar

Joined: Sat Oct 09, 2004 2:00 am
Posts: 865
Location: USA
Unread post Re: TWX command question
EP, great example....yes I figured that it relied on ZTM and explored data just had to ask. Thanks for the input glad to see ya still around:)

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

Boo! inc.


Thu Feb 26, 2009 7:13 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

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