View unanswered posts | View active topics It is currently Fri May 22, 2026 12:25 pm



Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
 Feature change 
Author Message
Boo! inc.

Joined: Fri Jan 04, 2002 3:00 am
Posts: 221
Location: Canada
Unread post 
heh, since everyone else gave code. i want to give some too. but mine is a little big... probably some problems with it too heh

:QuickStat
SEND "/"
WaitFor " Sect "
setVar $qs_line CURRENTLINE
:QS_StoreLine
setTextLineTrigger qs_line :QS_GetLine
PAUSE
:QS_GetLine
IF (CURRENTLINE <> "")
setVar $QS_line $QS_Line&CURRENTLINE
GOTO :QS_StoreLine
END
killTrigger qs_line

replaceText $qs_line #179 " "
setVar $qs_line $qs_line&" + "
stripText $qs_line ","

# Pull Out Data
# Current Sector
getText $qs_line $Info[SECT] "Sect " " Turns "
StripText $Info[SECT] " "
# Current Turns
getText $qs_line $Info[TURNS] "Turns " " Creds "
StripText $Info[TURNS] " "
# Current Credits
getText $qs_line $Info[CREDS] "Creds " " Figs "
StripText $Info[CREDS] " "
# Current Fighters
getText $qs_line $Info[FIGS] "Figs " " Shlds "
StripText $Info[FIGS] " "
# Current Shields
getText $qs_line $Info[SHLDS] "Shlds " " Hlds "
StripText $Info[SHLDS] " "
# Current Total Holds
getText $qs_line $Info[HLDS] "Hlds " " Ore "
StripText $Info[HLDS] " "
# Current Ore Holds
getText $qs_line $Info[ORE] "Ore " " Org "
StripText $Info[ORE] " "
# Current Org Holds
getText $qs_line $Info[ORG] "Org " " Equ "
StripText $Info[ORG] " "
# Current Equ Holds
getText $qs_line $Info[EQU] "Equ " " Col "
StripText $Info[EQU] " "
# Current Colo Holds
getText $qs_line $Info[COL] "Col " " Phot "
StripText $Info[COL] " "
# Current Photons
getText $qs_line $Info[PHOT] "Phot " " Armd "
StripText $Info[PHOT] " "
# Current Armid Mines
getText $qs_line $Info[ARMD] "Armd " " Lmpt "
StripText $Info[ARMD] " "
# Current Limpet Mines
getText $qs_line $Info[LMPT] "Lmpt " " GTorp "
StripText $Info[LMPT] " "
# Current Planet Gens
getText $qs_line $Info[GTORP] "GTorp " " TWarp "
StripText $Info[GTORP] " "
# Current Twarp Status
getText $qs_line $Info[TWARP] "TWarp " " Clks "
StripText $Info[TWARP] " "
# Current Cloaks
getText $qs_line $Info[CLKS] "Clks " " Beacns "
StripText $Info[CLKS] " "
# Current Total Beacons
getText $qs_line $Info[BEACNS] "Beacns " " AtmDt "
StripText $Info[BEACNS] " "
# Current Total Atomic Dets
getText $qs_line $Info[ATMDT] "AtmDt " " Crbo "
StripText $Info[ATMDT] " "
# Current Total Corbomite
getText $qs_line $Info[CRBO] "Crbo " " EPrb "
StripText $Info[CRBO] " "
# Current Total Ether Probes
getText $qs_line $Info[EPRB] "EPrb " " MDis "
StripText $Info[EPRB] " "
# Current Total Mine Disruptors
getText $qs_line $Info[MDIS] "MDis " " PsPrb "
StripText $Info[MDIS] " "
# Current Physcic Probe Status
getText $qs_line $Info[PSPRB] "PsPrb " " PlScn "
StripText $Info[PSPRB] " "
# Current Planet Scanner Status
getText $qs_line $Info[PLSCN] "PlScn " " LRS "
StripText $Info[PLSCN] " "
# Current Scanner Type
getText $qs_line $Info[LRS] "LRS " " Aln "
StripText $Info[LRS] " "
# Current Total Alignment
getText $qs_line $Info[ALN] "Aln " " Exp "
StripText $Info[ALN] " "

getWordPos $qs_line $pos " Corp "
# Current Total Experience
IF ($pos > 0)
getText $qs_line $Info[EXP] "Exp " " Corp "
ELSE
getText $qs_line $Info[EXP] "Exp " " Ship "
END
StripText $Info[EXP] " "
# Current Corporation Number
IF ($pos > 0)
getText $qs_line $Info[CORP] "Corp " " Ship "
ELSE
setVar $Info[CORP] "None"
END
StripText $Info[CORP] " "
# Current Ship Number & Short Name
getText $qs_line $ship_status "Ship " " + "
# Ship Number
GetWord $ship_status $Info[SHIP_NUM] 1
# Ship Short Name
GetWord $ship_status $Info[SHIP_SHORT] 2
StripText $Info[SHIP_NUM] " "
StripText $Info[SHIP_SHORT] " "
RETURN


