|
|
posted: 04/20/2009 at 01:43 PM
|
Post #1
|
|
Daala and I have been working on our ScoreKeeper script and another "in-house" script. I am having an issue on a random occurrance where the ScoreKeeper script is hanging. What happens is the ScoreKeeper enters the game, and at the game prompt it sends H at the "Enter your choice:". The issue is once in a while it hangs after the welcome screen is displayed and it sits at the "[Pause] - [Press Space or Enter to continue]". I check it and have to terminate the script and restart. It's not happening all the time, just on occassion in random games, and I can't figure out for the life of me why this is happening. Here is a snip of where the ScoreKeeper sends the game letter, but ends up hanging at the prompt:
<snip>
send $gameletter[$i]
waitfor "[Pause] - [Press Space or Enter to continue]"
send "*"
waitfor "Enter your choice: "
gosub :loadscores
<endsnip>
I have another script that does a sweeper function, removing figs from a determined number of sectors. I use the local/global password and it too sometimes hangs at the Password? prompt when switching to tedit mode. Again it happens on random games, not at one specific and not all the time. Sometimes it will run 24 hours then it hiccups, other times it happens after a few hours.
In case one is wondering, I am running four instances of TWXProxy, all four on different ports. One is the OCSBot, one is ScoreKeeper, and one is another script we designed specifically for our needs. OCSBot and the third script never hang or anything and run 24/7 with no issues. It's the ScoreKeeper that hangs at the above mentioned prompt, and the fourth instance that runs the sweeper hangs at the Password? prompt.
edited by: Thrawn on 04/20/2009 at 01:44 PM
|
|
ElderProphet
TWX Development Team
Joined: Mar 2005
|
|
|
posted: 04/23/2009 at 09:47 PM
|
Post #2
|
|
Two pointers...
First, it could possibly be an ANSI code in the middle of that line of text that is screwing you up. I have an ANSI parsing script that you could leave running, and when it hangs, have a look at the CURRENTANSILINE as displayed by my script.
Second, if you know where it is hanging, create a delay trigger along with your text trigger, so that if the text trigger doesn't fire within a certain amount of time, the delay trigger will.
Let us know,
+EP+
|
Haggle Blog-> http://jroller.com/page/ElderProphet
|
|
|
posted: 04/26/2009 at 10:40 AM
|
Post #3
|
|
Thrawn is on deployment at the moment, and has asked me to look after this issue in his absense.
I noticed that he was using the "waiton" and changed it to "setTextTrigger" instead. I also took your suggestion and added the delay trigger along with the text trigger. That has fixed the issue and now everything runs solid with no hang-ups.
Thank you for the help.
|
|
|
posted: 05/08/2009 at 01:36 PM
|
Post #4
|
|
Appreciate Harkov looking after this project during my absence.
Unfortunately EP I still have the same issue. What has been done is a delay trigger was added with the Text trigger as Harkov pointed out. I still get the occassional hangup. The ZOC terminal is connected to the TWXProxy instance, but when I see the "[Press Enter to continue]" nothing happens when Enter is pressed. I have to disconnect and reconnect the instance that runs the ScoreKeeper.
I suppose there is another possibility. I was thinking that perhaps it's a network issue on my end as it seems to hang right around a 2 hour window each day and it's during a key process being run on the network. It's not just this particular script, as I have had another script also hiccup around the same time. Our two instances of the OCSBot run 24/7 with no issues at all. That prompted me to write an application to terminate the TWXProxy instance of the ScoreKeeper and restart it and reconnect (automated program). That has been our solution.
|
|
LoneStar

Joined: Jul 2006
|
|
|
posted: 05/11/2009 at 08:54 PM
|
Post #5
|
|
<snip>
send $gameletter[$i]
waitfor "[Pause] - [Press Space or Enter to continue]"
send "*"
waitfor "Enter your choice: "
gosub :loadscores
<endsnip>
Not sure why you're using that WaitFor. Try This:
Send $GameLetter[$I]
SetTextTrigger PAUSE1 :PAUSE "[Pause]"
SetTextTrigger PAUSE2 :PAUSE "[Press Space or Enter to continue]"
SetDelayTrigger PAUSED :PAUSD 2000
Pause
:PAUSD
KillAllTriggers
# ....do something
:PAUSE
KillAllTriggers
Send "*"
# ....Continue
|
The Joker's Always Smiling in Every Hand That's De
|
|
|
posted: 05/14/2009 at 10:22 PM
|
Post #6
|
|
Works better LoneStar. Thanks for the insight.
|
|
|
|