Mush Client Auto Open Doors

Order Of Chaos Alliance Wiki | RecentChanges | Visiting as a guest. Login for full access.
Script
updated: Sat Jun 11 00:32:06 2011 system time

<triggers>
  <trigger
   enabled="y"
   group="script-autodoor"
   keep_evaluating="y"
   match="^(.+)\: It\'s locked\.$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
if GetVariable("bash") then
  Note("Auto-bashing: " .. lastdir)
  Send("BASH " .. lastdir)
end
  </send>
  </trigger>
  <trigger
   enabled="y"
   group="script-autodoor"
   keep_evaluating="y"
   match="^(?:The)? (.*?) (is|are) closed\.$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
if GetInfo(87) ~= nil then

local lastcommand = string.lower(GetInfo(87))
--local lastdir = "NONE" -- need this available elsewhere to bash
lastdir = "NONE"

local directions = {"n", "s", "e", "w", "u", "d", "nw", "ne", "sw", "se"}

local fulldirections = {
	n = "NORTH",
	s = "SOUTH",
	e = "EAST",
	w = "WEST",
	ne = "NORTHEAST",
	se = "SOUTHEAST",
	nw = "NORTHWEST",
	sw = "SOUTHWEST",
	u = "UP",
	d = "DOWN"
}

for k, v in pairs(directions) do
  if string.match(lastcommand, v) then
    lastdir = fulldirections[v]
  end
end

Note("Auto-opening: " .. lastdir)
Send("OPEN " .. lastdir)

else
  Note("Autodoor: Could not retrieve the last command sent to the MUD!")
end
  </send>
  </trigger>
</triggers>


Usage

You'll need to set your keypad to send abbreviated directions like n, s, e, w and so on for this trigger to work. Just bump into any closed door and it should open the door for you.

There is a trigger for auto-bashing a locked door as well. You'll need to set a variable called "bash" to enable it. Open the "World Properties" dialog and go to the "Variables" section. Click the "Add..." button to add a variable, give it the name "bash" and set its contents to "y" and you should be all set.


To uninstall

1. Game, Immediate (or Ctrl+I)

2. Copy the next line, then paste it into the Immediate window:

DeleteGroup ("script-autodoor")

3. Click [Run]


Order Of Chaos Alliance Wiki | RecentChanges | Visiting as a guest. Login for full access.
This page is read-only.
Last edited June 16, 2011 6:13 am by Enelya (diff)
Search: