Shattered Kingdoms
https://www.shatteredkingdoms.org/forums/

Prompts
https://www.shatteredkingdoms.org/forums/viewtopic.php?f=21&t=13480
Page 8 of 9

Author:  cheesekk [ Sun Nov 11, 2012 9:25 am ]
Post subject:  Re: Prompts

Dragonite, your plugin gives this error for me:

Code:
Line   32: Error "Failed: missing ) at offset 203" processing regular expression "^\*\s?\d+\%\*\s?\d+\%\*\s?\d+\%\*\s?\d+(am|pm)\*\#((?P<obs>\d+) obsidian(\, ?)?((?P<plat>\d+) platinum(\, )?)?((?P<gold>\d+) gold(\, )?)?((?P<silv>\d+) silver(\, )?)?((?P<copp>\d+) copper(\, )?)?(zero)?$" (trigger not loaded)


Any chance you can track down the problem and fix it? The previous one (two-line prompt) works for me.

Author:  ninja_ardith [ Sun Nov 11, 2012 9:39 am ]
Post subject:  Re: Prompts

...The problem is right there.

Author:  cheesekk [ Sun Nov 11, 2012 9:49 am ]
Post subject:  Re: Prompts

ninja_ardith wrote:
...The problem is right there.


You're either being sarcastic or deliberately unhelpful. I figured I would ask the original author to check the regex before looking into it myself. Supplying the missing ) I got:

Code:
match="^\*\s?\d+\%\*\s?\d+\%\*\s?\d+\%\*\s?\d+(am|pm)\*\#((?P<obs>\d+) obsidian(\, ?)?((?P<plat>\d+) platinum(\, )?)?((?P<gold>\d+) gold(\, )?)?((?P<silv>\d+) silver(\, )?)?((?P<copp>\d+) copper(\, )?)?(zero))?$"


Which loads without errors but does not do what it is supposed to do (coins are left in their full form).

Author:  cheesekk [ Sun Nov 11, 2012 9:57 am ]
Post subject:  Re: Prompts

OK, the ) was missing from obsidian. Here's the correct line:

Code:
match="^\*\s?\d+\%\*\s?\d+\%\*\s?\d+\%\*\s?\d+(am|pm)\*\#((?P<obs>\d+) obsidian(\, ?))?((?P<plat>\d+) platinum(\, )?)?((?P<gold>\d+) gold(\, )?)?((?P<silv>\d+) silver(\, )?)?((?P<copp>\d+) copper(\, )?)?(zero)?$"

Author:  ninja_ardith [ Sun Nov 11, 2012 9:57 am ]
Post subject:  Re: Prompts

cheesekk wrote:
ninja_ardith wrote:
...The problem is right there.


You're either being sarcastic or deliberately unhelpful. I figured I would ask the original author to check the regex before looking into it myself. Supplying the missing ) I got:

Code:
match="^\*\s?\d+\%\*\s?\d+\%\*\s?\d+\%\*\s?\d+(am|pm)\*\#((?P<obs>\d+) obsidian(\, ?)?((?P<plat>\d+) platinum(\, )?)?((?P<gold>\d+) gold(\, )?)?((?P<silv>\d+) silver(\, )?)?((?P<copp>\d+) copper(\, )?)?(zero))?$"


Which loads without errors but does not do what it is supposed to do (coins are left in their full form).


I got the impression from reading over his previous post that he didn't test this at all and that it was filled with errors. It's the post right before you posted.

Author:  cheesekk [ Sun Nov 11, 2012 10:16 am ]
Post subject:  Re: Prompts

Yes, I read that as well. I figured that if someone wrote something they would at least test it once though.... or update if it didn't work.

Regardless, with that change, it works. ;)

Author:  MsPooperTrooper [ Sun Oct 06, 2013 5:46 pm ]
Post subject:  Re: Prompts

It would be super awesome if stance were added to the prompt options. Pretty please?

Author:  Galactus [ Sun Oct 06, 2013 6:03 pm ]
Post subject:  Re: Prompts

MsPooperTrooper wrote:
It would be super awesome if stance were added to the prompt options. Pretty please?

Like +1million times!

Author:  grep [ Sun Oct 06, 2013 8:20 pm ]
Post subject:  Re: Prompts

There are a few things that could improve the aforementioned coin calculator. Instead of writing one monster expression that might not work if you don't have one of every coin type, it might be easier to put the coin line in a variable and then run a match to define each coin type on a separate line with an easy (\d+) copper syntax. I don't know who thought of putting asterisks in output you wanted a machine to parse, but you should probably not get in the habit of doing that.

For testing and fixing regular expressions, http://regexpal.com/" target="_BLANK is always a nice and easy tool to use.

As for stance and such, all you need to do is set triggers to pay attention to the output of the status command and any text indicating that the stance changes. Then have a prompt catcher that coughs out that stance variable along with whatever else you have going on. Think of your character as a state machine, and you're on your way to a host of conveniences.

Be careful, however, because you never really know for absolute certain what's going to be punished.

Author:  MsPooperTrooper [ Mon Oct 07, 2013 6:30 am ]
Post subject:  Re: Prompts

grep wrote:
As for stance and such, all you need to do is set triggers to pay attention to the output of the status command and any text indicating that the stance changes. Then have a prompt catcher that coughs out that stance variable along with whatever else you have going on.


I'm sort of on my way to doing that, but I think if D had it in his heart to add it as a feature of prompt in the game, it would be way easier and mucho appreciated.

Problem is, though, I'm operating with minimal knowledge of how this stuff works. I've got zmud and I've pretty much had to muddle my way through advanced triggers all on my own, although one of the threads in Clients helped a lot (thanks Finney). So far, I have a trigger that reacts when I change my stance by setting/resetting a variable to record what my stance is. Now I'm just trying to figure out how the whole client prompt thing works, or to at least make a trigger work that reacts to the ingame prompt by displaying my variable on the screen. So far, it hasn't worked. With any luck, I'll figure it out before work today, but if not.. maybe someone can halp?

Page 8 of 9 All times are UTC - 8 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/