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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Miniwindow plugin - campaign tracker for Aardwolf
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Miniwindow plugin - campaign tracker for Aardwolf
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by Twisol   USA  (1,483 posts)  [Biography] bio
Date Sun 03 Jan 2010 11:52 PM (UTC)  quote  ]
Message
Yes, that happens if you happen to add the same plugin twice, or two plugins somehow manage to have the same ID. If it's the former, just remove it from the plugins list and re-add it, or better, just click Reinstall with it selected. If it's the latter, it probably won't hurt in this case to replace the ID in the plugin's XML (where it points it out); you can go to Edit -> Generate Unique ID to get a new ID to put in there.

EDIT: Ninja'd.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (15,754 posts)  [Biography] bio
Date Sun 03 Jan 2010 11:51 PM (UTC)  quote  ]
Message
Sounds like you have two plugins of the same ID. Check what other plugins you have loaded.

- Nick Gammon

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

Posted by Plax   (1 post)  [Biography] bio
Date Sun 03 Jan 2010 11:42 PM (UTC)  quote  ]
Message
Line 17: Plugin "id" field must be unique for this world (problem in this file)

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, July 15, 2008, 11:06 AM -->
<!-- MuClient version 4.33 -->

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

<muclient>
<plugin
name="Aardwolf_Campaign_Noter_v2"
author="Nick Gammon"
id="23c3c91af0a26790c625f5d1"
language="Lua"
purpose="Shows remaining campaign objectives"
date_written="2008-07-22"
requires="4.34"
version="1.0"
save_state="y"
>
<description trim="y">
<![CDATA[
Shows outstanding campaign objectives.

To activate, type: cp check
]]>
</description>

</plugin>5d1"
[Go to top] top

Posted by Aardhabit   (4 posts)  [Biography] bio
Date Wed 23 Sep 2009 09:25 PM (UTC)  quote  ]
Message
Thanks for your patience! I haven't had a gq yet, but it appears to be working :-)
[Go to top] top

Posted by Bast   (48 posts)  [Biography] bio
Date Wed 23 Sep 2009 05:40 PM (UTC)  quote  ]
Message
In the zip that you downloaded, copy all the files from the lua directory into <MushclientInstallDir>/lua.

Bast

Scripts: http://bastmush.googlecode.com
[Go to top] top

Posted by Aardhabit   (4 posts)  [Biography] bio
Date Wed 23 Sep 2009 02:46 PM (UTC)  quote  ]
Message
I must apologize, I'm extremely dense about this stuff :-( But the error I get is:

Line 47: Error parsing script (problem in this file)

Oh, and I didn't notice this yesterday, but I also have a sizable message in my "home" window.

Run-time error
Plugin: miniwin_gq (called from world: Aardwolf)
Immediate execution
[string "Plugin"]:154: module 'miniwin' not found:
no field package.preload['miniwin']
no file '.\miniwin.lua'
no file 'H:\Documents\Curtis\Misc\MUSHclient\lua\miniwin.lua'
no file 'H:\Documents\Curtis\Misc\MUSHclient\lua\miniwin\init.lua'
no file 'H:\Documents\Curtis\Misc\MUSHclient\miniwin.lua'
no file 'H:\Documents\Curtis\Misc\MUSHclient\miniwin\init.lua'
stack traceback:
[C]: in function 'require'
[string "Plugin"]:154: in main chunk
Error context in script:
150 :
151 :
152 : require 'var'
153 : require "commas"
154*: require 'miniwin'
155 : require 'tprint'
156 : require 'pluginhelper'
157 :
158 : gqwin = Miniwin{name="GQ", windowpos=7, font_size=7, font="Verdana", header_height=0}

I'm guessing I'm missing some files necessary to run the plugin, but I don't know where to get these. Sorry for the trouble.
[Go to top] top

Posted by Blainer   (191 posts)  [Biography] bio
Date Tue 22 Sep 2009 11:42 PM (UTC)  quote  ]
Message
Post the errors.
[Go to top] top

Posted by Aardhabit   (4 posts)  [Biography] bio
Date Tue 22 Sep 2009 08:50 PM (UTC)  quote  ]
Message
Thanks very much! :-) If I could only get by the parsing errors, I'd be delighted!
[Go to top] top

