|
shakey Novice
Joined: 07 Jul 2007 Posts: 40
|
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Tue Jul 17, 2007 1:16 pm |
He used the status window and just had it set to float.
Collect the information that you want and place it into variables.
Then place the variables into the status window. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
shakey Novice
Joined: 07 Jul 2007 Posts: 40
|
Posted: Tue Jul 17, 2007 1:26 pm |
status window? Enlighten me oh wise one.
EDIT: I found the status window thing. But I can't put any varsiables into it.
EDITX2: Mmk, It's letting put variables into it now for some reason. If I have any other questions about how to obtain certain info, I'll hit you up agian. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Tue Jul 17, 2007 2:10 pm |
Code: |
____________________
|%format( "&-20s", %concat( "My Health is ", %format( "&-.0n", @hp), "."))|
|%format( "&-20s", %concat( "My level is ", @level, "."))|
|%format( "&20s", "")|
|%format( "&20s", "")|
|%format( "&20s", "")|
|%format( "&20s", "")|
|____________________| |
Edit: Heh, this is an example of something to paste into the status window where I told you to place the variables before.
It will make a nice box like that other fellow had.
@hp is a variable containing your current health and @level is a variable containing your current level.
Of course you would have to get these from somewhere. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Last edited by Arminas on Tue Jul 17, 2007 2:58 pm; edited 1 time in total |
|
|
|
shakey Novice
Joined: 07 Jul 2007 Posts: 40
|
Posted: Tue Jul 17, 2007 2:38 pm |
And what is that?
Here is a shot of the prompt that comes up. I tell you want I want from it. I've gotten some things, like my str int wis etc.. but...yeah
Code: |
ou are Vincent iS better At life than you.
You are level 31 with 0 practices (1933 hours)
You are carrying 1/18 items with weight 53/360 pounds. Encumbrance: 0%
You have 400/766 hit, 45/500 mana, 11/381 movement.
Str: 23 Int: 29 Wis: 25 Dex: 27 Con: 24 Chr: 13
Your levels are: Ma 19 Cl 23 Th 31 Wa 30
You have 4340258 experience points, and 47 gold coins.
Hitroll: 0 Damroll: -3.
Armor: 45 (you are very poorly armored for your level)
You are targeting A huge scarab beetle.
You are sneaking.
You are sleeping.
A cloud of evil surrounds you.
You are affected by:
Spell 'sanctuary', 9 minutes remaining.
Spell 'dexterity', 30 minutes remaining.
Spell 'armor', 33 minutes remaining.
Spell 'detect invisibility', one hour, 18 minutes remaining.
Spell 'infravision', one hour, 30 minutes remaining.
Spell 'fly', one hour, 30 minutes remaining.
|
I can get the exp I've just ran from my xp counter into there just fine, though I'd rather have total xp
armor
and a spells list/duration.
I have a few ideas on how to do some of this, but variables rock me -_- |
|
|
|
shakey Novice
Joined: 07 Jul 2007 Posts: 40
|
Posted: Tue Jul 17, 2007 3:16 pm |
Would this work?
#Var xp {%a}
#VAR gold {%b}
#TRIGGER {You have %a experience points, and %b gold coins.} {@xp; @gold} |
|
|
|
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Tue Jul 17, 2007 3:23 pm |
Quote: |
You have 4340258 experience points, and 47 gold coins.
|
as a pattern, its
Code: |
#trigger {You have (%d) experience points, and (%d) gold coins.}
|
Where first %d is %1 and second %d is %2.
So when you want to capture their value into variables, its
Code: |
#trigger {You have (%d) experience points, and (%d) gold coins.} {xp=%1;gold=%2}
|
Prog |
|
|
|
shakey Novice
Joined: 07 Jul 2007 Posts: 40
|
Posted: Tue Jul 17, 2007 3:31 pm |
yay, I've got my stats, exp, gold, and armor up there right now.
here's the code thus far.
Code: |
#CLASS {status window} {enable}
#VAR STR {23}
#VAR INT {29}
#VAR WIS {25}
#VAR DEX {22}
#VAR CON {24}
#VAR CHR {13}
#VAR xp {3412496}
#VAR gold {0}
#VAR AR {65 (you are very poorly armored for your level)}
#TRIGGER {Str: %1 Int: %2 Wis: %3 Dex: %4 Con: %5 Chr: %6} {
#Var STR {%1}
#var INT {%2}
#var WIS {%3}
#var DEX {%4}
#var CON {%5}
#var CHR {%6}
}
#TRIGGER {Armor: %1} {#VAR AR {%1}}
#TRIGGER {You have %1 experience points, and %2 gold coins.} {
#VAR xp {%1}
#var gold {%2}
}
#STAT {Vincent} "" "XP"
#STW {Vincent%{cr}------------------------%{cr}Str:@STR Int:@INT Wis:@WIS Dex:@DEX Con:@CON Chr:@CHR %{cr}------------------------%{cr}EXP: @xp %{cr}GOLD: @gold %{cr}------------------------%{cr}Armor: @AR %{cr}------------------------} "" "XP"
#CLASS 0 |
Obviously where the nubmers are in the variable is a %1-2-3- etc ..
I guess now the next major question is, how do I inpur colors? |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Tue Jul 17, 2007 3:58 pm |
Code: |
#tr {You have (%d) experience points, and (%d) gold coins.} {#var totalxp %1;#var gold %2}
#tr {Spell '(*)', (*) remaining.} {#addkey spellsd {%1} {%2}} |
Here is some code to make a pretty box.
Basically you find out how big a box you need to display everything and use the number in the places where you see the 53.
Code: |
" "%subchar( %format( "&-53s", ""), " ", "-")
|%format( "&-53s", "")|
|%format( "&-53s", %concat( "My Health is ", %format( "&-.0n", @hp), "."))|
|%format( "&-53s", %concat( "My level is ", @level, "."))|
|%format( "&-53s", %concat( "Detect Invisibility ", %db( @SpellsD, "detect invisibility"), " remaining."))|
|%format( "&-53s", "")|
" "%subchar( %format( "&-53s", ""), " ", "-") |
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Tue Jul 17, 2007 4:12 pm |
%ansi(red)This is red%ansi(green)
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
shakey Novice
Joined: 07 Jul 2007 Posts: 40
|
Posted: Tue Jul 17, 2007 8:04 pm |
hmm, shoulda I convert to Cmud? Maybe that'll be more user friendly?
|
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Wed Jul 18, 2007 2:03 am |
I'm sorry I was not trying to scare you with the code, or be so brief with you but I was posting from work.
First here is an example of what the code below does. Except that it is not in color because of the forums. I don't want to use an image for this.
Code: |
Vincent
------------------------------------------------------
|Str:23 Int:29 Wis:25 Dex:22 Con:24 Chr:13 |
------------------------------------------------------
|EXP:3412496 |
|GOLD:0 |
------------------------------------------------------
|Armor:65 (you are very poorly armored for your level) |
------------------------------------------------------ |
This code Does do colors but they don't work inside of a code block so just look at the example pic you gave to see the colors as I took them from that! Or just open Zmud and past the stuff in the box below into the command line.
This is a much better setup than I gave before but it requires a small amount of explanation.
Code: |
#CLASS {status window|BFunc}
#FUNC bLine {" "%ansi( hi, blue)%subchar( %format( %concat("&-",@bwidth,"s"), ""), " ", "-")%ansi(green)}
#VAR Bwidth {54}
#FUNC Line {%concat(%ansi( hi, blue)," ","|",%ansi( green),%format( %concat("&-",%eval((%len(%1)-%len(%stripansi(%1)))+@Bwidth),"s"), %1),%ansi( hi, blue),"|",%ansi( green))}
#FUNC Stat {%concat(" ",%ansi(cyan),%item(%1,1),":",%ansi(%item(%1,2)),%item(%1,3),%ansi(green))}
#CLASS 0
#CLASS {status window}
#VAR AR {65 (you are very poorly armored for your level)}
#VAR CHR {13}
#VAR CON {24}
#VAR DEX {22}
#VAR gold {0}
#VAR INT {29}
#VAR STR {23}
#VAR WIS {25}
#VAR xp {3412496}
#STW {%ansi(hi,red) Vincent%{cr}@bline%{cr}@line(%concat(@stat(Str|white|@str),@stat(Int|white|@int),@stat(Wis|white|@wis),@stat(Dex|white|@dex),@stat(Con|white|@con),@stat(Chr|white|@chr)))%{cr}@bline%{cr}@line(@stat(EXP|"hi,cyan"|@xp))%{cr}@line(@stat(GOLD|"hi,yellow"|@gold))%{cr}@bline%{cr}@line(%concat(@stat(Armor|red|%left(@ar,3))," ",%trim(%right(@ar,3))))%{cr}@bline%{cr}} "" "XP2"
#CLASS 0 |
First off to look at this you can open Zmud OR Cmud and paste it into the command line.
This window is a tad wide as the width @Bwidth is set to 54 so you may need to widen the window in Zmud for it to look right.
Now I know this looks scary being so wide. The exporter uses %cr where I have used a newline in the editor. It looks better in Zmud's editor than in Cmud's oddly enough.
The variables you should recognize as I took them from your example.
The user defined functions make this thing a little more readable than the other examples I gave you hopefully!
bLine: Use this when you want to create a line of --------- it will create a line of the length of @bwidth. I used this for the top and bottoms of the box as well. It does not take arguments.
line: Use this to create a normal line with bars on each side. | | I used this to create the sides of the box. It takes one argument. Or an empty string. ""
Stat: Use this when you want to display a status item, like strenth. This takes three arguments and needs to be used with line. More than one Stat can be used within a line.
Here is a bit of the script the above creates for an example.
@bline
@line(@stat(EXP|"hi,cyan"|@xp))
@line(@stat(GOLD|"hi,yellow"|@gold))
@bline
The @bline does not take arguments.
The @line is creating the | | around the @stat.
The @stat takes three arguments separated by | The first one is the name of the stat Item it always appears in cyan, The second argument is the color you want the third argument to be.
If you want to use more than one argument for the color then you need quotes around it, please do not use spaces. If I were not highlighting you can ignore the quotes and leave them out.
Finally the last argument is the variable to be displayed.
As for upgrading to Cmud that is a great idea. But at the moment this code is the same for both. Actually I rewrote it to make it CMud compatible before posting. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
|
|
|
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
|
|