View unanswered posts | View active topics It is currently Wed Apr 22, 2026 8:35 pm



Reply to topic  [ 8 posts ] 
 Now that 204 final is out..... 
Author Message
Lieutenant J.G.
User avatar

Joined: Sun Mar 13, 2005 3:00 am
Posts: 387
Location: USA
Unread post 
Probably will result in a flame war but what the hell....

What would you like to see in 2.04+?
What can you contribute to the community, beta testers need not apply. (j/k) all

This is an open source project now anyone can grab the source and twiddle with things that they would like to see implemented or see how bad a programmer Elder^H^H^H or Xide^H^H^H really is. Not really .... but if you have any understanding of how programs work or how scripts work your input will be valued.



IMHO one of the things that could be improved/added is I/O
Delphi is slow on I/O and Elder has provided a major speedup with the old ReadToArray subroutine my only problem with that is that no other previously compiled scripts will be able to take advantage of the new commands unless recompiled and updated. I had a I would call it a beta solution that did close to the same thing but suffered from a slight(imho) possibility that what the script was trying to read could be changed.

No disrespect to elder for his superb work on twx but what I was looking for was to say that from what I saw older scripts would read a file into an array using a loop. (because the old way was the only way to do it.) Now from a never a professional programmer the way the language forced you to do it was open file.... read line $loop close file .... then read line $loop and....read line $loop+1 and so forth so you can see it was opening and closing the file say for a 20K universe about 20K times.

Elders solution was to open the file once, read all data then close file which he then transfered into an array so the speedup is obvious.

Only problem with Elders solution was that old scripts would not know about newer commands and could not partake of this improvement.

I proposed and had a alpha+/beta version that would on first call open file set a flag variable that said hey I already have the data so no need to read or in old case re-read the data therefore allowing old scripts to enjoy the benefits of the improvements that elder implemented while not having to be re-written and or recompiled.

Unfortunately Elder pointed out that my "hack" had a nasty habit of if file was changed it still would use stale data so it was not implemented in final, but stay tuned there is a possibility of it being in a future version.

_________________
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


Wed Jan 24, 2007 2:44 am
Profile ICQ
Commander
User avatar

Joined: Wed May 03, 2006 2:00 am
Posts: 1722
Location: USA
Unread post 
And why are older scripts an issue?
What old scripts do you value that cant be replicated fresh using newer faster commands?
Why use a file if it can be avioded?
Can you be more specific ?

_________________
Coconut Telegraph (ICQ)#586137616
Team Speak3@ 220.244.125.70:9987
Founding Member -=[Team Kraaken]=- Winner of Gridwars 2010 - Ka Pla
Image
Jesus wounldn't Subspace Crawl


Wed Jan 24, 2007 3:37 am
Profile ICQ YIM
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
Let me point out that ye ole Studly Maniac held my hand the first few times I opened and compiled the TWX Proxy 2.03 source. Many thanks for that bro.

I'd love to see the read command enhanced. I probably understand Delphi and TWX well enough to do this without too much of a hassle. Give me a shout in a couple weeks (I'm going to take a few weeks off <g> and let's see what we can come up with.

I did upload the source to Grimy as promised, so go have a peak at how bad I stink as a Delphi programmer

+EP+

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


Wed Jan 24, 2007 3:42 am
Profile WWW
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
Parrothead, it's more of a logic problem that he and I worked on many months ago, never really finding an ideal solution. I'm sure there is one, it simply eluded us. When I script, I always read files to an array, so readToArray was not only my answer to the speed issue, but it saved me a few steps. And did I mention it was faster

I can readToArray a 20k line file in .032 secs... roughly. See what happens when you try to read a 20k line file to an array using read.

My solution would probably be to alter the read command to populate an internal string list, a variable to hold the path and file name, and a variable to hold the file's TimeStamp when it was read. A subsequent read would check the path and timestamp, and if they are the same, pull from the previously created and populated string list.

+EP+

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


Wed Jan 24, 2007 3:49 am
Profile WWW
Captain
User avatar

Joined: Sat Jun 18, 2005 2:00 am
Posts: 2214
Location: USA
Unread post 
Heck yea, file rewriting and ANSI code triggers are my top two suggestions; I have a theoretical idea for a new type of BOT that will raise the standards  of all scripts like never before imagined!

...muhahahahahaauauahahaa, muahaahauaaamauaahaha, muaahahahamuaauaaaaaahaa, ahaahaaaahahaa, ahahahahahahahahahahaaaaa, one hundred million dollars, hahahahaaa, hahaaha, ahahaha, haaha, haha, haa, aha uaha, yea, well alright then.

_________________
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!


Wed Jan 24, 2007 5:47 am
Profile ICQ WWW
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1401
Location: Canada
Unread post 
ElderProphet wrote:
... I did upload the source to Grimy as promised, so go have a peak at how bad I stink as a Delphi programmer

+EP+

Thanks EP. Reading source code, to me, is like reading a good novel. For real.  If I had a compiler and the time, I'd write a cts disassembler.. hehe.. fortunately -or unfortunately- I'm just too busy making scripts.
Thanks again for all your hard work!
Lone

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.


Wed Jan 24, 2007 9:36 am
Profile ICQ YIM
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post 
Yea, EP. If all you need to prevent is opening/closing the file 10 bajillion times just timestamp your last read and write attempt. If the last read attempt was too long ago, force a re-open/re-read. Also check if you've written since then, if so, do same.

_________________
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


Wed Jan 24, 2007 2:22 pm
Profile ICQ WWW
Veteran Op

Joined: Tue Nov 28, 2006 4:04 pm
Posts: 5025
Unread post 
Singularity wrote:
Yea, EP. If all you need to prevent is opening/closing the file 10 bajillion times just timestamp your last read and write attempt. If the last read attempt was too long ago, force a re-open/re-read. Also check if you've written since then, if so, do same.

I'm not saying this is not the way to go, but you really have to watch how you handle arrays as when they aren't implemented right, they an cause memory leaks and then system crashes.  Xide ran into that in a couple of versions.


Wed Jan 24, 2007 2:37 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

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