|
Duindain Novice
Joined: 14 Feb 2003 Posts: 31 Location: Perth, Australia
|
Posted: Wed Mar 05, 2003 4:16 am
#say command from within a trigger |
heya me again ok this time got a trigger tracks names from an array it works fine goes thru tracks sucsessive names fine what isnt working is the output the mud will say one of the three trigger conditions you sense no trail means is here but cant trail
you cant sense a trail to it from here means is here and noone around by that name means not loaded the actual exact mud output is inside the triggers below that works ok so no need to stress that what doesnt work is this
{#sa @currarray is loaded quick runnnnnn!}
these statments echo to the screen find but the will not let this
currarray=%arrget( tracks, @let)
update the currarray variable within the trigger i have checked whether currarray is changing to the elements in the aray from outside the #sa command and it is but within the triggers it defualts to the last element in the array and will not change so for output i would get
array isnt loaded
spammed down the screen for the length of the array for each element in the array which isnt loaded basically only problem is that #sa @currarray is not letting the currarray varible to be updated well is not displaying it becuase it is being updated fine
i checked that with a #say @currarray outside of the
#trigger {You sense no trail.} {#sa @currarray is loaded quick runnnnnn!}
and it showed the right output which would be
isnt isnt loaded
this isnt loaded
a isnt loaded
great isnt loaded
example isnt loaded
anyway u get the picture heh
#var tracks %array(isnt,this,a,great,example,of,elements,in,a,array}
let=0
arraylength= %arrhigh( tracks)
#UNTIL (@let == @arraylength+1) {
currarray=%arrget( tracks, @let)
track %arrget( tracks, @let)
#trigger {You sense no trail.} {#sa @currarray is loaded quick runnnnnn!}
#trigger {You can't sense a trail to (*) from here.} {#sa @currarray it loaded quick runnnnnn!}
#TRIGGER {No-one around by that name.} {#sa @currarray isnt loaded}
#add let 1
} |
|
|
|
Duindain Novice
Joined: 14 Feb 2003 Posts: 31 Location: Perth, Australia
|
Posted: Wed Mar 05, 2003 4:09 pm |
bleh why noone reply heh
|
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Wed Mar 05, 2003 4:35 pm |
ok, i see one problem at least:
quote:
#UNTIL (@let == @arraylength+1) {
currarray=%arrget( tracks, @let)
track %arrget( tracks, @let)
#trigger {You sense no trail.} {#sa @currarray is loaded quick runnnnnn!}
#trigger {You can't sense a trail to (*) from here.} {#sa @currarray it loaded quick runnnnnn!}
#TRIGGER {No-one around by that name.} {#sa @currarray isnt loaded}
#add let 1
}
putting the #trigger command inside a loop will create 1 trigger for each time the loop executes. This is causing the spam, you have way too many triggers where you only want 1. Also, since you are creating the triggers the way you are (inside an alias?) the variable expansion on @currarray is performed before the trigger is made.
what you'll want to do is open the triggers window, delete all those triggers, and recreate just the ones you want. then, when you execute your track alias, put a #wait statement after the track command so that your @currarray variable doesn't zoom far ahead of the mud output. The final commands would look something like this:
#trigger {You sense no trail.} {#sa @currarray is loaded quick runnnnnn!}
#trigger {You can't sense a trail to (*) from here.} {#sa @currarray it loaded quick runnnnnn!}
#TRIGGER {No-one around by that name.} {#sa @currarray isnt loaded}
#alias trackall {
#var tracks %array(isnt,this,a,great,example,of,elements,in,a,array}
let=0
arraylength= %arrhigh( tracks)
#UNTIL (@let == @arraylength+1) {
currarray=%arrget( tracks, @let)
track %arrget( tracks, @let)
#wait
#add let 1
}
}
--------
moon.icebound.net:9000 |
|
|
|
Duindain Novice
Joined: 14 Feb 2003 Posts: 31 Location: Perth, Australia
|
Posted: Thu Mar 06, 2003 5:48 am |
kewl got it working now the spam wasent from mutiple triggers thou it was from not having #wa in there never knew u could put that in without an argument for time heh
thx :) |
|
|
|
|
|
|
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 vote in polls in this forum
|
|