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
➜ Back up target variable
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| This_Guy
(13 posts) Bio
|
| Date
| Thu 30 Dec 2010 04:02 AM (UTC) |
| Message
| I'm trying to build a variable that would feed my target variable a new target if the world sends me one of the following messages:
You do not see that individual here.
I do not recognize anything called that here.
You detect nothing here by that name.
How exactly would I go about this? | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Thu 30 Dec 2010 06:16 AM (UTC) |
| Message
| | What do you mean by "feed my target variable a new target"? What would the new target be? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| This_Guy
(13 posts) Bio
|
| Date
| Reply #2 on Thu 30 Dec 2010 06:27 AM (UTC) |
| Message
| | Say I kill a guy by the name of Dias, and i don't notice and someone name Ivellios is wailing on me. I want to be able to have someway to have Ivellios automatically targeted in case there is too much text coming at me to make anything out. | | Top |
|
| Posted by
| Manacle
(28 posts) Bio
|
| Date
| Reply #3 on Thu 30 Dec 2010 03:35 PM (UTC) |
| Message
| I think I'd find your particular goal a difficult one to meet. You might find it easier to conceptualize if you instead target the core of the problem.
I wouldn't think of this as a problem of switching variables, but one of tracking your combat opponents. Can you identify specific messages that would begin (or simply indicate continuing combat with) opponents and also their deaths/fleeing?
If those messages are fairly well defined, it'd be a reasonable task to create a plugin that would automatically cycle through your current combatants as you kill them one by one. You'll use a series of triggers that view combatants entering (or continuing) combat with you and send them to a function that adds each of them to an array. You'll have a series of triggers that capture your kills and removes those opponents from the array. When your current target is removed from the array, you'll choose your target again as the first element of that array. (A more crude but more direct method of selecting a new target is to have a third set of triggers on the messages you mentioned in your last post so that you only switch targets when you attempt to swing at something that doesn't exist. Actually, you could do away with the death triggers if you don't mind those messages after each and every kill).
It may be slightly more difficult to handle multiple combatants of the same name or description. | | Top |
|
| Posted by
| This_Guy
(13 posts) Bio
|
| Date
| Reply #4 on Thu 30 Dec 2010 06:40 PM (UTC) |
| Message
| | I have an echo set for opponent deaths, but if one flees or if there is a mob of them and i can't see which one is hitting me things tend to get nasty pretty quick | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #5 on Thu 30 Dec 2010 08:54 PM (UTC) |
| Message
| You could easily make a trigger that matches:
You do not see that individual here.
That could set the target variable to an empty string. That doesn't however tell you who the new target is.
Without knowing your triggers it is hard to be more specific, but assuming you have some sort of trigger that detects if you are being attacked, and sets the target variable to whoever is attacking you, then that should cut in shouldn't it? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | 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.
19,878 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top