Page 1 of 1

Convert this to mudlet kthx

Posted: Thu Mar 09, 2017 8:29 pm
by Rig
#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)}}
}

Re: Convert this to mudlet kthx

Posted: Fri Mar 10, 2017 12:27 am
by Adael
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.

Re: Convert this to mudlet kthx

Posted: Fri Mar 10, 2017 12:42 am
by Rig
you are too smart

Re: Convert this to mudlet kthx

Posted: Fri Mar 10, 2017 12:26 pm
by Brocas
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?

Re: Convert this to mudlet kthx

Posted: Mon Mar 13, 2017 8:44 pm
by Jomin
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:

Code: Select all

target = matches[2]
which then leaves a global value "target" that you can then use in your combat system e.g. you could assign

Code: Select all

if target and target ~= "" then
    send("kill "..target.."\n")
end
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...

Re: Convert this to mudlet kthx

Posted: Tue Mar 14, 2017 9:14 am
by Brocas
Thanks Jomin. I'll experiment!

Re: Convert this to mudlet kthx

Posted: Tue Mar 14, 2017 9:55 pm
by Ara
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...

Re: Convert this to mudlet kthx

Posted: Thu Mar 16, 2017 6:57 pm
by Jomin
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...