Thu Jun 24, 2004 12:04 am
Profile
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
Heh, a scripting contest :)
PHX, what I posted works... consistently for me anyway. I can't think of a reason why it doesn't work for you. I played with this a good bit, hoping I could post a 6 line script that would do the same thing <grin> but it proves to be tougher than that. The only fool-proof way I came up was long... like Tweety's.

I like the way you guys concatenate all of the lines into one. This can present some problems though... like if Photons are disabled they'll be absent from the quickstats, throwing your numbering off. Also, the last line may not have #179 in it, so you have to allow for that. I'm sure there are others scenarios as well.

And the reason CK doesn't just use "(?=help)" is because it is sometimes "(?=Help)", like at the command prompt. Notice the uppercase "H".

Ah well, I'm sure it can be done in 10 lines :)

+EP+

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


Sat Jun 26, 2004 1:20 am
Profile WWW
Lieutenant

Joined: Sat Mar 03, 2001 3:00 am
Posts: 592
Location: USA
Unread post 
ok Find a flaw in this one....

Code:
setvar $info ""
setvar $space 0
send "/"
:info
  killalltriggers
  settextlinetrigger 1 :line #179
  settextlinetrigger 2 :line "Ship "
  settextlinetrigger 3 :done "elp)"
  setdelaytrigger 4 :done 500
  pause
    :line
      setvar $info $info & CURRENTLINE
      goto :info
    :done
      killalltriggers
      replacetext $info #179 " "
      striptext $info ","
      while ($space < 10)
          replacetext $info "  " " "
          add $space 1
        end
      getword $info $Sect 2
      getword $info $Turns 4
      getword $info $Creds 6
      getword $info $Figs 8
      getword $info $Shlds 10
      getword $info $Hlds 12
      getword $info $Ore 14
      getword $info $Org 16
      getword $info $Equ 18
      getword $info $Col 20
      getword $info $Phot 21
      if ($Phot = "Phot")
          getword $info $Phot 22
        else
          setvar $Phot ""
        end
      gettext $info $Armd "Armd " " Lmpt"
      gettext $info $Lmpt "Lmpt " " GTorp"
      gettext $info $GTorp "GTorp " " TWarp"
      gettext $info $TWarp "TWarp " " Clks"
      gettext $info $Clks "Clks " " Beacns"
      gettext $info $Beacns "Beacns " " AtmDt"
      gettext $info $AtmDt "AtmDt " " Crbo"
      gettext $info $Crbo "Crbo " " EPrb"
      gettext $info $EPrb "EPrb " " MDis"
      gettext $info $MDis "MDis " " PsPrb"
      gettext $info $PsPrb "PsPrb " " PlScn"
      gettext $info $PlScn "PlScn " " LRS"
      gettext $info $LRS "LRS " " Aln"
      gettext $info $Aln "Aln " " Exp"
      gettext $info $Exp "Exp " " Corp"
      if ($Exp = "")
          gettext $info $Exp "Exp " " Ship"
          setvar $Corp 0
        else
          gettext $info $Corp "Corp " " Ship"
        end
      if ($Phot <> "") and ($Corp > 0)
          getword $info $Ship1 56
          getword $info $Ship2 57
        elseif (($Phot = "") and ($Corp > 0)) or (($Phot <> "") and ($Corp = 0))
          getword $info $Ship1 54
          getword $info $Ship2 55
        elseif ($Phot = "") and ($Corp = 0)
          getword $info $Ship1 52
          getword $info $Ship2 53
        end
pause


More often than not (but not always) it is missing the "elp)" trigger, so I added a delay trigger to handle that...only problem I can see with this is if your on a slow Butt server or hit some bad lag right when this activates. Aside from that...its golden baby.
Unless someone can think of some other items that might not show up depending on game settings, lemme know so I can make the necessary changes.


Sat Jun 26, 2004 7:57 pm
Profile ICQ YIM WWW
Lieutenant

Joined: Sat Mar 03, 2001 3:00 am
Posts: 592
Location: USA
Unread post 
I suppose that adding [xxx] to the get lines also updates the DB?


Sun Jun 27, 2004 12:21 am
Profile ICQ YIM WWW
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
Actually PHX, that looks very thorough, well done. I can't think of a single scenario when that one will not work. And best of all, you've come a long way in your scripting ability since the first post.

+EP+

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


Sun Jun 27, 2004 5:14 pm
Profile WWW
Commander

Joined: Thu Feb 20, 2003 3:00 am
Posts: 1529
Location: USA
Unread post 
I never would have imagined it was so hard to get that info in TWX. It's really simple in REXX.


Mon Jun 28, 2004 12:10 am
Profile ICQ
Display posts from previous:  Sort by  
Reply to topic   [ 21 posts ]  Go to page Previous  1, 2

Who is online

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