MUSHclient Help

Posted by Artel on Wed 30 Jun 2004 11:27 PM — 18 posts, 86,587 views.

USA #0
Hello..

I'm a rather new user of MUSHclient(love it:) and MUD clients in general. I apologize if someone else has already covered my topic, but I really don't know what to do here. What I want to do is send quest reward info to the group channel(gtell). I currently have something quite simple like this:
(Message I receive from the mud):
Questor tells you 'As a reward, I am giving you 12 quest points and 174 gold.'
You get lucky and gain an extra 2 quest points.
You gain an extra 2 quest points 'MCCP Bonus'.

Trigger:
Questor tells you 'As a reward, I am giving you * quest points and * gp.'
Send:
gtell Quest completed: %1 qp, %2 gp.

But I really received 12 +2 +2 (16 total) quest points. I want the message to the MUD to say 16 not the 12.

I assume that I would use a variable here, but I don't know how to increase the variable by however many bonus points recieved.

Any help would be greatly appreciated.
Thanks
-Rathik
USA #1
I'm assuming that the easier solution of just sending multiple group tells is not acceptable? :-) To do it in one go is a bit harder, since you don't always get the bonuses and all; it's not impossible, but requires considerably more effort than just sending multiple tells.
Australia Forum Administrator #2
Your problem here is I assume you don't always "get lucky" and get the extra bonus. Thus, sending on a trigger of the first line may or may not be too soon, and waiting for the "get lucky" line may be wrong if it doesn't arrive.

What might work is to set up some multiple-line triggers, where you need to know something that happens *after* those three lines (like a prompt line).

Thus you might match on (roughly):

Questor tells you 'As a reward, I am giving you (.*) quest points and (.*) gp\.'\nYou get lucky and gain an extra (.*) quest points\.\nYou gain an extra (.*) quest points 'MCCP Bonus'\.\n<.*>.*\z

This is just the general idea, I haven't tested it. This would match all 3 lines if you got them, terminated by the prompt line ( < 10 hp 20 m 30 mv > blah ) or whatever.

Then make another one with only two lines, and then the one line. Hopefully one of them and only one will match a particular situation.

Then your trigger "send" box can do a bit of arithmetic to add up the points.


Australia Forum Administrator #3
Or, you can probably make a single multi-line trigger with the extra lines as options. Read up on regular expressions, but basically you can do something like this:

Match: blah blah (this is optional)?

The "?" after a group means match zero or one of the group, so it would match "blah blah" followed by an optional occurrence of "this is optional".

So (again without testing) it might look like this:

Questor tells you 'As a reward, I am giving you (.*) quest points and (.*) gp\.'\n(You get lucky and gain an extra (.*) quest points\.\n)?(You gain an extra (.*) quest points 'MCCP Bonus'\.\n)?<.*>.*\z

Notice the extra brackets with the question marks. You can express the same idea a bit more readably with braces:

Questor tells you 'As a reward, I am giving you (.*) quest points and (.*) gp\.'\n(You get lucky and gain an extra (.*) quest points\.\n){0,1}(You gain an extra (.*) quest points 'MCCP Bonus'\.\n){0,1}<.*>.*\z



USA #4
Ksilyan, I have tried the multi-line solution already, and when I review the channel history at the end, it is a bit spammy. When combined with multi-lines of leveling messages and rewards, it is not pretty. :)

I should have mentioned this the in the first post, but since MUSHclient supports MCCP, it is guaranteed that I will get "You gain an extra 2 quest points 'MCCP Bonus'." every single time, and that message is always at the very end of the quest rewards. I just wanted to make sure those 2 were added to the total qp.

I will try what you mentioned, Nick, also.
Thanks again
USA #5
Yeah, the MCCCP can terminate it.

