View unanswered posts | View active topics It is currently Wed Apr 17, 2024 8:27 pm



Reply to topic  [ 10 posts ] 
 Twx Version? 
Author Message
Gameop
User avatar

Joined: Tue Nov 19, 2002 3:00 am
Posts: 1050
Location: USA
Unread post 
While it may be a obvious question is there anyway to determine which version of TWX a user is useing? Would be mighty helpfull for a if structure.

_________________
Dark Dominion TWGS
Telnet://twgs.darkworlds.org:23
ICQ#31380757, -=English 101 pwns me=-
"This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."


Sun Oct 15, 2006 2:31 am
Profile ICQ
Captain
User avatar

Joined: Sat Jun 18, 2005 2:00 am
Posts: 2214
Location: USA
Unread post 
Just a hypothetical, but what about searching the TWXProxy directory for a filename that displays the version?


setVar $TWXVersion204 “C:\TWXProxy\TWX204b.EXE”
fileExists $version $TWXVersion204
IF $version

END
.
.
.

_________________
Your reliance upon subjective IRM's, subjugates you through utter omission, obfuscation, and distortion of fact!
Don't mess with me, I will 26 U.S.C. § 7212(a) your IRS!


Sun Oct 15, 2006 3:11 am
Profile ICQ WWW
Gameop
User avatar

Joined: Tue Nov 19, 2002 3:00 am
Posts: 1050
Location: USA
Unread post 
thats a good idea and would prolly do what I need it to do.

_________________
Dark Dominion TWGS
Telnet://twgs.darkworlds.org:23
ICQ#31380757, -=English 101 pwns me=-
"This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."


Sun Oct 15, 2006 4:29 am
Profile ICQ
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1131
Location: Augusta, GA
Unread post 
There's no simple way. I can think about some of the bug fixes over the last few revisions, and one might possibly check for them to determine the version. I know that's lame, but that is the only real option at this point, other than prompting the user.

TWX Proxy executables have always been named the same thing as far as I know, so checking it's name isn't feasible.

+EP+

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


Sun Oct 15, 2006 5:13 am
Profile WWW
Captain
User avatar

Joined: Sat Jun 18, 2005 2:00 am
Posts: 2214
Location: USA
Unread post 
I thought there was a file in there that had the version as part of the name? It does not need to necessarily be the .exe to do this just some file that has something specific to that version as the name. Testing for commands and/or errors would that not just cause TWX to crash out and terminate? As there is not really any built in error handling in TWX, so I don’t think that would really work out.

One thing that I know would work as an alternative is checking for example the updates/additions/corrections file, reading through to a predetermined line number that contains the update notice for that version and comparing that to a variable within the script if they match then you know exactly what the version is, if they do not match then you keep going down until you find the correct version. I just thought the file name would be much, much easier, I am not at home right now so am just speculating about the use of the a version specific filename method. Otherwise I would give that up as an alternative and just go for the file READ method instead. This would require you to get a copy of every version you want to account for and copying the line you want to use for the comparison and recording the true line number, this would be used in your IF tree to figure out the version currently being used.

_________________
Your reliance upon subjective IRM's, subjugates you through utter omission, obfuscation, and distortion of fact!
Don't mess with me, I will 26 U.S.C. § 7212(a) your IRS!


Sun Oct 15, 2006 6:18 am
Profile ICQ WWW
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1396
Location: Canada
Unread post 
Just a thought..

the very 1st line in the changes.txt files for versions 2.03 and 2.04 :

TWX PROXY v2.03 Changes
TWX PROXY v2.04 Changes



Lone

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
-= There are 10 types of people in the world: Those that understand Binary and those who do not
-= If Oil is made from Dinosaurs, and Plastic is made from Oil... are plastic Dinosaurs made from real Dinosaurs?
-= I like to keep my friends and my enemies rich, and wait to see which is which - Tony Stark (R.I.P.)


Sun Oct 15, 2006 6:25 am
Profile ICQ YIM
Captain
User avatar

Joined: Sat Jun 18, 2005 2:00 am
Posts: 2214
Location: USA
Unread post 
There you go that would work perfectly LoneStar, perhaps something simliar to:


fileExist $test "C:TWXProxy\changes.txt"
IF $test
READ $test $line 1
IF $line="TWX PROXY v2.04 Changes"
...
ELSEIF $line="TWX PROXY v2.03 Changes"
...
ELSEIF $line="TWX PROXY v2.02 Changes"
...
ELSE
...
END
END

BTW, I was wrong, there are no version specific filenames, bad memory recall, I guess; and that was not meant as a bust on EP, by any means, it was just a thought I had.

_________________
Your reliance upon subjective IRM's, subjugates you through utter omission, obfuscation, and distortion of fact!
Don't mess with me, I will 26 U.S.C. § 7212(a) your IRS!


Sun Oct 15, 2006 9:44 am
Profile ICQ WWW
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post 
The changes text doesn't reflect all bugfixes, IIRC. And... not everone updates it when they update binaries. :(

I've wanted (for some time) a VERSION constant that's numerical. Like...
VERSION 202011
VERSION 202010
VERSION 203001
VERSION 204001

Something like that. So you can literally go...

if (VERSION < 204000)
clientMessage "You must be running 2.04 for this to work"
halt
end

_________________
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


Sun Oct 15, 2006 9:51 am
Profile ICQ WWW
Gameop
User avatar

Joined: Tue Nov 19, 2002 3:00 am
Posts: 1050
Location: USA
Unread post 
I ask because I realized I used the CURRENTSECTOR/STARDOCK constants which make it not 2.03 compatiable. I dont plan on making it 2.03 compatiable as its just one more thing that can be spoofed.

_________________
Dark Dominion TWGS
Telnet://twgs.darkworlds.org:23
ICQ#31380757, -=English 101 pwns me=-
"This one claims to have been playing since 1993 and didn't know upgrading a port would raise his alignment."


Sun Oct 15, 2006 1:25 pm
Profile ICQ
Commander

Joined: Sun Feb 25, 2001 3:00 am
Posts: 1837
Location: Guam USA
Unread post 
You could just work off of a command that is 2.04b compatible ..
if you are just checking for version 2.04b .. else not right version ..

Like the CURRENTSECTOR if is # .. then its 2.04b compatible
if its 0 or the word CURRENTLINE then its 2.03 or less.

I've done this for one script , but dont normally worry about it
cause I tell those who need my scripts to use twx 2.04 right out.

_________________
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


Sun Oct 15, 2006 1:35 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

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