[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Aardwolf Consider all miniwindow.
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Aardwolf Consider all miniwindow.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1 2  3  4  5  6  

Posted by Blainer   (191 posts)  [Biography] bio
Date Mon 17 Aug 2009 01:33 AM (UTC)

Amended on Thu 27 Aug 2009 11:20 PM (UTC) by Blainer

Message
-Fixed a problem where MUSH variables don't get set causing the plugin to stop working.

This plugin displays the output of the 'consider all' command for Aardwolf in a miniwindow.

Features
-Reference Mobiles in the list by number from the command line.
-Set a default command to execute on click or from command line.
-Shows Nick's consider colours and levels.
-Toggle auto updating the window.
-Mouse click mobile's name to run default command / alias on that mobile.

Commands
conw - update window with consider all command.
<num> <word> - Execute <word> with keyword from line <num> on consider window.
<num> - Execute with default word.
conw <word> - set default command.
conw chng - swop keyword from beginning of name to end of name or vice-versa.
conw auto - toggle auto update consider window on room entry and after combat.
conw ? - show this help.


The way I see it being used is to like this.
You create an alias in MUSH that you use when you attack a mobile.
You then set the default command with 'conw <word>' to that alias.
Now you can just enter a number to pass the keyword to the alias.

For example I have this alias I use to start combat

<aliases>
    <alias
        match="ninja *"
        enabled="y"
        sequence="100"
    >
    <send>
        stab "%1"
        bash "%1"</send>
    </alias>
</aliases>

If I type 'ninja ogre' the alias will stab and then bash the ogre.
Now if I use the command 'conw ninja' the plugin will set the default command to 'ninja'.
When I enter a room the consider all window will update with line numbers next to all the mobs
in the room.
Example:
1. Ogre (-19 and below)
2. Goblin (+2 to +4)

To attack the Ogre with the ninja alias I simply enter '1' at the command line and hit enter.
This executes 'ninja Ogre'.
If I enter '2' and hit enter 'ninja Goblin' is executed.

I can create multiple aliases to do different things to a mobile and switch between them using 'conw <word>'
to change the default or I can enter '1 <command>', (command being any alias or MUD command) and then
'<command> Ogre' is sent to the MUD.

To make a macro or an aliase to switch on and off updating window automaticly use:
Note: In a macro you will need to precede this with your script prefix.

Execute ("conw auto")


Template:saveplugin=Aardwolf_Consider_Window To save and install the Aardwolf_Consider_Window plugin do this:
  1. Copy between the lines below (to the Clipboard)
  2. Open a text editor (such as Notepad) and paste the plugin into it
  3. Save to disk on your PC, preferably in your plugins directory, as Aardwolf_Consider_Window.xml
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file Aardwolf_Consider_Window.xml (which you just saved in step 3) as a plugin
  7. Click "Close"


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Friday, August 14, 2009, 6:13 AM -->
<!-- MuClient version 4.43 -->

<!-- Plugin "Consider_Window" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Aardwolf_Consider_Window"
   author="Blainer"
   id="584807a32cf46af04a1bece3"
   language="Lua"
   purpose="Display clickable consider command output."
   save_state="y"
   date_written="2009-08-14 06:12:14"
   requires="4.43"
   version="1.0"
   >
<description trim="y">
<![CDATA[
Put consider info in a miniwindow with commands.
Mostly copied from: http://www.gammon.com.au/forum/bbshowpost.php?id=8847
And: http://www.gammon.com.au/forum/?id=9664
]]>
</description>
</plugin>

<!--  Get our standard constants -->

<include name="constants.lua"/>
<!--  Triggers  -->

<triggers>
  <trigger
   enabled="n"
   group="consider"
   match="* looks a little worried about the idea."
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="n"
   group="consider"
   match="* says 'BEGONE FROM MY SIGHT unworthy!'"
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="n"
   group="consider"
   match="* should be a fair fight!"
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="n"
   group="consider"
   match="* snickers nervously."
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="n"
   group="consider"
   match="* would be easy, but is it even worth the work out?"
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="n"
   group="consider"
   match="* would crush you like a bug!"
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="n"
   group="consider"
   match="* would dance on your grave!"
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="n"
   group="consider"
   match="Best run away from * while you can!"
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="n"
   group="consider"
   match="Challenging * would be either very brave or very stupid."
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="n"
   group="consider"
   match="No Problem! * is weak compared to you."
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="n"
   group="consider"
   match="You would be completely annihilated by *!"
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="n"
   group="consider"
   match="You would stomp * into the ground."
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="n"
   group="consider"
   match="^(.*?) chuckles at the thought of you fighting (him|her|it)\.$"
   omit_from_output="y"
   regexp="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="n"
   group="consider"
   match="^You see no one here but yourself\!$"
   keep_evaluating="y"
   omit_from_output="y"
   regexp="y"
   script="adapt_consider"
   sequence="100"
  >
  </trigger>
    <trigger
   enabled="n"
   group="consider"
   match="^nhm$"
   omit_from_output="y"
   keep_evaluating="n"
   regexp="y"
   script="Show_Window"
   send_to="12"
   sequence="1"
  >
  </trigger>
    <trigger
   enabled="n"
   group="auto_consider"
   match="^You receive .+ experience points\.$"
   omit_from_output="n"
   keep_evaluating="y"
   regexp="y"
   script="send_consider"
   send_to="12"
   sequence="1"
  >
  </trigger>
   <trigger
   enabled="n"
   group="auto_consider"
   match="\[Exits\:.+$"
   omit_from_output="n"
   keep_evaluating="y"
   regexp="y"
   script="send_consider"
   send_to="12"
   sequence="1"
  >
  </trigger>
   <trigger
   enabled="n"
   group="auto_consider"
   match="^A (.+) has fled\!$"
   omit_from_output="n"
   keep_evaluating="y"
   regexp="y"
   script="send_consider"
   send_to="12"
   sequence="1"
  >
  </trigger>

</triggers>
<!-- Aliases -->
<aliases>
  <alias
   script="conw"
   match="^conw\s(.*)$"
   keep_evaluating="y"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  </alias>
    <alias
   script="send_consider"
   match="^conw$"
   keep_evaluating="y"
   enabled="y"
   regexp="y"
   send_to="12"
   sequence="99"
  >
  </alias>
  <alias
   script="command_line"
   match="^(\d+)\s?(\w*)$"
   enabled="y"
   regexp="y"
   send_to="12"
   keep_evaluating="y"
   sequence="1"
  >
  </alias>
</aliases>
<!--  Script  -->
<script>
<![CDATA[
-- Options -----------------------------------------------
local BACKGROUND_COLOUR     = ColourNameToRGB "black"
local BORDER_COLOUR         = ColourNameToRGB "dimgray"
local DEFAULT_TEXT_COLOUR   = ColourNameToRGB "white"
local TEXT_OFFSET           = "4"
local BORDER_WIDTH          = "1"
local LINE_SPACING          = "1"
local FONT_NAME             = "Dina"
local FONT_SIZE             = 8
local WIN_STACK             = "aa"  -- Windows are stacked alphabetically, so a win named "aa" will sit on top of a win named "zz".
                                    -- Adjust this setting to get the window to sit in front or behind other windows.
local SHOW_WELCOME          = true
local TITLE                 = "consider all"
local ECHO_CONSIDER         = false -- show consider in command window
local SHOW_NO_MOB           = false -- show warning when considering an empty room

require "movewindow"

consider_messages = {
    ["You would stomp (.+) into the ground%."] =
      { range = "-19 and below", colour = "gray", },
    ["(.+) would be easy, but is it even worth the work out%?"] =
      { range = "-10 to -19", colour = "darkgreen", },
    ["No Problem%! (.+) is weak compared to you%."] =
      { range = "-6 to -9", colour = "forestgreen", },
    ["(.+) looks a little worried about the idea%."] =
      { range = "-2 to -6", colour = "chartreuse", },
    ["(.+) should be a fair fight%!"] =
      { range = "-2 to +2", colour = "springgreen", },
    ["(.+) snickers nervously%."] =
      { range = "+2 to +3", colour = "darkgoldenrod", },
    ["(.+) chuckles at the thought of you fighting .+%."] =
      { range = "+3 to +8", colour = "gold", },
    ["Best run away from (.+) while you can%!"] =
      { range = "+8 to +16", colour = "tomato", },
    ["Challenging (.+) would be either very brave or very stupid%."] =
      { range = "+16 to +21", colour = "crimson", },
    ["(.+) would crush you like a bug%!"] =
      { range = "+21 to +32", colour = "lightpink", },
    ["(.+) would dance on your grave%!"] =
      { range = "+32 to +41", colour = "darkmagenta", },
    ["(.+) says 'BEGONE FROM MY SIGHT unworthy%!'"] =
      { range = "+41 to +50", colour = "darkviolet", },
    ["You would be completely annihilated by (.+)%!"] =
      { range = "+50 and above", colour = "magenta", },

      } -- end of consider_messages

replaceT =  { -- words to remove from Mobile's names to get the keyword
            ["a"] = "",
            ["A"] = "",
            ["an"] = "",
            ["An"] = "",
            ["the"] = "",
            ["The"] = "",
            ["of"] = "",
            ["Of"] = "",
            ["captured"] = "",
            ["damned"] = "",
            ["yummy"] = "",
            ["looking"] = "",
            ["wanders"] = "",
            ["beef"] = "",
            ["pot"] = "",
            ["scrumptious"] = "",
            ["tortured"] = "",
            ["Hell"] = "",
            ["largest"] = "",
            ["older"] = "",
            ["slithering"] = "",
            ["tiny"] = "",
            ["huge"] = ""
            }

targT = {}

function keyword_change (name, line, wildcards)

    if keyword_position == "end" then
        SetVariable ("keyword_position", "beginning")
    else
        SetVariable ("keyword_position", "end")
    end
    keyword_position = GetVariable ("keyword_position")

    ColourTell ("white", "blue", "Keywords will now be taken from the " .. keyword_position .. " of Mobile names. ")
    ColourNote ("", "black", " ")

end -- keyword_position

function conw (name, line, wildcards)

    --show help <conw ?>
    if wildcards[1] == "?" then
            a = {
                "conw - update window with consider all command.",
                "<num> <word> - Execute <word> with keyword from line <num> on consider window.",
                "<num> - Execute with default word.",
                "conw <word> - set default command.",
                "conw chng - swop keyword from beginning of name to end of name or vice-versa.",
                "conw auto - toggle auto update consider window on room entry and after combat.",
                "conw ? - show this help."
                }
        for i,v in ipairs (a) do
            sSpa = string.rep (" ", 20 - v:sub(1,v:find("-") - 1):len() )
            ColourTell ("yellow", GetInfo(271), v:sub(1,v:find("-") - 1) .. sSpa )
            ColourNote ("white", GetInfo(271), v:sub(v:find("-"), v:len() ))
        end
        return
    end

    if wildcards[1] == "auto" then
        if tonumber (GetVariable ("auto_conw")) == 1 then
            SetVariable ("auto_conw", 0)
            EnableTriggerGroup ("auto_consider", 0)
            ColourTell ("white", "blue", "Auto consider off.")
            ColourNote ("", "black", " ")
        else
            SetVariable ("auto_conw", 1)
            EnableTriggerGroup ("auto_consider", 1)
            ColourTell ("white", "blue", "Auto consider on.")
            ColourNote ("", "black", " ")
        end
        return
    end

    if wildcards[1] == "chng" then
        keyword_change ()
        return
    end

    if wildcards[1] and wildcards[1]:match ("^%w+$") then
        SetVariable ("default_command", wildcards[1])
        default_command = GetVariable ("default_command")
        ColourTell ("white", "blue", "Default command: " .. wildcards[1])
        ColourNote ("", "black", " ")
    end


end -- send_consider

function send_consider ()

    if GetVariable ("doing_consider") == "true" then
        return
    else
        SetVariable ("doing_consider", "true")
        EnableTriggerGroup ("consider", true)
        SendNoEcho ("consider all")
        Send ("echo nhm")
        targT = {}
    end

end -- send_consider

function execute_command (id, s)

    if not s then
        return
    end

    s = s:match ("^(%w+)%:%d+$")
    Execute (default_command .. " " .. s)
    ColourTell ("white", "blue", default_command .. " " .. s)
    ColourNote ("", "black", " ")

end -- execute_command

function command_line (name, line, wildcards)

    iNum = tonumber (wildcards[1])
    if iNum > #targT then
        return
    end

    if wildcards[2] == "" then
        sKey = default_command
    else
        sKey = tostring (wildcards[2])
    end

    if targT[iNum] then
        Execute (sKey .. " " .. targT[iNum].keyword)
        ColourTell ("white", "blue", sKey .. " " .. targT[iNum].keyword .. " ")
        ColourNote ("", "black", " ")
    else
        ColourTell ("white", "blue", "no target in targT ")
        ColourNote ("", "black", " ")
    end

end -- command_line

function adapt_consider (name, line, wildcards)

    mob = nil
    for k,  v in pairs (consider_messages) do
        mob = string.match (line, k)
        if keyword_position == "end" then
            sPat = "[%w\-]+$"
        else
            sPat = "^[%w\-]+"
        end
        if mob then
            t = {
                keyword = mob:gsub ("%w+", function (str) return replaceT [str] end ):gsub("^%s+", ""):gsub("%s+$", ""):match(sPat),
                name    = mob,
                line    = line,
                colour  = v.colour,
                range   = "(" .. v.range .. ")",
                message = line
                }
            if ECHO_CONSIDER then
                ColourNote (v.colour, "", line .. " (" .. v.range .. ")" )
            end
            table.insert (targT, t)
            break
        end -- if

    end -- for

    if not mob and SHOW_NO_MOB then
        ColourTell ("white", "blue", "Could not find anything: " .. line)
        ColourNote ("", "black", " ")
    end -- not  found in table

end -- adapt_consider

function Draw_Title ()

    --draw the title and add drag hotspot
    top     = BORDER_WIDTH + LINE_SPACING
    bottom  = top + font_height
    left    = BORDER_WIDTH + TEXT_OFFSET
    right   = WindowInfo (win, 3)
    movewindow.add_drag_handler (win, 0, top, right, bottom, 1)
    WindowText (win, font_id, TITLE .. " (" .. default_command .. ")", left, top, right, bottom, BORDER_COLOUR)

    -- draw drag bar rectangle
    WindowRectOp (win, 1, 0, 0, WindowInfo (win, 3) , WindowInfo (win, 4), BORDER_COLOUR)

    banner_height = bottom + LINE_SPACING + BORDER_WIDTH

end -- MakeTitle

function Show_Window ()

    -- get width and height and draw the window
    if #targT > 0 then
        for i,v in ipairs (targT) do
            window_width = math.max (WindowTextWidth (win, font_id, tostring (i) .. ". " .. v.name .. " " .. v.range) + TEXT_OFFSET * 2 + BORDER_WIDTH * 2, banner_width, window_width)
        end
    else
        window_width = banner_width
    end
    window_height = banner_height * 1.2 + #targT * (font_height + LINE_SPACING)

    WindowCreate (win,
         windowinfo.window_left,
         windowinfo.window_top,
         window_width,     -- width
         window_height,  -- height
         windowinfo.window_mode,
         windowinfo.window_flags,
         BACKGROUND_COLOUR)

    -- draw each line
    top     = banner_height + LINE_SPACING
    left    = TEXT_OFFSET + BORDER_WIDTH
    bottom  = top + font_height

    for i,v in ipairs (targT) do
        sLine = tostring (i) .. ". " .. v.name .. " " .. v.range
        right   = WindowTextWidth (win, font_id, sLine) + left
        WindowText (win, font_id, sLine, left, top, right, bottom, ColourNameToRGB (v.colour))
        sBalloon = v.line .. " " .. v.range .. "\n\n" .. "Click to Execute: '" .. default_command .. " " ..  v.keyword .. "'"
        WindowAddHotspot (win, v.keyword .. ":" .. tostring (i), left, top, right, bottom,
            "", -- MouseOver
            "", -- CancelMouseOver
            "", -- MouseDown
            "", -- CancelMouseDown
            "execute_command", -- MouseUp
            sBalloon,
            1, -- Cursor
            0) --  Flag
        top     = bottom + LINE_SPACING
        bottom  = top + font_height
    end

    --draw the title
    Draw_Title()

    WindowShow (win, true)
    SetVariable ("doing_consider", "false")
    EnableTriggerGroup ("consider", false)

end -- Show_Consider

function Show_Banner ()

    window_width = title_width + BORDER_WIDTH * 2 + TEXT_OFFSET * 2
    window_height = font_height + LINE_SPACING * 2 + descent

    WindowCreate (win,
         windowinfo.window_left,
         windowinfo.window_top,
         window_width,     -- width
         window_height,  -- height
         windowinfo.window_mode,
         windowinfo.window_flags,
         BACKGROUND_COLOUR)

    Draw_Title ()

    WindowShow (win, true)

end -- ShowBanner

function OnPluginInstall ()

    if SHOW_WELCOME then
        Note("Consider_Window.xml installed")
    end

    win = WIN_STACK .. GetPluginID ()

    local fonts = utils.getfontfamilies ()
    if fonts[FONT_NAME] then
        font_size = FONT_SIZE
        font_name = FONT_NAME
    elseif fonts.Dina then
        font_size = 8
        font_name = "Dina"    -- the actual font
    else
        font_size = 10
        font_name = "Courier"
    end -- if

    font_id = "consider_font"

    windowinfo = movewindow.install (win, 6)

    check (WindowCreate (win,
        windowinfo.window_left,
        windowinfo.window_top,
        1, 1,
        windowinfo.window_mode,
        windowinfo.window_flags,
        BACKGROUND_COLOUR) )

    WindowFont (win, font_id, font_name, font_size, false, false, false, false, 0, 0)  -- normal
    font_height = WindowFontInfo (win, font_id, 1)  -- height
    ascent = WindowFontInfo (win, font_id, 2)
    descent = WindowFontInfo (win, font_id, 3)

    default_command = GetVariable ("default_command") or "kill"
    keyword_position = GetVariable ("keyword_position") or "end"

    SetVariable ("doing_consider", "false")

    auto_conw = GetVariable ("auto_conw") or 1

    EnableTriggerGroup ("auto_consider", auto_conw)

    if GetVariable ("enabled") == "false" then
        ColourNote ("yellow", "", "Warning: Plugin " .. GetPluginName ().. " is currently disabled.")
        check (EnablePlugin(GetPluginID (), false))
        return
    end -- they didn't enable us last time

    OnPluginEnable ()

end -- OnPluginInstall

function OnPluginEnable ()

    title_width = WindowTextWidth (win, font_id, TITLE .. " (" .. default_command .. ")")
    banner_width = title_width + BORDER_WIDTH * 2 + TEXT_OFFSET * 2
    Show_Banner ()

end -- OnPluginEnable

function OnPluginDisable ()

  WindowShow (win, false)

end -- OnPluginDisable

function OnPluginSaveState ()

  SetVariable ("enabled", tostring (GetPluginInfo (GetPluginID (), 17)))
  SetVariable ("doing_consider", "false")
  movewindow.save_state (win)

end -- OnPluginSaveState

]]>
</script>
</muclient>
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 17 Aug 2009 05:35 AM (UTC)
Message

This is great! It is exactly what I was hoping someone would do. ;)