Posted by Bast   (48 posts)  [Biography] bio
Date Tue 22 Sep 2009 07:50 PM (UTC)  quote  ]
Message
I have one at http://code.google.com/p/bastmush/

Bast

Scripts: http://bastmush.googlecode.com
[Go to top] top

Posted by Aardhabit   (4 posts)  [Biography] bio
Date Tue 22 Sep 2009 06:29 PM (UTC)  quote  ]
Message
Has anyone out there successfully made a gq mob tracker similar to the cp mob tracker and willing to share it? I would maybe not be eternally grateful, but I would be grateful for a long, long time.
[Go to top] top

Posted by Jennkei   (7 posts)  [Biography] bio
Date Thu 19 Feb 2009 03:44 AM (UTC)  quote  ]

Amended on Thu 19 Feb 2009 03:50 AM (UTC) by Jennkei

Message
Hiding works beautifully now. Thank you so much, Nick! :)

If it's not too much trouble and you're free, could you possibly help me have a look at what's wrong with my replace-cp-with-gq version, please..? It's alright if you aren't, just thought I'd ask anyway. :D

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- From Aardwolf_Campaign_Noter_v2 by Nick Gammon -->
<!-- Saved on Tuesday, July 15, 2008, 11:06 AM -->
<!-- MuClient version 4.33 -->

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

<muclient>
<plugin
   name="Aardwolf_gq_Noter"
   author="Nick Gammon -modified-"
   id="23c3c91af0a26790c625f5d2"
   language="Lua"
   purpose="Shows remaining gq objectives"
   date_written="2008-07-22"
   requires="4.34"
   version="1.0"
   save_state="y"
   >
<description trim="y">
<![CDATA[
Shows outstanding gq objectives.

]]>
</description>

</plugin>


<!--  Triggers  -->

<triggers>
  <trigger
   match="^You still have to kill (.*?) \* (.*?)$"
   name="gq_item"
   script="gq_item"
   sequence="100"
   regexp="y"
  >
  </trigger>
  
 <trigger
   enabled="y"
   match="Congratulations, that was one of the GLOBAL QUEST mobs!"
   send_to="10"
   sequence="100"
  >
  <send>gq check</send>
  </trigger>

 <trigger
   enabled="y"
   match="Global Quest: The global quest has been won by"
   sequence="100"
   script="gq_done"
  >
  </trigger>

</triggers>

<!--  Aliases  -->

<aliases>
  <alias
   name="gq_check"
   script="gq_check"
   match="^(gq|gquest) check$"
   enabled="y"
   regexp="y"
   sequence="100"
  >
  <send>gq check</send>
  </alias>
</aliases>


<!--  Script  -->


