ID Grabber for those pesky Tosha monks

by Unknown

Back to Mechanic's Corner.

Unknown2006-08-18 09:27:59
There was a topic similar to this here, but it was for Zmud.

What I'd like is to know how I can do something similar to that, or if its even possible in Mush. I can't seem to find a #sub command for Mush, so I can't even do it manually, so I have to do it even more manually, as in using paper and pencil.

So, help save trees by teaching me how to do this. happy.gif
Unknown2006-08-26 14:09:11
I guess I'll have to try lower then.

Is it even possible to do #sub on Mushclient?

Edit: Ooooh, and how is it done. Must not forget that.
Unknown2006-08-26 14:44:49
You can't sub in MUSHclient, at least not in any remotely simple way. You can gag, or you can echo - but if you gag, it also gags your echoes. But gagging should work fine for your purposes. The real trick is storing the IDs, and for that you'll need to look into either MUSHclient's or VBscript's array functions.

The short version: it's complicated and takes some thought.
Unknown2006-08-26 15:06:16
OK, having given it more thought, here's how you could do it. Create two arrays - let's call 'em A and B. A will store id's of mobs you're done influencing. B will store id's of mobs currently in the room.

1. Trigger the successful influence message (whoever searches his pockets...) to add your current influence target to array A.
2. Alias IH to clear array B and send "IH".
3. Make a trigger that captures mob id's from IH and stores them in array B.
4. Make an alias that removes any id's present in A from array B, then takes the first key in array B, sets the influence target to that, and starts influencing.
5. Trigger the successful influence message (you can include this in the trigger from step 1) to run this alias.

And that should do it. If I'm feeling unlazy, I might try to do this myself and post the results...
Unknown2006-08-26 15:21:34
Thanks a lot. I'm not too good with scripting and I'm reading the help files, but they only help a little, so here's some rather basic questions.

Where do I create the arrays? By directly putting it in the script?

Do the triggers and aliases require me to check regular expression?

What is the difference between a key and value in an array?

For step 3, how do I capture all of the IDs? I know how to capture just one, but any more stumps me. And which function adds to an array?

And step 4 is a little tough for me. I have no idea how to do the first part, and for the second part, all I know is that I use ArrayGetFirstKey, but I'm stuck as to what to do with that.

Edit: Oh, and I've been looking through the help files a little, and found a Replace function. I'm not sure if I read it correctly, but does it work as a sub function? If not, would you mind explaining it?