Your notes don't seem to mention it, but clicking on a mob's name attacks it. Plus, it seems to auto-refresh as you move around. Very nice.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Blainer   (191 posts)  [Biography] bio
Date Reply #2 on Mon 17 Aug 2009 05:39 AM (UTC)

Amended on Mon 17 Aug 2009 06:28 AM (UTC) by Blainer

Message
Clicking on a mob executes the default command set with "conw <command>".
[Go to top] top

Posted by Drakkwen   (3 posts)  [Biography] bio
Date Reply #3 on Thu 27 Aug 2009 07:34 PM (UTC)
Message
hello, great plugin, i love it.

was working great for me, then when i go to use it today.
it wont do anything. it shows the bar the just says consider all. but doesnt refresh. i tried inputting conw, it does nothing. ive tried reinstalling, still no luck.

thanks
[Go to top] top

Posted by Blainer   (191 posts)  [Biography] bio
Date Reply #4 on Thu 27 Aug 2009 10:55 PM (UTC)
Message
This has to be a MUSH variable the plugin is not reseting properly.

-Remove the plugin from the Plugins Dialog.
-Find the plugins state file:
the name will contain "584807a32cf46af04a1bece3" and is usually in the MUSH\Worlds\plugins\state
the path on my install is "C:\Program Files\MUSHclient\worlds\plugins\state\777af83cdf336b8bb5207967-584807a32cf46af04a1bece3-state.xml"
-Delete this file.
-Install the plugin again.
-Do "conw ?" see if you get the help.
-Do "conw auto" see if the window updates automatically.

