View unanswered posts | View active topics It is currently Wed Apr 22, 2026 6:22 am



Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
 GetVar from QuickStats 
Author Message
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post Re: GetVar from QuickStats
It's the last post on pg. 5: viewtopic.php?f=15&t=19424&hilit=quickstats

11-LINE VERSION
Code:
:quickStatSub
send "/"
waitOn #179 & "Turns "
while (CURRENTLINE <> "")
     :label
     getText 0 & #179 & CURRENTLINE & #179 & #179 $block $block & #179 #179
     getWord $block $stat 1
     getWord $block $quickStat[$stat] 2
     stripText $quickStat[$stat] ","
     branch ($block = "") :label
     waitOn ""
end
return
And if you need simple variables, create them between the end & return lines...
setVar $CURRENT_SECTOR $quickStat[SECT]
setVar $TURNS $quickStat[TURNS]
setVar $CREDITS $quickStat[CREDITS]
... and so on.

+EP+

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


Tue Jan 15, 2008 8:51 pm
Profile WWW
Chief Warrant Officer
User avatar

Joined: Wed Jan 04, 2006 3:00 am
Posts: 136
Location: USA
Unread post Re: GetVar from QuickStats
Here is my attempt to bring both quikstat ideologies together into one insane subroutine. It does not use arrays at all, but it also does not go through as many if statements to complete it's job. It seems to work well, but if anyone sees a problem with it let me know.

Code:
:quikstats
   setVar $CURRENT_PROMPT       "Undefined"
   killtrigger prompt
   killtrigger statlinetrig
   setTextLineTrigger    prompt      :allPrompts       #145 & #8
   setTextLineTrigger    statlinetrig    :statStart       #179 & "Turns "
   send #145&"/"
   pause
   :allPrompts
      getWord CURRENTLINE $CURRENT_PROMPT 1 "Undefined"
      stripText $CURRENT_PROMPT #145
      stripText $CURRENT_PROMPT #8
      pause
   :statStart
      while (CURRENTLINE <> "")
         :grabstats
         getText 0 & #179 & CURRENTLINE & #179 & #179 $block $block & #179 #179
         getWord $block $stat_name 1 "NONE"
         getWord $block $stat 2
         stripText $stat ","
         branch ($stat_name = "NONE") ":"&$stat_name
         branch ($block = "") :label
         waitOn ""
      end
return
:PHOT
   setVar $PHOTONS $stat
   goto :grabstats
:CORP
   setVar $CORP $stat
   goto :grabstats
:SECT
   setVar $CURRENT_SECTOR $stat
:TURNS
   setVar $TURNS $stat
:CREDS
   setVar $CREDITS $stat
:FIGS
   setVar $FIGHTERS $stat
:SHLDS
   setVar $SHIELDS $stat
:HLDS
   setVar $TOTAL_HOLDS $stat
:ORE
   setVar $ORE_HOLDS $stat
:ORG
   setVar $ORGANIC_HOLDS $stat
:EQU
   setVar $EQUIPMENT_HOLDS $stat
:COL
   setVar $COLONIST_HOLDS $stat
:ARMD
   setVar $ARMIDS $stat
:LMPT
   setVar $LIMPETS $stat
:GTORP
   setVar $GENESIS $stat
:TWARP
   setVar $TWARP_TYPE $stat
:CLKS
   setVar $CLOAKS $stat
:BEACNS
   setVar $BEACONS $stat
:ATMDT
   setVar $ATOMIC $stat
:CRBO
   setVar $CORBO $stat
:EPRB
   setVar $EPROBES $stat
:MDIS
   setVar $MINE_DISRUPTORS $stat
:PSPRB
   setVar $PSYCHIC_PROBE $stat
:PLSCN
   setVar $PLANET_SCANNER $stat
:LRS
   setVar $SCAN_TYPE $stat
:ALN
   setVar $ALIGNMENT $stat
:EXP
   setVar $EXPERIENCE $stat
:SHIP
   setVar $SHIP_NUMBER $stat
   goto :grabstats


MD


Wed Jan 16, 2008 2:16 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 17 posts ]  Go to page Previous  1, 2

Who is online

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