Stat Roller for Mushclient

Posted by Bassball on Thu 03 Jan 2008 04:20 AM — 6 posts, 25,994 views.

#0
I play a MUD called Abandoned Realms, It uses a stat roller, that gives a list of stats and asks if you accept it or not, like this

Rolling attributes for a half-elf ranger.
Max Str: 19 Int: 22 Wis: 21 Dex: 22 Con: 18
[86] Str: 17 Int: 18 Wis: 16 Dex: 18 Con: 17 Keep? (Y/N)


then, you either type yes, or no.
and, if no, it responds with another set of attributes, like this..

[89] Str: 17 Int: 19 Wis: 18 Dex: 19 Con: 16 Keep? (Y/N)

Now, I need a stat roller that will do this for me automatically, because to get a maxed stat roll it takes awhile, and I don't have the patience to sit and type no for each one... so basically I need something that will recognize the first set of numbers, the "[86]" and realize that that is NOT an acceptable roll, so it will respond with a "no" then, recognize that the first number the "[89]" is unacceptable as well, and continue this process until it comes across the desired 'acceptable' number

I've been trying for quite some time to figure it out on my own, but I'm just not a very computer literate person, and I just can't manage to figure it out.

Thanks everyone for any and all responses
Australia Forum Administrator #1
Try searching this forum for "stat roller".
#2
Alright, I went through alot of the posts that came up when I searched for a stat roller, almost all of them have exactly the same reply this post did, go search... and there were a few that actually had codes posted, but unfortunatly they were abit far off from the way my MUD works and not only that, but I didn't understand them at all, heh.

Now, I made my own trigger set that seemed to have been working just fine, the only problem is I need it to trigger on prompt, not newline, in zmud that is as simple as checking a box, how can I make this happen with mushclient?
Australia Forum Administrator #3
I don't want to seem unhelpful, but we get so many requests for stat rollers, all slightly different. :)

I suggest for the newline issue you check out http://www.mushclient.com/faq point 11.

Since your stat roller prompt has a fairly static format, you could make a plugin that detects that (similar to the one described in the posts mentioned in the FAQ) that detects the stat line, and adds a newline to it, then the trigger will fire.
Australia Forum Administrator #4
This plugin should fix up the stat roller line to have a newline:


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>

<muclient>
<plugin
   name="Add_NewLine_To_Stats"
   author="Nick Gammon"
   id="dcc8965b129a0ed4c0dd157b"
   language="Lua"
   purpose="Forces a newline after a stats prompt"
   date_written="2008-01-04 16:00"
   requires="3.82"
   version="1.0"
   >

</plugin>


<!--  Script  -->


<script>
<![CDATA[
function OnPluginPacketReceived (s)
  return (string.gsub (s, "\n%[%d+%] Str: %d+ Int: %d+ Wis: %d+ Dex: %d+ Con: %d+ Keep%? %(Y/N%)", "%1\n"))
end -- function OnPluginPacketReceived
]]>
</script>

</muclient>



You need to save between the lines as Add_NewLine_To_Stats.xml and use the File -> Plugins menu item to install that file.
Amended on Fri 04 Jan 2008 04:52 AM by Nick Gammon
#5
Bassball would you post you trigger? I cannot figure out all of these codes and such. Thanks If he does not respond I need help with a layout like this...

[87] Str: 18 Int: 16 Wis: 17 Dex: 16 Con: 20 Keep? (Y/N)

desired:

[93] Str: 20 Int: 17 Wis: 18 Dex: 17 Con: 21 Keep? (Y/N)