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 ➜ Automated rolls

Automated rolls

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


Pages: 1 2  

Posted by Rhytnen   (2 posts)  Bio
Date Sat 02 Nov 2002 11:16 PM (UTC)
Message

Your ability scores:
Str: excellent Dex: very good Int: average
Wis: decent Con: very good Cha: poor

Press 'Y' to keep these stats, and 'N' to reroll:


The above is what rolling abilities looks like on the MUD I play.


Cha: average
Trigger input: no

Cha: awful
Trigger input: no

Cha: bad
Trigger input: no

Cha: below average
Trigger input: no

Cha: decent
Trigger input: no

Cha: excellent
Trigger input: *play sound*

Cha: good
Trigger input: no

Cha: poor
Trigger input: no

Cha: very good
Trigger input: *play sound*


These are the triggers I have set up for rolling abilities. "No" is the trigger input for all rolls save "excellent" and "very good." As you can see, my triggers are based entirely on charisma, and as a result, where my charisma may be excellent or very good, strength or some other ability is apt to be bad or poor or average. My question is, how can I get Cha: excellent or Cha: very good to prompt checks on strength, dexterity, intelligence, wisdom, and constitution to make sure they're all excellent, and if they're not all excellent, or one is not excellent, no will be the trigger input? Basically, how can I get the client to cease an automated roll until strength, dexterity, intelligence, wisdom, and constitution are all excellent, and charisma either very good or excellent? (It is a rarity that excellent charisma be ascertained.)


Your ability scores:
Str: excellent Dex: excellent Int: excellent
Wis: excellent Con: excellent Cha: excellent

or

Your ability scores:
Str: excellent Dex: excellent Int: excellent
Wis: excellent Con: excellent Cha: very good


The above is what I endeavor. How would I script an automated roll to accomplish this?
Top

Posted by Vaejor   (120 posts)  Bio
Date Reply #1 on Sun 03 Nov 2002 12:19 AM (UTC)
Message
Trigger:

(Str|Dex|Int|Wis|Con|Cha): (average|aweful|good| <etc> )

Let it match mulitiple times on the same line

In your script, you'll need 2 global variables, 1 to keep track of how many stats have been processed during this run, another to keep track of how many 'very good' and 'excellent' have been found.

When total matches is =6, then check to see if good matches =6, if not, world.send "no" and reset both numbers back to 0. If both are 6, then send the sound.
Top

Posted by Rhytnen   (2 posts)  Bio
Date Reply #2 on Sun 03 Nov 2002 01:07 AM (UTC)
Message
Er, easy enough.

But, I know absolutely _nothing_ about scripting. Could you go into a little more detail please? =]

Thanks.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #3 on Tue 05 Nov 2002 08:00 PM (UTC)
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

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #4 on Wed 06 Nov 2002 08:10 PM (UTC)
Message
Not to mention that the MUD probably assigns a predefined number of stat points to each stat, i.e. if you get one stat as excellent, another one will be bad, etc, so you can naver get excellent in all stats. I might be wrong though.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Gore   (207 posts)  Bio
Date Reply #5 on Sat 28 Jun 2003 09:34 PM (UTC)
Message
Am I allowed to modify this plug in for a different mud type? If so, can someone help me modify - the stats screen looks like this


Your stats are:
Current Racial
Stat Max
Agility : 43 85
Stamina : 40 80
Strength : 78 100
Quickness : 82 105
Willpower : 26 50
Perception : 65 65
Intelligence: 71 75
Is this acceptable?

Then you say Y or N
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #6 on Sun 29 Jun 2003 05:00 AM (UTC)
Message
You are allowed to, certainly, plugins are provided for your playing pleasure.

You would need a trigger per line (or a more complex regular-expression trigger), where each one remembers its score, and then on the "Is this acceptable?" line you would look at the saved scores and make a decision.

Bear in mind what I said above for trying for too high a score.

- Nick Gammon

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

Posted by Saladin   (4 posts)  Bio
Date Reply #7 on Mon 30 Jun 2003 04:56 PM (UTC)
Message
A new mud I have tried to play looks like this:

Your stats are:

Str: AVG. Int: AVG. Wis: HIGH. Dex: BAVG.
Con: LOW. Chr: LOW. Luc: HIGH. - Accept? (Y/N):

How would I change the trigger start to account for the return between "Your stats are:" and "Str: AVG. Int: AVG. Wis: HIGH. Dex: BAVG."?
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #8 on Mon 30 Jun 2003 09:34 PM (UTC)
Message
Ignore it. The important lines are the other three. You need three triggers, like this:

Your stats are:
Str: *. Int: *. Wis: *. Dex: *.
Con: *. Chr: *. Luc: *. - Accept? (Y/N):

The first one enables the other two.

The second one remembers the results (str, int, wis, dex) in variables.

