View unanswered posts | View active topics It is currently Sat Apr 25, 2026 7:33 pm



Reply to topic  [ 10 posts ] 
 Stops duplicate script subroutine 
Author Message
Commander
User avatar

Joined: Wed May 03, 2006 2:00 am
Posts: 1722
Location: USA
Unread post 
content edited.


Tue Jan 23, 2007 3:57 am
Profile ICQ YIM
Captain
User avatar

Joined: Sat Jun 18, 2005 2:00 am
Posts: 2214
Location: USA
Unread post 
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
Profile ICQ WWW
Commander
User avatar

Joined: Wed May 03, 2006 2:00 am
Posts: 1722
Location: USA
Unread post 
content edited


Tue Jan 23, 2007 8:02 pm
Profile ICQ YIM
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post 
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
Image


Tue Jan 23, 2007 10:34 pm
Profile ICQ WWW
Commander
User avatar

Joined: Wed May 03, 2006 2:00 am
Posts: 1722
Location: USA
Unread post 
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
Image
Jesus wounldn't Subspace Crawl


Tue Jan 23, 2007 11:45 pm
Profile ICQ YIM
Commander
User avatar

Joined: Wed May 03, 2006 2:00 am
Posts: 1722
Location: USA
Unread post 
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
Image
Jesus wounldn't Subspace Crawl


Sat Feb 03, 2007 7:33 pm
Profile ICQ YIM
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post 
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
Image


Sat Feb 03, 2007 10:11 pm
Profile ICQ WWW
Commander
User avatar

Joined: Wed May 03, 2006 2:00 am
Posts: 1722
Location: USA
Unread post 
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
Image
Jesus wounldn't Subspace Crawl


Sat Feb 03, 2007 10:23 pm
Profile ICQ YIM
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post 
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
Image


Sat Feb 03, 2007 11:48 pm
Profile ICQ WWW
Commander
User avatar

Joined: Wed May 03, 2006 2:00 am
Posts: 1722
Location: USA
Unread post 
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
Image
Jesus wounldn't Subspace Crawl


Sun Feb 04, 2007 1:56 am
Profile ICQ YIM
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

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