| Author |
Message |
|
Parrothead
Commander
Joined: Wed May 03, 2006 2:00 am Posts: 1722 Location: USA
|
content edited.
|
| Tue Jan 23, 2007 3:57 am |
|
 |
|
RexxCrow
Captain
Joined: Sat Jun 18, 2005 2:00 am Posts: 2214 Location: USA
|
Just as another option of doing this, here is code similar
to what I used to overcome a problem I encountered in the making of the POAN Monitor
project...
Code: IF $openREPLACEW/SCRIPTNAME>0
HALT
END
setVar $openREPLACEW/SCRIPTNAME 1
...BEGIN CODE...
_________________ Your reliance upon subjective IRM's, subjugates you through utter omission, obfuscation, and distortion of fact! Don't mess with me, I will 26 U.S.C. ยง 7212(a) your IRS!
|
| Tue Jan 23, 2007 7:12 pm |
|
 |
|
Parrothead
Commander
Joined: Wed May 03, 2006 2:00 am Posts: 1722 Location: USA
|
content edited
|
| Tue Jan 23, 2007 8:02 pm |
|
 |
|
Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA
|
My only concern would be if you accidently terminate the script you're running from the list, laff.
I usually prefer to go to included subroutines instead of full scripts. Then I write scripts from the routines. Like my newer holotorp stuff, holokilla stuff, density torping stuff, is all part of a set of includes instead of a seperate script.
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com
|
| Tue Jan 23, 2007 10:34 pm |
|
 |
|
Parrothead
Commander
Joined: Wed May 03, 2006 2:00 am Posts: 1722 Location: USA
|
Agreed I do 2 background scripts only ..one is a simple fighit tracker that Caretaker wrote that we added FIGSEC too for constant updates and the other is a quickstats script that any other script can call.Has one or 2 other useful functions also.But more the most part includes is the way to go.
The snippet only checks for duplicates and terminates them i.e. 2 ck_saveme.cts or whatever.
_________________ Coconut Telegraph (ICQ)#586137616 Team Speak3@ 220.244.125.70:9987 Founding Member -=[Team Kraaken]=- Winner of Gridwars 2010 - Ka Pla
 Jesus wounldn't Subspace Crawl
|
| Tue Jan 23, 2007 11:45 pm |
|
 |
|
Parrothead
Commander
Joined: Wed May 03, 2006 2:00 am Posts: 1722 Location: USA
|
Quote: My only concern would be if you accidently terminate the script you're running from the list, laff.
If you look at the subrountine closely you will find that that wont happen.
_________________ Coconut Telegraph (ICQ)#586137616 Team Speak3@ 220.244.125.70:9987 Founding Member -=[Team Kraaken]=- Winner of Gridwars 2010 - Ka Pla
 Jesus wounldn't Subspace Crawl
|
| Sat Feb 03, 2007 7:33 pm |
|
 |
|
Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA
|
I don't see how unless there's some designation for your current script in there that's not readily appearant.
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com
|
| Sat Feb 03, 2007 10:11 pm |
|
 |
|
Parrothead
Commander
Joined: Wed May 03, 2006 2:00 am Posts: 1722 Location: USA
|
if (($a <> $b) and ($scripts[$a] = $scriptsx[$b])) its in the math
this is meant to be run as a check apon loading a new scripts.
the new script that you load will be the last one therefore $a <> $b prevents self termination. the first copy of any duplicate script will be terminated and the loop will continue checking until there are no duplicates.
_________________ Coconut Telegraph (ICQ)#586137616 Team Speak3@ 220.244.125.70:9987 Founding Member -=[Team Kraaken]=- Winner of Gridwars 2010 - Ka Pla
 Jesus wounldn't Subspace Crawl
|
| Sat Feb 03, 2007 10:23 pm |
|
 |
|
Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA
|
That assumes that the last script you loaded is the one you're using. What if you're dealing with resident triggers and have loaded scripts after that? There's no special designation for the script you're currently using, so it is quite possible to self-terminate.
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com
|
| Sat Feb 03, 2007 11:48 pm |
|
 |
|
Parrothead
Commander
Joined: Wed May 03, 2006 2:00 am Posts: 1722 Location: USA
|
Only if you have 2 copies of it running in which case it will terminate the first copy. If I start a gridding script and it stalls then I start it again then the stalled first copy gets a force terminate command which is exactly what I want here. I can think of no instance where I would want 2 copies of the same script running.
_________________ Coconut Telegraph (ICQ)#586137616 Team Speak3@ 220.244.125.70:9987 Founding Member -=[Team Kraaken]=- Winner of Gridwars 2010 - Ka Pla
 Jesus wounldn't Subspace Crawl
|
| Sun Feb 04, 2007 1:56 am |
|
 |
|