View unanswered posts | View active topics It is currently Mon Apr 20, 2026 8:38 am



Reply to topic  [ 2 posts ] 
 ProRelog 2.1 .TS Use at your OWN risk 
Author Message
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post ProRelog 2.1 .TS Use at your OWN risk
This code is extremely ugly and bloated and should really be cleaned up, but it works.

I would suggest making sure that the check box is unchecked in TWX on its login after you are in the game. I use a saveVar that my 1_login.ts reads to abort after this script is started so I don't have to worry about it.

[CODE]
SetVar $version "2.01"
setVar $reconCount 0
setVar $pnum ""

systemscript

setVar $relogActive 1
saveVar $relogActive
getMenuValue TWX_RECONNECT $val
if ($val = "ON")
openMenu TWX_RECONNECT FALSE
closeMenu
end


if (connected)
# setVar $restorePrompt "y"

else
setVar $1stRun "1"
goto :lostrecon
end


getword currentline $prompt 1

if ($prompt = "Citadel")
send "q*c"
setTextTrigger inSector :inSector "in sector"
pause
:inSector
getword currentline $pnum 2
stripText $pnum "#"
elseIf ($prompt = "Planet")
send "*"
setTextTrigger inSector :inSector "in sector"
pause
getword currentline $pnum 2
stripText $pnum "#"
elseIf ($prompt = "Do")
setVar $prompt "Terra"
end

:setTriggers
killalltriggers
setTextTrigger bounceFromGame :bfg "Enter your choice:"
setEventTrigger connLost :lostRecon "CONNECTION LOST"
# setTextTrigger connLost2 :connLost "Connection lost"
setTextTrigger connLost3 :lostRecon "Connection failure"
setTextTrigger final :shutDownFinal "The server is shutting down"
setTextTrigger chngPlanet :chngPlanetPrompt "Planet command (?=help)"
setTextTrigger chngCit :chngCitPrompt "Citadel command (?=help)"
setTextLineTrigger chngPNumber :chngPNum "Land on which planet"
setTextTrigger terra :terra "Do you wish to (L)eave or (T)ake Colonists?"
setTextTrigger chngDock :chngDockPrompt "<StarDock> Where to?"
setTextTrigger chngSector :chngSectPrompt "Command [TL"
setTextLineTrigger done :logOff "Confirmed? (Y/N)?"
setTextLineTrigger SD :SD "You will have to start over from scratch!"
setTextLineTrigger quitFromCit :quitFromCit "Do you wish to end your turn now and remain here? Yes"
pause

:bfg
killalltriggers
send "t * n * "
waitfor "Password"
send PASSWORD "* "
waitfor "Command"
goto :checkPrompt

:shutdownFinal
setDelayTrigger shutdown :shutdown 30000
disconnect
goto :lostRecon

:sd
:quitFromCit
killalltriggers
setDelayTrigger qfc :qfc 2500
pause
:qfc
Halt

:chngPnum
getword currentline $pnum 9
setTextLineTrigger chngPNumber :chngPNum "Land on which planet"
pause

:terra
setVar $pnum 1
setVar $prompt "Terra"
setTextTrigger terra :terra "Do you wish to (L)eave or (T)ake Colonists?"
pause

:chngPlanetPrompt
getword currentline $prompt 1
setTextTrigger chngPlanet :chngPlanetPrompt "Planet command (?=help)"
pause

:chngCitPrompt
getword currentline $prompt 1
setTextTrigger chngCit :chngCitPrompt "Citadel command (?=help)"
pause

:chngDockPrompt
getword currentline $prompt 1
setTextTrigger chngDock :chngDockPrompt "<StarDock> Where to?"
pause

:chngSectPrompt
getWord currentline $prompt 1
setTextTrigger chngSector :chngSectPrompt "Command [TL"
pause

:logOff
killalltriggers
getword currentline $logoff 3
if ($logoff = "Yes")
halt
else
goto :setTriggers
end


:recon
KILLALLTRIGGERS
setVar $relogPrompt $prompt
add $reconCount 1
setTextTrigger name :name "Please enter your name"
SETEVENTTRIGGER lostRecon :lostRecon "CONNECTION LOST"
setTextTrigger connLost3 :lostRecon "Connection failure"
setDelaytrigger hosed :disc 5000
pause

