| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| ProTruceSetup.ts https://mail.black-squirrel.com/viewtopic.php?f=15&t=20985 |
Page 1 of 1 |
| Author: | Promethius [ Thu Sep 18, 2008 8:58 pm ] |
| Post subject: | ProTruceSetup.ts |
Code: # ProTruce Setup v1.0 by Promethius # protrucesetup.ts # Into the wild: 09/18/2008 # Please leave the above header intact # and note your changes if you give this # script out. Thanks. # sets all ships except the 2nd one in the catalog to # 0 figs, dets, ptorps, eprobes, mines, and figwave # 2nd ship has 1 fighter to set jump points with and # pull figs from a planet to base sector # Fed beacons will be set to a truce end time message # Note: If the Valiant ship leaves dock, it will not # get the sector and a warning will be given. # Truce end is setup by month/day/hour/minute/am or pm # Windows are used for status # Two data files are created during truce setup to restore # ship and alien settings (aggressive or not for aliens). # Script written for ease and not efficiency of code! setVar $pass 1 setVar $version "ProTruce Setup v1.0" :begin echo ANSI_11 "*Enter Game Letter to setup, or 0 <zero> to quit*" getConsoleInput $gameLetter singlekey upperCase $gameLetter if ($gameLetter = 0) halt end setVar $game "Game_" & $gameLetter & "_GameSetting.txt" echo ansi_12 "*Setup for Truce or Game? t / g / q quits*" getConsoleInput $gameType singleKey lowerCase $gameType if ($gameType = "q") halt end if ($gameType = "g") goto :gameOn end Echo ANSI_11 "*Enter truce end beacon information.*" echo ANSI_11 " | |*" getConsoleInput $fedBeacon setVar $Window 1 setVar $windowContents "* Game: " & $gameLetter & "*" Window proTruce 475 375 " " & $version & " by Promethius " ONTOP setWindowContents proTruce $windowContents send $gameLetter waitFor "Standard Editors" delete $game setVar $windowContents $windowContents & "* Getting Current Ship Stats*" setWindowContents proTruce $windowContents :getShipValue send "1" waitFor "Ship Editor" setVar $shipRecord 0 :shipClass killAllTriggers setTextTrigger shipDeleted :deletedShip "DELETED" setTextTrigger goodShip :goodShip "<>> Next Class" setDelayTrigger doneShips :doneShips 2000 pause :goodShip killAllTriggers send "5" setTextLineTrigger deployManual :deployedManual "method Manual" setTextLineTrigger deployGeneral :deployedGeneral "method General" setTextLineTrigger deployAlien :deployedAlien "method Alien" pause :deletedShip add $shipRecord 1 setVar $shipName[$shipRecord] "DELETED!" setVar $shipMethod[$shipRecord] "Delete" goto :checkforNext :deployedManual setVar $methodStr "Manual" goto :ss :deployedGeneral setVar $methodStr "General" goto :ss :deployedAlien setVar $methodStr "Alien" :ss waitFor "Enter your selection" send "1" setTextLineTrigger sClass :sClass "<A> Class" pause :sClass add $shipRecord 1 setVar $shipMethod[$shipRecord] $methodStr getText currentLine $line "Class " "<+> New class" setVar $iClass 1 getWord $line $word $iclass setVar $shipName[$shipRecord] "" while ($word <> 0) setVar $shipName[$shipRecord] $shipName[$shipRecord] & $word & " " add $iClass 1 getWord $line $word $iclass end setTextLineTrigger dets :dets "Atomic Detonators" pause :dets getWord currentLine $shipDets[$shipRecord] 9 setTextLineTrigger shipFigs :shipFigs "Corbomite" pause :shipFigs getWord currentLine $shipFighters[$shipRecord] 4 setTextLineTrigger eprobes :shipEprobes "SubSpace Ether" pause :shipEprobes getWord currentLine $shipEprobes[$shipRecord] 9 setTextLineTrigger mines :shipMines "Armid/Limpet" pause :shipMines getWord currentLine $shipMines[$shipRecord] 5 :shipptorps getWord currentLine $shipPtorps[$shipRecord] 9 setTextLineTrigger figWave :figWave "Fighter attack force" pause :figWave getWord currentLine $shipAttackWave[$shipRecord] 10 :checkForNext killAllTriggers setTextTrigger nextShip :nextShip "<>> Next Class" setDelayTrigger noNextShip :noNextShip 2000 pause :nextShip killTrigger noNextShip send ">" waitFor "New class" goto :shipClass :noNextShip killTrigger nextship :doneShips killAllTriggers setVar $i 1 while ($i <= $shipRecord) setVar $format $shipName[$i] setVar $formatLen 26 goSub :format setVar $shipName[$i] $format setVar $format $shipDets[$i] setVar $formatLen 2 goSub :format setVar $shipDets[$i] $format setVar $format $shipFighters[$i] setVar $formatLen 6 goSub :format setVar $shipFighters[$i] $format setvar $format $shipEprobes[$i] setVar $formatLen 3 goSub :format setVar $shipEprobes[$i] $format setVar $formatLen 3 setVar $format $shipMines[$i] goSub :format setVar $shipMines[$i] $format setVar $format $shipAttackWave[$i] setVar $formatLen 5 goSub :format setVar $shipAttackWave[$i] $format setvar $format $shipPtorps[$i] setVar $formatLen 2 goSub :format setVar $shipPtorps[$i] $format setVar $format $shipMethod[$i] setVar $formatLen 8 goSub :format setVar $shipMethod[$i] $format write $game $shipName[$i] & " " & $shipMethod[$i] & " " & $shipDets[$i] & " " & $shipFighters[$i] & " " & $shipEprobes[$i] & " " & $shipMines[$i] & " " & $shipPtorps[$i] & " " & $shipAttackWave[$i] add $i 1 end send "q" waitFor "Standard Editors" setVar $windowContents $windowContents & " * Ship stats done* Stats file is: " & $game & "*" setVar $windowContents $windowContents & "** Setting Ship Truce Values*" setwindowContents protruce $windowContents send "1" waitFor "Ship Editor" setVar $i 1 while ($i <= $shipRecord) stripText $shipMethod[$i] " " if ($shipMethod[$i] = "General") or ($shipMethod[$i] = "Manual") if ($i = 2) send "k0*d1*p1*f0*o0*>y" else send "k0*d0*m0*f0*o0*>y" end else send ">" end setDelayTrigger shiptruce :shipTruce 25 pause :shipTruce add $i 1 end send "q" waitFor "Change game time" goSub :alientrucesetup waitFor "Change game time" setVar $windowContents $windowContents & "* Setting Fed beacons to: " & $fedBeacon & "*" setWindowContents proTruce $windowContents send "g" setTextLineTrigger gameSectors :gameSectors ", sectors: " pause :gameSectors getWord currentLine $gameSectors 7 stripText $gameSectors "," getlength $gameSectors $sectorLen setTextLineTrigger starDock :starDock "StarShip Valiant Location" pause :starDock getWord currentLine $dock 7 send "q" waitFor "Standard Editors" send "s" getLength $dock $dockLen if ($dockLen = $sectorLen) send $dock else send $dock "*" end setTextTrigger gotDock :gotDock "The Federation" setDelayTrigger missedDock :missedDock 2000 pause :gotdock killTrigger missedDock send "n" send $fedBeacon "*x" goto :fedTerra :missedDock setVar $windowContents $windowContents & "* WARNING: Fed beacon not set for StarDock!!*" send "*" :fedTerra setVar $i 1 while ($i <= 10) waitFor "Change game time" send "s" send $i "*" waitFor "The Federation" send "n" send $fedBeacon & "*x" add $i 1 end send "q" waitFor "Selection (? for menu):" setVar $windowcontents $windowContents & "* Truce setup complete* Press d to exit*" setwindowContents protruce $windowContents setTextOutTrigger weBeDone :weBeDone "d" pause :weBeDone halt :gameOn echo ANSI_11 "*Enter the month to open or hit enter for current month*" getConsoleInput $monthOpen echo ANSI_11 "*Enter the day to open or hit enter for today*" getConsoleInput $dayOpen if ($monthOpen = "") getTime $monthOpen "m" end if ($dayOpen = "") getTime $dayOpen "d" end echo "*" $monthOpen echo "*" $dayOpen echo "*Enter the hour to open the game" getConsoleInput $timeHour echo "*Enter the minutes to open the game in mm (00, 30)" getConsoleInput $timeminutes echo "*Enter if this AM or PM (a/p)?" getConsoleInput $amPM singlekey setVar $time $timehour & ":" & $timeminutes & " " & $amPM & "m" setVar $Window 1 setVar $windowContents "* Game: " & $gameLetter & "*" setVar $windowContents $windowContents & "* Game goes non-truce on: " & $monthOpen & "/" & $dayOpen & " at " & $time & "*" Window proTruce 475 375 " " & $version & " by Promethius " ONTOP setWindowContents proTruce $windowContents :beginCountdown setvar $iCnt $pointer getTime $now "h mm a/p" getWord $now $nowHour 1 getWord $now $nowMin 2 getWord $now $nowAP 3 getTime $monthNow "m" getTime $dayNow "d" if ($nowhour = $timeHour) and ($nowMin >= $timeminutes) and ($nowAP = $amPM) and ($monthNow = $monthOpen) and ($dayNow = $dayOpen) goto :doItToIt end setDelayTrigger delay :myDelay 10000 pause :myDelay send "?" setWindowContents proTruce $windowContents & "* Current date and time: " & $monthNow & "/" & $dayNow & " " & $nowhour & ":" & $nowMin & " " & $nowAP &"m*" goto :beginCountdown :doItToIt send $gameLetter waitFor "Standard Editors" setVar $windowContents $windowContents & " * Restoring Ship Settings*" setVar $windowContents $windowContents & " From file: " & $game & "*" setWindowContents proTruce $windowContents send "1" waitFor "Gold Edition" read $game $ship 1 setVar $i 1 while ($ship <> EOF) cutText $ship $deployType 28 7 stripText $deployType " " cutText $ship $dets 37 2 stripText $dets " " cutText $ship $shipfigs 40 6 stripText $shipfigs " " cutText $ship $eProbes 47 3 stripText $eprobes " " cutText $ship $mines 51 3 stripText $mines " " cutText $ship $ptorps 55 2 stripText $ptorps " " cutText $ship $attackwave 58 999 stripText $attackWave " " if ($deployType = "General") or ($deployType = "Manual") send "k" $dets "*d" $shipFigs "*m" $eprobes "*f" $mines "*o" $ptorps "*p" $attackWave "*>y" else send ">" end add $i 1 read $game $ship $i end send "q" waitFor "Change game time" fileExists $yesItDoes "game_" & $gameLetter & "_alien.txt" if ($yesItdoes) goSub :alienracesGameOn end waitFor "Selection (? for menu):" setVar $windowContents $windowContents & "** Game " & $gameLetter & " set to non-truce!*" setVar $windowContents $windowContents & "** Press d to exit*" setWindowContents proTruce $windowContents setTextOutTrigger nonTruce :nonTruce "d" pause :nonTruce halt # goSubs :format getlength $format $len while ($len < $formatLen) setVar $format $format & " " add $len 1 end setVar $formatLen 0 return :alienTruceSetup delete "game_" & $gameLetter & "_alien.txt" setVar $windowcontents $windowcontents & "** Setting aliens to truce*" setWindowContents proTruce $windowcontents setVar $raceCnt 0 send "3" waitFor "<B> Alien" send "g" waitFor "Select Alien Race" :getRaces setTextTrigger races :races "ยบ <" setTextTrigger doneRaces :doneRaces "<Enter your" pause :races killTrigger doneRaces add $raceCnt 1 goto :getRaces :doneRaces killTrigger races send "*" :checkActiveTruce send "6" setTextLineTrigger activeRaceTruce :activeRaceTruce "Race is active" pause :activeRaceTruce getWordpos currentLine $posActive "Yes" if ($posActive = 0) write "game_" & $gameLetter & "_alien.txt" "Not Active" goto :checkForNextRace end send "2" waitFor "<B> Alien" setTextLineTrigger alientruce :alientruce "Aggressive" pause :alienTruce getWord currentLine $alienSet 4 if ($alienSet = "Yes") write "game_" & $gameLetter & "_alien.txt" "y" else write "game_" & $gameLetter & "_alien.txt" "n" end if ($gameType = "t") send "ln^y" end add $atRace 1 if ($atRace < $raceCnt) send ">" else send "q" return end goto :checkActiveTruce :alienRacesGameOn setVar $windowcontents $windowcontents & "** Setting aliens to normal*" setVar $windowcontents $windowcontents & " From file: " & "game_" & $gameLetter & "_alien.txt*" setWindowcontents proTruce $windowcontents send "3" waitFor "<B> Alien" send "2" read "game_" & $gameLetter & "_alien.txt" $alienSet 1 setVar $i 1 while ($alienSet <> EOF) getWordpos $alienSet $pos "Not" if ($pos > 0) send ">" else send "l" $alienSet "^y>" end add $i 1 read "game_" & $gameLetter & "_alien.txt" $alienSet $i end send "qq" return |
|
| Author: | NjoY [ Fri Sep 19, 2008 11:08 pm ] |
| Post subject: | Re: ProTruceSetup.ts |
I am interested in this and congrats to Prome for coming up with it!! The obvious issues being no dets, so not as easy to get the gold planets where ya want them (in the same sector) or am i missing something?? But workable!! Cant grid the bubbles/DE. till after the truce Not too sure what the Valient ship does yet... (Cant leave SD??) Best thing about a truce is u can build next to fed and grab cols. (Ignoring the cashing for now) If ya unlucky and ya dont get a gold planet u cant get the grab cols/speed advantage... but neither has anyone else. |
|
| Author: | Promethius [ Sun Sep 21, 2008 12:26 am ] |
| Post subject: | Re: ProTruceSetup.ts |
The Valiant is the name of a Fed ship and they always start at StarDock on a game bang. |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|