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



Reply to topic  [ 1 post ] 
 Sell ships at dock 
Author Message
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Sell ships at dock
I've seen a few games where xyz corp had 100 ships or so repo'd at dock. Since selling is a simple script, I am guessing that the 1.5M+ loss isn't that important, but to me it is still a loss. I don't know if it is the cost or if they just haven't taken the time to write the sell script so:

Code:
# proSell.ts
# sell ships at dock
# must be at the shipyard prompt
# option to sell ships with fighters
# the script will sell ALL ships at dock
# Promethius
# Dec 2008

# get our prompt
getword currentline $prompt 1

# make sure we are at the shipyard prompt
if ($prompt <> "<Shipyards>")
    echo ANSI_12 "*You must be at the " ANSI_15 " Shipyards " ansi_12 "prompt!!"
    halt
end

# Do we really want to sell that ship with 400k figs?
echo ANSI_13 "*Sell ships with " ANSI_12 "fighters?!?!?!!"
getConsoleInput $sellFigged singlekey
lowercase $sellFigged

# get our ship list to sell
:sellShipList
setVar $cnt 0
send "s"
waitfor "------------------------------------------------------------"
  :sellTriggers
  setTextTrigger sellship :sellShip " " & STARDOCK & " "
  setTextTrigger sellthem :sellthem "Choose which ship to sell"
  pause

  :sellShip
# get our trigger - STARDOCK comes after the ship num, but we also want the figs after it so setTextLineTrigger
  setTextLineTrigger sellship :sellShip " " & STARDOCK & " "
  # count the number of ships to sell
  add $cnt 1
  getword CURRENTLINE $sellShip[$cnt] 1
  cutText currentline $isFigged[$cnt]  34 8
  stripText $isFigged[$cnt] " "
  pause

  :sellThem
  killtrigger sellship
   setVar $i 1
   while ($i <= $cnt)
      # check to make sure 0 figs on the ship or if we just want to sell everything
      if ($sellfigged = "y") or ($isFigged[$i] = 0)
         send "s  " $sellShip[$i] "*y"
      end
   add $i 1
   end

  :done
  halt

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Tue Dec 30, 2008 2:15 pm
Profile ICQ
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

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.