Convert this to mudlet kthx
Convert this to mudlet kthx
#TRIGGER {^Your height is &%dstatFeet feet, &%dstatInches inches, and you weigh &statWeight lbs.} {
#MATH statTotalHeight (@statFeet*12)+@statInches
#MATH statHeightBMI @statTotalHeight*@statTotalHeight
#MATH statWeightBMI @statWeight*10
#MATH statBMI %float( @statWeightBMI)/%float( @statHeightBMI)
#IF (@showBMI) {#SUB {Your height is @statFeet feet, @statInches inches, and you weigh @statWeight lbs. Base BMI:%copy(@statBMI,3,2)}}
}
#MATH statTotalHeight (@statFeet*12)+@statInches
#MATH statHeightBMI @statTotalHeight*@statTotalHeight
#MATH statWeightBMI @statWeight*10
#MATH statBMI %float( @statWeightBMI)/%float( @statHeightBMI)
#IF (@showBMI) {#SUB {Your height is @statFeet feet, @statInches inches, and you weigh @statWeight lbs. Base BMI:%copy(@statBMI,3,2)}}
}
Re: Convert this to mudlet kthx
This should be good enough.
Make a new trigger, name it RigSux.
copy/paste
^Your height is (\d+) feet, (\d+) inches, and you weigh (\d+)\.(\d+) lbs\.$
into the pattern box, change pattern type from substring to perl regex.
then copy/paste
deleteLine()
local inches=tonumber(matches[2])*12.0+tonumber(matches[3])
local meters=inches*2.54/100
local pounds=tonumber(matches[4])+tonumber(matches[5])/10.0
local kg=pounds*0.454
local bmi=kg/meters^2
echo("\nYour height is "..matches[2].." feet, "..matches[3].." inches, and you weigh "..matches[4].."."..matches[5].." lbs. BMI: "..bmi)
into the bigger box below.
maybe theres a cleaner way to do it but idk this works alright.
Make a new trigger, name it RigSux.
copy/paste
^Your height is (\d+) feet, (\d+) inches, and you weigh (\d+)\.(\d+) lbs\.$
into the pattern box, change pattern type from substring to perl regex.
then copy/paste
deleteLine()
local inches=tonumber(matches[2])*12.0+tonumber(matches[3])
local meters=inches*2.54/100
local pounds=tonumber(matches[4])+tonumber(matches[5])/10.0
local kg=pounds*0.454
local bmi=kg/meters^2
echo("\nYour height is "..matches[2].." feet, "..matches[3].." inches, and you weigh "..matches[4].."."..matches[5].." lbs. BMI: "..bmi)
into the bigger box below.
maybe theres a cleaner way to do it but idk this works alright.
Re: Convert this to mudlet kthx
you are too smart
Re: Convert this to mudlet kthx
Does anyone have any general targeting scripts for mudlet?
Like something where you can do tgt mikhan and then your fireball, ice spike, etc weaves target mikhan?
Like something where you can do tgt mikhan and then your fireball, ice spike, etc weaves target mikhan?
-
- Posts: 160
- Joined: Thu Feb 19, 2015 3:54 pm
- Location: White Tower Libraries or Deepest Wiltshire, UK
Re: Convert this to mudlet kthx
You'd want an Alias - use ^tgt (\w+)$ as the "Pattern:" - which matches on you typing "tgt singleWordWithoutSpaces" then in the Lua Script area you can use something like:which then leaves a global value "target" that you can then use in your combat system e.g. you could assign to a <Cntl>K "Key"... you could get fancy and write a "Trigger" to detect the R.I.P. message and then set target back to the empty string "" so that the combo stops being effective once the target dies...
Code: Select all
target = matches[2]
Code: Select all
if target and target ~= "" then
send("kill "..target.."\n")
end
Re: Convert this to mudlet kthx
Thanks Jomin. I'll experiment!
Re: Convert this to mudlet kthx
Alias: Target
Pattern: ^tt (.+)$
target = matches[2]
target = string.title(target)
cecho("<light_blue>\nTarget set to -- " .. target .. " -- !\n\n")
**Note that target variable is not set to local
Alias: Ice Spikes
Pattern: ^is$
send("channel 'ice spikes' " ..target)
Alias: Call Lightning
Pattern: ^cl$
send("channel 'call lightning' " ..target)
and so on...
Pattern: ^tt (.+)$
target = matches[2]
target = string.title(target)
cecho("<light_blue>\nTarget set to -- " .. target .. " -- !\n\n")
**Note that target variable is not set to local
Alias: Ice Spikes
Pattern: ^is$
send("channel 'ice spikes' " ..target)
Alias: Call Lightning
Pattern: ^cl$
send("channel 'call lightning' " ..target)
and so on...
-
- Posts: 160
- Joined: Thu Feb 19, 2015 3:54 pm
- Location: White Tower Libraries or Deepest Wiltshire, UK
Re: Convert this to mudlet kthx
You might want to get fancy and add additional stuff to embrace before you cast your first weave; also you could detect weave success and fails and automatically retry on the latter; of course you may also need stuff to monitor your Saidar level and abort if unsafe to continue and to release when done - unless you deliberately want/need to hold a weave...