The third one makes the decision. If it accepts (sends Y) then it disables all three triggers. If not, it sends N and waits for the lines to appear again.

The blank line will not trigger anything and won't cause any harm.


- Nick Gammon

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

Posted by Saladin   (4 posts)  Bio
Date Reply #9 on Mon 30 Jun 2003 10:10 PM (UTC)
Message
I tried it again. But it still seems to acknoledge the return because I tried it on a mud without the space between "Your stats are:" and the Stats and it worked. But with the space it didn't. Please help me to realize why it won't ignore the return.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #10 on Mon 30 Jun 2003 11:12 PM (UTC)
Message
It won't be the blank line, but you might need to carefully look at each trigger. For example, is there a trailing space after "Your stats are:"?

Set each trigger to a different colour, then you will see which, if any, are matching. If they don't match you need to check that you have them right. An extra space here or there will throw them out.

- Nick Gammon

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

Posted by Erald   (2 posts)  Bio
Date Reply #11 on Mon 02 Feb 2004 08:52 PM (UTC)
Message
The mud i play at is anotherworld.org p:4000.
can anyone help me addapt/write a scrip for rolling the perfect stats on it.
it looks like this

Your abilities are:
Str(5spaces)Excellent
Int(5spaces)Excellent
Wis(5spaces)Excellent
Dex(5spaces)Excellent
Con(5spaces)Excellent
Cha(5spaces)i dont care about this one

Do you want to retain these abilities? [y/N]

So can anyone help me?
Also this mud forces the last stats you rolled on you after some 15-20 min or rolling. I would like to know if a way to reconnect, chose a certain gender, race, and class then keep rolling is possible (so i dont have to go back doing it :)
All your help would be mutch apprichiated
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #12 on Mon 02 Feb 2004 09:36 PM (UTC)
Message
Ah, this is the post I was talking about.

You are being given 20 minutes, but it might take 9 hours to get 5 excellents. It seems they are on to you. :)

The stat roller is simple enough, you need 5 or 6 triggers (or one more complex one) with a bit of scripting. See the other posts about rollers, at least the triggers for yours will be easy enough.

- Nick Gammon

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

Posted by Elihamblet   (1 post)  Bio
Date Reply #13 on Thu 29 Apr 2004 06:33 AM (UTC)

Amended on Thu 29 Apr 2004 06:39 AM (UTC) by Elihamblet

Message
I know this is probably a lot simplier than what your previous example was but I've never used scripts before.
What I'm trying to match is:

Str: 19 Int: 14 Wis: 15 Dex: 8 Con: 12 Cha: 11 Lck: 13
Keep? (Y/N)
n

Str: 19 Int: 14 Wis: 17 Dex: 7 Con: 13 Cha: 13 Lck: 17
Keep? (Y/N)

Something similar to this. I attempted to modify what you had....though I have no clue how close I've come to success or dismal faliure :P

Any help would be appreciated.
What I've changed it to is:

<?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="3"
group="scores"
match="Str: * Int: * Wis: * Dex: * Con: * Cha: * Lck: *"
script="OnLine1"
sequence="100"
>
</trigger>
</triggers>

<!-- Script -->


<script>
<![CDATA[

'
' converts a word score into a number
'


sub OnLine1 (sName, sLine, wildcards)
'
' remember str, dex, int for next time
'
world.SetVariable "str", wildcards (1)
world.SetVariable "int", wildcards (2)
world.SetVariable "wis", wildcards (3)
world.SetVariable "dex", wildcards (4)
world.SetVariable "con", wildcards (5)
world.SetVariable "cha", wildcards (6)
world.SetVariable "lck", wildcards (7)

end sub

ok = vbTrue

'
' see if it OK
'

if wildcards (1) < 15 then ok = vbFalse
if wildcards (2) < 15 then ok = vbFalse
if wildcards (3) < 15 then ok = vbFalse
if wildcards (4) < 15 then ok = vbFalse
if wildcards (5) < 15 then ok = vbFalse
if wildcards (6) < 15 then ok = vbFalse
if wildcards (7) < 15 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>


Once again, thanks.
-Eli hamblet
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #14 on Thu 29 Apr 2004 06:50 AM (UTC)

Amended on Thu 29 Apr 2004 06:51 AM (UTC) by Nick Gammon

Message
You get syntax errors I presume? It seems to be missing a Sub here and there.

Your example looks simple enough for one trigger. Something like this:


<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   match="Str: * Int: * Wis: * Dex: * Con: * Cha: * Lck: *"
   send_to="12"
   sequence="100"
  >
  <send>if (%1 + %2 + %3 + %4 + %4 + %6 + %7) &gt; 30 then
  Send "Y"
else
  Send "N"
end if</send>
  </trigger>
</triggers>


- 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.


67,262 views.

This is page 1, subject is 2 pages long: 1 2  [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.