|  | 
	
	
		| OmegaDeus Apprentice
 
  
 Joined: 14 Sep 2005
 Posts: 121
 
 
 | 
			
			  |  Posted: Thu Dec 15, 2005 4:40 pm 
 Really complex trigger
 
 |  
				| I have need for a really complex trigger.  What I'm wanting to do is get the prime stats for all of my skills and spells so that i can figure out which is my best order of assigning stats, but I need to make this universal so that I can use it with all of my characters, not just the one I'm currently using.  Here is the pertinent information: 
 skills list:
 
 
 
	  | Code: |  
	  | Level  1: dagger                100%( 94%) polearm                75%( 68%)
 scrolls                84%( 85%) wands                  75%( 78%)
 recall                 50%( 55%)
 Level  3: flee                   83%( 83%)
 Level  4: meditation             78%( 74%) staves                 76%( 77%)
 Level  5: appraise               75%( 74%)
 Level  6: dodge                  84%( 80%)
 Level  7: hand to hand           75%( 63%)
 Level 10: hide                   79%( 77%)
 Level 12: lore                   83%( 80%)
 Level 13: haggle                 76%( 81%)
 Level 14: dirt kicking           78%( 74%)
 Level 18: pick lock              76%( 77%)
 Level 19: distract               80%( 86%)
 Level 21: mace                   90%( 76%) steal                  85%( 86%)
 Level 24: arcane lore            78%( 78%)
 Level 26: peek                   77%( 80%)
 Level 32: sneak                  75%( 74%) swimming               76%( 77%)
 Level 35: disguise               75%( 70%)
 Level 40: alertness              76%( 67%)
 Level 41: focus                 100%( 83%)
 Level 47: shadowwalk             98%( 95%)
 Level 50: backstab               79%( 71%)
 Level 55: scribe                 85%( 71%)
 Level 85: arcana                 97%( 86%)
 |  
 spells list:
 
 
 
	  | Code: |  
	  | Level  1: infravision        6m  78%( 80%) magic missile      1m 100%( 97%) ventriloquate      6m  75%( 80%)
 Level  2: detect invis       5m  80%( 82%) faerie fire       18m  77%( 80%)
 sleep             18m  78%( 80%) word of recall    60m  77%( 79%)
 Level  3: detect hidden      6m  75%( 80%) faerie fog        14m  76%( 79%)
 Level  4: burning hands      5m 100%( 97%) fear              18m  75%( 78%)
 invisibility      12m  76%( 79%)
 Level  6: charm person      36m  75%( 80%) detect magic       6m  75%( 77%)
 shocking grasp     8m  97%( 95%)
 Level  7: colour spray      14m  79%( 81%)
 Level  8: armor              6m  78%( 80%) betray            18m  75%( 80%)
 chill touch       10m  95%( 92%)
 Level  9: detect poison      6m  75%( 77%)
 Level 10: feeblemind        12m  75%( 78%) giant strength    12m  78%( 80%)
 Level 12: fireball          17m  85%( 86%) know alignment    11m  75%( 75%)
 Level 14: dispel magic      32m  95%( 92%)
 Level 15: blindness         24m  75%( 78%) teleport          42m  75%( 80%)
 Level 16: cancellation      24m  77%( 79%)
 Level 18: change sex        15m  75%( 98%) enchant armor    300m  75%( 80%)
 lightning bolt    17m  81%( 83%) shield             6m  76%( 79%)
 Level 22: enchant weapon   300m  75%( 80%) mass invis        24m  75%( 78%)
 weaken            12m  75%( 75%)
 Level 23: detect evil        6m  75%( 74%) detect good        6m  75%( 74%)
 Level 24: identify          15m  75%( 75%)
 Level 25: acid blast        22m  92%( 87%) gate              90m  87%( 87%)
 haste             54m  91%( 91%)
 Level 26: slow              31m  77%( 76%)
 Level 28: stone skin        11m  79%( 81%)
 Level 30: fly               25m  76%( 75%) poison             6m  75%( 64%)
 Level 31: locate object     24m  75%( 78%)
 Level 32: detect astral     59m  78%( 82%) protection evil   22m  75%( 47%)
 protection good   23m  79%( 42%)
 Level 33: extinguish         6m  75%( 80%)
 Level 35: fireproof         12m  75%( 71%)
 Level 38: calm              40m  75%( 64%)
 Level 40: chain lightning   31m  75%( 75%) confusion         30m  75%( 79%)
 immolation        72m  77%( 79%) portal           120m  76%( 80%)
 refresh           19m  83%( 70%)
 Level 41: electrocution     73m  75%( 78%)
 Level 42: absolute zero     73m  75%( 78%)
 Level 43: epidemic          72m  76%( 79%)
 Level 45: summon            61m  78%( 77%)
 Level 46: mirror image      52m  94%( 96%)
 Level 47: mimic             41m  75%( 96%)
 Level 48: farsight          43m  76%( 80%)
 Level 50: astral projection 115m  82%( 85%) mana shield       38m  75%( 72%)
 sanctuary         89m  83%( 81%)
 Level 64: nexus            184m  78%( 77%)
 Level 70: laughing fit      48m  75%( 80%)
 Level 73: reflection        36m  76%( 77%)
 Level 75: renewal           41m  84%( 82%)
 Level 76: protection magic  31m  75%( 75%)
 Level 80: pass door         61m  76%( 78%)
 Level 86: fire breath       30m  81%( 79%)
 Level 87: frost breath      30m  81%( 79%)
 Level 88: lightning breath  21m 100%( 94%)
 Level 89: acid breath       21m  98%( 92%)
 Level 90: call lightning    20m  77%( 66%) gas breath        33m  94%( 89%)
 Level 91: monsoon           75m  77%( 75%)
 |  
 showskill output:
 
 
 
	  | Code: |  
	  | Settings for spell:  Haste Base Mana: 50  Lag: 12  Target: char_defensive  Combat: yes
 Prime Stat: agility   Second Stat: dexterity   Third Stat: luck
 
 Class          Level Points  Max
 ------------   ----- ------ -----
 Warrior         65     --     80
 Thief           35     --     90
 Cleric          --     --     --
 Mage            20     --    100
 Gladiator       --     --     --
 Samurai         60     --     85
 Paladin         --     --     --
 Assassin        60     --     85
 Ninja           40     --     90
 Monk            --     --     --
 Templar         --     --     --
 Illusionist     25     --    100
 Gunslinger      48     --     90
 Ranger          35     --     90
 Necromancer     20     --    100
 
 
 
 Settings for skill:  Arcana
 Base Move: 6
 Prime Stat: intelligence   Second Stat: discipline   Third Stat: wisdom
 
 Class          Level Points  Max
 ------------   ----- ------ -----
 Warrior         --     --     --
 Thief           --     --     --
 Cleric          --     --     --
 Mage            50      6    100
 Gladiator       --     --     --
 Samurai         --     --     --
 Paladin         --     --     --
 Assassin        --     --     --
 Ninja           --     --     --
 Monk            --     --     --
 Templar         --     --     --
 Illusionist     85      6     90
 Gunslinger      --     --     --
 Ranger          --     --     --
 Necromancer     85      6     90
 
 Settings for skill:  Dagger
 Prime Stat: dexterity   Second Stat: agility   Third Stat: luck
 
 Class          Level Points  Max
 ------------   ----- ------ -----
 Warrior          1      2     99
 Thief            1      3    100
 Cleric          --     --     --
 Mage             1      6     90
 Gladiator        1      2    100
 Samurai          1      3     96
 Paladin         --     --     --
 Assassin         1      5    100
 Ninja            1      6     98
 Monk            --     --     --
 Templar          8     12     80
 Illusionist      1      4     95
 Gunslinger       3      5     90
 Ranger           1      4     98
 Necromancer      1      6     91
 |  as you can see with this, it changes slightly each time, depending on the type of skill/spell, but it has a general theme.
 
 stats list:
 
 
 
	  | Code: |  
	  | Strength
 Constitution
 Vitality
 Agility
 Dexterity
 Intelligence
 Wisdom
 Discipline
 Charisma
 Luck
 
 |  
 Basically what i need this trigger, well more of a function to do is, when i run it, it first will need to pull up the skills list by sending skills to the mud and from that make a list of all skills then one by one with showskill <skill> and then take the list of stats from that and adds a tickmark to it(basically just simple math, add 1 to that skills number), and after it's gone through all of those, it has to pull up all spells by sending spells to the mud, then add those to a list, then one by one get the man stats from each of those with showskill <spell> all of this just needs to be stored in either a database or a variable or something so that it won't just show it right away, but from sending an alias to the mud(probably would want it to be statpri) it will show me in a list from most ticks(highest number stored) to least ticks the priority of which i should assign my stats.
 
 and example of the out put i want:
 
 
 
	  | Code: |  
	  | Current Class Stat Priority: =======================================
 Cha Luc Str Dex Agi Vit Con Int Dis Wis
 =======================================
 
 |  
 I know that this will be very complex, and very time consuming so I don't want anyone to spend too much time on it, I'm open just for suggestions on what should work where, and I can piece it together from there if need be.
 |  | 
	
	  | 
		    
			  | _________________ 
   
 Look at me I've got zSKILLS
 |   |  | 
	
		|  | 
	
		| TonDiening GURU
 
  
 Joined: 26 Jul 2001
 Posts: 1958
 Location: Canada
 
 | 
			
			  |  Posted: Thu Dec 15, 2005 5:29 pm 
 |  
				| Pattern Matching Patterns can contain several special character for wild-card matching.
 &nn	matches exactly nn characters (fixed width pattern)
 
 Fixed width pattern matching.  Turn on/off the capturing triggers doing #ADDITEM to the list.
 
 Then use #FORALL to process the next layers.
 |  | 
	
	  |  | 
	
		|  | 
	
		| OmegaDeus Apprentice
 
  
 Joined: 14 Sep 2005
 Posts: 121
 
 
 | 
			
			  |  Posted: Thu Dec 15, 2005 8:23 pm 
 |  
				| okay you're speaking in half zuggish and half gibberish... could you please elaborate using a little more english? 
 |  | 
	
	  | 
		    
			  | _________________ 
   
 Look at me I've got zSKILLS
 |   |  | 
	
		|  | 
	
		| TonDiening GURU
 
  
 Joined: 26 Jul 2001
 Posts: 1958
 Location: Canada
 
 | 
			
			  |  Posted: Fri Dec 16, 2005 2:06 pm 
 |  
				| CAPTURING Base info 
 skills list:
 Pattern assumes that there is no Level 100 spells where the fixed width of the layout would change.
 
 Level  1: dagger                100%( 94%) polearm                75%( 68%)
 #TRIGGER {^&6(&2)??(&22)(&3)??(&3)???(&22)(&3)??(&3)} {}
 If %int(%1) > 0 then you captured your skill level
 
 If !%null(%trim(%2)) then you got a skill to check - #ADDITEM SkillsToCheck {%trim(%2)}
 If %int(%3) > 0 then you have the ##% to check
 If %int(%4) >0 then you have the (###%) to check
 
 If !%null(%trim(%5)) then you got another skill to check - #ADDITEM SkillsToCheck {%trim(%2)}
 If %int(%6) > 0 then you have the ##% to check
 If %int(%7) >0 then you have the (###%) to check
 
 
 Spells list:
 
 I'd make 2 patterns as the fixed width wont work from seeing the shift in the #m
 Level 40: chain lightning   31m  75%( 75%) confusion         30m  75%( 79%)
 Level 50: astral projection 115m  82%( 85%) mana shield       38m  75%( 72%)
 sanctuary         89m  83%( 81%)
 
 #TRIGGER {&6(&2)??(*)(%d)m?(&3)??(&3)??(*)(%d)m?(&3)??(&3)??$} {}
 #TRIGGER {&6(&2)??(*)(%d)m?(&3)??(&3)?? $} {}
 
 Like about
 If !%null(%trim(%2)) then you got a spell to check - #ADDITEM SkillsToCheck {%trim(%2)}
 If !%null(%trim(%6)) then you got a spell to check - #ADDITEM SkillsToCheck {%trim(%2)}
 
 ========
 PROCESS Checking so we dont overwhelm the mud too much
 
 showskills %pop(SkillsToCheck)
 #VAR SkillTicks %null
 
 #TRIGGER {^Prime Stat:(*)Second Stat:(*)Third Stat:(*)} {#ADD SkillTicks.%trim(%1) 1;#ADD SkillTicks.%trim(%2) 1;#ADD SkillTicks.%trim(%3) 1;#IF (!%null(@skillsToCheck)) {showskill %pop(SkillsToCheck)} {#showdb @SkillTicks}}
 
 To sort database SkillTicks use Kjata's idea from:
 http://forums.zuggsoft.com/phpbb/viewtopic.php?t=10049&highlight=record+sort
 
 
 Looks right, I this is all written from hand and not tested.
 |  | 
	
	  |  | 
	
		|  | 
	
		| gamma_ray Magician
 
 
 Joined: 17 Apr 2005
 Posts: 496
 
 
 | 
			
			  |  Posted: Fri Dec 16, 2005 6:08 pm 
 |  
				| Here's another take on it. 
 
 
 
	  | Code: |  
	  | #CLASS {beststatscounter} #ALIAS statpri {#loopdb @beststats {#show {Stat: %key Priority: %val}}}
 #VAR skillslist {}
 #VAR beststats {}
 #ONINPUT {^updatestats$} {
 ;reset tracking variables
 skillslist = %null
 beststats = %null
 ;get a list of skills and spells and store them as a string list
 #t+ "parse.skillslist"
 skills
 spells
 } "" {regex}
 #COND {} {
 #t- "parse.skillslist"
 #t+ "parse.showskill"
 ;start checking the stats used for each skill/spell
 showskill %pop( @skillslist)
 } {wait|param=5000}
 #REGEX "parse.skillslist" {^(?:.*:)? +([a-z][a-z ]+[a-z]) +\d+(?:[^a-z]+([a-z][a-z ]+[a-z]) +\d+)} {
 #additem skillslist %1
 #if !%null( %2) {#additem skillslist %2}
 } "" {disable}
 #REGEX "parse.showskill" {^Prime Stat: ([a-z]+) +Second Stat: ([a-z]+) +Third Stat: ([a-z]+)$} {
 ;add a variable amount based on weather the stat is primary, secondary, or tertiary
 #add beststats.%1 3
 #add beststats.%2 2
 #add beststats.%3 1
 } "" {case|disable}
 #COND {} {
 ;keep looping until we've looked at every skill and spell
 #if (%numitems( @skillslist)) {showskill %pop( @skillslist)} {
 #t- "parse.showskill"
 #show {Done updating stats. Use statpri to see the list.}
 }
 } {wait|param=2000|disable}
 #CLASS 0
 |  
 Now, 1) It doesn't actually store that much information, just a list of stats and the priority for each (it doesn't store the stats for each skill/spell). 2) It adds 3 to the priority if a stat is listed as primary, 2 to the priority for secondary, and 1 to the priority for tertiary. This is easy to change if you prefer another way. 3) If you need to include quotes of some sort around multiple word skillnames that'll need to be fixed. 4) Doesn't output a sorted list, instead just a list of "Stat: Blah Priority: 10", with higher priority being better... but as there are only a handful of stats you should be able to pick the highest number easily enough. 5) Untested. Use at your own risk.
 
 To use it, load it (it should form it's own class properly), then enter "updatestats" (no quotes), wait until it tells you it's done, then enter statpri.
 
 Edit: Updated it to use %pop(), as I prefer that.
 Edit2: Minor bug fix.
 Edit3: How come none of the glaringly obvious bugs are glaringly obvious until after you've posted?
 |  | 
	
	  | 
		    
			  | 
 Last edited by gamma_ray on Fri Dec 16, 2005 6:38 pm; edited 1 time in total
 |   |  | 
	
		|  | 
	
		| OmegaDeus Apprentice
 
  
 Joined: 14 Sep 2005
 Posts: 121
 
 
 | 
			
			  |  Posted: Fri Dec 16, 2005 6:30 pm 
 |  
				| I tested it and for the most part it works, a few of the items on it do not work properly but I can probably fix that if i work on it.  Thanks much gamma_ray, that's almost exactly what i'm looking for. 
 |  | 
	
	  | 
		    
			  | _________________ 
   
 Look at me I've got zSKILLS
 |   |  | 
	
		|  | 
	
		|  | 
	
		|  |