 |
Brujah Wanderer
Joined: 13 Nov 2002 Posts: 88 Location: USA
|
Posted: Thu Sep 18, 2003 11:55 pm
Scripting guage buttons |
I have a guage button that i want to be very specific in all aspects...
lets say i want these dementions
Caption
@EXPTNL until level @level
Gauge
@totalexptnl-@exptnl
GaugeMax: @totalexptnl
GaugeMin: 0 (default)
Size
Width: 423
Height: 24
Position
Left: 319
Top: 0
How would i go about writing it so someone can cut/paste my script...
IE: #TR, #AL, #VAR, Etc... i am not as familiar with buttons as i should be. thank you in advance. :) |
|
|
 |
Brujah Wanderer
Joined: 13 Nov 2002 Posts: 88 Location: USA
|
Posted: Fri Sep 19, 2003 12:31 am |
a second question occurred to me to ask about gauges and i figured id add it on to this one... Is it possible to make the gauge color change or reset itself after it reaches a particular %? for instance could i make it red up until its 25% then green to 75% then cyan to 100%? if that is possible using triggers or variables or whatever... is it then possible to program it to gradually change colors every % or to seperate it into 100 different colors so it appears to be fading from green into black or the like?
|
|
|
 |
Brujah Wanderer
Joined: 13 Nov 2002 Posts: 88 Location: USA
|
Posted: Fri Sep 19, 2003 6:33 am |
*pokes his thread to make it stand out*
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Sep 19, 2003 4:09 pm |
Use the built-in export/import capabilities.
Feel free to experiment with %btncol(), #BUTTON, and #GAUGE.
CLARIFICATION: It's possible to change the gauge color(s) with external commands. I don't think there's any internal method for doing so. |
|
|
 |
Brujah Wanderer
Joined: 13 Nov 2002 Posts: 88 Location: USA
|
Posted: Fri Sep 19, 2003 5:26 pm |
my question now becomes.. and thank you so much for the help lightbulb... how do i make a trigger fire itself once, disable itself, and then set another trigger to enable it again?
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Sep 19, 2003 5:35 pm |
Oops, I hope you caught my edit.
Use a multi-state trigger.
#TR {first trigger phrase} {triggered action}
#COND {second trigger phrase} {#NOOP} |
|
|
 |
Brujah Wanderer
Joined: 13 Nov 2002 Posts: 88 Location: USA
|
Posted: Fri Sep 19, 2003 6:10 pm |
ill just show you the script and maybe you can tell me why its not working correctly... following the script is a cut/paste of the exp line im working with. it is getting an echo which doesnt send to the mud but shows up beneath my EXP Line every time i check my score. the way i wrote it, it should fire once IF i just leveled. the part of the script that i think has the problem is in bold and the echo is in green. this is what im making a gauge for. ive been playing with those gauge options but nowhere did i see what i would type to change the size/position of it. is doing it manually the only way to change that?
#VAR newlvl 0
#VAR totalexptnl 24000000
#TR {The Powers have noticed thy efforts at betterment, and have rewarded thee!} {#VAR newlvl 1}
#TR {and need (*) to advance.} {%if @newlvl=1 @totalexptnl = %replace "%1", "," #VAR newlvl 0}
#VAR EXPTNL
#VAR Level
#VAR Exp
#VAR Tnl
#VAR QP
#VAR Complete
#TRIGGER {* You have * experience points and need (*) to advance.} {@EXPTNL = %replace( "%1", ",")}
#TRIGGER {Total Level: (%d)} {#MATH Level (%1 + 1)}
#TRIGGER {You receive (*) experience points.} {@Exp = %replace( "%1", ",");#MATH Tnl (@EXPTNL/@Exp);#MATH EXPTNL (@EXPTNL-@Exp)}
#TRIGGER {Quest Points: (*) ~((*) quests~)} {@QP = %replace( "%1", ",");@Complete = %replace( "%2", ",")}
#ST Scripting brought to you directly from the MaD PiMp! Quest Points: @QP
* You have 213,658,433 experience points and need 6,841,567 to advance.
0=1 24000000 = 6,841,567, , #VAR newlvl 0
* You have killed 9,330 creatures and 30 players in combat.
* You have been killed 58 times, 34 in player kill combat.
* You have defeated 2 players and lost 3 times in arena combat.
* You are carrying 5 items weighing 15 stones and 73 pebbles.
* You will flee from combat if your hit points drop below 0. |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Sep 20, 2003 12:58 am |
%if requires () around its parameters, but it's not really appropriate in this situation anyway. It returns a value, which is acceptable for sending a single MUD command. However, you want to execute multiple zMUD commands so you should use #IF.
#TR {and need (%n) to advance.} {#IF (@newlvl = 1) {@totalexptnl = %1;#VAR newlvl 0}}
Gauges are buttons. #GAUGE is a simplified command which only makes gauge buttons and contains no size/position fields. If you want to control those from the command line you have to use the general #BUTTON command. It's simpler to just use the editor. |
|
|
 |
|
|