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 ➜ General ➜ Stat Roller for those that are code-stupid

Stat Roller for those that are code-stupid

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


Pages: 1 2  3  

Posted by Mapper   (20 posts)  Bio
Date Fri 18 Jul 2003 09:06 PM (UTC)

Amended on Fri 18 Jul 2003 09:08 PM (UTC) by Mapper

Message
K, I play a MUD where stat rolling is important. You can miss out on a lot if you don't get a good roll.

I have seen your huge, code intensive roller someone else asked about.

The thing is, I'm an idiot when it comes to code. I can make simple triggers and aliases, but I'm not a coder and I can't do anything special with MUSHclient.

Is there any way I can get or make a stat roller that's not horribly difficult for your code-moronic people to understand?

Is there something I can plug in to MUSHclient, or am I going to have to struggle with coding in order to get a character with a good roll?

Frankly if code is what I have to work with, I'll have to stick with a pen, paper, calculator and 5 hours of my time to spare.


I'm hoping and praying there's a simpler, easier-to-understand way to do this.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 18 Jul 2003 09:58 PM (UTC)
Message
The problem is, a lot of MUDs send the stats in a different way, so it is hard to do a general one.

However if you post your exact output, someone may do an example for you. :)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Mapper   (20 posts)  Bio
Date Reply #2 on Fri 18 Jul 2003 10:07 PM (UTC)
Message
Alrighty. You go in, pick your class and have to roll. For instance, I created a character, a human mage.

The numbers I start with are:

[Str: 42 Int: 55 Wis: 49 Dex: 39 Con: 39]
Keep these stats? (Y/N)

Now, I need to be able to have it roll until it reaches a specific total number, obviously. Each race and class has it's own "good" rolls, so the number of the total stats has to be veriable.

I should be able to specify that I'd like it to continue rolling until it reaches 230 total, for example, and until it gets to that number, adding up the stats, it continues to input "N" into the client for no.

When it hits my specified number, it should select "yes" automatically.

I've only played this one mud, so I have no idea if it works the same on all of them. Pardon me if I'm giving you information you're already aware of.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #3 on Fri 18 Jul 2003 11:16 PM (UTC)

Amended on Fri 18 Jul 2003 11:20 PM (UTC) by Nick Gammon

Message
OK, that looks easy enough. You need a couple of triggers (one for each line) and an alias to set up the total you want ...



<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   match="[Str: * Int: * Wis: * Dex: * Con: *]"
   send_to="12"
   sequence="100"
  >
  <send>
SetVariable "str", "%1"
SetVariable "int", "%2"
SetVariable "wis", "%3"
SetVariable "dex", "%4"
SetVariable "con", "%5"
</send>
  </trigger>
  <trigger
   custom_colour="3"
   enabled="y"
   match="Keep these stats? (Y/N)*"
   send_to="12"
   sequence="100"
  >
  <send>dim total

total = CInt (GetVariable ("str")) _
      + CInt (GetVariable ("int")) _
      + CInt (GetVariable ("wis")) _
      + CInt (GetVariable ("dex")) _
      + CInt (GetVariable ("con"))

if total &gt;= CInt (GetVariable ("total_wanted")) then
  Send "Y"
  Note "** Accepted total stats of " &amp; total
else
  Send "N"
  Note "Rejected total stats of " &amp; total
end if

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

<aliases>
  <alias
   match="stats *"
   enabled="y"
   variable="total_wanted"
   send_to="9"
   sequence="100"
  >
  <send>%1</send>
  </alias>
</aliases>





Copy between the lines and go into MUSHclient File menu, select Import and click on Clipboard. That should install it all.

Then type:

stats 230

(or whatever figure) and that will set up a variable to remember the total you are aiming for. Don't make it too high or you will spam the MUD as the total will never be reached.

Then when you connect the first trigger will match and remember the settings for each entry (str, dex, wis and so on) into variables.

Then the second trigger (Keep these stats? (Y/N)) adds them together and compares to your limit, and sends Y or N.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Mapper   (20 posts)  Bio
Date Reply #4 on Sat 19 Jul 2003 02:21 AM (UTC)
Message
I did as you instructed and got:

Line 6: Value '12' too large in numeric attribute named 'send_to'. Range is 0 to 9. (trigger not loaded)
Line 21: Value '12' too large in numeric attribute named 'send_to'. Range is 0 to 9. (trigger not loaded)
Line 49: Attribute not used: send_to="9" (alias)
Line 50: Attribute not used: sequence="100" (alias)
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #5 on Sat 19 Jul 2003 02:31 AM (UTC)
Message
Sounds like you have an earlier version of MUSHclient. These fancy "send to script" things are supported in the latest version.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Mapper   (20 posts)  Bio
Date Reply #6 on Sat 19 Jul 2003 03:15 AM (UTC)

Amended on Sat 19 Jul 2003 03:43 AM (UTC) by Mapper

Message
K, let's totally start over here instead of editing to death.

I downloaded 3.42 and it accepted the stuff. Now, it keeps telling me:


