Page 1 of 2
lbs to kg script
Posted: Mon Jul 24, 2017 4:05 am
by Alison
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.
Re: lbs to kg script
Posted: Mon Jul 24, 2017 4:33 am
by Maeglin
Might want to post what client you are using. This shouldn't be too hard in CMUD. I use one to add up my defense, but you have to replace the whole line.
Re: lbs to kg script
Posted: Mon Jul 24, 2017 11:03 am
by Aardvolf
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?
Re: lbs to kg script
Posted: Mon Jul 24, 2017 11:15 am
by Taziar
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?
To use decimals in zMUD you use the
%float function.
Re: lbs to kg script
Posted: Mon Jul 24, 2017 6:09 pm
by Naerin
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( @weigh*0.454))}
#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: Thanks to Maeglin for catching the error.
Re: lbs to kg script
Posted: Tue Jul 25, 2017 12:57 am
by Alison
thanks. And i use cmud. My mind is used to using kg's and not pounds.
Re: lbs to kg script
Posted: Tue Jul 25, 2017 8:06 am
by Grabel
I think my mind would go crazy if i would use kg, lugging around 8 kg sword etc.
Re: lbs to kg script
Posted: Tue Jul 25, 2017 5:55 pm
by Naerin
Can someone adapt my script for Cmud so that Alison can use it?
Re: lbs to kg script
Posted: Wed Jul 26, 2017 1:20 am
by Maeglin
If the zmud version doesn't work with CMUD, I'll try to work on it later tonight.
Re: lbs to kg script
Posted: Wed Jul 26, 2017 6:15 pm
by Maeglin
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
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.
#CLASS {LbstoKg}
#TRIGGER {and you weigh (%d).(%d) lbs.$} {
#MATH weigh %eval( %float( %1) + %norm( %eval( %2/%float( 10))))
#VAR weighkg {%format( 1, %eval( @weigh*0.454))}
#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
* 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:
EDIT:
One nitpicky thing if you care. If you initializes all of the variables at the start of the class, they won't spam up your general folder.
#CLASS {LbstoKg}
#Var weigh 0
#Var wearing 0
etc
#Triggers etc
#Class 0