lbs to kg script
Posted: Mon Jul 24, 2017 4:05 am
Im looking to change you are carrying xx lbs to you are carrying xx kgs . Atm 1 lbs is 0.454 kg. If anyone can help pls.
Forums for the Wheel of Time MUD
http://li937-51.members.linode.com/
http://li937-51.members.linode.com/viewtopic.php?f=76&t=5159
To use decimals in zMUD you use the %float function.Aardvolf wrote:I don't know about cMUD but I know zMUD does not handle fractions. It truncates anything beyond a decimal. Why do you need it in kg?
This works fine in CMUD, but there was a typo in the body weight trigger. Fixed below. I actually really dig this simple little script. Thanks for thinking about the idea, Alison.Naerin wrote:For Zmud:
#CLASS {LbstoKg}
#TRIGGER {and you weigh (%d).(%d) lbs.$} {
#MATH weigh %eval( %float( %1) + %norm( %eval( %2/%float( 10))))
#VAR weighkg {%format( 1, %eval( @wearing*0.454))} <------typo
#SUB {and you weigh @weighkg kg.}
}
#TRIGGER {^You are carrying (%d).(%d) lbs} {
#MATH carry %eval( %float( %1) + %norm( %eval( %2/%float( 10))))
#VAR carrykg {%format( 1, %eval( @carry*0.454))}
#SUB {You are carrying @carrykg kg}
}
#TRIGGER {and wearing (%d).(%d) lbs} {
#MATH wear %eval( %float( %1) + %norm( %eval( %2/%float( 10))))
#VAR wearkg {%format( 1, %eval( @wear*0.454))}
#SUB {and wearing @wearkg kg}
}
#CLASS 0
EDIT:* HP:Healthy MV:Fresh > TICK IN 5 SECONDS.
stat
You are a 432 year old male seanchan hunter.
Your height is 6 feet, 0 inches, and you weigh 178.0 lbs.
You are carrying 1.6 lbs and wearing 49.1 lbs, very light.
Your base abilities are: Str:19 Int:15 Wil:16 Dex:19 Con:19 Statsum: 88.
Offensive bonus: 96, Dodging bonus: 76, Parrying Bonus: 56, Defense: 132
Your mood is: Wimpy. You will flee below: 196 Hit Points
Your posture is: Defensive.
You are wanted by: Andor Tar Valon Illian Fal Dara Tear Amador Maradon Cairhien Children of Light Red Eagles Thiefbane Wolves Bandar Eban Mayene Tremalking Far Madding
Your armor absorbs about 58% on average.
You are subjected to the following effects:
* HP:Healthy MV:Fresh > stat
You are a 432 year old male seanchan hunter.
Your height is 6 feet, 0 inches, and you weigh 80.8 kg.
You are carrying 0.7 kg and wearing 22.3 kg, very light.
Your base abilities are: Str:19 Int:15 Wil:16 Dex:19 Con:19 Statsum: 88.
Offensive bonus: 96, Dodging bonus: 76, Parrying Bonus: 56, Defense: 132
Your mood is: Wimpy. You will flee below: 196 Hit Points
Your posture is: Defensive.
You are wanted by: Andor Tar Valon Illian Fal Dara Tear Amador Maradon Cairhien Children of Light Red Eagles Thiefbane Wolves Bandar Eban Mayene Tremalking Far Madding
Your armor absorbs about 58% on average.
You are subjected to the following effects: