Esano2009-01-29 05:38:00
You need to make it 'send to script' for both aliases. Even then you'll have some problems, I think, but that first.
Gregori2009-01-29 11:00:13
QUOTE (Kante @ Jan 25 2009, 02:16 PM) <{POST_SNAPBACK}>
How would I go about making a targeting alias and other attacking aliases to use with the targeting?
I have been using Cmud, and all I had to do to set things up was set up a targeting alias by doing:
Alias name: t
script: tar=%1
To make a double-jab alias, I simply did:
alias name:ja
script: jab @tar
jab @tar
Due to my free trial of Cmud running out, how would I set up something similar in MUSHclient? I'm inept when it comes to coding, so a bit of explanation might be necessary.
I have been using Cmud, and all I had to do to set things up was set up a targeting alias by doing:
Alias name: t
script: tar=%1
To make a double-jab alias, I simply did:
alias name:ja
script: jab @tar
jab @tar
Due to my free trial of Cmud running out, how would I set up something similar in MUSHclient? I'm inept when it comes to coding, so a bit of explanation might be necessary.
CODE
 Â
  enabled="y"
  regexp="y"
  send_to="12"
  keep_evaluating="y"
  sequence="100"
  >
 Â
 Â
CODE
 Â
  enabled="y"
  expand_variables="y"
  regexp="y"
  sequence="100"
  >
 Â
 Â
Gregori2009-01-29 11:13:49
QUOTE (Isuka @ Jan 25 2009, 03:11 PM) <{POST_SNAPBACK}>
I'm looking for suggestions on how to handle target and enemy highlighting in mush.
With cmud the general approach is to create a stringlist of your enemies and a variable for your target, and then create triggers that match against those variables. ie "(@enemylist)" or "@target" with a simple #CW statement.
It doesn't seem to be that simple for mush.
So I suppose the question is twofold: is it possible to match against a lua sandboxed variable, and is it possible to color a single word within a line, or do I have to reprint the entire line somehow?
With cmud the general approach is to create a stringlist of your enemies and a variable for your target, and then create triggers that match against those variables. ie "(@enemylist)" or "@target" with a simple #CW statement.
It doesn't seem to be that simple for mush.
So I suppose the question is twofold: is it possible to match against a lua sandboxed variable, and is it possible to color a single word within a line, or do I have to reprint the entire line somehow?
Change trigger lines to suit:
CODE
 Â
  enabled="y"
  expand_variables="y"
  keep_evaluating="y"
  match="\\b(@!members)\\b"
  regexp="y"
  repeat="y"
  sequence="1"
  other_text_colour="white"
  other_back_colour="blue"
  >
 Â
 Â
  ignore_case="y"
  keep_evaluating="y"
  match="\\bTotal\\b"
  regexp="y"
  repeat="y"
  send_to="12"
  sequence="90"
  other_text_colour="silver"
  >
 Â
 Â
 Â
  match="^Enemies of the .* of (Glomdoring|Serenwilde|Celest|Magnagora):$"
  regexp="y"
  send_to="12"
  sequence="100"
  >
 Â
 Â
 Â
  match="(.*)"
  regexp="y"
  send_to="12"
  sequence="100"
  >
 Â
SetVariable ("enemies", Replace (GetVariable("enemies"), ", ", "|", true))
 Â
 Â
  match="(.*)\\."
  regexp="y"
  send_to="12"
  sequence="100"
  >
 Â
SetVariable ("members", Replace (GetVariable("members"), ", ", "|", true))
 Â
 Â
  enabled="y"
  expand_variables="y"
  keep_evaluating="y"
  match="\\b(@!enemies)\\b"
  regexp="y"
  repeat="y"
  sequence="100"
  other_text_colour="white"
  other_back_colour="red"
  >
 Â
 Â
  match="\\d+h, \\d+m"
  regexp="y"
  send_to="12"
  sequence="100"
  >
 Â
 Â
 Â
  match="^The following are ACTIVE .* of the .* of (Glomdoring|Serenwilde|Celest|Magnagora):$"
  regexp="y"
  send_to="12"
  sequence="100"
  >
 Â
 Â
 Â
 Â
Isuka2009-01-29 16:37:19
QUOTE (Gregori @ Jan 29 2009, 03:13 AM) <{POST_SNAPBACK}>
Change trigger lines to suit:
    custom_colour="17"
  enabled="y"
  expand_variables="y"
  keep_evaluating="y"
  match="\\b(@!members)\\b"
  regexp="y"
  repeat="y"
  sequence="1"
  other_text_colour="white"
  other_back_colour="blue"
  >
 Â