You may want to look at the state file before you delete it and see what the variable "doing_consider" is set to, it should be "false", if not this is the problem.

Let me know how it goes.
[Go to top] top

Posted by Drakkwen   (3 posts)  [Biography] bio
Date Reply #5 on Thu 27 Aug 2009 11:05 PM (UTC)
Message
k, it worked, but i opened up the state file, and it does say
<variable name="doing_consider">false</variable>
[Go to top] top

Posted by Blainer   (191 posts)  [Biography] bio
Date Reply #6 on Thu 27 Aug 2009 11:23 PM (UTC)

Amended on Fri 28 Aug 2009 07:16 AM (UTC) by Blainer

Message
I can't reproduce this on my computer but I have added a couple of lines to set the variable back to what it should be.

If the window stops updating again open the plugins dialog select Aardwolf_Consider_Window and click reinstall.

However I don't think it should happen anymore.
[Go to top] top

Posted by Drakkwen   (3 posts)  [Biography] bio
Date Reply #7 on Thu 27 Aug 2009 11:25 PM (UTC)
Message
thanks a bunch for the help.
[Go to top] top

Posted by ShredMemory   (2 posts)  [Biography] bio
Date Reply #8 on Fri 31 Dec 2010 12:09 AM (UTC)
Message
This is one of my favorite plugins for aardwolf, But I always get this error in Land of Oz in the area "midway up a tornado" It is a Pk Area if that matters, Can anyone help? I'm not good with these things, Thanks.


