Kaalak2008-05-28 06:35:46
So Alodia created the following Macro for Nexus (credit also goes to Shiri). If you have contemplate, amissio and absolve,
it allows you to bash F1 and it will amissio the target if the target's mana is above 50%. Below 50% the target will be absolved.
Variable
Variable: absolve
Value: on
Aliases
Alias: abs
Script: #set absolve on
peep
Alias:peep
Script: contemplate $target
Alias:absolve
Script:starcall absolve $target
Alias:ami
Script:chant amissio $target
Trigger
Trigger: {w} mana stands at {d}/{d}
Script:
#highlight 15
#math manapercent ( $2*100) / $3
#echo $manapercent%
#if $absolve = on {#if $manapercent < 50 {absolve} else {ami}
}
#set absolve off
Keybindings
Keybinding:F1
Script: abs
it allows you to bash F1 and it will amissio the target if the target's mana is above 50%. Below 50% the target will be absolved.
Variable
Variable: absolve
Value: on
Aliases
Alias: abs
Script: #set absolve on
peep
Alias:peep
Script: contemplate $target
Alias:absolve
Script:starcall absolve $target
Alias:ami
Script:chant amissio $target
Trigger
Trigger: {w} mana stands at {d}/{d}
Script:
#highlight 15
#math manapercent ( $2*100) / $3
#echo $manapercent%
#if $absolve = on {#if $manapercent < 50 {absolve} else {ami}
}
#set absolve off
Keybindings
Keybinding:F1
Script: abs
Kaalak2008-05-28 06:47:40
I adapted the above for zMud with thanks to Talkan.
Keybinding
Key:F1
Value:peep
Alias
Name:peep
Value:contemplate @target
Name:ami
Value:chant amissio @target
Name:abs
Value:starcall absolve @target
Trigger
Pattern: Mana stands at (%d)/(%d).
Value: #Math manapercent ( %1*100)/%2
#var targetmana %1
#var targetmax %2
#show @targetmana and @targetmax
#show MANAPERCENT = @manapercent
#CO bold,red
#if @targetmana>(@targetmax/2) {ami} {abs}
Keybinding
Key:F1
Value:peep
Alias
Name:peep
Value:contemplate @target
Name:ami
Value:chant amissio @target
Name:abs
Value:starcall absolve @target
Trigger
Pattern: Mana stands at (%d)/(%d).
Value: #Math manapercent ( %1*100)/%2
#var targetmana %1
#var targetmax %2
#show @targetmana and @targetmax
#show MANAPERCENT = @manapercent
#CO bold,red
#if @targetmana>(@targetmax/2) {ami} {abs}
Kiradawea2008-05-28 15:26:56
Neatly done. I can't test it since I don't have contemplate (oh why must you be so high up in a nontempting skillset) but I want to point out a minor flaw I see immediately that'll not make this work.
In Nexus, the Alias is ami, but the trigger will try to activate the alias "amis", with an extra s. Remove that extra s, and those of us who use Nexus will be able to copy it over with no problem.
In Nexus, the Alias is ami, but the trigger will try to activate the alias "amis", with an extra s. Remove that extra s, and those of us who use Nexus will be able to copy it over with no problem.
Kaalak2008-05-29 21:16:08
Fixed. Thanks for noticing that Kiradawea. If there are any other errors you find please let me know.
And since I'm on the subject, I like using audio cues for when the aura opens from Heretic in zMud.
Trigger
Pattern: glows with a white light.
Value: #beep 75
And since I'm on the subject, I like using audio cues for when the aura opens from Heretic in zMud.
Trigger
Pattern: glows with a white light.
Value: #beep 75
Vathael2008-05-29 22:00:13
I'm kind of curious as to why you made it set variables for something you could just make it figure in the trigger.
#regex {^((@target).*)'s mana stands at (\\d+)/(\\d+).$} {#sa Mana at %eval( %2*100/%3)%.;#if (%2 > %eval( %3/2)) {ami} {abs}}
#regex {^((@target).*)'s mana stands at (\\d+)/(\\d+).$} {#sa Mana at %eval( %2*100/%3)%.;#if (%2 > %eval( %3/2)) {ami} {abs}}
Rauros2008-05-30 00:20:06
How would this be implemented into MUSHclient, with LUA?
This is what I have so far:
This is what happens when I try to run it:
As you can see, it's not recognizing those commands as aliases, just nonsense.
This is what I have so far:
CODE
AliasFuncTable = {
  F_abssetc    = "abssetc *",
  F_abssetm    = "abssetm *",
  F_abschk      = "abschk",
  F_abs    = "abs",      -- discern and turns on absolve
}
---------------Absolve-----------------------
require "addxml"
addxml.trigger {
    match = "mana stands at (\\\\d+)/(\\\\d+)",
    regexp = true,
    = true,
    send_to = 12,
    send = ],
    sequence = 100,
    enabled = true,
    name = "absolve",
}
tcurm=1 --target's current mana
tmaxm=1 --target's max mana
mperc=100 --a percent of target's mana
absolve=on
-- absolve
function F_abs (thename, theoutput, wildcards, line)
    absolve=on
    Send ("discern "..target)
