MUSHclient Plugins

Have a question about which MUD client works best with SI? Looking for a free app that lets you log in from your phone? Need help with a complicated script? This is the place.
Xiija
Citizen of Archai
Posts in topic: 1
Posts: 440
Joined: Wed Jul 23, 2014 6:55 pm
Contact:

Re: MUSHclient Plugins

Post by Xiija » Mon Jan 09, 2017 4:19 am

* cut and paste like usual into Mush

you can make a variable called skills... (add all the skills you want here )
________________________________

<variables>
<variable name="skills">Close Combat|Ranged Combat|Climbing</variable>
</variables>

________________________________________
and then make a trigger to gag and re-display them...
*note - custom_colour="9" is a blue, not sure how you want em colored heh...
______________________________________________

<triggers>
<trigger
custom_colour="9"
colour_change_type="1"
enabled="y"
expand_variables="y"
keep_evaluating="y"
match="^\s*(@!skills)\s*(\d+)\s*(\d+)"
omit_from_output="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>Note (" %1: lvl %3 ... %2 ")</send>
</trigger>
</triggers>
_______________________________
example output when you type .... "skill"... , the first, second and fifth ones are the replaced ones :)

Climbing: lvl 23 ... 2817
Close Combat: lvl 29 ... 1757
Divine Blessing 892 9
Hiding 2461 20
Ranged Combat: lvl 12 ... 1473
Searching 2453 20

_______________________________________
you can also do this for other things, i have all kinds of gems in a variable,
and i color/highlight em so they stand out in shops or loot :) (add your gem names to the variable below)

<variables>
<variable name="gems">aquamarine|peridot|topaz</variable>
</variables>

_____________________________________

<triggers>
<trigger
custom_colour="6"
enabled="y"
expand_variables="y"
ignore_case="y"
lines_to_match="10"
keep_evaluating="y"
match="(@!gems)"
regexp="y"
repeat="y"
sequence="100"
>
</trigger>
</triggers>
______________________________
Have fun :P


Image


X͕̝̦̹̻̟ͧ̃̃̓I͕͍̫͍̞ͨ̆̒ͯ̏̿͑I͖̹̮̬̬͚̬͈ͧͬ̄̚J̙̩̗̙̹ͥ͂̆ͨ̒Ạ̖̻͈̠̣̦̖ͤ̋̽ͨͣ ̠̳͉̻̙̙̹̝͖ͮ͛̔̈ͬA̱͖̐̋̒̊ͬ̂ͫN̠͍̝̰͙̼ͦ̀͊͆͗̾ͫZ̘̞̒͐͊U͓̫ͭͨ́ͤ̇̎̂ͮͅ

Forhekset
Citizen of Archai
Posts in topic: 4
Posts: 190
Joined: Mon Sep 16, 2013 9:59 pm

Re: MUSHclient Plugins

Post by Forhekset » Mon Dec 18, 2017 11:09 pm

So i finally tried to get the mappers working. The speed walking is desirable.

However, I can't save the file as an xml, it only gives me the option for txt.

There is a mapper plugin already installed in Mush but I can't figure out how to make it work, or turn it on or whatever.



Forhekset
Citizen of Archai
Posts in topic: 4
Posts: 190
Joined: Mon Sep 16, 2013 9:59 pm

Re: MUSHclient Plugins

Post by Forhekset » Mon Dec 18, 2017 11:18 pm

Okay. Mapper is working. But speed walking is mad. Something something timer triggers keeps popping up. So its one room at a time right now.

Suggestions?



Teef
Citizen of Archai
Posts in topic: 11
Posts: 296
Joined: Sun Sep 29, 2013 10:39 pm

Re: MUSHclient Plugins

Post by Teef » Wed Apr 25, 2018 9:02 pm

Beep bop boop

cheap and easy like your mom, poison timers
time is actually a guesstimate since the poison wears off faster if you actually use the weapon. So timed how long it lasts in combat and after killing many many things came up with a rough idea.
Now go ye forth denizens of the shadows and kill mages.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>

<muclient>
<plugin
   name="Poison_Tracker_Bars_Miniwindow"
   author="Teef"
   id="8387b11a4baa87b1b1215a7c"
   language="Lua"
   purpose="Shows poison gauges to track poison times applied to weapons"
   date_written="2017-09-10 01:00"
   requires="4.84"
   version="1.0"
   save_state="y"
   >
<description trim="y">
<![CDATA[
Install this plugin to show bars to track when poisons wear off

The window can be dragged to a new location with the mouse.

This probably can be done better and cleaner but I haven't coded in a few years.
Just revamped the health bars. So one bar for each poison. Didn't feel like making it only
show poisons currently being used so I imagine the window could get bigger.

So it is what it is. I also don't know or have unlocked all the poisons,
so you will have to update it yourself when you have unlocked everything.


Just copy and paste this into notepad and save as an .xml
then go to plugins add and enable it.



]]>
</description>

</plugin>

<!--  Triggers  -->

