Hi,
Still quite new to coding in lua and MUSH itself, just wanted to see if I could get a bit of help with something. I'm trying to write a script which will automatically target things for me, but I want to write a few exceptions into the script. My current version looks a little like this:
<triggers>
<trigger
expand_variables="y"
group="Chade"
ignore_case="y"
keep_evaluating="y"
match="^\"(.+?)\d+\""
name="ihbash_"
regexp="y"
send_to="12"
sequence="100"
>
<send>if "%1" == "pony" then
display.Info("NO TARGETS HERE")
EnableTrigger("ihbash_", false)
else
Execute("t %1;bashon")
EnableTrigger("ihbash_", false)
end
</send>
</trigger>
</triggers>
This works relatively well for my purposes but has a few problems and I want to make it work better.
This is a quick example of what the NPC/Item list looks like:
"gatekeeper42866" a hooded gatekeeper
"pony36065" a pale blue, sleek pony with feathered wings
Number of objects: 2
I own the pony which is why I don't want it targetted. In the above situation the script works fine, but if I enter the room and then an NPC follows me in I encounter problems, the pony becomes the first NPC on the list which prevents the auto-targetter working.
"pony36065" a pale blue, sleek pony with feathered wings
"gatekeeper42866" a hooded gatekeeper
Number of objects: 2
The final problem I have is when inanimate objects are on the list, as 9 times out of 10 they've always first on the list.
"seal47870" a circular seal
"gatekeeper42866" a hooded gatekeeper
"pony36065" a pale blue, sleek pony with feathered wings
Number of objects: 3
If I attempt to target and attack the seal, as it's an item I get one of three messages:
Ahh, I am truly sorry, but I do not see anyone by that name here.
You detect nothing here by that name.
Nothing can be seen here by that name.
Anyone have any suggestions as to what I could do to improve functionality?
Cheers,
Chade
Still quite new to coding in lua and MUSH itself, just wanted to see if I could get a bit of help with something. I'm trying to write a script which will automatically target things for me, but I want to write a few exceptions into the script. My current version looks a little like this:
<triggers>
<trigger
expand_variables="y"
group="Chade"
ignore_case="y"
keep_evaluating="y"
match="^\"(.+?)\d+\""
name="ihbash_"
regexp="y"
send_to="12"
sequence="100"
>
<send>if "%1" == "pony" then
display.Info("NO TARGETS HERE")
EnableTrigger("ihbash_", false)
else
Execute("t %1;bashon")
EnableTrigger("ihbash_", false)
end
</send>
</trigger>
</triggers>
This works relatively well for my purposes but has a few problems and I want to make it work better.
This is a quick example of what the NPC/Item list looks like:
"gatekeeper42866" a hooded gatekeeper
"pony36065" a pale blue, sleek pony with feathered wings
Number of objects: 2
I own the pony which is why I don't want it targetted. In the above situation the script works fine, but if I enter the room and then an NPC follows me in I encounter problems, the pony becomes the first NPC on the list which prevents the auto-targetter working.
"pony36065" a pale blue, sleek pony with feathered wings
"gatekeeper42866" a hooded gatekeeper
Number of objects: 2
The final problem I have is when inanimate objects are on the list, as 9 times out of 10 they've always first on the list.
"seal47870" a circular seal
"gatekeeper42866" a hooded gatekeeper
"pony36065" a pale blue, sleek pony with feathered wings
Number of objects: 3
If I attempt to target and attack the seal, as it's an item I get one of three messages:
Ahh, I am truly sorry, but I do not see anyone by that name here.
You detect nothing here by that name.
Nothing can be seen here by that name.
Anyone have any suggestions as to what I could do to improve functionality?
Cheers,
Chade