Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Message
| Your first problem is that what you are attempting to do is not very realistic. I am assuming from your examples that the MUD randomly rolls stats for you, and you have an equal chance of being offered one of "excellent", "very good", "good", "decent", "average", "poor", "bad" or "awful". That means a 1 in 8 chance of each one. Now you have 6 stats, so to get excellent on all 8 you would have a 1 in 8 X 8 X 8 X 8 X 8 X 8 = 262,144 chance. You have said you would accept "very good" or "excellent" in charisma, which makes it slighly easier, namely 1 in 131,072 chance.
Put it another way, you need 131,072 rolls before you get that score, at say 10 seconds per roll, would take 21,845 minutes, which is 364 hours, which is 15 days. Frankly if I was the MUD admin and I found someone taking 15 days of continuous spamming of my MUD with attempts to roll the perfect stats I would boot them off for good.
However if you scale back your ambitions a bit, it can get easier. For example, you might want "average" or better for all stats (ie. 1 in 2 chance) plus "very good" or "excellent" for charisma. The odds for that should be:
4/8 X 4/8 X 4/8 X 4/8 X 4/8 X 2/8 = 1 in 128 chance. That is, only 128 rolls.
The plugin below will do that. It uses three triggers, the first one remembers the line with the Str, Dex and Int scores, the second one discards the roll if the above criteria are not met. The third trigger looks for the line "Your ability scores:", and uses that to enable the other triggers so you don't get false matches later on.
Just copy from below the line, and paste into a blank notepad window, and save as ScoreChecker.xml. Then add that file into MUSHclient using the plugins window.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, November 05, 2002, 5:34 PM -->
<!-- MuClient version 3.30 -->
<!-- Plugin "ScoreChecker" generated by Plugin Wizard -->
<muclient>
<plugin
name="ScoreChecker"
author="Nick Gammon"
id="e5035cb194f55fc466334012"
language="VBscript"
purpose="Checks stat rolls"
date_written="2002-11-05 17:32:55"
requires="3.27"
version="1.0"
>
<description trim="y">
<![CDATA[
This checks your stats (str, dex, wis etc.) and replies "Y" (to accept)
if they are OK, and "N" (to reject) if not.
See:
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=1936
for more details.
]]>
</description>
</plugin>
<!-- Triggers -->
<triggers>
<trigger
custom_colour="2"
enabled="y"
match="Your ability scores:"
script="OnStart"
sequence="100"
>
</trigger>
<trigger
custom_colour="3"
group="scores"
match="Str: * Dex: * Int: *"
script="OnLine1"
sequence="100"
>
</trigger>
<trigger
custom_colour="4"
group="scores"
match="Wis: * Con: * Cha: *"
script="OnLine2"
sequence="100"
>
</trigger>
</triggers>
<!-- Script -->
<script>
<![CDATA[
sub OnStart (sName, sLine, wildcards)
world.EnableGroup "scores", 1
end sub
'
' converts a word score into a number
'
function RateIt (score)
select case score
case "excellent" RateIt = 8
case "very good" RateIt = 7
case "good" RateIt = 6
case "decent" RateIt = 5
case "average" RateIt = 4
case "poor" RateIt = 3
case "bad" RateIt = 2
case "awful" RateIt = 1
case else RateIt = 0
end select
end function
sub OnLine1 (sName, sLine, wildcards)
'
' remember str, dex, int for next time
'
world.SetVariable "str", wildcards (1)
world.SetVariable "dex", wildcards (2)
world.SetVariable "int", wildcards (3)
end sub
sub OnLine2 (sName, sLine, wildcards)
dim str, dex, int, wis, con, cha, ok
str = world.GetVariable ("str")
dex = world.GetVariable ("dex")
int = world.GetVariable ("int")
wis = wildcards (1)
con = wildcards (2)
cha = wildcards (3)
ok = vbTrue
'
' see if it OK
'
if RateIt (str) < 4 then ok = vbFalse
if RateIt (dex) < 4 then ok = vbFalse
if RateIt (int) < 4 then ok = vbFalse
if RateIt (wis) < 4 then ok = vbFalse
if RateIt (con) < 4 then ok = vbFalse
if RateIt (cha) < 7 then ok = vbFalse
'
' accept scores if ok
'
if ok then
world.send "Y"
else
world.send "N"
end if
world.EnableGroup "scores", 0
end sub
]]>
</script>
</muclient>
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|