Deleting triggers

Posted by Shadowfyr on Sat 25 Aug 2001 11:33 PM — 5 posts, 17,234 views.

USA #0
I am currently using v3.04, so this may be fixed by now..

I have two aliases set up. One to create a trigger and one to remove it. I have to do it this way, since I need to be able to change the name of my target, but I also need to shut off the trigger fast. Disabling it would possibly work, but then I would still have to edit/remove it manually to change the target.

The first script command sets up the trigger correctly. However, typing the alias to delete it seems to execute the script, but when I look in the triger list, the trigger is still in the list and appears to still be enabled. I am not sure if this is only an artifact though or if the trigger still is active, since in the process of trying to test this the network my mud is on went down. It does appear however that the trigger was never removed.
Australia Forum Administrator #1
Try checking the status from the deletetrigger. This will indicate if it failed for some reason.

eg.


dim i

i = World.DeleteTrigger ("my_trigger")

world.note "trigger delete status was " & i


The status should be zero. If it isn't it failed. The meanings of the return codes are on the page:


http://www.gammon.com.au/scripts/function.php?action=errors


USA #2
I'll try that. As soon as the mud comes back online. It's located on a university server in sweden and there system tend to blow up once in a while. At the moment it is doin this:

27 443 ms 358 ms 363 ms du-gw.du.se [130.242.201.98]
28 532 ms 482 ms 342 ms falun-borlange-1-fe1-0-...
29 401 ms 358 ms 363 ms du-gw.du.se [130.242.201.98]
30 426 ms 363 ms 357 ms falun-borlange-1-fe1-0-...
31 427 ms 612 ms 367 ms du-gw.du.se [130.242.201.98]
32 364 ms 357 ms 331 ms falun-borlange-1-fe1-0-...
33 356 ms 357 ms 363 ms du-gw.du.se [130.242.201.98]
34 343 ms 367 ms 347 ms falun-borlange-1-fe1-0-...

Which is kind of interesting, but not real helpful. ;)

For you info though the Aliases and script are:
Alias: srejuv *
Label: SRejuv
Script: SRejuv

Alias: urejuv
Label: DRejuv
Script: DRejuv

sub SRejuv (thename, theoutput, thewildcards)
dim sTarget
dim sTcommand
sTarget = Trim (thewildcards (1))
sTcommand = "rejuvenate " & sTarget
world.addtrigger "Rejuv","*You feel a rush of en*",sTcommand,1,-1,0,"",""
end sub

sub DRejuv
world.DeleteTrigger "Rejuv"
end sub

I can't see why the second one won't work. :(
Australia Forum Administrator #3
I can see one problem - I'm surprised you don't get an error message.

The second script still needs the argument list, even if it doesn't use it.

ie.


sub DRejuv (thename, theoutput, thewildcards)
world.DeleteTrigger "Rejuv"
end sub



USA #4
Seems to have fixed the problem. ;) Though it may have been something in version 3.04 too. I downloaded the 3.16 upgrade and installed it, so... Thanks.