Have three triggers, for each of the lines. The first one catches it and turns the other two on (enabletrigger "triggerX", 1). Sends the number to the variable (which resets it), then the second one adds to it (Setvariable "questpoints", Cint(getvariable("questpoints"))+%1 then the third does the same, except it also sends it (and turns off itself (enabletrigger "triggerX", 0) and the second line one).
If the second one doesnt catch (because its not there) its no big deal, you dont need it.

And no, Ive never been a big fan of multiline triggers. What happens if things lag and a command gets put in between, or another line, or who knows what. This will always work, assuming you always get the MCCP bonus (which you will know if you do or dont).
USA #6
I'm afraid I might be a little more new than either one of us thought.. It makes sense to me what you said Flannel, but where do I put that stuff in at?
USA #7

^Questor tells you \'As a reward, I am giving you (\d{1,}) quest points and (\d{1,}) gold\.\'$
Triggername: QuestTrig1
Send to: script
Enabled, Regexp, Keep Evaluating
send: setvariable "goldgain", %2
setvariable "qpgain", %1
enabletrigger "QuestTrig2", 1
enabletrigger "QuestTrig3", 1

^You get lucky and gain an extra (\d{1,}) quest points\.$
Triggername: "QuestTrig2"
Send to: script
Regexp, Keep Evalutating, NOT ENABLED
send: setvariable "qpgain", Cint(getvariable("qpgain")+%1

^You gain an extra (\d{1,}) quest points \'MCCP Bonus\'\.$
Triggername: "QuestTrig3"
Send to: script
Regexp, Keep Evalutating, NOT ENABLED
send: setvariable "qpgain", Cint(getvariable("qpgain")+%1
enabletrigger "QuestTrig2", 0
enabletrigger "QuestTrig3", 0
send "Quest Complete: " & getvariable("qpgain") & " qp and " & getvariable("goldgain") & " gp."

That should do it, if I got all that right.
USA #8
Glad that you have a good solution that does what you need. I didn't realize the MCCP line always came. I'm curious though; are they giving out a bonus for MCCP to encourage people to use it?
USA #9
Thats what Id suspect. Less bandwidth usage, which means theoretically less lag, or whatever.
USA #10
Sorry for the late post.. but I have done what Flannel said, and nothing happens when I finish a quest. The qpgain and goldgain variables don't even change. What am I missing?
USA #11
Are you sure the triggers are matching? Try making the triggers change the color of the line, to see if it matches.
USA #12
I got an email from someone asking if I could email them a copy/pastable version of this... I dont know which of the two of you it is. But, here it is (complete with color change to validate your regexp).

Copy between <triggers> and </triggers> then click "paste" in the trigger dialog.

<triggers>
  <trigger
   custom_colour="12"
   enabled="y"
   ignore_case="y"
   keep_evaluating="y"
   match="^Questor tells you \'As a reward, I am giving you (\d{1,}) quest points and (\d{1,}) gold\.\'$"
   name="QuestTrig1"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>setvariable &quot;goldgain&quot;, %2
setvariable &quot;qpgain&quot;, %1
enabletrigger &quot;QuestTrig2&quot;, 1
enabletrigger &quot;QuestTrig3&quot;, 1
</send>
  </trigger>
  <trigger
   custom_colour="12"
   ignore_case="y"
   keep_evaluating="y"
   match="^You gain an extra (\d{1,}) quest points \'MCCP Bonus\'\.$"
   name="QuestTrig3"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>setvariable &quot;qpgain&quot;, Cint(getvariable(&quot;qpgain&quot;)+%1)
enabletrigger &quot;QuestTrig2&quot;, 0
enabletrigger &quot;QuestTrig3&quot;, 0
send &quot;Quest Complete: &quot; &amp; getvariable(&quot;qpgain&quot;) &amp; &quot; qp and &quot; &amp; getvariable(&quot;goldgain&quot;) &amp; &quot; gp.&quot;
</send>
  </trigger>
  <trigger
   custom_colour="12"
   ignore_case="y"
   keep_evaluating="y"
   match="^You get lucky and gain an extra (\d{1,}) quest points\.$"
   name="QuestTrig2"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>setvariable &quot;qpgain&quot;, Cint(getvariable(&quot;qpgain&quot;)+%1)
</send>
  </trigger>
</triggers>
Amended on Sat 17 Jul 2004 07:11 AM by Flannel
#13
Hello

I just started using mushclient (aardwolf player)
but can't figure out how to enter this script - or even where to enter it! I know I may appear to be dumb but I've tried everything to get this to work.

I simply don't know how or where to enter it...I assumed in the trigger dialog in the config box.

hope someone can help me..
USA #14
Copy the whole thing (copy from <triggers> to </triggers> including that text) and then go to the triggers page (thats the one with all the lines where you can add triggers and such) and click 'paste' and that's it!
This button (except the triggers page not the alias one):
http://www.gammon.com.au/images/alias_paste.gif
#15
well i cant post my plugin for you guys here conact me in aard for it

it shows
quest info/results auto posted to your personal channel of choice

example of taken quest:

(Group) -={666}=- Mictlan: '}- -¤--^}-{Quest}-{Camaxtli }-{ a professional cook }-{ Pantry }-{ Wedded Bliss }-{ 24mins}-{^--¤- -{'

example of completed quest:

(Group) -={666}=- Mictlan: '}- -¤--^}-{Quest}-{9qps }-{ +2qps MCCP }-{ 1276gold }-{ 44secs }-{ 2Tqs }-{ 33Tqps }-{ 16AVEqp/q }-{ 2pracs 0trains 0tps}-{^--¤- -{'

this info also appears in your info bar along with
total exp/avg exp
total gold/avg gold
vorpals/gags/skins

also has warfare scripting in it which puts the war info in the status bar telling you the kind of war who started it and what lvls

also in status bar it posts your quest info when takeing a quest
shows name of mob room and area along with time
very handy and faster then q info

i will note this is all 1 plugin
its for aardwolf mud
send me a note if your interested it was writen by Opoch of Xunti. ill pass it on to you all b/c people are always asken about my plugins for aard

Mictlan
USA #16
Sounds great -- thanks for offering to share. Out of curiosity why can't you post it here?
USA #17
If that's all in a single plugin, odds are it so far exceeds the single post character limit it's near painful to try breaking into postable chunks.