<triggers>
    
  <trigger
   enabled="y"
   match="^You successfully applied (?P<poison>.*)\.$"
   name="poisoner"
   regexp="y"
   script="do_apply"
   sequence="100"
  >
  </trigger>
  
  
</triggers>

<!--  Timers  -->

<timers>
  <timer 
    script="handle_cooldowns" 
    enabled="y" second="1.00" 
    active_closed="y" >
  </timer>
</timers>


<!--  Script  -->


<script>
<![CDATA[

GAUGE_HEIGHT = 15

WINDOW_WIDTH = 300
WINDOW_HEIGHT = 175  -- make this bigger if you run out of room for gauges.
NUMBER_OF_TICKS = 5

BACKGROUND_COLOUR = ColourNameToRGB "dimgray"
FONT_COLOUR = ColourNameToRGB "white"
BORDER_COLOUR = ColourNameToRGB "#553333"

	
if string.sub (GetInfo (60), 1, 1) == "." then 
  plugindir = GetInfo (66) .. string.sub (GetInfo (60), 3)
else
  plugindir = GetInfo (60)
end -- if to get directory path for images 

function DoGauge (sPrompt, current, max, Colour)

  if max <= 0 then 
    return 
  end -- no divide by zero
  
  -- fraction in range 0 to 1
  local Fraction = math.min (math.max (current / max, 0), 1) 
   
  local width = WindowTextWidth (win, font_id, sPrompt)
  
  WindowText (win, font_id, sPrompt, gauge_left - width, vertical, 0, 0, FONT_COLOUR)

  WindowRectOp (win, 2, gauge_left, vertical, WINDOW_WIDTH - 5, vertical + GAUGE_HEIGHT, 
                          BACKGROUND_COLOUR)  -- fill entire box
  
  local gauge_width = (WINDOW_WIDTH - gauge_left - 5) * Fraction
  
   -- box size must be > 0 or WindowGradient fills the whole thing 
  if math.floor (gauge_width) > 0 then
    
    -- top half
    WindowGradient (win, gauge_left, vertical, gauge_left + gauge_width, vertical + GAUGE_HEIGHT / 2, 
                    0x000000,
                    Colour, 2) 
    
    -- bottom half
    WindowGradient (win, gauge_left, vertical + GAUGE_HEIGHT / 2, 
                    gauge_left + gauge_width, vertical +  GAUGE_HEIGHT,   
                    Colour,
                    0x000000,
                    2) 

  end -- non-zero
  
  -- show ticks
  local ticks_at = (WINDOW_WIDTH - gauge_left - 5) / (NUMBER_OF_TICKS + 1)
  
  -- ticks
  for i = 1, NUMBER_OF_TICKS do
    WindowLine (win, gauge_left + (i * ticks_at), vertical, 
                gauge_left + (i * ticks_at), vertical + GAUGE_HEIGHT, ColourNameToRGB ("silver"), 0, 1)
  end -- for

  -- draw a box around it
  WindowRectOp (win, 1, gauge_left, vertical, WINDOW_WIDTH - 5, vertical + GAUGE_HEIGHT, 
          ColourNameToRGB ("lightgrey"))  -- frame entire box
  
  -- mouse-over information: add hotspot if not there
  if not WindowHotspotInfo(win, sPrompt, 1) then
    WindowAddHotspot (win, sPrompt, gauge_left, vertical, WINDOW_WIDTH - 5, vertical + font_height, 
                  "", "", "", "", "", "", 0, 0)
  end -- if
  
  -- store numeric values in case they mouse over it
  WindowHotspotTooltip(win, sPrompt, string.format ("%s\t%i / %i (%i%%)", 
                        sPrompt, current, max, Fraction * 100) )
                                  
  vertical = vertical + font_height + 3
 
  end -- function DoGauge

p_time = {
		orc_time = 0,
		sea_time = 0,
		blood_time = 0,
		scale_time = 0,
		sludge_time = 0,
		alcohol_time = 0,
		venom_time = 0,
		blight_time = 0,
		drip_time = 0,
		}  -- table of poison times. add new times for poisons here


function handle_cooldowns (name)
    if p_time.sea_time > 0 then
		p_time.sea_time = p_time.sea_time - 1
	end -- super messy in I know, probably needs to be a loop
	if p_time.blood_time > 0 then
		p_time.blood_time = p_time.blood_time - 1
	end
	if p_time.orc_time > 0 then
		p_time.orc_time = p_time.orc_time - 1
	end
	if p_time.scale_time > 0 then
		p_time.scale_time = p_time.scale_time - 1
	end
	if p_time.sludge_time > 0 then
		p_time.sludge_time = p_time.sludge_time - 1
	end
	if p_time.venom_time > 0 then
		p_time.venom_time = p_time.venom_time - 1
	end
	if p_time.blight_time > 0 then
		p_time.blight_time = p_time.blight_time - 1
	end
	if p_time.drip_time > 0 then
		p_time.drip_time = p_time.drip_time - 1
	end
	if p_time.alcohol_time > 0 then
		p_time.alcohol_time = p_time.alcohol_time -1
	end --end if
   --  I know there's a way to do this with like 4 lines of code
   --  but it's 3am and i just want it to work once
  do_poison ()
end -- function handle_cooldowns

		
function do_apply(name, line, wildcards)
  local x
  x = GetTriggerWildcard ("poisoner", "poison")
    if x == "some sea slime" then
		p_time.sea_time = 240
		--print "green"  part of original debugging
    elseif x == "some bloodboil" then
		p_time.blood_time = 240
		--print "red"
	elseif x == "some orc-rot" then
		p_time.orc_time = 240
	elseif x == "some scale-rot" then
		p_time.scale_time = 240
	elseif x == "some gargoyle sludge" then
		p_time.sludge_time = 240
	elseif x == "some serpent venom" then
		p_time.venom_time = 240  
	elseif x == "some mind blight" then
		p_time.blight_time = 240
	elseif x == "some goblindrip" then
		p_time.drip_time = 240  -- add new poisons with an elseif before else
	else
		p_time.alcohol_time = 240
		--print "blue"
	end --end if
	
	do_poison ()
   
end --end function

 
function do_poison(name, line, wildcards)
  local x
  
  --NOTE AFTER TESTING COMBAT CUTS DURATION TO 4 MINUTES. OUT OF COMBAT LASTS 6 MINUTES.
  --
  max_poison = 240
 
  -- fill upper box to clear it
  check (WindowRectOp (win, 2, 0, 0, 300, 200, BACKGROUND_COLOUR))  -- fill upper box
  
  -- Edge around box rectangle
  check (WindowCircleOp (win, 3, 0, 0, 0, 0, BORDER_COLOUR, 0, 2, 0, 1))

  vertical = 6  -- pixel to start at

  DoGauge ("Orcrot: ",    p_time.orc_time ,   max_poison,    ColourNameToRGB "lightgreen")
  DoGauge ("Seaslime: ",  p_time.sea_time,  max_poison,  ColourNameToRGB "mediumblue")
  DoGauge ("Scalerot: ",  p_time.scale_time,  max_poison,  ColourNameToRGB "orange")
  DoGauge ("Bloodboil: ",  p_time.blood_time,  max_poison,  ColourNameToRGB "red")
  DoGauge ("Gargoyle: ",  p_time.sludge_time,  max_poison,  ColourNameToRGB "darkgrey")
  DoGauge ("Drip: ",  p_time.drip_time,  max_poison,  ColourNameToRGB "darkgreen")
  DoGauge ("Venom: ",  p_time.venom_time,  max_poison,  ColourNameToRGB "darkred")
  DoGauge ("Blight: ",  p_time.blight_time,  max_poison,  ColourNameToRGB "darkblue")
  DoGauge ("Alcohol: ",  p_time.alcohol_time,  max_poison,  ColourNameToRGB "yellow")
  -- add new poisons here. remember to add new poison time to table
  
  WindowShow (win, true)
  
end -- function do_prompt

function OnPluginInstall ()
  
  win = GetPluginID ()
  font_id = "fn"
  
  require "movewindow"  -- load the movewindow.lua module

  -- install the window movement handler, get back the window position
  windowinfo = movewindow.install (win, 7)  -- default to 7 (on right, center top/bottom)
                   
  font_name = "Fixedsys"    -- the font
    
  -- make miniwindow so I can grab the font info
  WindowCreate (win, 
                windowinfo.window_left,
                windowinfo.window_top,
                WINDOW_WIDTH, 
                WINDOW_HEIGHT,  
                windowinfo.window_mode,   
                windowinfo.window_flags,    
                BACKGROUND_COLOUR)

  -- add the drag handler so they can move the window around
  movewindow.add_drag_handler (win, 0, 0, 0, 0)
                 
  WindowFont (win, font_id, font_name, 9)
  font_height = WindowFontInfo (win, font_id, 1)  -- height
  
  -- work out how far in to start the gauge
  gauge_left =                        WindowTextWidth (win, font_id, "Orcrot: ")
  gauge_left = math.max (gauge_left,  WindowTextWidth (win, font_id, "Bloodboil: "))
    
  gauge_left = gauge_left + 5  -- allow gap from edge
  
 
  if GetVariable ("enabled") == "false" then
    ColourNote ("yellow", "", "Warning: Plugin " .. GetPluginName ().. " is currently disabled.")
    check (EnablePlugin(GetPluginID (), false))
  end -- they didn't enable us last time
 
end -- OnPluginInstall

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

function OnPluginEnable ()
  WindowShow (win, true)
  
  -- draw gauge again if possible
  do_poison ()
end -- OnPluginEnable

function OnPluginSaveState ()
   -- save window current location for next time  
  movewindow.save_state (win)
  SetVariable ("enabled", tostring (GetPluginInfo (GetPluginID (), 17)))
end -- OnPluginSaveState


]]>
</script>

</muclient>



Post Reply