Run-time error
Plugin: Aardwolf_Consider_Window (called from world: Aardwolf)
Function/Sub: Show_Window called by trigger
Reason: processing trigger ""
[string "Plugin"]:426: attempt to concatenate field 'keyword' (a nil value)
stack traceback:
        [string "Plugin"]:426: in function <[string "Plugin"]:396>
Error context in script:
 422 :     for i,v in ipairs (targT) do
 423 :         sLine = tostring (i) .. ". " .. v.name .. " " .. v.range
 424 :         right   = WindowTextWidth (win, font_id, sLine) + left
 425 :         WindowText (win, font_id, sLine, left, top, right, bottom, ColourNameToRGB (v.colour))
 426*:         sBalloon = v.line .. " " .. v.range .. "\n\n" .. "Click to Execute: '" .. default_command .. " " ..  v.keyword .. "'"
 427 :         WindowAddHotspot (win, v.keyword .. ":" .. tostring (i), left, top, right, bottom,
 428 :             "", -- MouseOver
 429 :             "", -- CancelMouseOver
 430 :             "", -- MouseDown
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Fri 31 Dec 2010 12:35 AM (UTC)
Message
As a work-around, edit the plugin file and between lines 425 and 426 (just before the line starting "sBalloon = v.line ...") add this:


v.keyword = v.keyword or ""



- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by ShredMemory   (2 posts)  [Biography] bio
Date Reply #10 on Fri 31 Dec 2010 01:00 AM (UTC)
Message
Wow fast response, Thanks Nick that fixed it =)
[Go to top] top

