Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Jscript ➜ Multiple line triggers? I dunno...

Multiple line triggers? I dunno...

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


Posted by Helpless   (48 posts)  Bio
Date Sun 29 Apr 2007 10:59 PM (UTC)
Message
I thought I understood them from the helpfile but I still didnt get it to do what I want unfortunately. And what I want may need more then multiple line triggers, possibly variables and im just not very good at JScript or any scripting except mIRC (which is very simplified or something), which I wish there was a mud client that was just like it with its scripting abilities.

Heres what I want it to do...

"We" have 6 different color die (red, blue, green, yellow, silver, purple), "we" type game progessive to roll the die (we start out on red). The line we see after typing that command is "You roll the red die!" (and so on for the other die colors). When we advance to the next die, "we" get the line "Congratulations! You move up a color on your die on your next roll." and what I want it to do when I get that line (while on the YELLOW die) is to enter the command "game progessive payout". Any idea how to make that script?

Note: What I currently do is type "game progessive" after each roll of the die, and if im on silver I roll the die once and then payout, but sometimes I can win with just 1 roll of silver and I dont want to win on silver.

If you need any more info, please post here (dont email). There are other lines we get after rolling the die, such as:

Large win! You win 5000 gold to your pot.
Your pot contains 6000 gold coins right now.
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #1 on Mon 30 Apr 2007 06:06 AM (UTC)
Message
I'm not sure if you're asking about a multi line trigger, or multiple triggers which would match on the various lines.

Personally, I'd have a regex trigger which would match on
^You roll a (red|blue|green|yellow|silver|purple) die!$
And then just have stash the colour in a variable. In the trigger set off by the die result, just have the script check this variable for "yellow" and enable a trigger that matches on "Congratulations! You move up a color on your die on your next roll." which sends "game progressive payout"

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Helpless   (48 posts)  Bio
Date Reply #2 on Mon 30 Apr 2007 04:54 PM (UTC)

Amended on Mon 30 Apr 2007 07:12 PM (UTC) by Helpless

Message
im not sure how to make all that....so I took the (seemingly) LONG way around and heres what I have (see next 2 posts).

The problem is it stops sending the command "game prog" some where along the line after i get to the green die, and I do not know why. Also, I cant get it to type game prog on the "What luck!" line, dunno why that either but it usually all stops when i get to that part

Btw, the full line of "What luck!" is:

What luck! You gain 81 quest points!
Top

Posted by Helpless   (48 posts)  Bio
Date Reply #3 on Mon 30 Apr 2007 07:01 PM (UTC)

Amended on Tue 01 May 2007 12:05 PM (UTC) by Nick Gammon

Message

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Wednesday, April 11, 2007, 3:02 PM -->
<!-- MuClient version 4.01 -->

<!-- Plugin "festival" generated by Plugin Wizard -->

<muclient>
<plugin
   name="festival"
   id="06a4800b8189f282add7cc57"
   language="JScript"
   date_written="2007-04-11 15:01:44"
   purpose="festival"
   requires="4.01"
   version="1.0"
   >

</plugin>


<!--  Get our standard constants -->

<include name="constants.js"/>

<!--  Triggers  -->

<triggers>
<trigger
enabled="y"
match="You pay the dealer 50000 gold to begin a game of progressive dice..."
sequence="100"
send_to="12"
>
<send>
world.enabletriggergroup ("baddd", 0)
world.enabletriggergroup ("almost", 0)
world.enabletriggergroup ("bluegreen", 0)
world.enabletriggergroup ("redd", 1)</send>
</trigger>
  <trigger
   enabled="n"
group="redd"
   match="* win!  You * gold to your pot."
   sequence="100"
  >
  <send>game prog</send>
  </trigger>
  <trigger
   enabled="n"
group="redd"
   match="* loss!  You * gold from your pot."
   sequence="100"
  >
  <send>game prog</send>
  </trigger>
