About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 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
demoneyoungblood
Apprentice


Joined: 16 Dec 2002
Posts: 114
Location: USA

PostPosted: Sun Jul 17, 2005 3:14 am   

AutoPracticer
 
Ok... im pretty good with triggers... and I know how this should work in theory, but not quite how to do it using zmud... maybe one of you guru's would like to help on this one..

given almost all muds use the "practice command"

when i type practice, the output appears as:

Code:

animate            [ 75%] armor              [ 75%] barkskin           [ 75%]
bless              [ 75%] burning hands      [ 75%] cause critical     [ 75%]
cause serious      [  1%] chill touch        [ 75%] colour spray       [ 75%]
cure critical      [ 75%] cure disease       [  1%] cure light         [ 75%]
cure poison        [  1%] cure serious       [ 75%] detect hidden      [  1%]
detect invis       [  1%] detect magic       [  1%] detect poison      [  1%]
farsight           [  1%] fireball           [ 75%] fly                [ 75%]
frenzy             [ 75%] iceshield          [ 75%] identify           [  1%]
infravision        [ 75%] invisibility       [  1%] magic missile      [ 75%]
mass invis         [  1%] plague             [ 75%] poison             [ 75%]
refresh            [ 75%] sanctuary minor    [  1%] shocking grasp     [ 75%]
sleep              [  1%] vigorize           [  1%] weaken             [ 75%]

onto the fun part...
I would like to create an alias that will loop through andcompare the % of a skill to a statically declared variable... lets say "mastered" which will be set at the max "practicable" percent and practice the skill/spell until it is equal to the "master" percent... (ie: auto practice without overkill)

so if I can practice a skill up to 75 percent... @mastered is going to be 75...
pretty simple on that part... but how would i loop through the practice list without spamming myself off, etc.. anyone care to see if they can work up a script?

Also, some other outputs from the mud that might be useful:

Code:

You practice vigorize. (11)
You are now learned at vigorize. (75)


I think thats enough info.. i am just quite uncertain how to go about this one. Would appreciate any aide :).
_________________
-Demone YoungBlood
Reply with quote
demoneyoungblood
Apprentice


Joined: 16 Dec 2002
Posts: 114
Location: USA

PostPosted: Tue Jul 19, 2005 4:20 pm   
 
Kinda depressing, noone with any idea? guess ill see what i can come up with, wish me luck :-D
_________________
-Demone YoungBlood
Reply with quote
Ziah
Novice


Joined: 11 Mar 2005
Posts: 40

PostPosted: Wed Jul 20, 2005 4:30 am   
 
**wishes you luck**
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Thu Jul 21, 2005 10:42 am   
 
Code:

Skills = {animate|bless|cause serious|...}
MaxSkills = {75|75|20|...}

#TRIGGER {^You are now learned at ([%w%s]). ~((%d)~)$} {
    #IF (%ismember("%1",@Skills)) {
        #IF (%2<%item(@MaxSkills,%ismember("%1",@Skills))) {#SEND {practice %1}}
    }
}


Question
Reply with quote
demoneyoungblood
Apprentice


Joined: 16 Dec 2002
Posts: 114
Location: USA

PostPosted: Thu Jul 21, 2005 4:18 pm   
 
The problem with the method you suggest maelstrom, is that I have to still update the variables manually, i wanted this to be 100% automatic.
_________________
-Demone YoungBlood
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Thu Jul 21, 2005 6:52 pm   
 
I was just providing what it sounded like in you initial post:
Quote:

and compare the % of a skill to a statically declared variable


MaxSkills is, of course, the "statically declared" list of values which would only need to be set once. Unless of course I misunderstood your meaning or your practice output. Are the values posted in the practice output (1st post) current or max numbers? When you say 100% automatic do you mean looping through every skill one by one and training each?
Reply with quote
demoneyoungblood
Apprentice


Joined: 16 Dec 2002
Posts: 114
Location: USA

PostPosted: Thu Jul 21, 2005 7:58 pm   
 
Ok, let me see if i can re-explain it more clearly, and i apologize for the confusion.

When I type practice, with the output appearing as:

Code:

animate            [ 75%] armor              [ 75%] barkskin           [ 75%]
bless              [ 75%] burning hands      [ 75%] cause critical     [ 75%]
cause serious      [  1%] chill touch        [ 75%] colour spray       [ 75%]
cure critical      [ 75%] cure disease       [  1%] cure light         [ 75%]
cure poison        [  1%] cure serious       [ 75%] detect hidden      [  1%]
detect invis       [  1%] detect magic       [  1%] detect poison      [  1%]
farsight           [  1%] fireball           [ 75%] fly                [ 75%]
frenzy             [ 75%] iceshield          [ 75%] identify           [  1%]
infravision        [ 75%] invisibility       [  1%] magic missile      [ 75%]
mass invis         [  1%] plague             [ 75%] poison             [ 75%]
refresh            [ 75%] sanctuary minor    [  1%] shocking grasp     [ 75%]
sleep              [  1%] vigorize           [  1%] weaken             [ 75%]


That shows the skill name, and the *current* percentile.
The max percentile is *always* the same for each skill as far as practice goes. So yes, I wanted to be able to type something like autopractice, have it enable a trigger class, and automatically practice each skill individually to the max value.

