View unanswered posts | View active topics It is currently Fri Apr 17, 2026 9:26 am



Reply to topic  [ 2 posts ] 
 Help with WorldTrade / Port upgrading 
Author Message
Civilian

Joined: Thu Jun 28, 2012 11:27 am
Posts: 0
Unread post Help with WorldTrade / Port upgrading
Trying to upgrade the ports while trading. Tried adding o1500*2500*3500*q to the extra commands but it breaks navigation. I have tried adding a d at the end, but it still either breaks on twarp question or non-express pauses.

Am I missing something, or do I just need to write another trade script to upgrade ports as I go?


Thu Jun 28, 2012 11:30 am
Profile
Private

Joined: Sat Feb 04, 2012 1:23 pm
Posts: 1
Unread post Re: Help with WorldTrade / Port upgrading
crimzon wrote:
Trying to upgrade the ports while trading. Tried adding o1500*2500*3500*q to the extra commands but it breaks navigation. I have tried adding a d at the end, but it still either breaks on twarp question or non-express pauses.

Am I missing something, or do I just need to write another trade script to upgrade ports as I go?


Can splice in the code from Mombot's PATP script which includes an option to upgrade ports, put this in in your WT script when it gets to the sector and is at the command line but before it docks to trade:

Code:
gosub :quikstats
                  setVar $total_creds_needed (300*7000)
                  if ($total_creds_needed > $CREDITS)         
                     send "q q *O 1"
                     waitOn ", 0 to quit)"
                     getWord CURRENTLINE $upgradeAmount 9
                     stripText $upgradeAmount "("
                     send $upgradeAmount&"* * *CR*Q"
                     send "q q *O 2"
                     waitOn ", 0 to quit)"
                     getWord CURRENTLINE $upgradeAmount 9
                     stripText $upgradeAmount "("
                     send $upgradeAmount&"* * *CR*Q"
                     send "q q *O 3"
                     waitOn ", 0 to quit)"
                     getWord CURRENTLINE $upgradeAmount 9
                     stripText $upgradeAmount "("
                     send $upgradeAmount&"* * *CR*Q"
                  end


Uses quikstats subroutine to get current trader/ship info, would need to add this to end of your worldtrade script if it doesn't already have it:

Code:
:quikstats
   setVar $CURRENT_PROMPT       "Undefined"
   killtrigger noprompt
   killtrigger prompt1
   killtrigger prompt2
   killtrigger prompt3
   killtrigger prompt4
   killtrigger statlinetrig
   killtrigger getLine2
   setTextTrigger       prompt1    :allPrompts       "(?="
   setTextLineTrigger    prompt2    :secondaryPrompts    "(?)"
   setTextLineTrigger    statlinetrig    :statStart       #179
   setTextTrigger      prompt3         :terraPrompts      "Do you wish to (L)eave or (T)ake Colonists?"
   setTextTrigger      prompt4         :terraPrompts      "How many groups of Colonists do you want to take ("
