Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
psm
Novice


Joined: 19 Jan 2002
Posts: 34
Location: Austria

PostPosted: Wed Jan 30, 2002 6:38 am   

Autoroller script please
 
ok, i am asking you guys for help.
I would like to try an autorollen on Sojourn3

the output looks like:

Your basic stats:
Strength: fair Power: mundane
Dexterity: fair Intelligence: average
Agility: average Wisdom: mundane
Constitution: good Charisma: bad


Explanation of stats:
Bad: 25-50 Mundane: 51-65 Average: 66-75
Fair: 76-81 Good: 82-87 Mighty: 88-93
Heroic: 94-99 Perfect: 100

You may choose to reroll your character at this time. If you elect
to reroll, these stats will be erased and new ones rolled. To reroll,
select 'y' (or hit <return>). To keep this character, and continue
character generation, select 'n'.
Do you want to reroll this char (y/n) [y]:

Now i'd like the script type "yes" until i have, let say:

Strength: mighty(or better) Power: mundane(or better)
Dexterity: good(or better) Intelligence: average(exactly)
Agility: average(or better) Wisdom: does not matter
Constitution: good(or better) Charisma: mundane(or worse)

if i get that, the script should make some sort of alarm, like a beep or something.

how would i set this up (and please explain it to me like to a complete newbie, because i am :)

thanks a lot[burple][/burple][burple][/burple]
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Wed Jan 30, 2002 7:28 am   
 
Try this:

#VAR bad {25}
#VAR mundane {51}
#VAR average {66}
#VAR fair {76}
#VAR good {82}
#VAR mighty {88}
#VAR heroic {94}
#VAR perfect {100}
#VAR power {}
#VAR dex {}
#VAR int {}
#VAR str {}
#VAR agil {}
#VAR con {}
#VAR cha {}

#TRIGGER {Strength~: (%w) Power~: (%w)$Dexterity~: (%w) Intelligence~: (%w)$Agility~: (%w) Wisdom~: %w$Constitution~: (%w) Charisma~: (%w)} {#var str @{%1};#var power @{%2};#var dex @{%3};#var int @{%4};#var agil @{%5};#var con @{%6};#var cha @{%7}}

#TRIGGER {Do you want to reroll this char ~(y/n~) ~[y~]:} {#if (@str>=@mighty and @power>=@mundane and @dex>=@good and @int=@average and @agil>=@average and @con>=@good and @cha<=@mundane) {#beep} {y}} "" {"prompt"}


Iljhar
Reply with quote
psm
Novice


Joined: 19 Jan 2002
Posts: 34
Location: Austria

PostPosted: Wed Jan 30, 2002 9:06 am   
 
thx for the fast reply.

I entered all you wrote, but nothing happens, also a pattern test does not work
what's wrong with it?

thx
Reply with quote
psm
Novice


Joined: 19 Jan 2002
Posts: 34
Location: Austria

PostPosted: Wed Jan 30, 2002 11:59 am   
 
Ok, i made some changes myself, because some things did not seem right, and it did not work, but then again, i don't really understand the scripting, so please be nice :)

ok, here is what i did:

#VAR bad {bad}
#VAR mundane {mundane}
#VAR average {average}
#VAR fair {fair}
#VAR good {good}
#VAR mighty {mighty}
#VAR heroic {heroic}
#VAR perfect {perfect}
#VAR str {Strength}
#VAR power {Power}
#VAR dex {Dexterity}
#VAR int {Intelligence}
#VAR agil {Agility}
#VAR wis {Wisdom}
#VAR con {Constitution}
#VAR cha {Charisma}

#TRIGGER {Do you want to reroll this char ~(y/n~) ~[y~]~:} {#if (@str>=@mundane and @power>=@mundane and @dex>=@mundane and @int=@mundane and @agil>=@mundane and @wis>=@mundane and @con>=@mundane and @cha>=@mundane) {#beep} {y}} "" {prompt}

#TRIGGER {Strength~: (%w) Power~: (%w)$Dexterity~: (%w) Intelligence~: (%w)$Agility~: (%w) Wisdom~: (%w)$Constitution~: (%w) Charisma~: (%w)} {#var str @{%1};#var power @{%2};#var dex @{%3};#var int @{%4};#var agil @{%5};#var wis @{%6};#var con @{%7};#var cha @{%8}} "" {color}


