|
OmegaDeus Apprentice
Joined: 14 Sep 2005 Posts: 121
|
Posted: Fri Sep 16, 2005 4:38 pm
Complicated Trigger Help |
:===========================================================================:
| Schoktra is the brown streak in your undies |
| Level: 90 (Remort 0) Clan: Coven Rank: Witch |
| Class: illusionist Race: leprechaun Gender: male |
:===========================================================================:
| Age: 23 years (Played: 127 hours) You are married to Kyliegh. |
| Practices: 20 |
| Trains: 0 Trains Spent: 0 on hp, 0 on mn, 0 on mv (MAX 180) |
| Alignment: -624 (evil) |
| Mobkills: 373 kills, 12 deaths. |
| Warfare: Grade <Z> (0 points from 0 warkills) |
| You are standing. |
| Carrying: 18/110 items (41/386 pounds). |
:===========================================================================:
| Assets: 0 gold, 270 silver Bank: 0 gold |
| Experience: 90371 real exp |
| Quests: You have 110 quest points 200/300 (66.7%) |
:===========================================================================:
| Hp: 2254/2254 Mana: 2570/2570 Moves: 1589/1589 |
| Wimpy: 0 (0.0%) |
| Str: 66( 72) Con: 79( 83) Vit: 57( 61) Agi: 67( 79) Dex: 70( 79) |
| Int: 92(103) Wis: 80( 91) Dis: 75( 79) Cha: 119(131) Luc: 129(129) |
| Armor Class: -305, -305, -305, -300 (pierce, bash, slash, magic) |
| Hitroll, Damroll: 48, 55 Saves: -15 |
:===========================================================================: |
This is what my mud displays whenever i score myself for stats. I was wanting the best way to capture each and every little number and my title to put into a database so that i can play around with making aliases to display certain bits of information upon demand so i won't have to bring this screen up except for every time i change equipment and stuff. And also i'd like to capture the clan, rank, wife, race, and class, and warfare grade.
Any help would be greatly appreciated. |
|
|
|
billaben Wanderer
Joined: 02 Sep 2005 Posts: 60
|
Posted: Wed Sep 21, 2005 5:40 pm |
Oh brother... don't want much do ya?
I'm just going to snag a line or two here as example and let you expand things from there. Also I haven't messed much with the databasing side of things yet so I can't help there.
Code: |
#CLASS {System}
#ONINPUT {score} {#CLASS Grabscore 1}
#CLASS 0
!
!
#CLASS {System|GrabScore}
#CLASS GrabScore 0
#TRIGGER {^~| Age~: (%d) years ~(Played~: (%d) hours~) (%s)(*) ~|$} {
#VAR Age %1
#VAR Played %2
#VAR Married %4
}
#TRIGGER {^~| Hitroll, Damroll~: (%s)(%d),(%d)(%s)Saves~: (%n)(%s)~|$~:~=~=~=~=} {
#VAR Hitroll %2
#VAR Damroll %3
#VAR Saves %5
#CLASS Grabscore 0
}
#CLASS 0 |
That should grab two of the lines in your score block. I leave it to you to expand that and grab them all. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Wed Sep 21, 2005 6:57 pm |
I'm just getting back into MUDing so my DB skills in zMud are rusty, but a multi-state trigger should do you good.
This is what my score screen looks like.
Code: |
+===============================================================+
| Score sheet for the Human known as |
| -* Gratnok of Allanos *- |
| 17 years, 0 months and 7 days |
| (3 hours RL) |
+===============================================================+
| 82/ 82 Hit 120/ 120 Mana 170/ 170 Movement 3 Practices |
| [ Str:18/18 Int:13/18 Wis:21/21 Dex:14/18 Con:18/18 ] |
| Cle: 6 War: 5 |
| Psuedo level: 6 |
| Class Order: Cle War Mag |
X========= Exps: 15776 ========= Quest Points: 0 ========X
| You are carrying 35/ 43 items, weight 43.55/ 250 kg. |
| Autoexit: *ON* Autoloot: *ON* Autosac: *ON* |
| Autogold: *ON* Autoassist: *OFF* |
| Wimpy Set to 16 HitPoints. Page Length is 80 lines. |
| Drunk: No Thirsty: No Hungry: Yes |
| |
| You have assumed the Stance of the Adventurer. |
| You are sleeping. |
| Armor Class: -82. You are slightly armored. |
| Hitroll: 30 Damroll: 32 |
| Alignment: 0. You are neutral. |
| Saving throws: -2 |
+===============================================================+ |
and here's the multi-state trigger I use to capture the data.
Code: |
#TRIGGER "Score" {+===============================================================+} {} "Stats"
#COND {|%sScore sheet for the &%w{Race} known as%s|} {}
#COND {|%s-~* &%w{Name} of &%w{City} ~*-%s|} {}
#COND {|%s (%d) years, (%d) months and (%d) days %s |} {}
#COND {+===============================================================+} {}
#COND {|%s&%d{HP}/ &%d{MxHP} Hit%s&%d{M}/ &%d{MxM} Mana%s&%d{Mv}/ &%d{MxMv} Movement%s&%d{Practice} Practices |} {}
#COND {|%s ~[ Str:&%d{Str}/&%d{MxStr} Int:&%d{Int}/&%d{MxInt} Wis:&%d{Wis}/&%d{MxWis} Dex:&%d{Dex}/&%d{MxDex} Con:&%d{Con}/&%d{MxCon} ~] %s |} {}
#COND {|%s &%w{Class1}: &%d{Class1Lvl} &%w{Class2}: &%d{Class2Lvl} %s |} {}
#COND {|%s Psuedo level: &%d{PLvl} %s |} {}
#COND {|%s Class Order: (%w) (%w) (%w) %s |} {}
#COND {X========= Exps:%s&%d{XP} ========= Quest Points:%s&%d{QPts} ========X} {}
#COND {| You are carrying%s &%d{Items}/%s&%d{MxItems} items, weight (%d.%d)/%s &%d{MxWgt} kg.%s|} {}
#COND {|%s Autoexit: ~*({OFF|ON})~* %s Autoloot: ~*({OFF|ON})~* %s Autosac: ~*({OFF|ON})~* %s |} {}
#COND {|%s Autogold: ~*({OFF|ON})~* %s Autoassist: ~*({OFF|ON})~* %s |} {}
#COND {|%s Wimpy Set to &%d{Wimpy} HitPoints. Page Length is %d lines. %s |} {}
#COND {|%s Drunk:%s(%w) Thirsty:%s(%w) Hungry:%s(%w) %s |} {}
#COND {|%s You have assumed the Stance of the (*). %s |} {#VAR Stance %1}
#COND {|%sYou are (%w).%s|} {}
#COND {|%s Armor Class:%s &%n{AC}. You are (*).%s|} {}
#COND {|%sHitroll: &%d{HRoll}%sDamroll: &%d{DRoll}%s|} {}
#COND {|%sAlignment:%s (%n).%s You are n(%w).%s|} {}
#COND {|%sSaving throws: (%n)%s|} {}
#COND {+===============================================================+} {} |
Of course it can be tweaked but it should give you a pretty good idea of what you can.
Note 1: I don't capture all values into variables. For example I'm just matching but not using the AutoXXXX properties. As mentioned earlier its a work in progress.
Note 2: Many of my variables are captured directly in my trigger pattern but you can you zMud script (or some other) to capture it to the DB. This link should be able to help you out. http://forums.zuggsoft.com/modules/mx_kb/kb.php?page=3&mode=doc&k=123 and http://forums.zuggsoft.com/modules/mx_kb/kb.php?page=3&mode=doc&k=239
Good luck and happy zMudding. |
|
_________________ Asati di tempari! |
|
|
|
OmegaDeus Apprentice
Joined: 14 Sep 2005 Posts: 121
|
Posted: Wed Sep 21, 2005 7:58 pm |
I'll try to see what I can do, but I'm very new to making complex triggers, so this will still be a bit of a challenge for me. Aside from that I've got some questions about how to use the database. The reason is this. I want to make a trigger for when someone casts a spell to replace the spell gibberish with the spell name from a database and I'm having the hardest time ever figuring out how to do that.
ex:
Schoktra utters the words, 'sagg eaaf'.
I wanna make it pull from the database and substitute so it says Schoktra utters the words, 'pass door'. I can do the substitution, but I don't know how exactly to do the pattern matching in the database. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Sep 22, 2005 12:56 am |
For your most recent question don't bother with the actual database. It isn't fast enough to handle what you want. A simple record variable (also calse a database variable, even though I specifically renamed every reference to them in the help) does what you want. Triggers can work directly with such variables, so your code is very short, everything is contained in the variable.
#VAR SpellTexts {}
#ADDKEY SpellTexts {sagg eaaf} {pass door}
#TRIGGER {({@SpellTexts})} {#SUB {%db(@SpellTexts,"%1")}}
Just use #ADDKEY, similar to my usage above, for all the others you discover. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
OmegaDeus Apprentice
Joined: 14 Sep 2005 Posts: 121
|
Posted: Thu Sep 22, 2005 6:49 am |
that works great thanks!
|
|
_________________
Look at me I've got zSKILLS |
|
|
|
|
|
|
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
|
|