and something else I did.. I love playing around with this thing btw!
I'm using vista so I can't put all my rail files into a Rails folder. So I got all these rail files in my easyuo folder with all my script.
I hate cluter! So I modified the Rail Engine so I could have more than one rail in a Rails.txt file and use something like this..
call %railsubs TM_LoadRail c:\rails.txt railname
if %3 <> N/A ;======================
{
set !filename %3 <---- Added this..
set %filename %3
} ;=======================
else
{
set !filename %2
set %filename %2
}
set !temp_LPC #LPC
set !idx 0
while !filename . !idx <> N/A
{
set !filename . !idx N/A
set !idx !idx + 1
}
set #LPC 10000
set %fileout0 N/A
if %3 <> N/A ;===============================
call %2 %3 <--- and this...
else ;===============================
call !filename
if %fileout0 = N/A
Now Instead of loading a bunch of different rails from different files I use one file
Cotton_Rails.txt
gosub %1
exit
sub Bank2Cotton
set %fileout0 Bank2Cotton3710446611710?0NONE-1011446211680?0NONE-1012445811650?0NONE-1013445811600?0NONE-1014445811540?0NONE-1015445811480?0NONE-1016445811430?0NONE-1017445811370?0NONE-1018445811320?0NONE-101044581124000None0019445611240Teleporter_Gate40NONE-10110445111260?0NONE-10111445111300?0NONE-10112444611310?0NONE-10113444211310?0NONE-10114443711340?0NONE-10115443411390?0NONE-10116443911400?0NONE-10117444311400?0NONE-10118444311375?40NONE-10119449014780?0NONE-10120449414840?0NONE-10121450014860?0NONE-10122450514860?0NONE-10123451114860?0NONE-10124451714860?0NONE-10125452214860?0NONE-10126452814860?0NONE-10127453314860?0NONE-10128453814861?0NONE-10129454314900?0NONE-10130454814860?0NONE-10131455314850?0NONE-10132455814860?0NONE-10133456414860?0NONE-10134457014860?0NONE-10135457014820Cotton_Gate40NONE-10136457014770?0NONE-10
set %callbackfunctions c:\easyuo\callbacks.txt
return
sub Cotton2Bank
set %fileout0 Cotton2Bank3610457014770?0NONE-1011457014800?40NONE-1012457014850?0NONE-1013456514860?0NONE-1014456014860?0NONE-1015455414860?0NONE-1016455014860?0NONE-1017454614900?0NONE-1018454114930?0NONE-1019453614930?0NONE-10110452914930?0NONE-10111452414930?0NONE-10112451914930?0NONE-10113451414930?0NONE-10114450914880?0NONE-10115450514840?0NONE-10116450014840?0NONE-10117449614840?0NONE-10118449614803?0NONE-10119449614798?0NONE-101204496147511?40NONE-10123443911280?0NONE-10124444211320?0NONE-10125444711320?0NONE-10126445111300?0NONE-10127445411240?40NONE-10128445811240?0NONE-10129446111290?0NONE-10130446111340?0NONE-10131446111390?0NONE-10132446111430?0NONE-10133445611480?0NONE-10134445611530?0NONE-10135445611590?0NONE-10136445611640?0NONE-10137446111700?0NONE-10138446611720?0NONE-10
set %callbackfunctions c:\easyuo\callbacks.txt
return
Now when I got to load my rails I just use this..
set %railsubs TM_RailEngine_Server.txt ;Had to do some renaming.. Ha!
set %railfile Cotton_Rails.txt
set %rail1 Bank2Cotton
set %rail2 Cotton2Bank
set %rails 2
gosub SetupRailServer
;============================
code..
;============================
sub SetupRailServer
call %railsubs TM_GetServerMode ; SERVER, SUBROUTINE, or *blank*
if #RESULT = SERVER
{
call %railsubs TM_PingServer
if #RESULT = PONG ; server is alive, must reset it and were good to go.
{
call %railsubs TM_ServerInitialize ; still need to break a move if in progress....
}
else
{
display ok Namespace is initialized, but server is not running. Please restart server.
call %railsubs TM_Close
stop
}
goto skipsetupcheck
}
if #RESULT = SUBROUTINE
{
display ok You were running in Subroutine mode, please start a server.
call %railsubs TM_Close
stop
}
display ok No server was found, please start a server session.
call %railsubs TM_Close
stop
skipsetupcheck:
for %i 1 %rails
{
call %railsubs TM_LoadRail %railfile %rail . %i
if #RESULT = #TRUE
{
display ok Error loading , #SPC , %rail . %i
stop
}
wait 2s
}
return
I still have to copy and paste my rails into the Rails.txt file, but after that I can delete them and just have one Rails file per scipt.
EDIT:
I'm sure most people figure this out, but you can put your rails at the bottom of your script, and add this to the top. That way you don't even have to use a separate rail file. Just call the script it's self..
if %1 <> N/A
{
gosub %1
exit
}
;=========================
script...
;=========================
;=========================
; Rails
;=========================
sub Bank2Cotton
set %fileout0 Bank2Cotton3710446611710?0NONE-1011446211680?0NONE-1012445811650?0NONE-1013445811600?0NONE-1014445811540?0NONE-1015445811480?0NONE-1016445811430?0NONE-1017445811370?0NONE-1018445811320?0NONE-101044581124000None0019445611240Teleporter_Gate40NONE-10110445111260?0NONE-10111445111300?0NONE-10112444611310?0NONE-10113444211310?0NONE-10114443711340?0NONE-10115443411390?0NONE-10116443911400?0NONE-10117444311400?0NONE-10118444311375?40NONE-10119449014780?0NONE-10120449414840?0NONE-10121450014860?0NONE-10122450514860?0NONE-10123451114860?0NONE-10124451714860?0NONE-10125452214860?0NONE-10126452814860?0NONE-10127453314860?0NONE-10128453814861?0NONE-10129454314900?0NONE-10130454814860?0NONE-10131455314850?0NONE-10132455814860?0NONE-10133456414860?0NONE-10134457014860?0NONE-10135457014820Cotton_Gate40NONE-10136457014770?0NONE-10
set %callbackfunctions c:\easyuo\callbacks.txt
return
sub Cotton2Bank
set %fileout0 Cotton2Bank3610457014770?0NONE-1011457014800?40NONE-1012457014850?0NONE-1013456514860?0NONE-1014456014860?0NONE-1015455414860?0NONE-1016455014860?0NONE-1017454614900?0NONE-1018454114930?0NONE-1019453614930?0NONE-10110452914930?0NONE-10111452414930?0NONE-10112451914930?0NONE-10113451414930?0NONE-10114450914880?0NONE-10115450514840?0NONE-10116450014840?0NONE-10117449614840?0NONE-10118449614803?0NONE-10119449614798?0NONE-101204496147511?40NONE-10123443911280?0NONE-10124444211320?0NONE-10125444711320?0NONE-10126445111300?0NONE-10127445411240?40NONE-10128445811240?0NONE-10129446111290?0NONE-10130446111340?0NONE-10131446111390?0NONE-10132446111430?0NONE-10133445611480?0NONE-10134445611530?0NONE-10135445611590?0NONE-10136445611640?0NONE-10137446111700?0NONE-10138446611720?0NONE-10
set %callbackfunctions c:\easyuo\callbacks.txt
return