Keep these stats? (Y/N) [Str: 20 Int: 69 Wis: 46 Dex: 48 Con: 29]
N
rejected total stats of 223
Keep these stats? (Y/N) [Str: 25 Int: 75 Wis: 58 Dex: 51 Con: 25]
N
Rejected total stats of 223


Even thought the numbers are changing and some are NOT adding up to 223.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #7 on Sat 19 Jul 2003 04:00 AM (UTC)
Message
You can see it is merging together the lines about keeping the stats, and the next line of stats.

Change the match string to have an extra wildcard, like this:


match="*[Str: * Int: * Wis: * Dex: * Con: *]"

That first asterisk will match the other stuff.

Then change each wildcard to add 1 to it (to skip the first one), like this:


SetVariable "str", "%2"
SetVariable "int", "%3"
SetVariable "wis", "%4"
SetVariable "dex", "%5"
SetVariable "con", "%6"

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Mapper   (20 posts)  Bio
Date Reply #8 on Sat 19 Jul 2003 04:14 AM (UTC)

Amended on Sat 19 Jul 2003 04:24 AM (UTC) by Mapper

Message
Well, now instead of saying "rejected stat of 223", it's saying "rejected stat of 0"

I tried tweaking and got:

[Str: 42 Int: 54 Wis: 45 Dex: 43 Con: 36]
Keep these stats? (Y/N) [Str: 42 Int: 50 Wis: 49 Dex: 43 Con: 45]
Keep these stats? (Y/N) Keep these stats? (Y/N)

It's making me manually enter No, now.

Ugh. I hate code, I hate code...
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #9 on Sat 19 Jul 2003 04:23 AM (UTC)
Message
Change the total calculation slightly to recalc as it receives and sets each variable, kinda like:

SetVariable "str", "%2"
total = CInt (GetVariable ("str"))
SetVariable "int", "%3"
total = CInt (total + ("int"))
SetVariable "wis", "%4"
total = CInt (total + ("wis"))
SetVariable "dex", "%5"
total = CInt (total + ("dex"))
SetVariable "con", "%6"
total = CInt (total + ("con"))


You'll probly also want to set total to 0 at the beginning of each iteration of the loop if you do this otherwise it will guarantee an acceptance of the 2nd roll.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Mapper   (20 posts)  Bio
Date Reply #10 on Sat 19 Jul 2003 04:26 AM (UTC)

Amended on Sat 19 Jul 2003 04:27 AM (UTC) by Mapper

Message
"You'll probly also want to set total to 0 at the beginning of each iteration of the loop if you do this otherwise it will guarantee an acceptance of the 2nd roll."


Hahahah. That makes no sense. I don't even know what an iteration is.

I'm a code moron, remember? :)

Anyway, now I'm getting:

Type mismatch: 'CInt'
Line in error:



I'm afraid I've screwed somethign up horribly.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #11 on Sat 19 Jul 2003 06:08 AM (UTC)
Message
Meerclar, you left out a "getvariable" in your post.

Anyway, my method should have worked, and not needed tweaking. Can you copy and post the two triggers as you have amended them?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #12 on Sat 19 Jul 2003 06:53 AM (UTC)
Message
Eh, guess thats why I shouldna be coding on 8 hours of sleep in the past week. Though in my defense, I did say "kinda like" the example I gave. As for why yours didnt work, I dunno either, it *should* have the way it was written but such is the world of microsoft. I also lied when I said it would need to be set to 0 at the beginning of each roll, the first stat would automatically clear the old total. (DUH!) Bad coder, no cookies for me. (Oh, wait, I don't have any anyway... )

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Mapper   (20 posts)  Bio
Date Reply #13 on Sat 19 Jul 2003 07:17 PM (UTC)
Message
Sure:

"*[Str: * Int: * Wis: * Dex: * Con: *]"

SetVariable "str", "%2"
SetVariable "int", "%3"
SetVariable "wis", "%4"
SetVariable "dex", "%5"
SetVariable "con", "%6"





Keep these stats? (Y/N)*

total = CInt (GetVariable ("str")) _
+ CInt (GetVariable ("int")) _
+ CInt (GetVariable ("wis")) _
+ CInt (GetVariable ("dex")) _
+ CInt (GetVariable ("con"))

if total >= CInt (GetVariable ("total_wanted")) then
Send "Y"
Note "** Accepted total stats of " & total
else
Send "N"
Note "Rejected total stats of " & total
end if






I'm still getting:


keep these stats? (Y/N) [Str: 36 Int: 56 Wis: 51 Dex: 35 Con: 37]
N
Rejected total stats of 0
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #14 on Sat 19 Jul 2003 09:09 PM (UTC)
Message
Oh, OK, I see. The second trigger is firing to take precedence over the first one.

Edit the "*[Str: * Int: * Wis: * Dex: * Con: *]" trigger and change its sequence number to 90, so it fires first.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


101,236 views.

This is page 1, subject is 3 pages long: 1 2  3  [Next page]

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.