View unanswered posts | View active topics It is currently Tue Apr 21, 2026 2:01 pm



Reply to topic  [ 9 posts ] 
 TWX Script Hangs 
Author Message
Commander
User avatar

Joined: Fri Aug 20, 2004 2:00 am
Posts: 1801
Location: Outer Rims
Unread post TWX Script Hangs
I run a script for our TradeWars Academy game where a fedsweeper script runs. The OCSBot is logged in via admin, switches to TW mode, logs into the game, runs the OCSBot script. Then it logs out, goes to tedit mode, and runs a fedsweeper function. Once done, it returns to TW mode and re-enters the game, etc.

My issue is once in a while the script when going to tedit mode hangs at the Password? prompt. I have the script set to enter the tedit password, but every once in a while that is EXACTLY where it hangs. I'm trying to understand why that is. I can restart the script and then it is fine. I run the TWGS on one machine, and the OCSBot is on a different machine. I was thinking it's a network issue with a dropped packet, but was curious if any of the TWX/script gurus might know why.

_________________
-Thrawn

But risk has always been an inescapable part of warfare.

--

Knight to Queen's Bishop 3


Mon Mar 02, 2009 10:47 pm
Profile
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Re: TWX Script Hangs
Thrawn wrote:
I run a script for our TradeWars Academy game where a fedsweeper script runs. The OCSBot is logged in via admin, switches to TW mode, logs into the game, runs the OCSBot script. Then it logs out, goes to tedit mode, and runs a fedsweeper function. Once done, it returns to TW mode and re-enters the game, etc.

My issue is once in a while the script when going to tedit mode hangs at the Password? prompt. I have the script set to enter the tedit password, but every once in a while that is EXACTLY where it hangs. I'm trying to understand why that is. I can restart the script and then it is fine. I run the TWGS on one machine, and the OCSBot is on a different machine. I was thinking it's a network issue with a dropped packet, but was curious if any of the TWX/script gurus might know why.


I have ran into strange issues with T-Edit scripting that "shouldn't" happen. I would check the triggers that are active at that point to start with. It may be looking for something that isn't there. I've had to use waitfor a lot in T-Edit where I don't have to use it in normal game scripting - "shouldn't" be a difference I would think.

_________________
               / Promethius / Enigma / Wolfen /

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


Tue Mar 03, 2009 1:02 am
Profile ICQ
Commander

Joined: Sun Feb 25, 2001 3:00 am
Posts: 1838
Location: Guam USA
Unread post Re: TWX Script Hangs
That is probably the exact problem ..
Use waitfor

That is the only way I've gotten the password issue resolved.
refer to my 14_login.ts script for sysops

I go to and from admin to in game and back many times without issues anymore.

_________________
TWGS V2 Vids World on Guam Port 2002
Telnet://vkworld.ddns.net:2002
Discord @ DiverDave#8374
Vid's World Discord

Founding Member -=[Team Kraaken]=- Ka Pla

Image
Winners of Gridwars 2010
MBN Fall Tournament 2011 winners Team Kraaken
Undisputed Champions of 2019 HHT Just for showing up!

The Oldist , Longist Running , Orginal Registered Owner of a TWGS server :
Vids World On Guam


Tue Mar 03, 2009 3:51 am
Profile WWW
Gameop
User avatar

Joined: Tue Sep 25, 2007 7:27 pm
Posts: 530
Location: Long Island
Unread post Re: TWX Script Hangs
I also have encountered this issue sometimes with Sysbot. I have a workaround in mind, just not gotten a chance to code it yet... put a delaytrigger in when the script starts an iteration, make it maybe twice as long as the script normally takes to run, and have it reset at each iteration. If the trigger hits, the script is hung, so I drop the connection and restart the script. This happens even when the TWX is running on the same box as the TWGS.

_________________
If you have a building game, they will come...

Proud Sysop of ICE9 TWGS
Home of Building and Non Regulated Games
http://www.oregonsouth.com/ice9
telnet://ice9-tw.com:2002


Tue Mar 03, 2009 9:40 am
Profile
Commander
User avatar

Joined: Fri Aug 20, 2004 2:00 am
Posts: 1801
Location: Outer Rims
Unread post Re: TWX Script Hangs
Promethius wrote:
I have ran into strange issues with T-Edit scripting that "shouldn't" happen. I would check the triggers that are active at that point to start with. It may be looking for something that isn't there. I've had to use waitfor a lot in T-Edit where I don't have to use it in normal game scripting - "shouldn't" be a difference I would think.