CODE
 Â
  enabled="y"
  expand_variables="y"
  keep_evaluating="y"
  match="\\b(@!members)\\b"
  regexp="y"
  repeat="y"
  sequence="1"
  other_text_colour="white"
  other_back_colour="blue"
  >
 Â
what is the "@!" identifier? I can't seem to find a record of it. i know that the "@" is expanding a variable name, but not sure what the "!" behind it does.
Unknown2009-01-29 17:59:39
The ! prevents MUSHclient from escaping the contents of the variable, treating it as a literal regular expression (so you don't end up with \\\\ when you wanted \\, for example).
Shaddus2009-01-29 23:41:07
Trying to work on setting up a system for katas. I'm currently using ethelon's system, but that shouldn't matter in much.
I'm trying to make
do
I thought it would work, but something isn't right. When I use (With Seraku as my target, for instance)
It does
And that's it. What am I missing?
I'm trying to make
QUOTE
KA *
do
QUOTE
KATA PERFORM (target) %1
I thought it would work, but something isn't right. When I use (With Seraku as my target, for instance)
QUOTE
KA PVP1
It does
QUOTE
KATA PERFORM SERAKU
And that's it. What am I missing?
Kante2009-01-29 23:43:23
I hate myself. :|
Gregori2009-01-30 09:16:33
QUOTE (Shaddus Mes'ard @ Jan 29 2009, 05:41 PM) <{POST_SNAPBACK}>
Trying to work on setting up a system for katas. I'm currently using ethelon's system, but that shouldn't matter in much.
I'm trying to make
do
I thought it would work, but something isn't right. When I use (With Seraku as my target, for instance)
It does
And that's it. What am I missing?
I'm trying to make
do
I thought it would work, but something isn't right. When I use (With Seraku as my target, for instance)
It does
And that's it. What am I missing?
Put %1 in " "
So it is "%1"
Isuka2009-02-04 01:18:57
All right, I'm stuck (again).
I'm coding a system to automatically def up in lua. The system works well with one flaw that I can't seem to figure out: EnableGroup (or world.EnableGroup) doesn't seem to work when called from a script.
I'm using this
The "false" command works as it should. The "true" command fails every time. However, if I use the command from within the console (/world.EnableGroup("def_captures", true)) it works fine. Also, if I manually enable the group, the system will turn itself off when appropriate.
Any thoughts?
I'm coding a system to automatically def up in lua. The system works well with one flaw that I can't seem to figure out: EnableGroup (or world.EnableGroup) doesn't seem to work when called from a script.
I'm using this
CODE
function defs:defup()
    if not mydefs then -- mydefs was never defined. Abort.
        return
    end
    local continue = false
    -- Start by turning on the alias to catch the bal regain triggers
    world.EnableGroup("defup_captures", true)
    -- every def will be defined with an associated command and balance.
    -- parse through them, and if possible run the command to put them up.
    for k,v in pairs(mydefs) do
        -- always process free defs
        if v == "free" and not defs:has(k) and bals:canAct() then
            world.Send(v)
            defs:add(k)
            continue = true
        elseif not defs:has(k) and bals:has(v) and bals:canAct() then
            world.Send(v)
            bals:lose(v)
            defs:add(k)
            continue = true
        end
    end
    -- Finalize by turning off the trigger group to stop further processing.
    if not continue then
        world.EnableGroup("defup_captures", false)
    end
end
    if not mydefs then -- mydefs was never defined. Abort.
        return
    end
    local continue = false
    -- Start by turning on the alias to catch the bal regain triggers
    world.EnableGroup("defup_captures", true)
    -- every def will be defined with an associated command and balance.
    -- parse through them, and if possible run the command to put them up.
    for k,v in pairs(mydefs) do
        -- always process free defs
        if v == "free" and not defs:has(k) and bals:canAct() then
            world.Send(v)
            defs:add(k)
            continue = true
        elseif not defs:has(k) and bals:has(v) and bals:canAct() then
            world.Send(v)
            bals:lose(v)
            defs:add(k)
            continue = true
        end
    end
    -- Finalize by turning off the trigger group to stop further processing.
    if not continue then
        world.EnableGroup("defup_captures", false)
    end
end
The "false" command works as it should. The "true" command fails every time. However, if I use the command from within the console (/world.EnableGroup("def_captures", true)) it works fine. Also, if I manually enable the group, the system will turn itself off when appropriate.
Any thoughts?
Unknown2009-02-04 01:27:40
Looking at Treant script files, I think you do not need the 'world.' part. Just EnableGroup("groupname", true) will do, apparently.
Isuka2009-02-04 01:43:19
QUOTE (Caerulo @ Feb 3 2009, 05:27 PM) <{POST_SNAPBACK}>
Looking at Treant script files, I think you do not need the 'world.' part. Just EnableGroup("groupname", true) will do, apparently.
I've tried both. Neither works properly.
Unknown2009-02-04 02:41:22
I had a problem using EnableGroup recently. I used EnableGroup because I wanted to enable aliases and triggers with a single command, but it didn't enable anything. I ended up using EnableAliasGroup and EnableTriggerGroup instead.
Isuka2009-02-04 02:58:50
QUOTE (Zarquan @ Feb 3 2009, 06:41 PM) <{POST_SNAPBACK}>
I had a problem using EnableGroup recently. I used EnableGroup because I wanted to enable aliases and triggers with a single command, but it didn't enable anything. I ended up using EnableAliasGroup and EnableTriggerGroup instead.
I actually tried using EnableAliasGroup as well, without success. I'm not sure what is causing this, I had to bypass it by enabling the group with the alias for starting the process.
Isuka2009-02-04 06:35:43
Ok, I'm baffled.
I thought I had my previous issue worked around by using an alias to issue the EnableGroup command. However, when I reloaded my system I realized that it doesn't work at all. Even being called from the alias, EnableGroup and EnableAliasGroup are not successfully enabling the alias needed.
Any ideas on how to debug this? Is it more likely my code, or MUSH?
I thought I had my previous issue worked around by using an alias to issue the EnableGroup command. However, when I reloaded my system I realized that it doesn't work at all. Even being called from the alias, EnableGroup and EnableAliasGroup are not successfully enabling the alias needed.
Any ideas on how to debug this? Is it more likely my code, or MUSH?
Unknown2009-02-04 07:15:26
I dunno, my EnableTrigger and EnableGroup aliases seem to be working, although they enable triggers only.
EDIT: I'll try EnableAlias and EnableAliasGroup to see if that is a problem.
I think its the code? I used a basic alias, and EnableAlias, EnableGroup and EnableAliasGroup works. However, it was just one alias, and its a very basic alias that just sent a note.
EDIT: I'll try EnableAlias and EnableAliasGroup to see if that is a problem.
I think its the code? I used a basic alias, and EnableAlias, EnableGroup and EnableAliasGroup works. However, it was just one alias, and its a very basic alias that just sent a note.
Unknown2009-02-04 12:08:44
I suspect that there's some minor bug there in MUSHclient. The source code is available, so it's possible to debug the code (if/when I get the time).
Unknown2009-02-04 13:50:45
I should note that all my 'tests' were done in-client, not with script files. I still haven't figured out how to use them yet, but you mentioned having problems client-side, so I tested that out.
Isuka2009-02-04 21:29:09
All right, new question.
In cmud I used ATCP to track changes to my stats without needing to SCORE to get them, and it was a fairly simple issue. Simply set a trigger to listen to telnet commands, no problem.
Mush client makes this a little harder. While I know that you can listen to telnet with plugins (because Zarquan has a plugin to do it), I'm not certain how to translate the results into the rest of my system.
As far as I know, plugins are completely encapsulated. Therefore, while I would be able to parse the vitals line, i wouldn't be able to feed it to my vitals variables outside of the plugin.
Am I wrong? How could this be done?
In cmud I used ATCP to track changes to my stats without needing to SCORE to get them, and it was a fairly simple issue. Simply set a trigger to listen to telnet commands, no problem.
Mush client makes this a little harder. While I know that you can listen to telnet with plugins (because Zarquan has a plugin to do it), I'm not certain how to translate the results into the rest of my system.
As far as I know, plugins are completely encapsulated. Therefore, while I would be able to parse the vitals line, i wouldn't be able to feed it to my vitals variables outside of the plugin.
Am I wrong? How could this be done?
Unknown2009-02-04 21:47:54
Yes, I have a plugin that does it. However, my plugin calls an alias in my world to set variables for each stat. In other words, my plugin already does the very thing you're trying to do! Look for "setvar" and you'll see how I do that.
Isuka2009-02-04 21:57:02
QUOTE (Zarquan @ Feb 4 2009, 01:47 PM) <{POST_SNAPBACK}>
Yes, I have a plugin that does it. However, my plugin calls an alias in my world to set variables for each stat. In other words, my plugin already does the very thing you're trying to do! Look for "setvar" and you'll see how I do that.
Ah, I didn't realize that a plugin could call a world alias.