View unanswered posts | View active topics It is currently Fri Apr 24, 2026 5:28 pm



Reply to topic  [ 11 posts ] 
 twx203 windows 
Author Message
Lieutenant

Joined: Sat Mar 03, 2001 3:00 am
Posts: 592
Location: USA
Unread post 
Well this is the first time ive ever worked with data windows so its probably me doin somethin wrong. I can get the window to come up but no data will show in it, and my txt file comes out just fine.

Code:
setvar $sector 11
setvar $file "list.txt"
  window status 100 50 "List Status" ONTOP
  setvar $window "0"
  setwindowcontents status $window

  while ($sector <= SECTORS)
      if (SECTOR.EXPLORED[$sector] = "NO")
          write $file $sector
          gosub :update
        end
      add $sector 1
    end
  goto :end

:update
  add $window 1
  setwindowcontents status $window
  return

:end


Mon Mar 21, 2005 2:16 am
Profile ICQ YIM WWW
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
Ok PHX, just a few minor changes. Think of the contents of the display window as a variable. The window contents will be formatted however the info within that variable is formatted. You'll see from the code below that I formatted it so that there are 11 sectors per line in the $window variable. Then, when the script is complete, we display that $window variable in the display window.

Hope it helps,
+EP+

Code:
setvar $sector 11
setvar $file "list.txt"
window status 350 500 "List Status" ONTOP
setvar $window ""

while ($sector <= SECTORS)
   if (SECTOR.EXPLORED[$sector] = "NO")
      write $file $sector
      gosub :update
   end
   add $sector 1
end
goto :end

:update
add $wordsPerLine 1
if ($wordsPerLine > 11)
   setVar $window $window & "*"
   setVar $wordsPerLine 1
end
setVar $window $window & "   " & $sector
return

:end
setwindowcontents status $window
pause

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


Mon Mar 21, 2005 3:30 am
Profile WWW
Gunnery Sergeant

Joined: Tue Mar 08, 2005 3:00 am
Posts: 23
Location: USA
Unread post 
Something EP didn't say is that all things written to a script window MUST end with a * to display anything.
Kimsanee


Mon Mar 21, 2005 12:13 pm
Profile ICQ
Gunnery Sergeant

Joined: Tue Mar 08, 2005 3:00 am
Posts: 23
Location: USA
Unread post 
I just remembered. If you'd like to see an example of a script window. d/l my route window over at http://www.grimytrader.com (cheap plug). It's fully commented, so it should help with windows.
Kimsanee


Mon Mar 21, 2005 12:22 pm
Profile ICQ
Warrant Officer

Joined: Sat Dec 15, 2001 3:00 am
Posts: 94
Location: USA
Unread post 
Thanks for the cheap plug!

_________________
http://www.grimytrader.com


Tue Mar 22, 2005 1:02 pm
Profile WWW
Gunnery Sergeant

Joined: Tue Mar 08, 2005 3:00 am
Posts: 23
Location: USA
Unread post 
well I could't afford an expensive one <G>


Tue Mar 22, 2005 3:18 pm
Profile ICQ
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
I've never found that to be the case about * Kimsanee, but I'll give your route display a go. Actually, I thought this was a clever use of script windows. I've often wanted a visual of my path. So props, a good idea.

See, now it is up to 2 cheap plugs :)

+EP+

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


Tue Mar 22, 2005 11:24 pm
Profile WWW
Gunnery Sergeant

Joined: Tue Mar 08, 2005 3:00 am
Posts: 23
Location: USA
Unread post 
TY


Wed Mar 23, 2005 2:59 am
Profile ICQ
Commander

Joined: Tue Mar 26, 2002 3:00 am
Posts: 1416
Location: Canada
Unread post 
oh, and go visit http://www.tw-cabal.com for all your tradewars info needs!




It needed to be done. [:D]


Wed Mar 23, 2005 4:31 am
Profile ICQ
Lieutenant

Joined: Sat Mar 03, 2001 3:00 am
Posts: 592
Location: USA
Unread post 
Sorry EP but I took Kimsanee's fix before trying yours and it worked just fine. SO see the simplest answer is usually the correct one. No it doesn't have to be the only correct answer but it was certainly the quickest fix.

Thanks to both of you. Id be lost in the sauce otherwise.


Fri Apr 01, 2005 1:48 am
Profile ICQ YIM WWW
Lieutenant

Joined: Sat Mar 03, 2001 3:00 am
Posts: 592
Location: USA
Unread post 
OH yeah btw, the script I was writing that I wanted to know this for is now posted on The Grimy Trader. With updates to follow probably soon.....my turn to make a cheap plug. heh

Sector List Generator 3.0


Fri Apr 01, 2005 1:52 am
Profile ICQ YIM WWW
Display posts from previous:  Sort by  
Reply to topic   [ 11 posts ] 

Who is online

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