|
jotun2011 Beginner
Joined: 06 Apr 2012 Posts: 19
|
Posted: Fri Jun 01, 2012 8:03 pm
I need help...triggers, recording, boxes, special windows etc |
So...I am trying to find a way to keep track of my forms, its special forms based on combat etc...
what im looking for is to make a window with cells in to and int eh cells shows the name and in the next a % showing the skill level.
Here is the output from the mud...
Speardancer Forms:
Rising of the Dragon 4%
Slashing Talon 1%
Descent on Silent Wings 3%
Death Walks 4%
Whirling Dervish 3%
Darting Sparrow 1%
Staffmaster Forms:
Falling Leaves 100%
Lunge of the Timber Wolf 99%
Swaying Branches 94%
Falling Pine 100%
The WidowMaker 100%
Strike of the Badger 91%
Thunder in the Woods 93%
Leaves in the Wind 99%
The Old Oak 96%
Bruins Maul 100%
Broken Maul 93%
Movement in the Leaves 93%
Rage of an Ogier 93%
Fallen Oak 95%
Creeper Vine Entwines 93%
Snapping Branches 95%
How do I manage to get that into a window in a nice and tidy fashion so I can have it at a glance? |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Jun 01, 2012 8:11 pm |
First, do you already have this data stored somehow? If you do, we would need to know how it is stored. If you don't, we would need to know how you will get the data.
|
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Fri Jun 01, 2012 8:13 pm |
Could you give an example of how you want it to look, beyond just nice and tidy?
|
|
|
|
jotun2011 Beginner
Joined: 06 Apr 2012 Posts: 19
|
Posted: Fri Jun 01, 2012 8:48 pm |
I want it to be like an excel with boxes(cells) in a extra window like I can use #cap windows for example...just a little window on top of the main window showing the current numbers in any way... I was to be able to glance at that window and see the current % of those forms...
as to the other question...no its not store... it comes forth in the mud when I press the command forms (thats shows the current % of the forms) |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Sat Jun 02, 2012 1:10 am |
Do all the forms get listed by the mud even if you have 0%?
Do you want all the forms listed in your Forms window even if you have 0%?
What is the exact output from the mud with this information? Cut and paste an example in your response. Just before the example, add "[code]", and just after the example add "[/code]".
The easiest way to store the data will be in a database variable. The commands #LOOPDB, #EXECWIN, and #WINDOW will be useful for entering the data into the window. The %format() function might be useful for formatting it, or you can format it manually. Here is an example of what you could do:
Code: |
#EXECWIN Forms {#CLR}
#LOOPDB @forms {
$category = %key
$formset = %val
#WINDOW Forms {%category Forms:}
#LOOPDB $formset {
$dotlen = 30 - %len(%key)
#IF ($dotlen < 0) {$dotlen = 0}
$dotstring = %repeat(".", $dotlen))
#WINDOW Forms {%key $dotstring %val\%}
}
#WINDOW Forms {}
}
|
If the database has the right data, that code should produce something that looks something like this:
Code: |
Speardancer Forms:
Rising of the Dragon .......... 4%
Slashing Talon ................ 1%
Descent on Silent Wings ....... 3%
Staffmaster Forms:
Falling Leaves ................ 100%
Lunge of the Timber Wolf ...... 99%
Swaying Branches .............. 94%
|
You could have the output formatted any way you want. But to help any further, you'll need to give us specific information about what the mud outputs and how you want this displayed. |
|
|
|
jotun2011 Beginner
Joined: 06 Apr 2012 Posts: 19
|
Posted: Sat Jun 02, 2012 11:09 am |
I thank you but I do not know how to use that code you gave me. where do I place it? in a trigger?
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Sat Jun 02, 2012 4:55 pm |
Yes, that would have to go into a trigger. But as I said, you will have to give us a lot more information before we can help you any more than that, because we don't have enough information to tell you what the trigger should look like.
|
|
|
|
jotun2011 Beginner
Joined: 06 Apr 2012 Posts: 19
|
Posted: Sat Jun 02, 2012 6:32 pm |
I do not know what information more to give...
the command to check on the forms are
forms
the result from the mud is:
Speardancer Forms:
Rising of the Dragon 4%
Slashing Talon 1%
Descent on Silent Wings 3%
Death Walks 4%
Whirling Dervish 3%
Darting Sparrow 1%
Staffmaster Forms:
Falling Leaves 100%
Lunge of the Timber Wolf 100%
Swaying Branches 100%
Falling Pine 100%
The WidowMaker 100%
Strike of the Badger 100%
Thunder in the Woods 100%
Leaves in the Wind 100%
The Old Oak 100%
Bruins Maul 100%
Broken Maul 98%
Movement in the Leaves 100%
Rage of an Ogier 100%
Fallen Oak 100%
Creeper Vine Entwines 100%
Snapping Branches 98%
and the forms always starts at 1% there is no 0%
and what I want is for that information to be seen in another window. preferably in a excel like boxes(or cells as they are called) |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Jun 04, 2012 2:08 am |
All right, that is most of what we need. You didn't actually answer most of the questions I asked, but I will make some assumptions on what you want. Cut and paste the following commands into your command line:
Code: |
#ONINPUT forms {#T+ FormClass}
#WINDOW Forms
#CLASS FormClass {disable}
#T+ FormClass
#VAR curform {} {} FormClass
#VAR curlist {} {} FormClass
#VAR fulllist {} {} FormClass
#TRIGGER {(*):} {#IF (@curlist) {#ADDKEY fulllist @curform @curlist};VAR curlist {};#VAR curform %1} FormClass
#TRIGGER {(*) (%d)%} {#ADDKEY curlist %1 %2} FormClass
#TRIGGER {>} {
#IF (@curlist) {#ADDKEY fulllist @curform @curlist}
#VAR curlist {}
#VAR curform {}
#EXECWIN Forms {#CLR}
#LOOPDB @fulllist {
$category = %key
$formset = %val
#WINDOW Forms {%category Forms:}
#LOOPDB $formset {
#WINDOW Forms {%format("<u>| &30s | &3d |</u>",%key,%val)}
}
#VAR fulllist {}
#WINDOW Forms {}
}
#T- FormClass
} FormClass
#T- FormClass
#CLASS 0
|
I have not tested this code, but I believe it should be close to what you want. The one thing I could not make a guess at is what the prompt on your mud looks like. This is part of why I wanted to see actual text from the mud, enclosed inside the [code] ... [/code] tags. In my triggers above, I have assumed that your mud prompt is ">". If it is something different, change the code to match your prompt. |
|
|
|
jotun2011 Beginner
Joined: 06 Apr 2012 Posts: 19
|
Posted: Mon Jun 04, 2012 7:18 am |
Code: |
<8304/8304|21627/21925|1807|28594|1336> (D)(fv) [i]*rem* the prompt[/i]
>forms [i]*rem* the command[/i]
Speardancer Forms:
Rising of the Dragon 4%
Slashing Talon 1%
Descent on Silent Wings 3%
Death Walks 4%
Whirling Dervish 3%
Darting Sparrow 1%
Staffmaster Forms:
Falling Leaves 100%
Lunge of the Timber Wolf 100%
Swaying Branches 100%
Falling Pine 100%
The WidowMaker 100%
Strike of the Badger 100%
Thunder in the Woods 100%
Leaves in the Wind 100%
The Old Oak 100%
Bruins Maul 100%
Broken Maul 99%
Movement in the Leaves 100%
Rage of an Ogier 100%
Fallen Oak 100%
Creeper Vine Entwines 100%
Snapping Branches 100% |
|
|
|
|
jotun2011 Beginner
Joined: 06 Apr 2012 Posts: 19
|
Posted: Mon Jun 04, 2012 7:19 am |
and I ran tha code you gave me and I got a window name forms.... and its blank there is no text going to it.
|
|
|
|
jotun2011 Beginner
Joined: 06 Apr 2012 Posts: 19
|
Posted: Mon Jun 04, 2012 7:22 am |
I tried changing the trigger to the prompt but it does nothing, the window is still blank, I tried changing the trigger to the fist form "Speardancer Forms:" and still does nothing
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Jun 04, 2012 1:05 pm |
Yes, executing my code should create the blank window. After that, did you actually run the 'forms' command on your mud to see what would show up in the window?
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Jun 04, 2012 1:11 pm |
Ah, your mud output has lots of spaces. We need to change one of the triggers.
Change the trigger pattern
to:
|
|
|
|
jotun2011 Beginner
Joined: 06 Apr 2012 Posts: 19
|
Posted: Mon Jun 04, 2012 6:43 pm |
still only a blank window, it opens up a window after I cope and paste that to the mud, then nothing....
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Jun 04, 2012 7:41 pm |
Again--did you actually run the 'forms' command on your mud after that so that the triggers could grab some information?
|
|
|
|
jotun2011 Beginner
Joined: 06 Apr 2012 Posts: 19
|
Posted: Mon Jun 04, 2012 9:27 pm |
yes I did... and it nothing... either im doing something wrong or I dont fully understand how to implement this... im sorry, im not so well versed in this...
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Jun 05, 2012 12:50 am |
Nope, it's my fault. I just tested it (Sorry, I wasn't able to test it before). It was close, but had a couple bugs. The order that I put the commands in accidentally created the FormClass in the Forms window rather than in your main session window. That's the main problem. There were also a couple other small bugs in it. Here, I'll just give you a new version that should work. Go into the Package Editor and delete all the stuff created by my previous code, then execute the following:
Code: |
#ONINPUT forms {#T+ FormClass}
#VAR curform {} {} FormClass
#VAR curlist {} {} FormClass
#VAR fulllist {} {} FormClass
#TRIGGER {(*):} {#IF (@curlist) {#ADDKEY fulllist @curform @curlist};#VAR curlist {};#VAR curform %1} FormClass
#TRIGGER {%s(*)%s(%d)~%} {#ADDKEY curlist %1 %2} FormClass
#TRIGGER {>} {
#IF (@curlist) {#ADDKEY fulllist @curform @curlist}
#VAR curlist {}
#VAR curform {}
#EXECWIN Forms {#CLR}
#LOOPDB @fulllist {
$category = %key
$formset = %val
#WINDOW Forms { }
#WINDOW Forms {%format("<u>&-40s</u>", $category)}
#LOOPDB $formset {
#WINDOW Forms {%format("<u>|&30s | &3d%% |</u>",%key,%val)}
}
#VAR fulllist {}
}
#T- FormClass
#WINDOW 0
} FormClass
#T- FormClass
#WINDOW Forms
#WINDOW 0
|
[edited to fix one trigger pattern] |
|
|
|
|
|