The Dink Network

Reply to Re: To kill a running script

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
March 15th 2015, 01:31 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Do you have a script number of the script you want to kill? In those cases I'd do something like adding a self-destruct button:

// stuff.c
void main( void )
{
  // Do stuff here. But at some point, I need to be killed!
}

void selfdestruct( void )
{
  // Self-destruct button.
  kill_this_task();
}


// killer.c
void main( void )
{
  // There are other ways to get at a script number. I believe sp_script also returns one.
  int &script = spawn("stuff");
}

void talk( void )
{
  // Or whenever. Just make sure that you somehow have the script number.
  run_script_by_number(&script,"selfdestruct");
}