| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| Twx Version? https://mail.black-squirrel.com/viewtopic.php?f=15&t=17915 |
Page 1 of 1 |
| Author: | Kaus [ Sun Oct 15, 2006 2:31 am ] |
| Post subject: | |
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. |
|
| Author: | RexxCrow [ Sun Oct 15, 2006 3:11 am ] |
| Post subject: | |
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 . . . |
|
| Author: | Kaus [ Sun Oct 15, 2006 4:29 am ] |
| Post subject: | |
thats a good idea and would prolly do what I need it to do. |
|
| Author: | ElderProphet [ Sun Oct 15, 2006 5:13 am ] |
| Post subject: | |
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+ |
|
| Author: | RexxCrow [ Sun Oct 15, 2006 6:18 am ] |
| Post subject: | |
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. |
|
| Author: | LoneStar [ Sun Oct 15, 2006 6:25 am ] |
| Post subject: | |
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 |
|
| Author: | RexxCrow [ Sun Oct 15, 2006 9:44 am ] |
| Post subject: | |
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. |
|
| Author: | Singularity [ Sun Oct 15, 2006 9:51 am ] |
| Post subject: | |
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 |
|
| Author: | Kaus [ Sun Oct 15, 2006 1:25 pm ] |
| Post subject: | |
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. |
|
| Author: | Vid Kid [ Sun Oct 15, 2006 1:35 pm ] |
| Post subject: | |
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. |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|