Agreed. Checked and managed to locate the trigger that it was "waiting" on. Managed to fix that. Also noticed that I had two triggers waiting on the exact same thing and managed to fix that.

Vid Kid wrote:
That is probably the exact problem ..
Use waitfor

That is the only way I've gotten the password issue resolved.
refer to my 14_login.ts script for sysops

I go to and from admin to in game and back many times without issues anymore.


I took a look at your 14_login.ts script and liked what you did for the admin login. I used the same method as you had and so far no issues now. If you do not mind, I'd like to incorporate that permanately into my ScoreKeeper script to avoid any further issues.

V'Ger wrote:
I also have encountered this issue sometimes with Sysbot. I have a workaround in mind, just not gotten a chance to code it yet... put a delaytrigger in when the script starts an iteration, make it maybe twice as long as the script normally takes to run, and have it reset at each iteration. If the trigger hits, the script is hung, so I drop the connection and restart the script. This happens even when the TWX is running on the same box as the TWGS.


We had a similar instance too with that, but it has been fine on my end now. I believe you gave Daala a hand with the issue.

Appreciate the help guys.

_________________
-Thrawn

But risk has always been an inescapable part of warfare.

--

Knight to Queen's Bishop 3


Tue Mar 03, 2009 11:19 pm
Profile
Veteran Op

Joined: Tue Nov 28, 2006 4:04 pm
Posts: 5025
Unread post Re: TWX Script Hangs
It's probably because it misses something occasionally. A few waitFor commands could slow it down enought to cure this problem since it's not speed you are looking for here.


Wed Mar 04, 2009 7:17 am
Profile
Gameop
User avatar

Joined: Tue Sep 25, 2007 7:27 pm
Posts: 530
Location: Long Island
Unread post Re: TWX Script Hangs
Thrawn wrote:

V'Ger wrote:
I also have encountered this issue sometimes with Sysbot. I have a workaround in mind, just not gotten a chance to code it yet... put a delaytrigger in when the script starts an iteration, make it maybe twice as long as the script normally takes to run, and have it reset at each iteration. If the trigger hits, the script is hung, so I drop the connection and restart the script. This happens even when the TWX is running on the same box as the TWGS.


We had a similar instance too with that, but it has been fine on my end now. I believe you gave Daala a hand with the issue.

Appreciate the help guys.


I tightened it up, and that helped, but maybe once every 7-10 days it will still hang at the password prompt... just have been too lazy to fix it, maybe when I add the other sysbot features that I want to add.

_________________
If you have a building game, they will come...

Proud Sysop of ICE9 TWGS
Home of Building and Non Regulated Games
http://www.oregonsouth.com/ice9
telnet://ice9-tw.com:2002


Wed Mar 04, 2009 11:19 am
Profile
Gameop
User avatar

Joined: Thu Mar 08, 2001 3:00 am
Posts: 886
Location: USA
Unread post Re: TWX Script Hangs
i've had this problem too and i think i know why it happens. the problem is that behind the scenes twgs.exe is actually handing off responsibility for the user input to tw2002.exe (or tedit.exe?) and if you time it just right when you send your password, it falls between the cracks and neither process catches it. using the waitfor ensures that you're fully in tw2002.exe before you send the password.

_________________
twgs : telnet://twgs.thereverend.org:5023
web : http://www.thereverend.org
games : http://www.thestardock.com/twgssearch/i ... verend.org
helper : http://svn.thereverend.org:8080/revhelper/


Wed Mar 04, 2009 8:41 pm
Profile
Commander
User avatar

Joined: Fri Aug 20, 2004 2:00 am
Posts: 1801
Location: Outer Rims
Unread post Re: TWX Script Hangs
the reverend wrote:
i've had this problem too and i think i know why it happens. the problem is that behind the scenes twgs.exe is actually handing off responsibility for the user input to tw2002.exe (or tedit.exe?) and if you time it just right when you send your password, it falls between the cracks and neither process catches it. using the waitfor ensures that you're fully in tw2002.exe before you send the password.


Thanks Rev. I was going to ask that very thing, so I made sure that I have the WaitFor in place to avoid the problem. So far so good, no hanging in the last 8 hours solid.

_________________
-Thrawn

But risk has always been an inescapable part of warfare.

--

Knight to Queen's Bishop 3


Wed Mar 04, 2009 10:14 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

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