<trigger
group="redd"
enabled="n"
match="Congratulations!  You move up *"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("bluegreen", 1)</send>
</trigger>
<trigger
group="redd"
enabled="n"
match="Holy ...!  You skipped a color?!?"
sequence="100"
send_to="12"
>
<send>world.enabletriggergroup ("baddd", 1)</send>
</trigger>
<trigger
group="redd"
enabled="n"
match="Lucky lucky lucky!  *"
sequence="100"
>
<send>game prog</send>
</trigger>
<trigger
group="redd"
enabled="n"
match="Bummer!  You do not advance, better luck next time!"
sequence="100"
>
<send>game prog</send>
</trigger>
<trigger
group="redd"
enabled="n"
match="Bad luck!  Game over!!"
sequence="100"
>
<send>game prog</send>
</trigger>
  <trigger
group="bluegreen"
   enabled="n"
   match="* win!  You * gold to your pot."
   sequence="100"
send_to="12"
  >
  <send>world.send("game prog")
world.enabletriggergroup ("redd", 0)</send>
  </trigger>
  <trigger
   enabled="n"
group="bluegreen"
   match="* loss!  You * gold from your pot."
   sequence="100"
send_to="12"
  >
  <send>world.send("game prog")
world.enabletriggergroup ("redd", 0)</send>
  </trigger>
<trigger
group="bluegreen"
enabled="n"
match="Congratulations!  You move up a color *"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("baddd", 1)
world.enabletriggergroup ("redd", 0)</send>
</trigger>
<trigger
group="bluegreen"
enabled="n"
match="Holy ...!  You skipped a color?!?"
sequence="100"
send_to="12"
>
<send>world.enabletriggergroup ("almost", 1)
world.enabletriggergroup ("redd", 0)</send>
</trigger>
<trigger
group="bluegreen"
enabled="n"
match="Lucky lucky lucky!  You almost lost the game, *"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("redd", 0)</send>
</trigger>
<trigger
group="bluegreen"
enabled="n"
match="Bummer!  You do not advance, better luck next time!"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("redd", 0)</send>
</trigger>
<trigger
group="bluegreen"
enabled="n"
match="Bad luck!  Game over!!"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("redd", 0)</send>
</trigger>
  <trigger
group="baddd"
   enabled="n"
   match="* win!  You * gold to your pot."
   sequence="100"
send_to="12"
  >
  <send>world.send("game prog")
world.enabletriggergroup ("bluegreen", 0)
world.enabletriggergroup ("redd", 0)</send>
  </trigger>
<trigger
group="baddd"
enabled="n"
match="Holy ...!  You skipped a color?!?"
sequence="100"
send_to="12"
>
<send>world.send("game prog payout")
world.send("game prog")
world.enabletriggergroup ("redd", 0)
world.enabletriggergroup ("bluegreen", 0)</send>
</trigger>
<trigger
group="baddd"
enabled="n"
match="Congratulations!  You move up a *"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("almost", 1)
world.enabletriggergroup ("bluegreen", 0)
world.enabletriggergroup ("redd", 0)</send>
</trigger>
<trigger
group="badd"
enabled="n"
match="Lucky lucky lucky!  You almost lost the game, *"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("bluegreen", 0)
world.enabletriggergroup ("redd", 0)</send>
</trigger>
<trigger
group="badd"
enabled="n"
match="Bummer!  You do not advance, better luck next time!"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("bluegreen", 0)
world.enabletriggergroup ("redd", 0)</send>
</trigger>
<trigger
group="badd"
enabled="n"
match="Bad luck!  Game over!!"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("bluegreen", 0)
world.enabletriggergroup ("redd", 0)</send>
</trigger>
<trigger
group="badd"
enabled="n"
match="What luck* *"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("bluegreen", 0)
world.enabletriggergroup ("redd", 0)</send>
</trigger>
  <trigger
   enabled="n"
group="badd"
   match="* loss!  You * gold from your pot."
   sequence="100"
send_to="12"
  >
  <send>world.send("game prog")