:disc
disconnect
setDelayTrigger discDelay :discDelay 2000
pause
:discDelay
goto :lRecon

:name
killtrigger hosed
SEND LOGINNAME "*"
goto :login

:lostRecon
killalltriggers
setDelayTrigger lRecon :lRecon 75
pause
:lRecon
Connect
goto :recon


:login
killalltriggers
SETEVENTTRIGGER lost :lostrecon "CONNECTION LOST"
setTextTrigger connLost3 :lostRecon "Connection failure"
settexttrigger gameletter :gameletter "Server registered to"
SETTEXTTRIGGER play :play "Enter your choice:"
SETTEXTTRIGGER newpassword :password "Please enter a password for this game account."
SETTEXTTRIGGER password :password "A password is required to enter this game."
SETTEXTTRIGGER pause :pause "[Pause]"
SETTEXTTRIGGER void :no "Do you wish to clear some avoids?"
SETTEXTTRIGGER todaylog :no "Show today's log? (Y/N)"
SETTEXTTRIGGER messages :messages "Searching for messages"
SETTEXTTRIGGER command :command "Command [TL"

#if ($1stRun = 1)
# setTextTrigger 1stPlanet :1stPlanet "Planet"
# setTextTrigger 1stCit :1stCit "Citadel"
#end
PAUSE

:gameletter
SEND GAME & "*"
waitfor "Trade Wars 2002"
send " "
pause


:play
send "t*"
pause


:yes
SEND "y"
pause

:no
SEND "n"
pause

:password
send PASSWORD & "*"
pause

:pause
SETVAR $line1 CURRENTLINE
if ($LINE1 = "[Pause]")
send " "
ELSEIF ($line1 = "[Pause] - Delete messages? (Y/N) [N] ")
SEND "y"
END
SETTEXTTRIGGER pause :pause "[Pause]"
pause

:messages
send "A"
pause


# wtf is this
:1stPlanet
killalltriggers
send "*c"
setTextTrigger 1stinSector :1stinSector "in sector"
pause
:1stinSector
getword currentline $pnum 2
stripText $pnum "#"
goto :setTriggers

:1stCitadel
killalltriggers
send "q*c"
setTextTrigger cit1stinSector :cit1stinSector "in sector"
pause
:cit1stinSector
getword currentline $pnum 2
stripText $pnum "#"
setVar $prompt "Citadel"
goto :setTriggers


:command
killalltriggers
send "'ProRelog " & $version & " activated " $reconCount " times.*"

if ($relogprompt = "Citadel") and ($pnum <> "")
send "l " #08 #08 $pnum "* c"
waitfor "Citadel"
elseif ($relogprompt = "Planet") and ($pnum <> "")
send "l " #08 #08 $pnum "* "
waitfor "Planet"
elseif ($relogprompt = "<StarDock>")
send "p s "
elseif ($relogprompt = "Terra")
send "l"
setTextTrigger onTerra :onTerra "Do you wish to"
setTextTrigger pnumTerra :pnumTerra "Land on which planet"
pause
:pnumTerra
killtrigger onTerra
send "1*"
:onTerra
killTrigger pnumTerra

end
listActiveScripts $scripts
setVar $a 1
while ($a <= $scripts)
lowercase $scripts[$a]
if ($scripts[$a] = "plocked.ts")
setdelaytrigger plock :plock 5000
pause
:plock
load "dd_fed_killa.ts"
end
add $a 1
end
goto :setTriggers

[/Edit]

_________________
               / Promethius / Enigma / Wolfen /

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


Thu Jul 29, 2010 6:42 pm
Profile ICQ
Commander
User avatar

Joined: Fri Aug 20, 2004 2:00 am
Posts: 1801
Location: Outer Rims
Unread post Re: ProRelog 2.1 .TS Use at your OWN risk
Code works fine Promethius. Daala and I incorporated your code into one we already had, since you had a few more triggers than we did. Even learned a new thing here and there.

Thanks for posting this.

_________________
-Thrawn

But risk has always been an inescapable part of warfare.

--

Knight to Queen's Bishop 3


Fri Jul 30, 2010 11:18 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

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