#   setDelayTrigger    noprompt        :doneQuikstats       3000
   send "^Q/"
   pause

   :allPrompts
      getWord currentansiline $checkPrompt 1
      getWord currentline $tempPrompt 1
      getWordPos $checkPrompt $pos ""
      if ($pos > 0)
         setVar $CURRENT_PROMPT $tempPrompt
      end
      setTextLineTrigger prompt1 :allPrompts "(?="
      pause
   :secondaryPrompts
      getWord currentansiline $checkPrompt 1
      getWord currentline $tempPrompt 1
      getWordPos $checkPrompt $pos ""
      if ($pos > 0)
         setVar $CURRENT_PROMPT $tempPrompt
      end
      setTextLineTrigger prompt2 :secondaryPrompts "(?)"
      pause
   :terraPrompts
      killtrigger prompt3
      killtrigger prompt4
      getWord currentansiline $checkPrompt 1
      getWordPos $checkPrompt $pos ""
      if ($pos > 0)
         setVar $CURRENT_PROMPT "Terra"
      end
      setTextTrigger      prompt3         :terraPrompts      "Do you wish to (L)eave or (T)ake Colonists?"
      setTextTrigger      prompt4         :terraPrompts      "How many groups of Colonists do you want to take ("
      pause

   :statStart
      killtrigger prompt1
      killtrigger prompt2
      killtrigger prompt3
      killtrigger prompt4
      killtrigger noprompt
      setVar $stats ""
      setVar $wordy ""


   :statsline
      killtrigger statlinetrig
      killtrigger getLine2
      setVar $line2 CURRENTLINE
      replacetext $line2 #179 " "
      striptext $line2 ","
      setVar $stats $stats & $line2
      getWordPos $line2 $pos "Ship"
      if ($pos > 0)
         goto :gotStats
      else
         setTextLineTrigger getLine2 :statsline
         pause
      end

   :gotStats
      setVar $stats $stats & " @@@"

      setVar $current_word 0
      while ($wordy <> "@@@")
         if ($wordy = "Sect")
            getWord $stats $CURRENT_SECTOR      ($current_word + 1)
         elseif ($wordy = "Turns")
            getWord $stats $TURNS           ($current_word + 1)
         elseif ($wordy = "Creds")
            getWord $stats $CREDITS        ($current_word + 1)
         elseif ($wordy = "Figs")
            getWord $stats $FIGHTERS         ($current_word + 1)
         elseif ($wordy = "Shlds")
            getWord $stats $SHIELDS        ($current_word + 1)
         elseif ($wordy = "Hlds")
            getWord $stats $TOTAL_HOLDS         ($current_word + 1)
         elseif ($wordy = "Ore")
            getWord $stats $ORE_HOLDS          ($current_word + 1)
         elseif ($wordy = "Org")
            getWord $stats $ORGANIC_HOLDS       ($current_word + 1)
         elseif ($wordy = "Equ")
            getWord $stats $EQUIPMENT_HOLDS       ($current_word + 1)
         elseif ($wordy = "Col")
            getWord $stats $COLONIST_HOLDS       ($current_word + 1)
         elseif ($wordy = "Phot")
            getWord $stats $PHOTONS         ($current_word + 1)
         elseif ($wordy = "Armd")
            getWord $stats $ARMIDS         ($current_word + 1)
         elseif ($wordy = "Lmpt")
            getWord $stats $LIMPETS         ($current_word + 1)
         elseif ($wordy = "GTorp")
            getWord $stats $GENESIS        ($current_word + 1)
         elseif ($wordy = "TWarp")
            getWord $stats $TWARP_TYPE        ($current_word + 1)
         elseif ($wordy = "Clks")
            getWord $stats $CLOAKS         ($current_word + 1)
         elseif ($wordy = "Beacns")
            getWord $stats $BEACONS       ($current_word + 1)
         elseif ($wordy = "AtmDt")
            getWord $stats $ATOMIC        ($current_word + 1)
         elseif ($wordy = "Corbo")
            getWord $stats $CORBO         ($current_word + 1)
         elseif ($wordy = "EPrb")
            getWord $stats $EPROBES         ($current_word + 1)
         elseif ($wordy = "MDis")
            getWord $stats $MINE_DISRUPTORS      ($current_word + 1)
         elseif ($wordy = "PsPrb")
            getWord $stats $PSYCHIC_PROBE        ($current_word + 1)
         elseif ($wordy = "PlScn")
            getWord $stats $PLANET_SCANNER     ($current_word + 1)
         elseif ($wordy = "LRS")
            getWord $stats $SCAN_TYPE          ($current_word + 1)
         elseif ($wordy = "Aln")
            getWord $stats $ALIGNMENT          ($current_word + 1)
         elseif ($wordy = "Exp")
            getWord $stats $EXPERIENCE          ($current_word + 1)
         elseif ($wordy = "Corp")
            getWord $stats $CORP            ($current_word + 1)
         elseif ($wordy = "Ship")
            getWord $stats $SHIP_NUMBER         ($current_word + 1)
         end
         add $current_word 1
         getWord $stats $wordy $current_word
      end
   :doneQuikstats
      killtrigger prompt1
      killtrigger prompt2
      killtrigger prompt3
      killtrigger prompt4
      killtrigger statlinetrig
      killtrigger getLine2

return


If your worldtrade script is integrated with Mombot, add
Code:
if ($upgrade)
to the beginning of the upgrade code and then a second "end" line after the upgrade code.

Also this to the beginning where it lists the different options you can use when you send the Mombot command so that you can set it to e.g. 'bot worldtrade upgrade or if you dont want it upgrading on that run just 'bot worldtrade:

Code:
   getWordPos $user_command_line $pos "upgrade"
   if ($pos > 0)
      setVar $upgrade TRUE
   else
      setVar $upgrade FALSE


Will only upgrade if you have at least 2,100,000 creds on hand when you enter the sector otherwise should trade as normal. You'll need to debug it though, I haven't tested it out.


Sat Jul 14, 2012 6:27 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

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