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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Auto-Razing

Auto-Razing

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Rivius   (99 posts)  [Biography] bio
Date Thu 02 Sep 2010 01:43 AM (UTC)
Message
In one game I play, Lusternia, players are able to raise defenses such as magical shields and stat boosts, and indeed often do during combat.

Using the command raze <target> usually slashes away these defenses. If one does NOT do this, there can be some serious repercussions such as your attacks getting rebounded.

Now, I set up a targetting alias that sets up a specific target for use in other aliases.

If I see a particular trigger line like

"you perceive an aura of weapon rebounding materialize around *"

it would trigger raze @target.


Now there is ONE draw back to this, and one that is pretty serious in battles involving teams. If anyone who ISN'T my target ends up putting up their auras, it will set the trigger off to, and send the command to raze @target.

This is an issue, because Lusternia has a balance system which means that careless razing will cost me time and may get me killed.

TO illustrate my point further lets say I am hunting down a guy called John I would type

target John

Now, John becomes my target.

next, I go into John's room, and I'm followed by a friend.

Immediately upon entering, my friend puts up his shield.

My trigger sets off and I end up razing John, but John had no shield up. In the mean time that my balance is resetting John has some free swipes at me.

Quite irritating problem indeed.

I'm looking for as great refinement to this process as possible. Could I perhaps make it so that the trigger would only set off if it contained characters that matched with my target variable?

I don't know, I'm lost and new to lua but I seriously need a better razing trigger.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #1 on Thu 02 Sep 2010 01:48 AM (UTC)
Message
Just set your trigger to "^you perceive an aura of weapon rebounding materialize around (@target)", set it to a Regular Expression, and make sure "Expand variables" is checked too. It'll insert the @target variable into the trigger every time it's checked, so you don't need to do any extra scripting: it'll only match on that target. :)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Rivius   (99 posts)  [Biography] bio
Date Reply #2 on Thu 02 Sep 2010 01:23 PM (UTC)
Message
Wow! Ok, that seems to be working so far thanks!

But let's see if we can make it slightly more efficient. When I set my targetting alias, I want it so that I can type only part of the name like Lusternia allows.

For example

setting target to tea and then seeing

You suddenly perceive the vague outline of an aura of rebounding around Tea

Seems to set off the trigger.

However!

You suddenly perceive the vague outline of an aura of rebounding around Teacup

does not.

Any little tweak I can do for that?

So far it's workable, but I want to squeeze as much efficiency as possible. Also, thanks again Twisol ^^
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #3 on Thu 02 Sep 2010 05:03 PM (UTC)

Amended on Thu 02 Sep 2010 05:04 PM (UTC) by Twisol

Message
Well this is odd. Compare the trigger and the line itself:

Trigger: ^You perceive an aura of weapon rebounding materialize around (@target)
Line:    You suddenly perceive the vague outline of an aura of rebounding around Tea


Those lines hardly even compare. That trigger will never match. If it looks like it's matching, you must have another trigger somewhere that's doing it, which you should probably remove.

The correct trigger would look like:

^You suddenly perceive the vague outline of an aura of rebounding around (@target)


(I changed "you" to "You", but as long as you have "ignore case" set it shouldn't matter. I'm just a perfectionist :D)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Rivius   (99 posts)  [Biography] bio
Date Reply #4 on Thu 02 Sep 2010 05:12 PM (UTC)
Message
Ah, sorry about that. In the first post I was recalling it from my head. In the next I was using the exact line from the game >.<
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #5 on Thu 02 Sep 2010 05:33 PM (UTC)

Amended on Thu 02 Sep 2010 05:35 PM (UTC) by Twisol

Message
Ah, okay. Well, that line seems to match fine on both lines you gave, with "tea" in the target variable. If you're still having problems, can you paste the trigger itself in XML format?

Template:post=4776 Please see the forum thread: http://gammon.com.au/forum/?id=4776.


EDIT: (Nick, what's the forum template for the Pasting XML topic again? :S)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Thu 02 Sep 2010 08:21 PM (UTC)
Message
Twisol, check out: http://www.gammon.com.au/templates

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #7 on Thu 02 Sep 2010 08:28 PM (UTC)
Message
Nick Gammon said:
Twisol, check out: http://www.gammon.com.au/templates


I looked at that! :( I didn't find it! And now it's there. :S

Tired, blind, stupid: pick any two...

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Thu 02 Sep 2010 09:26 PM (UTC)
Message
And if you forget that link, it is there when you go to do a post:


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #9 on Thu 02 Sep 2010 09:27 PM (UTC)
Message
Blind and stupid, then. Much obliged, Nick.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Rivius   (99 posts)  [Biography] bio
Date Reply #10 on Thu 02 Sep 2010 10:06 PM (UTC)
Message
Ok! The price line is:

\bYou suddenly perceive the vague outline of an aura of rebounding around (@target)\b
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #11 on Thu 02 Sep 2010 10:12 PM (UTC)

Amended on Thu 02 Sep 2010 10:13 PM (UTC) by Twisol

Message
Price?

By the way, \b just means "the border between a word character and a non-word character". It's useful for matching, say, "sol" but not "extrasolar": \bsol\b.

I think you probably meant this:

^You suddenly perceive the vague outline of an aura of rebounding around (@target)$


The ^ (caret) is an anchor to the start of a line, and the $ is an anchor to the end of a line. Taken together, the pattern will only match the content if that's the whole line.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #12 on Thu 02 Sep 2010 10:42 PM (UTC)
Message
Yes, but the $ will stop matching on Teapot if the variable is Tea.

Just drop the trailing \b and the trailing $

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Rivius   (99 posts)  [Biography] bio
Date Reply #13 on Thu 02 Sep 2010 10:49 PM (UTC)
Message
Sorry for being such a dumby. Originally I had the line highlighted and it defaulted it to that. In any case I think it works now. Thank you guys so much. It seems to be working flawlessly now.

Also, I'm not sure why I wrote price. I meant precise but must have gotten distracted.
[Go to top] top

Posted by Tahtete   USA  (1 post)  [Biography] bio
Date Reply #14 on Fri 10 Sep 2010 08:16 PM (UTC)
Message
Well, I'm also a Lusternia player, but as a monk! What I wish to know seems a bit more complex dealing with razing as a monk and this thing called "momentum" Ok, currently we have five momentums that are described as mo1, mo2, mo3, mo4, mo5. Using the same line as:

^You suddenly perceive the vague outline of an aura of rebounding around (@script_target).
In the send box I have:

editTemp("targetrebound", true);
SetVariable("targetrebound", "true");
end

Also, I have regular expressions/expand variables/send to script all checked.

How can I make the line actually cause a raze of the target utilizing whatever momentum I am in to continue the stringed forms with little difficulty.
Razing action is kata perform @script_target raze smash. As an example that is.
[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.


31,703 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at HostDash]