end
-- sets tcurm
function F_abssetc (thename, theoutput, wildcards, line)Â Â Â Â Â Â Â Â Â Â Â Â
    tcurm=wildcards
end
-- sets tmaxm
function F_abssetm (thename, theoutput, wildcards, line)
    tmaxm=wildcards
end
-- absolve check
function F_abschk (thename, theoutput, wildcards, line)
    mperc=(tcurm * 100 )/tmaxm
    Note ("//___Mana percent="..mperc.."%___\\\\\\\\")
    Note ("\\\\\\\\  Mana percent="..mperc.."%  //")
    if absolve == "on" then
        if mperc<50 then
              Send ("starcall absolve "..target)
        else
        Send ("chant amissio "..target)
        end
    end
    absolve="off"
end
  F_abssetc    = "abssetc *",
  F_abssetm    = "abssetm *",
  F_abschk      = "abschk",
  F_abs    = "abs",      -- discern and turns on absolve
}
---------------Absolve-----------------------
require "addxml"
addxml.trigger {
    match = "mana stands at (\\\\d+)/(\\\\d+)",
    regexp = true,
    = true,
    send_to = 12,
    send = ],
    sequence = 100,
    enabled = true,
    name = "absolve",
}
tcurm=1 --target's current mana
tmaxm=1 --target's max mana
mperc=100 --a percent of target's mana
absolve=on
-- absolve
function F_abs (thename, theoutput, wildcards, line)
    absolve=on
    Send ("discern "..target)
end
-- sets tcurm
function F_abssetc (thename, theoutput, wildcards, line)Â Â Â Â Â Â Â Â Â Â Â Â
    tcurm=wildcards
end
-- sets tmaxm
function F_abssetm (thename, theoutput, wildcards, line)
    tmaxm=wildcards
end
-- absolve check
function F_abschk (thename, theoutput, wildcards, line)
    mperc=(tcurm * 100 )/tmaxm
    Note ("//___Mana percent="..mperc.."%___\\\\\\\\")
    Note ("\\\\\\\\  Mana percent="..mperc.."%  //")
    if absolve == "on" then
        if mperc<50 then
              Send ("starcall absolve "..target)
        else
        Send ("chant amissio "..target)
        end
    end
    absolve="off"
end
This is what happens when I try to run it:
QUOTE
discern kaalak
You stare deep into Kaalak's soul and discern that:
Kaalak's health stands at 3111/3111.
Kaalak's mana stands at 4440/4440.
abssetc 4440
abssetm 4440
abschk
Kaalak's ego stands at 4233/4233.
Kaalak's power stands at 10/10.
4859h, 2885m, 3534e, 10p, 21575en, 13480w exk-
Most perplexing.
4859h, 2885m, 3534e, 10p, 21575en, 13480w exk-
Clarification is in order.
4859h, 2885m, 3534e, 10p, 21575en, 13480w exk-
Please try rewording.
You stare deep into Kaalak's soul and discern that:
Kaalak's health stands at 3111/3111.
Kaalak's mana stands at 4440/4440.
abssetc 4440
abssetm 4440
abschk
Kaalak's ego stands at 4233/4233.
Kaalak's power stands at 10/10.
4859h, 2885m, 3534e, 10p, 21575en, 13480w exk-
Most perplexing.
4859h, 2885m, 3534e, 10p, 21575en, 13480w exk-
Clarification is in order.
4859h, 2885m, 3534e, 10p, 21575en, 13480w exk-
Please try rewording.
As you can see, it's not recognizing those commands as aliases, just nonsense.
Unknown2008-05-30 02:32:12
Why are you still coding even the simplest aliases in a .lua script file? Just make an alias and put your one line of code in it. Sure, there are half a dozen different ways to do it, but it looks to me like you're making it harder than it really should be.
Rauros2008-05-30 12:00:19
QUOTE(Zarquan @ May 29 2008, 10:32 PM) 516576
Why are you still coding even the simplest aliases in a .lua script file? Just make an alias and put your one line of code in it. Sure, there are half a dozen different ways to do it, but it looks to me like you're making it harder than it really should be.
Well, I haven't gotten down the basic grasp of Mush client coding yet, so I'm going by what Nezha has already made. I'm just tryin things out. Trying to read the Mush client help files is like reading stereo instructions.