[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Help with a script

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Help with a script
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Bakarus   (17 posts)  [Biography] bio
Date Mon 25 Jun 2012 05:22 PM (UTC)  quote  ]
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.
[Go to top] top

Posted by Bakarus   (17 posts)  [Biography] bio
Date Mon 18 Jun 2012 01:50 AM (UTC)  quote  ]
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 :)
[Go to top] top

Posted by Bakarus   (17 posts)  [Biography] bio
Date Sun 17 Jun 2012 10:02 PM (UTC)  quote  ]
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.
[Go to top] 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.


655 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]