| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| Detecting version of TWXProxy via script https://mail.black-squirrel.com/viewtopic.php?f=15&t=18287 |
Page 1 of 1 |
| Author: | Maniac [ Fri Dec 22, 2006 11:40 pm ] |
| Post subject: | |
I have looked at source code and can't find a way for a script to detect what version of TWXProxy is. I ask this because of the recent fix of figs not being refreshed on versions prior to 2.04. If a script had a way of determining what version they were running under they could bypass the "workaround" CK and others have implemented the refresh fig scripts everyone has or SHOULD have. In a 20K universe refreshing figs takes an alarming amount of time and was wondering if a script could detect that it was running a newer version and could grab a fig list from the database instead of having to refresh from the server. IMHO this would provide less of a drain on server resources as people would not have to refresh figs prior to running certain scripts that require a current fig list. If I am out in left field please someone let me know; I am a catcher not an outfielder |
|
| Author: | Singularity [ Sat Dec 23, 2006 12:33 am ] |
| Post subject: | |
Easiest way is to check for 2.04 specific variables like CURRENTSECTOR. The question about figs tho... yes. I have one on the site in my sig. It still requires a fig refresh (as that's really the only reliable way to know if you have a fig there since the database doesn't update on hit msgs) but I do use a sector parameter to hold the value which ends up being much faster than reading from a data file. Not sure how close it is to what you want but go here... http://www.navhaz.com/files/dny_quick_figs.ts Look at the foton and pdrop scripts as examples on making parms work. |
|
| Author: | LoneStar [ Sat Dec 23, 2006 12:34 am ] |
| Post subject: | |
Try this bit of code.. it's not the best.. but it works.. Code: setVar $File_TWX203 "c:\TWXProxy_203\TWXProxy.exe" setVar $File_TWX204 "C:\TWX\TWXProxy.exe" read $File_TWX203 $temp_TWX203 2 read $File_TWX204 $temp_TWX204 2 getlength $temp_TWX203 $len_TWX203 getlength $temp_TWX204 $len_TWX204 echo "*" echo "*" & ANSI_14 & "TWX 2.03 Line-2 Length Is : " & ANSI_15 & $len_TWX203 echo "*" & ANSI_14 & "TWX 2.04 Line-2 Length Is : " & ANSI_15 & $len_TWX204 echo "*" Edit... thought I should include the results... TWX 2.03 Line-2 Length Is : 168 TWX 2.04 Line-2 Length Is : 314 |
|
| Author: | ElderProphet [ Sat Dec 23, 2006 1:51 am ] |
| Post subject: | |
Yeah, I've been thinking about versioning a lot lately. I'll come up with something for the upcoming release to make this sort of thing possible. If you try to check for the existence of new static variables like CURRENTSECTOR, I believe the script would halt in 2.03. For now though, you can check the current version based on math changes. if 3/2 = 2, version is 2.03 if 3/2 is 1, version is 2.04, or its 2.02 or earlier. I *think* that is right. If it's really important to see if 2.02 is running, you could check for the existence of the uncompiled Pack2 includes... something like "fileExists $v202 Scripts\Include\Header.inc" would yield $v202=1 for v2.02. No guarantees that my syntax is correct, but it should set you on the right path... at least until that feature is included in TWX. +EP+ |
|
| Author: | Maniac [ Sat Dec 23, 2006 2:23 am ] |
| Post subject: | |
Lonestar that is genius I tell ya..... Wanna try my limburger cheese head? Thanks for a possible solution. And thank you Sing... you had a great idea but if I am using 2.03 and try using CURRENTSECTOR my script will not compile, or be interpreted it will just error out. TWXProxy checks for a script version before running/compiling but doesn't expose the check to the scripting engine. Maybe Elder could find a way to include that in a future release of TWXProxy. Assuming that the figs are refreshed correctly in TWXProxy the refresh figs scripts can be downgraded to an unnecessary step. IIRC 2.03 didn't have system variables RYLOS and ALPHA_CENTARI but we have no way of using the lack of a system variable to determine version #. I do know that the database format changed somewhat between versions was wondering whether it would be that much of a hassle to make it visible to the script engine. Back when I was young and stupid (this morning) I thought that changing TWXProxy would be a piece of cake hell we had the source code and could see what Xide was trying to do and now that I am older and wiser I see what kind of difficulities that Elder is working under. Yea I have helped Elder out a bit but what he is doing is difficult and I wish I could help him more. Part of the problem is Xide choose a language that is not very well supported today and the people that might be able to help are well into their how should I put this.... in their golden years. **** I just described 60% of tradewars players. I enjoy playing TW and am having trouble making time to help out Elder more than an occasionally thought. So if anyone else out there that can contribute a little knowledge I am sure that Elder would not mind. I'm sure that there are others that feel the same way, My internet connection is as flaky as Zark's so please be patient if I don't get back to you immediatly. |
|
| Author: | RexxCrow [ Sat Dec 23, 2006 2:55 am ] |
| Post subject: | |
Just as an easy alternative and as an FYI, this was discussed a few months back and a very easy and simple way to do this is to have a script read the first line in the changes.txt i.e. "TWX PROXY v2.04 Changes" |
|
| Author: | Maniac [ Sat Dec 23, 2006 3:20 am ] |
| Post subject: | |
Heh Rexx you win the limburger cheese hat... thank you ... A workaround but a feasable one Once again thanks |
|
| Author: | LoneStar [ Sat Dec 23, 2006 12:52 pm ] |
| Post subject: | |
RexxCrow wrote: Just as an easy alternative and as an FYI, this was discussed a few months back and a very easy and simple way to do this is to have a script read the first line in the changes.txt i.e. "TWX PROXY v2.04 Changes" I suggested that. But Sing brought up a good point when he noted some people only update their binaries.. so that's when I came up with checking a line in the actual Binaries |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|