| Author |
Message |
|
Maniac
Lieutenant J.G.
Joined: Sun Mar 13, 2005 3:00 am Posts: 387 Location: USA
|
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
_________________ Find out just what any people will quietly submit to and you have the exact measure of the injustice and wrong which will be imposed on them. Frederick Douglas
|
| Fri Dec 22, 2006 11:40 pm |
|
 |
|
Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA
|
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.
_________________ 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
|
| Sat Dec 23, 2006 12:33 am |
|
 |
|
LoneStar
Commander
Joined: Fri Jun 09, 2006 2:00 am Posts: 1402 Location: Canada
|
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
_________________ ---------------------------- -= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
|
| Sat Dec 23, 2006 12:34 am |
|
 |
|
ElderProphet
Commander
Joined: Tue Oct 07, 2003 2:00 am Posts: 1134 Location: Augusta, GA
|
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+
_________________ Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.
|
| Sat Dec 23, 2006 1:51 am |
|
 |
|
Maniac
Lieutenant J.G.
Joined: Sun Mar 13, 2005 3:00 am Posts: 387 Location: USA
|
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.
_________________ Find out just what any people will quietly submit to and you have the exact measure of the injustice and wrong which will be imposed on them. Frederick Douglas
|
| Sat Dec 23, 2006 2:23 am |
|
 |
|
RexxCrow
Captain
Joined: Sat Jun 18, 2005 2:00 am Posts: 2214 Location: USA
|
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"
_________________ 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!
|
| Sat Dec 23, 2006 2:55 am |
|
 |
|
Maniac
Lieutenant J.G.
Joined: Sun Mar 13, 2005 3:00 am Posts: 387 Location: USA
|
Heh Rexx you win the limburger cheese hat...
thank you ... A workaround but a feasable one
Once again thanks
_________________ Find out just what any people will quietly submit to and you have the exact measure of the injustice and wrong which will be imposed on them. Frederick Douglas
|
| Sat Dec 23, 2006 3:20 am |
|
 |
|
LoneStar
Commander
Joined: Fri Jun 09, 2006 2:00 am Posts: 1402 Location: Canada
|
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
_________________ ---------------------------- -= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
|
| Sat Dec 23, 2006 12:52 pm |
|
 |
|