^A battle-scarred soldier stalks rigidly down the street.$
sends to variable, reg exp checked, script attached store
the rest of the triggers are quite the same, that is to say, the name of the mob when one looks around the room.
an edited version of the script follows, edited becuase i didnt want to make a huge page.
function store(name,output,wildcardsVB)
{
var temp = world.getvariable("temporary");
var thestring = world.getvariable("thestring");
var toadd = "";
if (temp.indexOf("noble",0) > 0)
toadd = "noble";
else if (temp.indexOf("this wagoneer scowls",0) > 0)
toadd = "wagon";
.................
I cut a large bunch of lines out here
.................
else if (temp.indexOf("loud wagoneer growls",0) > 0)
toadd = "wagon";
else
toadd = "";
if (toadd.length > 0)
thestring = thestring + toadd + "~";
world.setvariable("thestring",thestring);
// world.note(thestring);
}
function cleanstore(name,output,wildcardsVB)
{
world.setvariable("thestring","");
}
function doclean(name,output,wildcardsVB)
{
var temp = world.getvariable("thestring");
var kill = temp.substring(0,temp.indexOf("~",0));
temp = temp.substring(temp.indexOf("~",0)+1,temp.length);
world.note("kill = "+kill);
world.note("temp = "+temp);
if (kill.length > 0)
world.Execute("back "+kill);
world.setvariable("thestring",temp);
}
attached to the script are some other triggers, that allow me to tell the client that a mob has died. they just call the doclean script again. macros are used to clean the string, as well as to start the clean script.
so, i Look in a room, and the client catches the names of mobs it recognizes, feeding the entire line into the script, which catches a unique portion (in most cases anyways) and adds a keyword for the mob to the stack, the hackjob that it is. it does this rather rapidly, and when i decide, i call the script using the macro, and it backstabs each mob in turn.
i guess that i'm now asking if this is possible to turn into a plugin.
thanks for your time in advance. |