<script>
<![CDATA[

require "commas"

background_colour = 0xE7FFFF
text_colour = 0x000000
heading_colour = 0x800080
time_colour = 0x82004B

gq_info = {}
 
function capitalize (s)
  return string.sub (s, 1, 1):upper () .. string.sub (s, 2):lower ()
end -- capitalize 

function gq_item (name, line, wildcards)
  local text =  wildcards [1]
  text = string.sub (text, 1, 1):upper () .. string.sub (text, 2)
  table.insert (gq_info, text)
  max_width = math.max (max_width, WindowTextWidth (global, font_id, text))
end -- gq_item

function gq_done (name, line, wildcards)
  WindowShow (global, false)
  gq_info = {}
end -- gq_done

function Display_Line (i, text, id, colour)

local right = 5
local top =  (i * font_height) - font_height

  WindowText (global, id, text, left, top, 0, 0, colour)

end -- Display_Line

function show_gq_text ()

  -- do nothing if no gq
  if #gq_info == 0 or when_required == nil then
    return
  end -- if

  -- recreate the Window the correct size
  check (WindowCreate (global, 
                 0, 0,   -- left, top (auto-positions)
                 max_width + 10,     -- width
                 (#gq_info + 2)   * font_height + 5,  -- height
                 7,       -- auto-position: top middle
                 0,  -- flags
                 0xE7FFFF) )
 
  -- heading
  local text = "Current gq. You need to kill:"
  max_width = math.max (max_width, WindowTextWidth (global, font_id, text))
  Display_Line (1, text, font_id, heading_colour)

  -- list of mobs
  for i, v in ipairs (gq_info) do
    Display_Line (i + 1, v, font_id, text_colour)
  end -- for
     
  WindowShow (global, true)  
end -- show_gq_text

   
  
function gq_check( name, line, wildcards)
  check (EnableTrigger ("gq_item", true))
  gq_info = {}
  max_width = 0
  
end -- gq_check


function OnPluginInstall ()
  global = GetPluginID ()
  font_id = "fn"
  
  font_name = "Comic Sans MS"    -- the actual font
  
  -- make window so I can grab the font info
  check (WindowCreate (global, 
                 0, 0, 1, 1,  
                 1,   -- irrelevant
                 0, 
                 background_colour) )

  check (WindowFont (global, font_id, font_name, 8, false, false, false, false, 0, 0))  -- normal  
  font_height = WindowFontInfo (global, font_id, 1)  -- height
end -- OnPluginInstall

function OnPluginDisable ()
  WindowShow (global, false)
end -- OnPluginDisable

]]>
</script>

</muclient>
[Go to top] top

Posted by Nick Gammon   Australia  (15,754 posts)  [Biography] bio
Date Thu 19 Feb 2009 03:02 AM (UTC)  quote  ]
Message
Quote:

The aliases work, but why do the windows appear again after each tick? o.O


It seems I didn't think it through. :O

Give the timer a name, like this:


<timers>
  <timer 
      script="show_campaign_text" 
      enabled="y" 
      second="30.00"
      name="show_campaign_text" 
      >
  </timer>
</timers>


Modify the aliases to disable/enable the timer:


<aliases>
  <alias
   match="hide_campaign"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
WindowShow (win, false)
EnableTimer ("show_campaign_text", false)
</send>
  </alias>

  <alias
   match="show_campaign"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
WindowShow (win, true)
EnableTimer ("show_campaign_text", true)
</send>
  </alias>
</aliases>




- Nick Gammon

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

Posted by Nick Gammon   Australia  (15,754 posts)  [Biography] bio
Date Thu 19 Feb 2009 02:58 AM (UTC)  quote  ]
Message
Quote:

unfortunately increasing the size of my main window will result in covering up all the other windows that i use constantly


My original campaign tracker sent to a notepad window. Here it is:


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, July 15, 2008, 11:06 AM -->
<!-- MuClient version 4.33 -->

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

<muclient>
<plugin
   name="Aardwolf_Campaign_Noter"
   author="Nick Gammon"
   id="2bfb7e23fb504ae4e55f0ed6"
   language="Lua"
   purpose="Shows remaining campaign objectives"
   date_written="2008-07-15 11:04:43"
   requires="4.33"
   version="1.0"
   save_state="y"
   >
<description trim="y">
<![CDATA[
Shows outstanding campaign objectives.

To activate, type: cp check
]]>
</description>

</plugin>


<!--  Triggers  -->

<triggers>
  <trigger
   match="You have * left to finish this campaign."
   name="cp_time"
   script="cp_time"
   sequence="100"
  >
  </trigger>
  <trigger
   match="You still have to kill *"
   name="campaign_item"
   script="campaign_item"
   sequence="100"
  >
  </trigger>
  
 <trigger
   enabled="y"
   match="Congratulations, that was one of your CAMPAIGN mobs!"
   send_to="10"
   sequence="100"
  >
  <send>cp check</send>
  </trigger>

 <trigger
   enabled="y"
   match="CONGRATULATIONS! You have completed your campaign."
   sequence="100"
   script="campaign_done"
  >
  </trigger>


</triggers>

<!--  Aliases  -->

<aliases>
  <alias
   name="cp_check"
   script="cp_check"
   match="^(cp|campaign) check$"
   enabled="y"
   regexp="y"
   sequence="100"
  >
  <send>cp check</send>
  </alias>
</aliases>

<!--  Timers  -->

