|
Aashaekuth Newbie
Joined: 10 Mar 2005 Posts: 2
|
Posted: Sat Oct 22, 2005 3:52 am
Achaea Learning Script? |
Ever been ordered to learn an odd number of lessons, and you can't do the math to figure out how many full sets you need? I'm that stupid, so I'm looking for a script that'll figure the full sets of 15 and the odd numbered set.. So, I could do LEARN 156 (skill) FROM (dude)..
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Oct 22, 2005 11:37 am |
Hrm. I could make this very complex or very simple. I am going to go for the complex solution. Give me a little while to build it and test it.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Oct 22, 2005 1:39 pm |
Code: |
#CLASS {Learning}
#VAR Lessons {0} {0}
#VAR LessonPattern {} {}
#VAR LearnSets {}
#VAR EatenMyrrh {0} {0}
#VAR Teacher {} {}
#ONINPUT "LearnSystem" {^learn (%d) (%w) from (*)$} {Teacher="%3";#IF (%1>0) {#IF (%1>15) {LessonPattern=%concat(%repeat("15|",%eval(%1/15)),%mod(%1,15));#DELITEM LessonPattern {0}} {LessonPattern=%1};#ADDKEY LearnSets {%lower(%2)} {@LessonPattern};#GAG;#IF (@EatenMyrrh=0) {#ECHO {Haven't eaten myrrh gum. Correcting.};#SEND {outr myrrh};#SEND {eat myrrh}};Lessons=0;#ECHO {Verifying lesson count.};#T+ LearnTriggers;#SEND {status}} {#GAG;#STATE LearnSystem 0;#ECHO You must choose greater than 1.;#ECHO "LEARN <# of lessons> <skill> FROM <whoever>"}} "" {notrig}
#COND {^You will timeout after %d minutes of idleness/inactivity.$} {learn %t2}
#COND {} {#ECHO Lockout State this gets reset by Second part of system.} {manual}
#ONINPUT "Learner" {^learn ({@LearnSets})(*)$} {LessonPattern=%db(@LearnSets,%lower("%1"));#IF ("%2"!="") {Teacher=%trim("%2")};#IF (@LessonPattern!="") {#IF (@Lessons>%item(@LessonPattern,1)) {#STATE LearnSystem 2;#ADD Lessons %eval(%item(@LessonPattern,1)*-1);#SUB {learn %pop(LessonPattern) %1 from @Teacher}} {#GAG;#ECHO Insufficient lessons to learn %item(@LessonPattern,1) %1 from @Teacher;#STATE Learner 0;#STATE LearnSystem 0;#T- LearnTriggers}} {#GAG;#STATE Learner 0;#STATE LearnSystem 0;#ECHO No quantity of lessons defined for %1;#T- LearnTriggers}}
#COND {^* {bows to you and commences the lesson in|begins the lesson by bowing deeply to you.}} {#ADDKEY LearnSets {%lower(%t1)} {@LessonPattern}}
#COND {^* {bows to you - the lesson in |bows to you and declares that your lesson is at an end.}} {#IF (@LessonPattern!="") {#ALARM {+1} {learn %t1}} {#STATE LearnSystem 0;#T- LearnTriggers}}
#TRIGGER {^{You eat a ball of myrrh gum|Your mind is racing with enhanced speed}.$} {EatenMyrrh=1}
#CLASS 0
#CLASS {Learning|LearnTriggers}
#TRIGGER {^You have (%d) lesson~(s~), %d credit~(s~).} {Lessons=%1}
#TRIGGER {^At fledgling class rank you may only learn class skills up to} {#STATE LearnSystem 0;#STATE Learner 0;#T- LearnTriggers}
#TRIGGER {^I don't see who you wish to learn from.$} {#STATE LearnSystem 0;#STATE Learner 0;#T- LearnTriggers}
#CLASS 0
#T- LearnTriggers |
I couldn't test all the various begin and end lesson messages so you will have to add to those, also I am sure there are some other failure messages possible.
To use all you have to do is type the standard learn command and it will calculate the lessons up then record your progress with that skill. After that you can just type 'learn skill' or 'learn skill newTeacher' to proceed further with the set. It automatically keeps doing learning as long as you have enough lessons, assuming that the begin and end messages are already entered for that skill. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|