Re: Getting an Error Code from TWX Proxy then it shuts down
LoneStar wrote:
I played with processin a long time ago, I can't remember the details except to say that there was probably a good reason I stopped playing with it.
I was going to suggest that you use the EventTrigger to determine if a script was still running:
Code:
setEventTrigger stopped :stopped "SCRIPT STOPPED" "somescript.ts"
alternatively, you can have your mainbot use the twx listActiveScripts to determine if a script is still running.
Good idea LoneStar. I use the EventTrigger a bit, and if I'm just wanting to wait for one script to finish before proceeding then that's what I will probably use. Actually I'll probably try to set everything up using includes.
I put in a while loop and it didn't like that, I sometimes still struggle getting while loops to work right, I think I don't get the logic flow or whatever you call it right in while loops. Ran away on me.
Changed it to an IF statement and added in an else for halting the script, and it worked fine. Iterated 10 times, echoing my text from both scripts, and then the process halted normally.
+++
I was just wanting to test this to see if it worked, and it seems to work OK with some precautions. Back when I was actually playing and scripting, I used to write these huge scripts because I wasn't good with the include function or EventTrigger at that time. I'm sure a few questions in the old twxproxy.com forums and I would have been on top of things, everyone was great with helping you learn to script. Now I can use includes a bit better, but I can see where this would have been a huge help to me 10 years ago.
Back then I had this huge script for managing my assets in the base. It pretty much handled everything you would need to do in your sectors, for the whole bubble. But it had a lot of parts to do all of that, and it was big. And single use.
And I remember thinking, if I could just break that down into modules, I could probably save myself a ton of coding in later scripts. I got out of the game before I progressed on with either using EventTrigger or includes. So I kind of did this to see if I could have used a technique like that to do modular scripts without using include, and I can see where this might have worked.
Plus I was kinda bored today and before I knew it I was in my local game and firing up Notepad++
Edit : Nothing in what I said above was meant to imply I don't think the scripters here aren't good about helping you with problems so you can learn to script better, I wouldn't want anyone to misunderstand what I was saying. Your post being a good example LoneStar