world.enabletriggergroup ("bluegreen", 0)
world.enabletriggergroup ("redd", 0)</send>
  </trigger>
Top

Posted by Helpless   (48 posts)  Bio
Date Reply #4 on Mon 30 Apr 2007 07:01 PM (UTC)

Amended on Tue 01 May 2007 12:07 PM (UTC) by Nick Gammon

Message

  <trigger
group="almost"
   enabled="n"
   match="* win!  You * gold to your pot."
   sequence="100"
send_to="12"
  >
  <send>world.send("game prog")
world.enabletriggergroup ("badd", 0)
world.enabletriggergroup ("bluegreen", 0)</send>
  </trigger>
<trigger
group="almost"
enabled="n"
match="Congratulations!  You move up a *"
sequence="100"
send_to="12"
>
<send>world.send("game prog payout")
world.send("game prog")
world.enabletriggergroup ("badd", 0)
world.enabletriggergroup ("bluegreen", 0)</send>
</trigger>
<trigger
group="almost"
enabled="n"
match="Lucky lucky lucky!  You almost lost the game, *"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("badd", 0)
world.enabletriggergroup ("bluegreen", 0)</send>
</trigger>
<trigger
group="almost"
enabled="n"
match="Bummer!  You do not advance, better luck next time!"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("badd", 0)
world.enabletriggergroup ("bluegreen", 0)</send>
</trigger>
<trigger
group="almost"
enabled="n"
match="Bad luck!  Game over!!"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("bluegreen", 0)
world.enabletriggergroup ("badd", 0)</send>
</trigger>
<trigger
group="almost"
enabled="n"
match="What luck!  You gain * quest points!"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("badd", 0)
world.enabletriggergroup ("bluegreen", 0)</send>
</trigger>
<trigger
group="almost"
enabled="n"
match="A Random Event!!"
sequence="100"
send_to="12"
>
<send>world.send("game prog")
world.enabletriggergroup ("badd", 0)
world.enabletriggergroup ("bluegreen", 0)</send>
</trigger>
  <trigger
   enabled="y"
   match="You roll the Purple die!"
   sequence="100"
send_to="12"
  >
  <send>world.send("game prog")
world.enabletriggergroup ("almost", 0)</send>
</trigger>
</triggers>

</muclient>
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #5 on Tue 01 May 2007 11:45 AM (UTC)
Message
Is all that just for matching that one line for yellow? Picking through your code is a little confusing since there are several triggers getting switched on and off that match on the same thing. I'm pretty sure that the lucky quest point one isn't matching simply because it hasn't been turned on. Unfortunately, since you said that the script doesn't quite work, I'm having some difficulty piecing everything together here. What precisely do you want to do here? Just need a list of conditions you're checking for, and specific output from the mud. I'm pretty sure I have the basic idea of what you're doing, and I'm trying to figure out how to condense things a bit.

Another thing real quick if you want your code a bit more readable on the forum. There are forum codes you can use to make sure that spaces aren't stripped from your post. Just encapsulate your code in the code tags. [code]foo[\code]

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Helpless   (48 posts)  Bio
Date Reply #6 on Tue 01 May 2007 05:13 PM (UTC)
Message
the What luck line has to be enabled as it is in the same group as the others.

Groups are as follows for the dice:
redd = red die
bluegreen = blue die
badd = green die
almost = yellow die

most of the triggers are just to keep rolling the die for each color unless I advance to the silver die while on yellow, in which i force myself out of the game (game prog payout).
Top

Posted by Helpless   (48 posts)  Bio
Date Reply #7 on Thu 03 May 2007 05:41 AM (UTC)
Message
well it turns out im an idiot, after all this time I finally realized why it stopped working on the green die.

The problem was that some of the group was labeled "baddd" and some of it "badd". Stupid extra D.
Sorry to have wasted your time.
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.


28,398 views.

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

Go to topic:           Search the forum


[Go to top] top

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