| Author |
Message |
|
Kaus
Boo! inc.
Joined: Tue Nov 19, 2002 3:00 am Posts: 514 Location: USA
|
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.
_________________ -=English 101 pwns me=- ICQ#31380757, (Mad Hatter) No not The Mad Hatter and no affiliation with him
"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 |
|
 |
|
RexxCrow
Joined: Sat Jun 18, 2005 2:00 am Posts: 2215 Location: USA
|
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 |
|
 |
|
Kaus
Boo! inc.
Joined: Tue Nov 19, 2002 3:00 am Posts: 514 Location: USA
|
thats a good idea and would prolly do what I need it to do.
_________________ -=English 101 pwns me=- ICQ#31380757, (Mad Hatter) No not The Mad Hatter and no affiliation with him
"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 |
|
 |
|
ElderProphet
Joined: Tue Oct 07, 2003 2:00 am Posts: 838 Location: USA
|
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+
_________________ +aking +rading +o +he nex+ level
http://jroller.com/page/ElderProphet
|
| Sun Oct 15, 2006 5:13 am |
|
 |
|
RexxCrow
Joined: Sat Jun 18, 2005 2:00 am Posts: 2215 Location: USA
|
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 |
|
 |
|
LoneStar
Joined: Fri Jun 09, 2006 2:00 am Posts: 702 Location: Canada
|
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
_________________ [ELITE-O-METER> |-*--0----5----10|
"I am the punishment of God... If you had not committed great sins, God would not have sent a punishment like me upon you." Genghis Khan
|
| Sun Oct 15, 2006 6:25 am |
|
 |
|
RexxCrow
Joined: Sat Jun 18, 2005 2:00 am Posts: 2215 Location: USA
|
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 |
|
 |
|
Singularity
Ambassador
Joined: Thu Jun 02, 2005 2:00 am Posts: 4126 Location: USA
|
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
|
| Sun Oct 15, 2006 9:51 am |
|
 |
|
Kaus
Boo! inc.
Joined: Tue Nov 19, 2002 3:00 am Posts: 514 Location: USA
|
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.
_________________ -=English 101 pwns me=- ICQ#31380757, (Mad Hatter) No not The Mad Hatter and no affiliation with him
"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 |
|
 |
|
Vid Kid
Ambassador
Joined: Sun Feb 25, 2001 3:00 am Posts: 831 Location: Guam USA
|
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.
_________________ telnet://202.151.82.243:2002 Vids World Team Speak2 @ 87.106.47.61:8767 Team Speak3 @ 220.244.125.70:9987
|
| Sun Oct 15, 2006 1:35 pm |
|
 |
|