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
➜ VBscript
➜ Stat Rolling Trigger
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Krylan
(8 posts) Bio
|
Date
| Thu 21 Apr 2005 11:30 AM (UTC) |
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 | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #1 on Thu 21 Apr 2005 06:49 PM (UTC) |
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. | Top |
|
Posted by
| Krylan
(8 posts) Bio
|
Date
| Reply #2 on Fri 22 Apr 2005 01:16 AM (UTC) |
Message
| The rolling code is alot different actually. Doesn't take as long and is very possible. Also, stat rollers are allowed there. | Top |
|
Posted by
| Krylan
(8 posts) Bio
|
Date
| Reply #3 on Sat 23 Apr 2005 08:15 PM (UTC) |
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 | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #4 on Sat 23 Apr 2005 09:07 PM (UTC) |
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" >= 12) then
med = med + 1
if ("%1" = 18) then
max = max + 1
end if
end if
if ("%2" >= 12) then
med = med + 1
if ("%2" = 18) then
max = max + 1
end if
end if
if ("%3" >= 12) then
med = med + 1
if ("%3" = 18) then
max = max + 1
end if
end if
if ("%4" >= 12) then
med = med + 1
if ("%4" = 18) then
max = max + 1
end if
end if
if ("%5" >= 12) then
med = med + 1
if ("%5" = 18) then
max = max + 1
end if
end if
if ("%6" >= 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 >= 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. | Top |
|
Posted by
| Krylan
(8 posts) Bio
|
Date
| Reply #5 on Sat 23 Apr 2005 09:21 PM (UTC) |
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? | Top |
|
Posted by
| Krylan
(8 posts) Bio
|
Date
| Reply #6 on Sat 23 Apr 2005 09:24 PM (UTC) 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 | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #7 on Sat 23 Apr 2005 09:29 PM (UTC) 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. | Top |
|
Posted by
| Krylan
(8 posts) Bio
|
Date
| Reply #8 on Sat 23 Apr 2005 09:36 PM (UTC) |
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. | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #9 on Sat 23 Apr 2005 09:38 PM (UTC) |
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" >= 12) then
med = med + 1
if ("%1" = 18) then
max = max + 1
end if
end if
if ("%2" >= 12) then
med = med + 1
if ("%2" = 18) then
max = max + 1
end if
end if
if ("%3" >= 12) then
med = med + 1
if ("%3" = 18) then
max = max + 1
end if
end if
if ("%4" >= 12) then
med = med + 1
if ("%4" = 18) then
max = max + 1
end if
end if
if ("%5" >= 12) then
med = med + 1
if ("%5" = 18) then
max = max + 1
end if
end if
if ("%6" >= 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 >= 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. | Top |
|
Posted by
| Krylan
(8 posts) Bio
|
Date
| Reply #10 on Sat 23 Apr 2005 09:42 PM (UTC) |
Message
| Alright man, Thanks alot. I'm sure I annoyed the heck out of you but its really appreciated. Its working now...
Krylan | 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.
26,949 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top