[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Stat Rolling Trigger
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Stat Rolling Trigger

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


Posted by Domnslave2003   (2 posts)  [Biography] bio
Date Wed 12 May 2004 08:11 AM (UTC)

Amended on Wed 12 May 2004 10:35 PM (UTC) by Nick Gammon

Message
I'm looking for someone to make me a stat rolling trigger(s)
for zmud v7.05 that will do either...

A: look at each stat and reroll the given set of scores if they're all not 14 or higher

OR

B: add up the sum of all the stats and reroll them if their total is less than 110


I ship off to basic training in 12 days so i need this fairly soon... as for the output of the mud when making a character .. its as follows:


Character stats
------------------------------

You may now roll for your character's stats.
You may roll as often as you like.


    Strength: 12 (Average)
   Dexterity: 10 (Average)
Constitution: 13 (Fit)
Intelligence: 14 (Smart)
      Wisdom:  9 (Average)
    Charisma:  8 (Average)
        Luck: 16 (Very lucky)

Keep? (Y/N)


ok .. hope that helps .. thanks.
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #1 on Wed 12 May 2004 08:22 AM (UTC)
Message
Entirely the wrong forum for zmud scripting support - try the forums over at zuggsoft, Im sure theyll be more helpful since thats the zmud support forums.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by Zendu   (66 posts)  [Biography] bio
Date Reply #2 on Wed 12 May 2004 08:35 AM (UTC)

Amended on Wed 12 May 2004 08:36 AM (UTC) by Zendu

Message
wow how often does that happen

i can tell you how to do it in mushclient... i think..

God im helpless
Currently using MushClient 3.46 on Win Xp pro on [url=www.aetolia.com]Aetolia[/url]
[Go to top] top

Posted by Domnslave2003   (2 posts)  [Biography] bio
Date Reply #3 on Wed 12 May 2004 05:28 PM (UTC)
Message
okay ... same situation and whatnot .... now that i have mushclient, could someone help write up a trigger for mush?
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #4 on Wed 12 May 2004 08:11 PM (UTC)

Amended on Wed 12 May 2004 10:23 PM (UTC) by Flannel

Message
Copy this whole thing, then paste it in your triggers page (copy it, have it on your clipboard, then go to triggers, and click paste). It should work, some of the syntax might be a little off, let me know. Also, as they match, the triggers will change the text color to brown on black, if this doesnt happen, let me know.

(Nick, change the title of this thread? for archive purposes, or something?)

<triggers>
  <trigger
   custom_colour="10"
   enabled="y"
   match="^Charisma: (\d+) \(.*\) $"
   regexp="y"
   send_to="9"
   sequence="100"
   variable="RollCha"
  >
  <send>%1</send>
  </trigger>
  <trigger
   custom_colour="10"
   enabled="y"
   match="^Constitution: (\d+) \(.*\) $"
   regexp="y"
   send_to="9"
   sequence="100"
   variable="RollCon"
  >
  <send>%1</send>
  </trigger>
  <trigger
   custom_colour="10"
   enabled="y"
   match="^Dexterity: (\d+) \(.*\) $"
   regexp="y"
   send_to="9"
   sequence="100"
   variable="RollDex"
  >
  <send>%1</send>
  </trigger>
  <trigger
   custom_colour="10"
   enabled="y"
   match="^Intelligence: (\d+) \(.*\) $"
   regexp="y"
   send_to="9"
   sequence="100"
   variable="RollInt"
  >
  <send>%1</send>
  </trigger>
  <trigger
   custom_colour="10"
   enabled="y"
   match="^Keep\? \(Y\/N\) $"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>dim add, check
add = &quot;N&quot;
If (Cint(Getvariable(&quot;RollStr&quot;))+Cint(Getvariable(&quot;RollDex&quot;))+Cint(Getvariable(&quot;RollCon&quot;))+Cint(Getvariable(&quot;RollInt&quot;))+Cint(Getvariable(&quot;RollWis&quot;))+Cint(Getvariable(&quot;RollCha&quot;))+Cint(Getvariable(&quot;RollLck&quot;))) &gt;= 110 Then
add = &quot;Y&quot;
end if
check = &quot;Y&quot;
If Cint(Getvariable(&quot;RollStr&quot;) &lt; 14 then
check = &quot;N&quot;
end if
If Cint(Getvariable(&quot;RollDex&quot;) &lt; 14 then
check = &quot;N&quot;
end if
If Cint(Getvariable(&quot;RollCon&quot;) &lt; 14 then
check = &quot;N&quot;
end if
If Cint(Getvariable(&quot;RollInt&quot;) &lt; 14 then
check = &quot;N&quot;
end if
If Cint(Getvariable(&quot;RollWis&quot;) &lt; 14 then
check = &quot;N&quot;
end if
If Cint(Getvariable(&quot;RollCha&quot;) &lt; 14 then
check = &quot;N&quot;
end if
If Cint(Getvariable(&quot;RollLck&quot;) &lt; 14 then
check = &quot;N&quot;
end if
If check == &quot;N&quot; OR add == &quot;N&quot; then
world.send &quot;N&quot;
else
world.send &quot;Y&quot;
end if</send>
  </trigger>
  <trigger
   custom_colour="10"
   enabled="y"
   match="^Luck: (\d+) \(.*\) $"
   regexp="y"
   send_to="9"
   sequence="100"
   variable="RollLck"
  >
  <send>%1</send>
  </trigger>
  <trigger
   custom_colour="10"
   enabled="y"
   match="^Strength: (\d+) \(.*\) $"
   regexp="y"
   send_to="9"
   sequence="100"
   variable="RollStr"
  >
  <send>%1</send>
  </trigger>
  <trigger
   custom_colour="10"
   enabled="y"
   match="^Wisdom: (\d+) \(.*\) $"
   regexp="y"
   send_to="9"
   sequence="100"
   variable="RollWis"
  >
  <send>%1</send>
  </trigger>
</triggers>

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Zendu   (66 posts)  [Biography] bio
Date Reply #5 on Wed 12 May 2004 08:18 PM (UTC)

Amended on Wed 12 May 2004 08:20 PM (UTC) by Zendu

Message





*edit* drat flannel knows more about scipting than i...and hes faster

God im helpless
Currently using MushClient 3.46 on Win Xp pro on [url=www.aetolia.com]Aetolia[/url]
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Wed 12 May 2004 11:01 PM (UTC)

Amended on Wed 12 May 2004 11:02 PM (UTC) by Nick Gammon

Message
With the latest version of MUSHclient you can do that as a single multi-line trigger, like this:



<triggers>
<trigger
enabled="y"
lines_to_match="10"
match="(?x) ^\s*Strength\:\s*(?P&lt;str&gt;\d+)\s*\(.*\)\n \s*Dexterity\:\s*(?P&lt;dex&gt;\d+)\s*\(.*\)\n \s*Constitution\:\s*(?P&lt;con&gt;\d+)\s*\(.*\)\n \s*Intelligence\:\s*(?P&lt;int&gt;\d+)\s*\(.*\)\n \s*Wisdom\:\s*(?P&lt;wis&gt;\d+)\s*\(.*\)\n \s*Charisma\:\s*(?P&lt;cha&gt;\d+)\s*\(.*\)\n \s*Luck\:\s*(?P&lt;lck&gt;\d+)\s*\(.*\)\n \n \s*Keep\?\s+\(Y/N\)\s*$"
multi_line="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>


total = %&lt;str&gt; + %&lt;dex&gt; + %&lt;con&gt; + %&lt;int&gt; + _
        %&lt;wis&gt; + %&lt;cha&gt; + %&lt;lck&gt;

if %&lt;str&gt; &lt; 14 or _
   %&lt;dex&gt; &lt; 14 or _
   %&lt;con&gt; &lt; 14 or _
   %&lt;int&gt; &lt; 14 or _
   %&lt;wis&gt; &lt; 14 or _
   %&lt;cha&gt; &lt; 14 or _
   %&lt;lck&gt; &lt; 14 then
 ColourNote "white", "blue", "stats too low"
 Send "N"
elseif total &lt; 110 then
 ColourNote "white", "blue", "total too low (" &amp; total &amp; ")" 
 Send "N"
else
 ColourNote "white", "blue", "accepted stats" 
 Send "Y"
end if

   </send>
  </trigger>
</triggers>



This uses named wildcards and multi-line triggers to achieve the whole stat roller in a single trigger with fairly easily viewed arithmetic.

You can copy the whole lot and click the "paste" button in the trigger list to import it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


7,344 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]