Stat Rolling Trigger

Posted by Krylan on Thu 21 Apr 2005 11:30 AM — 11 posts, 37,490 views.

#0
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
USA #1
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).
#2
The rolling code is alot different actually. Doesn't take as long and is very possible. Also, stat rollers are allowed there.
#3
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
USA #4
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>
#5
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?
#6
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
Amended on Sat 23 Apr 2005 09:34 PM by Krylan
USA #7
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).
Amended on Sat 23 Apr 2005 09:31 PM by Flannel
#8
 
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.
USA #9
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>
#10
Alright man, Thanks alot. I'm sure I annoyed the heck out of you but its really appreciated. Its working now...
Krylan