so in that example, autoprac would practice cause serious, cure poison, detect invis, farsight, sleep, mass invis, cure disease, detect magic, invisibility, sanctuary minor, vigorize, detect hidden, detect poison, identify. Now.. the reason I asked for help was so that the solution would be efficient/effective without using numerous triggers.

I can easily do 4 triggers to do it....
the reason I would need 4 is due to the number of words in each skill spell being able to vary, and the percentiles, havent quite figured out how to use one trigger to match say... [ 75%] and [100%] without capturing the " " in the 75%.... Further input greatly appreciated :)
_________________
-Demone YoungBlood
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Jul 21, 2005 11:04 pm   
 
//NOT FULL CODE just and example to capture [ 75%] and [100%] using Fixed width matching


#TRIGGER {~[(&3)~%~]} {#SAY "%1"}

Also be sure to ask your Mud Admins if Autopracticing skills is legal, Most muds do not allow this kind of thing (And as a side note some muds are coded so that repeatadly spamming a command will not increase it.)
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Jul 25, 2005 9:07 am   
 
Here is the script I use to capture the skills list for my mud. It is up to you to modify it to fit your needs. All the capturing is done in the SkillCapTrig. My mud doesn't use [] around the numbers. My prompt starts with a '-' so that is used to detect the end of list for such things.

#CLASS {Character|SkillCapture}
#VAR TempSkillCap {} {}
#VAR TempSkillCap2 {} {}
#VAR SkillGain {} {}
#TRIGGER {^You find using weaves of (%w) easier.$} {#ADDKEY Skills {%1} {%eval(%db(@Skills,"%1")+1)};#ADDKEY SkillGain {%1} {%db(@Skills,"%1")}} "" {case}
#TRIGGER {^You've (%d) air, (%d) earth, (%d) fire, (%d) water, and (%d) spirit.$} {#ADDKEY Skills {Air} {%1};#ADDKEY Skills {Earth} {%2};#ADDKEY Skills {Fire} {%3};#ADDKEY Skills {Water} {%4};#ADDKEY Skills {Spirit} {%5}} "" {case}
#ONINPUT "SkillCapTrig" {^{skill|form|learned}$} {}
#COND {^{Level|-}%s%d{: |/}(*)$} {#IF (%begins(%line,"-")) {#STATE SkillCapTrig 0;#IF (%iskey(@Skills,"blademaster")) {#IF (@StancePref.Sword) {#ADDKEY StancePref {Sword} {@StancePref.Sword}} {#ADDKEY StancePref {Sword} {None}}};#IF (%iskey(@Skills,"knifefighter")) {#IF (@StancePref.Dagger) {#ADDKEY StancePref {Dagger} {@StancePref.Dagger}} {#ADDKEY StancePref {Dagger} {None}}};#IF (%iskey(@Skills,"martial arts")) {#IF (@StancePref.HTH) {#ADDKEY StancePref {HTH} {@StancePref.HTH}} {#ADDKEY StancePref {HTH} {None}}};#IF (%iskey(@Skills,"spearfighter")) {#IF (@StancePref.Spear) {#ADDKEY StancePref {Spear} {@StancePref.Spear}} {#ADDKEY StancePref {Spear} {None}}}} {#VAR TempSkillCap {%subchar("%1","%","|")};TempSkillCap=%replace(@TempSkillCap,"n/a","1|");TempSkillCap2="";#PRIORITY {#FORALL @TempSkillCap {#ADDITEM TempSkillCap2 {%concat(%word(%i,1," "),"=",%word(%i,%numwords(%i)))}}};#DELITEM TempSkillCap2 {=};#ADDKEY Skills {@TempSkillCap2}}} {looppat|param=30}
#TRIGGER {^You have become better at (*)!$} {#ADDKEY Skills {%1} {%eval(%db(@Skills,"%1")+1)};#ADDKEY SkillGain {%1} {%db(@Skills,"%1")}} "" {case}
#TRIGGER {^* trains you in the art of (*)$} {#ADDKEY Skills {%1} {1}} "" {case}
#TRIGGER {^You have learned the weave (*) from watching * channel!$} {#ADDKEY Skills {%1} {1};#ADDKEY SkillGain {%1} {%db(@Skills,"%1")}} "" {case}
#BUTTON SkillGainBTN "%if(%btnenable(SkillGainBTN,@SkillGain!=""),Skill gains: %expanddb(@SkillGain,", ","-"),)" {save} {} {} {} {} {} {Size} {700} {17} {Pos} {0} {1} {} {} {} {} "" {} {} {SkillGainBTN} {4}
#CLASS 0
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Tue Jul 26, 2005 7:11 am   
 
This might help a little
Code:

#ALIAS autoprac {#T+ "Skill Capture";prac;#TEMP {YOUR PROMPT HERE} {#T- "Skill Capture";#LOOPDB @skills {#IF (%val < 75) {practice %key} {#ECHO %key is already at its max}}}}

#TRIGGER "Skill Capture" {([%w%s])%s~[{| }(%d)~%~]} {#ADDKEY Skills {%1} %2}


That sould make a trigger and an alias
Alias will send the prac command to the mud, then the trigger will capture every skill and its current rate, store it in the "skills" variable, then wait for your prompt, and loop through this variable, check if their practice rate is below 75, and send the practice "skill name" to the mud if its below it, though it will only send 1 each time, so you'd have to type autoprac again, to raise every skill thats below 75, I think :D
I did not test it, but everything can be tweaked.
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