<timers>
  <timer script="get_notepad_position" 
         enabled="y" 
         second="10.00" 
         active_closed="y" >

  </timer>
</timers>

<!--  Script  -->


<script>
<![CDATA[

require "serialize"

pos = {}

function get_notepad_position (name)
  local newpos = GetNotepadWindowPosition ("Campaign")
  pos = newpos or pos
  
  if next (pos) then
    Left, Top, Width, Height = pos.left, pos.top, pos.width, pos.height
  end -- if 
end -- get_notepad_position

-- notepad position
Left, Top, Width, Height = 500, 200, 600, 600
MenuSize = 50

campaign_info = {}
 
function campaign_item (name, line, wildcards)
  table.insert (campaign_info, line)
end -- campaign_item

function campaign_done (name, line, wildcards)
  Send "score"
  CloseNotepad ("Campaign", false)
end -- campaign_done

function cp_time (name, line, wildcards)

  table.insert (campaign_info, line)
  
  check (EnableTrigger ("campaign_item", false))
  check (EnableTrigger ("cp_time", false))

  CloseNotepad ("Campaign", false)
  ReplaceNotepad ("Campaign", table.concat (campaign_info, "\r\n"))
  NotepadColour ("Campaign", "black", "#FFFFE7")
  NotepadSaveMethod ("Campaign", 2)  -- don't try to save
  
  local lines = #campaign_info + 1
  
  if lines < 40 then
    MoveNotepadWindow ("Campaign", Left, Top, Width, GetInfo (214) * lines + MenuSize)  
  else
    MoveNotepadWindow("Campaign", Left, Top, Width, Height)
  end -- if
  
  ActivateNotepad "Campaign"
  
  Activate ()
  
  NotepadReadOnly ("Campaign")
  
end -- cp_time

function cp_check( name, line, wildcards)
  check (EnableTrigger ("campaign_item", true))
  check (EnableTrigger ("cp_time", true))
  campaign_info = {}
  
end -- cp_check

function OnPluginSaveState ()
  get_notepad_position ()
  SetVariable ("pos", "pos = " .. serialize.save_simple (pos))
end -- function OnPluginSaveState

function OnPluginInstall ()
  assert (loadstring (GetVariable ("pos") or "")) ()
  
  if next (pos) then
    Left, Top, Width, Height = pos.left, pos.top, pos.width, pos.height
  end -- table not empty
  
end -- OnPluginInstall

]]>
</script>


<!--  Plugin help  -->

<aliases>
  <alias
   script="OnHelp"
   match="Aardwolf_Campaign_Noter:help"
   enabled="y"
  >
  </alias>
</aliases>

<script>
<![CDATA[
function OnHelp ()
  world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
end
]]>
</script> 

</muclient>


Not sure how well it works now, but it could be a start for you to look at.

- Nick Gammon

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

Posted by Jennkei   (7 posts)  [Biography] bio
Date Thu 19 Feb 2009 12:52 AM (UTC)  quote  ]

Amended on Thu 19 Feb 2009 02:12 AM (UTC) by Jennkei

Message
Thank you very much for this, Nick! Using it and loving it.

The aliases work, but why do the windows appear again after each tick? o.O

I've been wanting something like this for gquests for a long time now -- have always been copying to notepad. So I tried modifying this script...e.g.

<triggers>
  <trigger
   match="^You still have to kill (.*?) \* (.*?)$"
   name="gq_item"
   script="gq_item"
   sequence="100"
   regexp="y"
  >
  </trigger>


Unfortunately, didn't really seem to work..the trigger for gq check would fire, but that's about it. -wry- Ah well, not pro enough to wrestle with the code. :(
[Go to top] top

Posted by Imalish   (2 posts)  [Biography] bio
Date Sun 18 Jan 2009 01:41 AM (UTC)  quote  ]
Message
unfortunately increasing the size of my main window will result in covering up all the other windows that i use constantly (spellup monitor,status,map and chat catcher)

my idea is that with the targets in a seperate window i can have it up over the other windows for the few moments it takes me to figure out where im running to next, then minimize it or send it behind the other windows ... no need for the window to be up and visible once i get into the appropriate zone.
[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.


8,486 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]