Posted by Snakesfordivine   (8 posts)  [Biography] bio
Date Reply #11 on Tue 04 Jan 2011 10:14 PM (UTC)
Message
I have installed several plugins before but this one isn't working for some reason.Is there anything I need to do before I install the plugin for it to work?

I start off by copypasting the code into xml and installing the plugin

I type "conw ?" (works)
I type "conw auto" (says on , works)

The miniwindow shows "consider all(kill)" and never changes

I move once and it considers all on the main mud screen (miniwindow still shows "consider all(kill)") , and the 2nd line says nhm.

After that moving around does nothing. Miniwindow never shows anything.

I've tried completely deleting mushclient and reinstalling everything from scratch and the plugin still doesn't work. Any help is appreciated
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #12 on Tue 04 Jan 2011 10:30 PM (UTC)
Message
I wouldn't delete MUSHclient just because a plugin doesn't work.

I tried it (I presume you are on Aardwolf, right?) - and indeed I saw "consider all (kill)" if there were no mobs around.

However after running to Verume, it updated with the mobs in the local room.

I'm not sure about the "echo nhm" stuff, but try editing the plugin and change:


Send ("echo nhm")


to:



SendNoEcho ("echo nhm")


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Snakesfordivine   (8 posts)  [Biography] bio
Date Reply #13 on Tue 04 Jan 2011 10:57 PM (UTC)

