I think I may have found a way to resolve the server line issue. After the 'call %railsubs TM_GetStatus' results in an Idle #Result, I compare the current waypoint to the known start and end endpoints of the currently running rail. Knowing the character is at neither point, I call the TM_RunRail function with "Present" as the rail start, then back to the TM_GetStatus line. All is good after that.
I have come across an issue and I hope it's just me. Sporadically throughout any rail, the RE will return an IDLE status in the window, but the character is still running the rail. I can't pause the WIT script to find the error, as it seems the RE is in an infinate loop at line 84. The lines reads:
while #TRUE
{
set !TM_temp !TM_RailTotal + 1
menu set EUOEdit1 !TM_temp
menu set EUOEdit2 !TM_temp_rail
menu set EUOEdit3 !TM_temp_index
menu set EUOEdit5 !TM_ServerCommand
menu set EUOEdit6 !TM_Status
if !temp_rails <> !TM_RailTotal
{
wait 40
menu delete EUOListBox1
menu List Create EUOListBox1 208 4 141 141
set !temp_rails !TM_RailTotal
for !i 0 !TM_RailTotal
menu list add EUOListBox1 !TM_RailName . !i
}
if !TM_ServerCommand = RUNRAIL
{
set #LPC 100
gosub TM_DoRail NULL !TM_temp_rail !TM_temp_index !TM_temp_steps !TM_temp_direction
set #LPC 10
if #RESULT = #TRUE
{
set !TM_Status ERROR
}
else
{
set !TM_Status IDLE
}
set !TM_ServerCommand NONE
}
if !temp_ping = PING ; ping handler.
{
set !temp_ping PONG
}
if !TM_menuvisible = #TRUE && !TM_menu_command = HIDE
{
set !TM_menuvisible #FALSE
menu hide
}
if !TM_menuvisible = #FALSE && !TM_menu_command = SHOW
{
set !TM_menuvisible #TRUE
menu show
}
}
When I do pause the WIT script, I tab over to the tool_railengine30l tab and see that I'm continuously going over this block of code. I'm wondering if my SS_Globals script has anything to do with it, and further yet, if I should put TM_Close somewhere in my script that is really needed. My SS_Globals script is running in a separate tab just as the RE, and too is using a global namespace to communicate with my WIT script, specifically scanning for gumps in a loop.