Nexus and Trigger matching

by Unknown

Back to Mechanic's Corner.

Unknown2006-05-19 07:01:24
Before you say anything; No! I am not switching to MUSH, I am not switching to Zmud, and I am not switching to any other client you may suggest. I like Nexus... don't know why but I do. happy.gif

Now, the reason I created this topic. The Nexus wild cards ' {<} and {>} '... how do they work? They say they match the beginning or end of a line, while not matching the actule new line character. I've tried to use them to simply highlight a word, just to see what they matched, but haven't gotten them to work. No matter where I placed them.

{<}pilgrim
{<} Pilgrim
Pilgrim{>}
Pilgrim {>}
{<}pilgrim{>}

All to no avail. Is there any way I could be shown an example of how they might be used?

While I'm here, I might as well as ask how ' {} and {} ' are used as well. While I haven't messed with them yet... I suspect that they'll make reflexing a little easier... or so difficult that my little mind implodes.
Daganev2006-05-19 15:57:59
If you find out the answer from another source, please post it here smile.gif

If you find out the answer from another source, please post it here smile.gif
Unknown2006-05-20 05:14:20
{<} and {>} indeed do match the beginning and end of a line. For instance, the trigger pattern "{<}You move sluggishly into action." will fire on:

You move sluggishly into action.

but not on:

You do a happy twirly dance. You move sluggishly into action.

The pattern: "You move sluggishly into action.{>}" should match on the first line above, but not on:

You move sluggishly into action. You do a happy twirly dance.

If you leave out the {<} or {>}, you'll match on all the lines above. In fact, triggering only "pilgrim" will match on pilgrim every time; the reason your triggers weren't matching is because they were looking for "pilgrim" at the start or end of a line.

Why is it useful to have triggers match only new lines? Mostly to detect gross illusions. If you don't anchor your triggers to the beginnings/ends of lines, you'll fall prey to illusions like this:

You are too stunned to be able to do anything. You move sluggishly into action. You begin to trying to wrest your mind free of that which has transfixed it.

{} matches one or more of the characters between the 's. You can use {} to represent the possible letters on your prompt, for instance, and the trigger will match "ex", or "exdb", or "xk", or any other combination. {} matches anything but the characters in the 's, and I can't think of a good example of when you'd use this...
Unknown2006-05-20 09:52:04
Thank you very much. Once I get offa this dial-up connection, I'm gonna have'ta have Tervic bash my brains in some more so I can re-work my triggers with the anchor in. I, currently, have them matching a bare minimum of text. Java and Dial-up don't seem to get along... but then again, MUSH didn't care for Dial-up either. dry.gif

As for the {}... I can... feel it... aaahhh explode.gif

Those would mainly just be used to check for equilibrium and other balances?

Daganev2006-05-23 18:42:13
Anybody know how to get the elseif to work in Nexus?

Here is the code I'm using, and it only works if I turn everything into an #if but that makes it run much slower...

CODE

#if ($infType = 1) {
#if ($infStage = 1) {
beg
}
#if $infStage = 2 {
wheed
db
}
#if ($infStage = 3) { sup }
}
#if ($infType = 2) {
#if ($infStage =1) {
praise
}
#if ($infStage = 3) {
admire
}
#if ($infStage = 2) {
comp
db
}
}


I would have liked to use elseif....

is there any other way to speed up this code? it goes so slow I have to enter it before I regain equi if I don't want to get hit with 14 charisma...
Unknown2006-05-23 19:33:06
Here you go, with far fewer if's and more elsif's. You'll have to test it yourself, I don't use Nexus these days:

QUOTE
#if ($infType = 1) {
#if ($infStage = 1) {
beg
}
elsif ($infStage = 2) {
wheed
db
}
elsif ($infStage = 3) { sup }
}
elsif ($infType = 2) {
#if ($infStage = 1) {
praise
}
elsif ($infStage = 2) {
comp
db
}
elsif ($infStage = 3) { admire }
}


If you want it to work faster still... use MUSHclient, sorry sad.gif By the way, is the "db" a drink bromide alias? Don't you drink bromides as part of your auto-sipping?
Unknown2006-05-23 23:44:16
Since I'm on a troll roll, might as well include the mechanics corner too!

Seriously, all mechanics-wise gameplay can be solved so easily with muds.

DONT PLAY THEM. biggrin.gif

Play a real game where you dont have to learn code in order to be any good at combat. Play a game where skill, not ones "system" determines the outcome of the game.




And... next subforum!
Daganev2006-05-24 00:50:51
QUOTE(vale_kant @ May 23 2006, 12:33 PM) 290695

Here you go, with far fewer if's and more elsif's. You'll have to test it yourself, I don't use Nexus these days:
If you want it to work faster still... use MUSHclient, sorry sad.gif By the way, is the "db" a drink bromide alias? Don't you drink bromides as part of your auto-sipping?



Thanks... however, what I was saying was that "elseif" wasn't working... some reason it was executing every line.

And I don't have a autosipper for Nexus, thats just asking to break.

I use zmud at home, but when I'm on the road I like to bash too.

I was wondering if anyone has been able to get elseif working in Nexus or not.

And everyone has access to nexus if you want to try... thats the nice thing about nexus!
Shiri2006-05-24 01:10:04
I just mentioned this on the IRC, but I figure I'll mention it here anyway: it's "elsif". Not elseif.

EDIT: Actually, vale_kant even said that. tongue.gif
Daganev2006-05-24 02:01:29
Odd, the final code that works is this...

CODE

#if $infType = 1 {#if $infStage = 1 { beg } elsif $infStage = 2 { wheed >> db } elsif $infStage = 3 { sup } elsif $infType = 2 {#if $infStage = 1 { praise } elsif ($infStage = 3) { admire } elsif ($infStage = 2) { comp >> db }
}
}


And thats the only way it would work... all on the same line. save the last two }

And the elsif is running 1 - 1.5 seconds faster... I no longer have to enter the commands before I see the equi recovery.. thank you all for your help.
Unknown2006-05-24 04:40:13
QUOTE(daganev @ May 24 2006, 01:50 AM) 290777
And everyone has access to nexus if you want to try... thats the nice thing about nexus!


No, we don't. It crashes on my ancient computer. If I'm lucky, it crawls. It's not Nexus's fault, the same happens with most Java applets. sad.gif
Daganev2006-05-24 05:29:50
QUOTE(vale_kant @ May 23 2006, 09:40 PM) 290861

No, we don't. It crashes on my ancient computer. If I'm lucky, it crawls. It's not Nexus's fault, the same happens with most Java applets. sad.gif


Try downloading the JDK, it seems to improve general Java performance if you have it.
Shiri2006-05-24 13:45:36
QUOTE(daganev @ May 24 2006, 06:29 AM) 290873

Try downloading the JDK, it seems to improve general Java performance if you have it.


Quoted for truthery. It was spazzing around on my (bought in 2005) PC for months until I got that thing.