But now it does not stop and goes on forever, allthought, i put all the stats on mundane or better, which is the second lowest. I watched the output and i saw the stats in the wanted range, but the trigger did neither beep nor stop sending a "y"
what's wrong with it?

BTW: i would also like to insert a timeout of 2 seconds, before the trigger should send the "y", so that i do not spam the mud.

thx
psm
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Jan 30, 2002 12:05 pm   
 
The problem is that it seems you MUD output has some spaces but when you pasted that in the forum, it did not show, because the forum removes extra spaces. It seems the output should really look like this:
Strength:        fair    Power:           mundane
Dexterity:       fair    Intelligence:    average
Agility:         average Wisdom:          mundane
Constitution:    good    Charisma:        bad

Change the pattern of the trigger to this:
Strength~:%s(%w)%sPower~:%s(%w)$Dexterity~:%s(%w)%sIntelligence~:%s(%w)$Agility~:%s(%w)%sWisdom~:%s%w$Constitution~:%s(%w)%sCharisma~:%s(%w)

Kjata
Reply with quote
psm
Novice


Joined: 19 Jan 2002
Posts: 34
Location: Austria

PostPosted: Wed Jan 30, 2002 12:14 pm   
 
You were right with the spaces, but it still does not work.
here is an example of the output while the trigger was running. as you can see, all stats are at, or above the requested and the trigger keeps on going.
(i might note, that the stat-values are in color(eg fair=yellow), tho i turned off the anis-option in the trigger)

Rerolling this character.


Your basic stats:
Strength: fair Power: mundane
Dexterity: average Intelligence: mundane
Agility: mundane Wisdom: average
Constitution: fair Charisma: mundane


Explanation of stats:
Bad: 25-50 Mundane: 51-65 Average: 66-75
Fair: 76-81 Good: 82-87 Mighty: 88-93
Heroic: 94-99 Perfect: 100

You may choose to reroll your character at this time. If you elect
to reroll, these stats will be erased and new ones rolled. To reroll,
select 'y' (or hit <return>). To keep this character, and continue
character generation, select 'n'.
Do you want to reroll this char (y/n) [y]: y
y
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Jan 30, 2002 12:16 pm   
 


Your basic stats:
Strength: fair Power: mundane
Dexterity: average Intelligence: mundane
Agility: mundane Wisdom: average
Constitution: fair Charisma: mundane


A touch up to Kjata's post:
Strength~:%s(%w)%sPower~:%s(%w)$Dexterity~:%s(%w)%sIntelligence~:%s(%w)$Agility~:%s(%w)%sWisdom~:%s(%w)$Constitution~:%s(%w)%sCharisma~:%s(%w)
TonDiening
Uses 6.16
Reply with quote
psm
Novice


Joined: 19 Jan 2002
Posts: 34
Location: Austria

PostPosted: Wed Jan 30, 2002 12:19 pm   
 
yep, that's the correct format, thanks TonDiening :)
Reply with quote
psm
Novice


Joined: 19 Jan 2002
Posts: 34
Location: Austria

PostPosted: Wed Jan 30, 2002 2:49 pm   
 
ok, althought i am a stupid in scripting, i think i found something
i think, the trigger does not really understand the value of the stats

iljhar set them to numbers:

#VAR bad {25}
#VAR mundane {51}
#VAR average {66}
#VAR fair {76}
#VAR good {82}
#VAR mighty {88}
#VAR heroic {94}
#VAR perfect {100})

which does not work, because there are no numbers in the stat-roll, so i set them to:

#VAR bad {bad}
#VAR mundane {mundane}
#VAR average {average}
#VAR fair {fair}
#VAR good {good}
#VAR mighty {mighty}
#VAR heroic {heroic}
#VAR perfect {perfect}

which are the actual string the trigger should look out for, right?
now if i set the trigger to:

#if (@str=mundane and @power=mundane and @dex=mundane and @int=@mundane and @agil=mundane and @wis=mundane and @con>=mundane and @cha>=mundane) {#beep} {y}

the trigger will re-roll until all stats are at "mundane".

if i set the trigger to:

#if (@str>=mundane and @power<=mundane and @dex>=mundane and @int>=@mundane and @agil=mundane and @wis=mundane and @con<=mundane and @cha>=mundane) {#beep} {y}

the trigger would still re-roll until all stats are on mundane, becaue he does not know what is higher or lower.
what i would need now, is a way to let the trigger know, that bad is lower the mundane which again is lower then average and so on.
so how can i add this into the variables?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Jan 30, 2002 3:18 pm   
 