Amended on Tue 04 Jan 2011 11:25 PM (UTC) by Snakesfordivine

Message
Nick Gammon said:

I wouldn't delete MUSHclient just because a plugin doesn't work.

I tried it (I presume you are on Aardwolf, right?) - and indeed I saw "consider all (kill)" if there were no mobs around.

However after running to Verume, it updated with the mobs in the local room.

I'm not sure about the "echo nhm" stuff, but try editing the plugin and change:


Send ("echo nhm")


to:



SendNoEcho ("echo nhm")




I tried the adjustment to SendNoEcho ("echo nhm")
and the miniwindow still doesn't work.

Yeah I am using fresh installs of the Aardwolf mud client, I don't know if this effects the usage.

Here is the state file I have ,

Quote:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, January 04, 2011, 3:22 PM -->
<!-- MuClient version 4.71 -->
<!-- Written by Nick Gammon -->
<!-- Home Page: http://www.mushclient.com/ -->

<!-- Plugin state saved. Plugin: "Aardwolf_Consider_Window". World: "Aardwolf". -->

<muclient>

<!-- variables -->

<variables
muclient_version="4.71"
world_file_version="15"
date_saved="2011-01-04 15:22:39"
>
<variable name="auto_conw">1</variable>
<variable name="doing_consider">false</variable>
<variable name="enabled">true</variable>
<variable name="mw_aa584807a32cf46af04a1bece3_windowflags">0</variable>
<variable name="mw_aa584807a32cf46af04a1bece3_windowmode">6</variable>
<variable name="mw_aa584807a32cf46af04a1bece3_windowx">0</variable>
<variable name="mw_aa584807a32cf46af04a1bece3_windowy">0</variable>
</variables>
</muclient>

[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #14 on Tue 04 Jan 2011 11:27 PM (UTC)
Message
I just downloaded the latest Aard client to see if that made a difference. Once installed, and once I loaded the "consider" plugin it worked - provided I typed "conw auto" to enable the triggers in the plugin - which match lines like:


A mosquito flies about in a very annoying way.


Also you need to see those lines, so there need to be mobs in the room. So, you should have seen:


Auto consider on. 


You need to be in a room with mobs. Try typing "look" to force the auto-consider.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


78,467 views.

This is page 1, subject is 6 pages long: 1 2  3  4  5  6  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]