Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Lua
➜ Help with a script
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Bakarus
(17 posts) Bio
|
Date
| Sun 17 Jun 2012 10:02 PM (UTC) |
Message
| I am wanting to make a script to search corpses after I kill them and then loot the items that have a chance to be on them after searching.
What I'd like to do is to count the number of corpses in the room, then search that many.
a typical room would have several types, like this:
The corpse of a mage is lying here.
(2) The corpse of an apprentice is lying here.
(3) The corpse of the janitor is lying here.
so i'd need to count the corpses, which would be 6, then have it search the 6 corpses, i.e. search corpse, search 2.corpse etc.
the items that can be found by searching are:
conditionals:
You find a blue orb hidden in the corpse
You find an ancient relic of unknown origin hidden in the corpse
You find a gem of true seeing hidden in the corpse
You find a Mana Stone hidden in the corpse
then i'd need to get the items, like get all.relic all.corpse if it was found.
any help would be appreciated, i've looked through the lua scripting docs, i suppose i could use a trigger when i look at the room, not sure how to count up the corpses thou. | Top |
|
Posted by
| Bakarus
(17 posts) Bio
|
Date
| Reply #1 on Mon 18 Jun 2012 01:50 AM (UTC) |
Message
| I could possibly make a trigger like:
The corpse of a * is laying here.
then I need to loop through the corpses in the room, Need to check lua docs for how to do a foreach or do/while loop putting them into an array or table i think it is in lua
then search each corpse in the collection, and doing a get all.item if anything is found.
Time to do some more reading :) | Top |
|
Posted by
| Bakarus
(17 posts) Bio
|
Date
| Reply #2 on Mon 25 Jun 2012 05:22 PM (UTC) |
Message
| I changed my approach, instead i just searched corpses incrementally until i got the error message there is not *.corpse here, then made triggers for having found the various item, and looted them according to the incrementor. If anyone wants a copy of the plugin, let me know. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
10,077 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top