Jump to content

zMUD roller code question


P_body

Recommended Posts

I'm trying to create a roller that will show me the target # and what the highest roll so far is.

I found this roller somewhere and I've broken it down. Broke it a couple times, now I think I have it working again, but I can't figure out how to make it show the highest roll so far.

strings:

#var max 23

#ALIAS max #var max

#TRIGGER { ~[(%d)~] Cmds~:} {#IF (%1 < @max) {roll}

#SHOW MaxRoll: @max CurrentRoll: %1}

Feedback?

Link to comment
Share on other sites

I'm trying to create a roller that will show me the target # and what the highest roll so far is.

I found this roller somewhere and I've broken it down. Broke it a couple times, now I think I have it working again, but I can't figure out how to make it show the highest roll so far.

strings:

#var max 23

#ALIAS max #var max

#TRIGGER { ~[(%d)~] Cmds~:} {#IF (%1 < @max) {roll}

#SHOW MaxRoll: @max CurrentRoll: %1}

Feedback?

First, you're making a class named "max" when you make your alias. Should read:

#ALIAS max {#va max %1}

Use the squiggly brackets to group what you want the value to do.

Second, your trigger is a bit off. Here, your squiggly brackets are not grouping the right things together.

#TRIGGER {~[(%d)~] Cmds~:} {#IF (%1 < @max) {roll}

Try:

#TRIGGER {~[(%d)~] Cmds~:} {%IF( %1 < @max, "roll"}

As for the highest roll capture, you'll need to do some variable substitution to the rolling trigger itself.

#TRIGGER {~[(%d)~] Cmds~:} {%IF( @currentroll < @max, "roll"}

And a second variable, but it must be placed inside the value of the trigger on a separate line:

#var currentroll %1

And in the value of your trigger on a separate line as well:

highroll = %if( @currentroll >= @highroll, @currentroll, @highroll)

Now when you use your setup, it should work. However, the only downside is that you'll have to manually kill and/or disable your trigger(s) to prevent non-rolling spam. Try making it a class so that it doesn't interfere with other triggers, groups, classes you may or may not have set up.

All said, it should look like this, ready for your command prompt:

#CLASS {Rolling} {disable}

#ALIAS max {#va max %1}

#TRIGGER {~[(%d)~] Cmds~:} {#VAR currentroll {%1};%IF( @currentroll < @max, "roll", "disablerolling");highroll = %if( @currentroll >= @highroll, @currentroll, @highroll);#Say MaxRoll: @max CurrentRoll: @Currentroll HighestRoll: @highroll}

#TRIGGER {disablerolling} {#class Rolling 0}

#CLASS 0

If I can figure out how to make it work in the same trigger, you won't need two. But this works. You'll need to enable this class before rolling as the way I've got it set up is it'll disable the class when connecting to the MUD. Just right click the folder and click enable.

The only other thing I've done is use #say instead of #show. The two function similar, but #show processes text like it was received from the MUD whereas #say does an 'echo' of sorts. And it shows up light blue. :D

Link to comment
Share on other sites

  • 7 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...