What iljhar did was to make an elegant
way to convert the words into numbers so
you can then use the >= (higher/lower)
between numbers.

Tweak iljhar's orignal trigger as well:
#TRIGGER {Do you want to reroll this char ~(y/n~) ~[y~]:} {#if (@str>=@mighty and @power>=@mundane and @dex>=@good and @int>=@average and @agil>=@average and @con>=@good and @cha>=@mundane) {#beep} {y}} "" {"prompt"}

Works for me when I test it locally.


TonDiening
Uses 6.16
Reply with quote
psm
Novice


Joined: 19 Jan 2002
Posts: 34
Location: Austria

PostPosted: Wed Jan 30, 2002 7:39 pm   
 
well, it works so far, only the #beep does not and the temporary variables are not deleted.
Reply with quote
psm
Novice


Joined: 19 Jan 2002
Posts: 34
Location: Austria

PostPosted: Wed Jan 30, 2002 8:15 pm   
 
ok, i tried it a bit but something is still wrong

this is the script i am useing now:

#VAR bad {25}
#VAR mundane {51}
#VAR average {66}
#VAR fair {76}
#VAR good {82}
#VAR mighty {88}
#VAR heroic {94}
#VAR perfect {100}
#VAR str { }
#VAR power { }
#VAR dex { }
#VAR int { }
#VAR agil { }
#VAR wis { }
#VAR con { }
#VAR cha { }

#TRIGGER {Strength~:%s(%w)%sPower~:%s(%w)$Dexterity~:%s(%w)%sIntelligence~:%s(%w)$Agility~:%s(%w)%sWisdom~:%s(%w)$Constitution~:%s(%w)%sCharisma~:%s(%w)} {#var str @{%1};#var power @{%2};#var dex @{%3};#var int @{%4};#var agil @{%5};#var wis @{%6};#var con @{%7};#var cha @{%8}}

#TRIGGER {Do you want to reroll this char ~(y/n~) ~[y~]~:} {#if (@str>=@average and @power>=@average and @dex>=@average and @int>=@average and @agil>=@average and @con>=@average and @cha>=@average) {#Beep} {y}} "" {prompt}

and it stopped here:

Rerolling this character.


Your basic stats:
Strength: average Power: fair
Dexterity: mighty Intelligence: mundane
Agility: good Wisdom: mundane
Constitution: mighty Charisma: fair


Explanation of stats:
Bad: 25-50 Mundane: 51-65 Average: 66-75
Fair: 76-81 Good: 82-87 Mighty: 88-93
Heroic: 94-99 Perfect: 100

You may choose to reroll your character at this time. If you elect
to reroll, these stats will be erased and new ones rolled. To reroll,
select 'y' (or hit <return>). To keep this character, and continue
character generation, select 'n'.
Do you want to reroll this char (y/n) [y]:


as you can see, all stats should be at a minimum of average, but they are not. also, the #beep does not sound ( i tried it with "#play name.wav", but when the wanted stat-roll showed in the output, it played the sound and hit y once more)
can anyone find a failure in the script? also i'd like to add a function, that resets the variables
#VAR str { }
#VAR power { }
#VAR dex { }
#VAR int { }
#VAR agil { }
#VAR wis { }
#VAR con { }
#VAR cha { }
to { }, becaue they and up with a value, as soon as the trigger stops.

thanks again
Reply with quote
psm
Novice


Joined: 19 Jan 2002
Posts: 34
Location: Austria

PostPosted: Wed Jan 30, 2002 9:38 pm   
 
ok, it sorta works now, althought i don't think it's completely clean :)

thanks to all for the help
psm


PS: i posted the final version into the "finished mud scripts"-forum
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Thu Jan 31, 2002 5:38 am   
 
I know it's a bit late, but the reason I put @cha<=@mundane was because in the first post, you said that you wanted charisma mundane or worse while everything else was better, hence the '<=' but whatever ;P

Glad you got it working! :)

Iljhar
Reply with quote
psm
Novice


Joined: 19 Jan 2002
Posts: 34
Location: Austria

PostPosted: Thu Jan 31, 2002 7:55 am   
 
yes, that's true. of course, there is not much point in the <= for stats really, but i wanted to see the possibilities, so i asked for that too :)

again, thanks to all who helped.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net