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 Stryker   (4 posts)  Bio
Date Reply #15 on Mon 18 Jul 2005 12:14 AM (UTC)

Amended on Mon 18 Jul 2005 12:20 AM (UTC) by Stryker

Message
I play a mud that has a stat roll setup similar to the first one mentioned in this forum subject. The only issue is there is a two space indention for the stats like so (forum won't show so I'm substituting "~" for a space):

Your ability scores:
~~Str: * Dex: * Int: *
~~Wis: * Con: * Cha: *

Using Nick Gammon's unaltered code the trigger recognized the 'Your ability scores:' but stopped. However, when I tried to compensate for the indention in the code provided by Nick Gammon by adding two spaces in front of 'Str:', 'match="~~Str: * Dex: * Int: *"' (Lines 49 and 57), the trigger recognized the text but would not accept stats within the limmits I gave it. For example, I changed all the stats to accept at least a 'poor' or 'awful' but even when all the stats were at least 'average' or 'decent' trigger would still output "N" to the mud.

I'm ignorant of all the scripting languages accepted by MUSHclient but with knowledge in C++ I understand some of what I see in the script provided by Nick Gammon. Therefore it would be helpful if someone could explain what I did wrong as well as show me what corrections to make.
Top

Posted by Chaosphos   (2 posts)  Bio
Date Reply #16 on Mon 21 Apr 2014 01:14 AM (UTC)
Message
Alright, I dunno if anyone is around to help on this anymore, but I am finally trying to build a stat roller for "The Final Challenge" (Which is the mud that Saladin was trying to play, as that is a dear friend of mine, that brought a smile to my face, I remember him rolling Saladin)



Saladin said:

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.


So the problem I think we're having (because I've been working on modifying the trigger to work with TFC with meh for success) is that it only gives the start line a single time (Your stats are). I tried setting the start line to register as line 1 and keep eveluating (Str: *. Int: *. etc) and am still having issues getting this to fire right. Can anyone help? My scripting skills are negligible but I'm trying! :P
Top

Posted by Chaosphos   (2 posts)  Bio
Date Reply #17 on Tue 22 Apr 2014 05:13 PM (UTC)
Message
Ok, so here is a copy/paste of the tweaked code I have that isn't working...if anyone sees where they can point me in the proper direction...

I did try shifting it to include the .'s into the structure, but it rolled forever, so now trying to uninclude them.

Some of these tweaks are resultant of reading other threads to try to make this more efficient...

Using 4.27 still...would updating help? Maybe I should try that...though last time I tried my color triggers broke, heh...

-----------------------------------------------

<?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="1"
keep_evaluating="y"
enabled="y"
match="Str: *. Int: *. Wis: *. Dex: *."
script="OnStart"
sequence="1"
>
</trigger>
<trigger
custom_colour="3"
enabled="y"
group="scores"
match="Str: *. Int: *. Wis: *. Dex: *."
script="OnLine1"
sequence="1"
>
</trigger>
<trigger
custom_colour="4"
enabled="y"
group="scores"
match="Con: *. Chr: *. Luc: *. - Accept? (Y/N):"
script="OnLine2"
sequence="1"
>
</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 "MAX" RateIt = 6
case "HIGH" RateIt = 5
case "AAVG" RateIt = 4
case "AVG" RateIt = 3
case "BAVG" RateIt = 2
case "LOW" RateIt = 1
case else RateIt = 0
end select

end function

sub OnLine1 (sName, sLine, wildcards)
'
' remember str, int, wis, dex for next time
'
world.SetVariable "str", "%1"
world.SetVariable "int", "%2"
world.SetVariable "wis", "%3"
world.SetVariable "dex", "%4"
end sub

sub OnLine2 (sName, sLine, wildcards)
dim str, int, wis, dex, con, chr, luc, ok

str = world.GetVariable ("str")
int = world.GetVariable ("int")
wis = world.GetVariable ("wis")
dex = world.GetVariable ("dex")
con = "%1"
chr = "%2"
luc = "%3"

ok = vbTrue

'
' see if it OK
'

if RateIt (str) < 2 then ok = vbFalse
if RateIt (int) < 2 then ok = vbFalse
if RateIt (wis) < 2 then ok = vbFalse
if RateIt (dex) < 2 then ok = vbFalse
if RateIt (con) < 2 then ok = vbFalse
if RateIt (chr) < 2 then ok = vbFalse
if RateIt (luc) < 5 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>
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #18 on Tue 22 Apr 2014 07:57 PM (UTC)
Message
I'm not a big fan of stat rollers these days because they can clog up the server with thousands of rolls.

Quote:

... that isn't working ...


Can you be more specific? What arrives? What happens?

- 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,667 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

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.