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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  Stat Rolling Trigger

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Stat Rolling Trigger

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Krylan   (8 posts)  [Biography] bio
Date Thu 21 Apr 2005 11:30 AM (UTC)  quote  ]
Message
Ok, I'm trying to set up a stat rolling trigger.
The MUD sends :
Your roll: 10, 14, 13, 8, 12, 6
It's always randomized of course. I want to be able to get 4 18s and the other 2 above 12. I'm not sure how to set this up. Everything I've tried has failed. And of course it doesn't matter where they number are. Any help would be appreciated. I've just begun to learn VBscript.
Krylan
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Thu 21 Apr 2005 06:49 PM (UTC)  quote  ]
Message
This has been covered plenty of times. Do a search of "stat roller" in the mushclient forums and you'll return lots of things.

However, assuming three dice per number, You're going to be waiting an awful long time for those 4 18s.
Heck, one 18 is only 0.46% four would be: 0.000045%. And then the probability of rolling a 12 or above is 50.25% which means your total probability is only: 0.000011%.
Which is 1 out of 9090909 rolls.

So, while this may not be hard to code, you should definately think about relaxing your requirements, since assuming you get 10 rolls a second (which is probably more than what you'll get) it will take you a little over 10 and a half days to get that roll. Let alone being conected (and throttling a steady stream of bandwidth) for those 10 days will probably get you noticed by the admin, and reprimanded, even if stat rollers are allowed (which in many places they aren't).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Krylan   (8 posts)  [Biography] bio
Date Reply #2 on Fri 22 Apr 2005 01:16 AM (UTC)  quote  ]
Message
The rolling code is alot different actually. Doesn't take as long and is very possible. Also, stat rollers are allowed there.
[Go to top] top

Posted by Krylan   (8 posts)  [Biography] bio
Date Reply #3 on Sat 23 Apr 2005 08:15 PM (UTC)  quote  ]
Message
Ok, I've been searching through the forums and I still can't find anything that helps me. All the autorollers I see are matched up with str, int, dex, etc... All I need is it to stop rerolling on a line that has 4 18s. Like I said I searched the forums, and I'm not very good with scripts etc. I don't care if its done through vbscript or not, I'd just like to see how to do it. I'm trying to learn. Thanks
Krylan
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #4 on Sat 23 Apr 2005 09:07 PM (UTC)  quote  ]
Message
Alright, here you go. It's pretty cut and dry, could have made it more complicated (but a lot shorter), but this works and should serve to help you figure out how this stuff works.

Basically all it does is count the number of things that are above 12, and also the ones that are 18, and then if everything is above 12 it checks to see if four or more are 18. You can change the note lines (note "asdfaf") to send lines (send "yes") to send whatever (probably Y or N). The notes send it to the client (you can see it, server cant) and the sends actually send it to the server.

It also colors the line that it matches (if you don't get color, the trigger isnt working). If the trigger isn't catching, you either aren't having the line end in a newline, or there is something else in the line (more spaces, perhaps?) and we'll need to fix that.

<triggers>
  <trigger
   custom_colour="4"
   enabled="y"
   match="^Your roll: (\d+), (\d+), (\d+), (\d+), (\d+), (\d+)$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>dim max,med
max = 0
med = 0
if ("%1" &gt;= 12) then
  med = med + 1
  if ("%1" = 18) then
    max = max + 1
  end if
end if
if ("%2" &gt;= 12) then
  med = med + 1
  if ("%2" = 18) then
    max = max + 1
  end if
end if
if ("%3" &gt;= 12) then
  med = med + 1
  if ("%3" = 18) then
    max = max + 1
  end if
end if
if ("%4" &gt;= 12) then
  med = med + 1
  if ("%4" = 18) then
    max = max + 1
  end if
end if
if ("%5" &gt;= 12) then
  med = med + 1
  if ("%5" = 18) then
    max = max + 1
  end if
end if
if ("%6" &gt;= 12) then
  med = med + 1
  if ("%6" = 18) then
    max = max + 1
  end if
end if

'done figuring out values
if (med = 6) then
  if (max &gt;= 4) then
    note "Yes!"
  else
    note "Almost! (all above 12)"
  end if
else
  note "nope"
end if</send>
  </trigger>
</triggers>

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Krylan   (8 posts)  [Biography] bio
Date Reply #5 on Sat 23 Apr 2005 09:21 PM (UTC)  quote  ]
Message
Thanks, It's not catching though. I don't think its spaces, I double checked... *shrug* I'm not sure whats going on. Where should I look?
[Go to top] top

Posted by Krylan   (8 posts)  [Biography] bio
Date Reply #6 on Sat 23 Apr 2005 09:24 PM (UTC)  quote  ]

Amended on Sat 23 Apr 2005 09:34 PM (UTC) by Krylan

Message
Hmm, I think I found something. It'll work if the line returns something like this :
Your roll: 15, 13, 13, 12, 11, 12
It's not liking single digits cause it won't catch this line:
Your roll: 8, 17, 13, 15, 8, 10
or any line that contains a single digit
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #7 on Sat 23 Apr 2005 09:29 PM (UTC)  quote  ]

Amended on Sat 23 Apr 2005 09:31 PM (UTC) by Flannel

Message
There's probably an extra space infront of the digit then (where the 1 is in 10 is a space in " 8")
Could you post a few lines, inside of [code] [/code] tags? (that way they will remained spaced properly).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Krylan   (8 posts)  [Biography] bio
Date Reply #8 on Sat 23 Apr 2005 09:36 PM (UTC)  quote  ]
Message
 
Your roll:  8, 17, 13, 15,  8, 10
Your roll: 15, 13, 13, 12, 11, 12
Your roll: 10,  8, 12,  7, 14, 13

Sorry, forgot about using tags. lol.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #9 on Sat 23 Apr 2005 09:38 PM (UTC)  quote  ]
Message
Yep, thought so. Alright, here's the modified trigger:
All it is is an extra space, with a ? (extra space, but it may or may not be there).

<triggers>
  <trigger
   custom_colour="4"
   enabled="y"
   match="^Your roll:  ?(\d+),  ?(\d+),  ?(\d+),  ?(\d+),  ?(\d+),  ?(\d+)$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>dim max,med
max = 0
med = 0
if ("%1" &gt;= 12) then
  med = med + 1
  if ("%1" = 18) then
    max = max + 1
  end if
end if
if ("%2" &gt;= 12) then
  med = med + 1
  if ("%2" = 18) then
    max = max + 1
  end if
end if
if ("%3" &gt;= 12) then
  med = med + 1
  if ("%3" = 18) then
    max = max + 1
  end if
end if
if ("%4" &gt;= 12) then
  med = med + 1
  if ("%4" = 18) then
    max = max + 1
  end if
end if
if ("%5" &gt;= 12) then
  med = med + 1
  if ("%5" = 18) then
    max = max + 1
  end if
end if
if ("%6" &gt;= 12) then
  med = med + 1
  if ("%6" = 18) then
    max = max + 1
  end if
end if

'done figuring out values
if (med = 6) then
  if (max &gt;= 4) then
    note "Yes!"
  else
    note "Almost! (all above 12)"
  end if
else
  note "nope"
end if</send>
  </trigger>
</triggers>

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Krylan   (8 posts)  [Biography] bio
Date Reply #10 on Sat 23 Apr 2005 09:42 PM (UTC)  quote  ]
Message
Alright man, Thanks alot. I'm sure I annoyed the heck out of you but its really appreciated. Its working now...
Krylan
[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.


1,861 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]