Unknown2008-12-30 23:55:49
So, I guess the title is sort of self-explanatory, Can't quite figure out how to rig up a Momentum tracker using VBScript (Eth's system)
Any ideas? I know the prompt doesn't include momentum specifically so I would have to change all the prompt lines (again)
I also considered making a trigger to set a series of variables based on successful form triggers, somehow but this seems too complicated, and I'm also like -100 on a scale of 1 to 10 in coding knowledge
Any ideas? I know the prompt doesn't include momentum specifically so I would have to change all the prompt lines (again)
I also considered making a trigger to set a series of variables based on successful form triggers, somehow but this seems too complicated, and I'm also like -100 on a scale of 1 to 10 in coding knowledge
Isuka2008-12-31 00:31:25
I don't know nearly enough about how your system works to give you a definiative answer on this: but I use regular expressions to include all of the optional arguments on the prompt.
If you have the option of using regular expressions, that line will acknowledge momentum.
QUOTE
^((\\d+)h)?(, (\\d+)m)?(, (\\d+)e)?(, (\\d+)p)?(, (\\d+)en)?(, (\\d+)w)?(, (\\d+)mo)? (.+)?-$
If you have the option of using regular expressions, that line will acknowledge momentum.
Unknown2008-12-31 00:39:49
Ah see this may be incredibly old, as I was just looking for a quick solution when Momentum tended to break things, So this is what I have -
^(\\d+)h\\, (\\d+)m\\, (\\d+)e\\, (\\d+)p\\, (\\d+)en\\, (\\d+)w(.*?)\\\\>?\\-
^(\\d+)h\\, (\\d+)m\\, (\\d+)e\\, (\\d+)p\\, (\\d+)en\\, (\\d+)w(.*?)\\\\>?\\-
Isuka2008-12-31 01:11:09
QUOTE (Tau y'Kaliath @ Dec 30 2008, 04:39 PM) <{POST_SNAPBACK}>
Ah see this may be incredibly old, as I was just looking for a quick solution when Momentum tended to break things, So this is what I have -
^(\\d+)h\\, (\\d+)m\\, (\\d+)e\\, (\\d+)p\\, (\\d+)en\\, (\\d+)w(.*?)\\\\>?\\-
^(\\d+)h\\, (\\d+)m\\, (\\d+)e\\, (\\d+)p\\, (\\d+)en\\, (\\d+)w(.*?)\\\\>?\\-
I like mine because it'll trigger for most things. It'll even trigger on a blackout, because every argument is optional.
Also, you can check the group to see if the momentum line is even there. for example: my trigger's value is:
QUOTE
#if (%1) {vitals.chp=%2}
#if (%3) {vitals.cmp=%4}
#if (%5) {vitals.ceg=%6}
#if (%7) {vitals.cpr=%8}
#if (%9) {vitals.cen=%10}
#if (%11) {vitals.cwp=%12}
#if (%13) {vitals.cmo=%14} {vitals.cmo=0}
#if (%15) {
bals.eq=%if(%regex(%15,"e"),1,0)
bals.bal=%if(%regex(%15,"x"),1,0)
hinders.prone=%if(%regex(%15,"p"),1,0)
}
#raiseevent onPrompt
#if (%3) {vitals.cmp=%4}
#if (%5) {vitals.ceg=%6}
#if (%7) {vitals.cpr=%8}
#if (%9) {vitals.cen=%10}
#if (%11) {vitals.cwp=%12}
#if (%13) {vitals.cmo=%14} {vitals.cmo=0}
#if (%15) {
bals.eq=%if(%regex(%15,"e"),1,0)
bals.bal=%if(%regex(%15,"x"),1,0)
hinders.prone=%if(%regex(%15,"p"),1,0)
}
#raiseevent onPrompt
Unknown2008-12-31 01:13:39
It probably isn't, I don't remember Ethelon ever commenting on the post I got this out of. All I remember is pulling the code and replacing all of the trigger lines that needed it with it, and then all the curing stuff worked just fine. Whats that about using Regular Expressions? What does that mean? *halo*
Unknown2008-12-31 01:26:19
QUOTE (Tau y'Kaliath @ Dec 30 2008, 06:13 PM) <{POST_SNAPBACK}>
It probably isn't, I don't remember Ethelon ever commenting on the post I got this out of. All I remember is pulling the code and replacing all of the trigger lines that needed it with it, and then all the curing stuff worked just fine. Whats that about using Regular Expressions? What does that mean? *halo*
Sorry, that was not very helpful of me. I definitely don't know how to find the group, but with my line of code it seems to be set up as a wildcard so its a good chance that isn't there. Do you think it would work if I tried to replace my line with your line?
EDIT: Tried your prompt, COMPLETELY Breaks the system. If it helps, the regular prompt shows as
4234h, 3708m, 2266e, 10p, 18860en, 16730w, 1mo elrxkb-
Where as, With Momentum, Eth's prompt is gagged as
4174h, 3648m, 2266e, 10p, , 3mo erxkb
Unknown2009-01-06 16:14:51
Don't suppose I'd be able to get something like this for zMUD would I?
Normal prompt:
Normal prompt:
CODE
1534h, 1236m, 867e, 0p, 5860en, 5230w elrx-
Isuka2009-01-06 19:03:23
QUOTE (Xerphes @ Jan 6 2009, 08:14 AM) <{POST_SNAPBACK}>
Don't suppose I'd be able to get something like this for zMUD would I?
Normal prompt:
Normal prompt:
CODE
1534h, 1236m, 867e, 0p, 5860en, 5230w elrx-
The prompt I posted earlier works in zmud as well.
CODE
^((\\d+)h)?(, (\\d+)m)?(, (\\d+)e)?(, (\\d+)p)?(, (\\d+)en)?(, (\\d+)w)?(, (\\d+)mo)? (.+)?-$
the momentum is stored in %14. You'll have to check to see if it exists at all, because if it doesn't you need to set your tracker to 0.
Unknown2009-01-06 20:52:39
Sweet pieces of awesome, thanks!
Unknown2009-01-06 22:59:14
It might be a little simpler to work with if you made those outer groups non-capture groups. You'd have half the wildcards to work with (and it might even match just a little faster).
CODE
^(?:(\\d+)h)?(?:, (\\d+)m)?(?:, (\\d+)e)?(?:, (\\d+)p)?(?:, (\\d+)en)?(?:, (\\d+)w)?(?:, (\\d+)mo)? (.*?)(?:\\<\\>)?-$
Isuka2009-01-06 23:44:39
QUOTE (Zarquan @ Jan 6 2009, 02:59 PM) <{POST_SNAPBACK}>
It might be a little simpler to work with if you made those outer groups non-capture groups. You'd have half the wildcards to work with (and it might even match just a little faster).
CODE
^(?:(\\d+)h)?(?:, (\\d+)m)?(?:, (\\d+)e)?(?:, (\\d+)p)?(?:, (\\d+)en)?(?:, (\\d+)w)?(?:, (\\d+)mo)? (.*?)(?:\\<\\>)?-$
True, but zmud doesn't seem to support that. It always gave me a ton of problems.
Unknown2009-01-07 01:55:38
Just for closure, Eth's system overwrites base command in Muschlient. Things like note.
Its all done a specific way, which is clever and all, but eventually we had to rig it up using an alias. And even that didn't work, becuase the execute wasn't working right either so we had to use DoAfterSpecial
If anyone's interested in it, I'm sure Isuka/Kage wouldn't mind me handing it out? <.<
Its all done a specific way, which is clever and all, but eventually we had to rig it up using an alias. And even that didn't work, becuase the execute wasn't working right either so we had to use DoAfterSpecial
If anyone's interested in it, I'm sure Isuka/Kage wouldn't mind me handing it out? <.<
Daved2009-03-03 18:43:07
This is how it's done folks:
enabled="y"
match="^(\\d+)h\\, (\\d+)m\\, (\\d+)e\\, (\\d+)p\\, (\\d+)en\\, (\\d+)w(?:, (\\d+)mo|) (\\w+)-$"
regexp="y"
send_to="12"
sequence="100"
>
mo = "%7"
if (mo ~= "") then
momentum = tonumber(mo)
else
momentum = 0
end
CODE
match="^(\\d+)h\\, (\\d+)m\\, (\\d+)e\\, (\\d+)p\\, (\\d+)en\\, (\\d+)w(?:, (\\d+)mo|) (\\w+)-$"
regexp="y"
send_to="12"
sequence="100"
>
mo = "%7"
if (mo ~= "") then
momentum = tonumber(mo)
else
momentum = 0
end
Unknown2009-03-03 18:49:10
Here, let me fix that right up for you...
enabled="y"
match="^(\\d+)h\\, (\\d+)m\\, (\\d+)e\\, (\\d+)p\\, (\\d+)en\\, (\\d+)w(?:, (\\d+)mo)? (.*?)\\-$"
regexp="y"
send_to="12"
sequence="100"
>
if #"%7" > 0 then
  momentum = tonumber("%7")
else
  momentum = 0
end
CODE
match="^(\\d+)h\\, (\\d+)m\\, (\\d+)e\\, (\\d+)p\\, (\\d+)en\\, (\\d+)w(?:, (\\d+)mo)? (.*?)\\-$"
regexp="y"
send_to="12"
sequence="100"
>
  momentum = tonumber("%7")
else
  momentum = 0
end