Influencer

by Ssaliss

Back to Mechanic's Corner.

Ssaliss2010-06-15 20:10:56
Well, in short, I volunteered to make a very simple influence plugin for MushClient when speaking to someone. Figured I might as well share it with everyone, so here it is!

Note that this is my very first MUSH-plugin (with a solid two or three hours of MUSH programming experience behind it), so it might have some bugs in it (I'd be more surprised if it didn't, really).

The usage is very simple: You analyze your target and then use "inf". It then keeps influencing until there's no more target in the room to influence.

Enjoy!

Oh, and it assumes that you have all three influence-abilities in all the influence-types. Otherwise things won't work quite well.
Unknown2010-06-15 20:31:18
Thank you Ssaliss wub.gif
Calixa2010-06-15 21:16:04
QUOTE
SetVariable ("argnum", GetVariable("argnum")+1) if (GetVariable ("argnum") >= "4") then SetVariable ("argnum", "1") end -- Note ("Argnum: " .. GetVariable("argnum"))


If I read your code right, changing 4 to 3 is a quick and dirty fix to make it work for having the first two abilities of each type. At a first glance this looks great for a basic script, I'll get around testing it.
Ssaliss2010-06-15 21:45:15
QUOTE (Calixa @ Jun 15 2010, 11:16 PM) <{POST_SNAPBACK}>
If I read your code right, changing 4 to 3 is a quick and dirty fix to make it work for having the first two abilities of each type. At a first glance this looks great for a basic script, I'll get around testing it.

Yeah. Just remember I go from strongest to weakest, so you'd have to change the order of the inf-alias as well.
Calixa2010-06-15 22:18:52
Just found out about the strongest to weakest. Fix is like this then:

QUOTE
SetVariable ("argnum", "0")


Change 0 to 1

QUOTE
0


Again change 0 to 1

QUOTE
if (GetVariable ("argnum") >= "4") then
SetVariable ("argnum", "1")
end


Change 1 to 2

Remember to reinstall the plugin if you already have it loaded after you have applied the edits, or it will behave incorrectly!
Acrune2010-06-15 22:22:36
Are you sure there is a 'strongest'? I was under the impression that all 3 of the same influence type were the same 'strength', just that alternating between 2 and 3 rather than just repeating 1 is what makes it worth learning more skills.
Ssaliss2010-06-15 22:34:02
I dunno, I always just assumed the last to learn was the strongest. But could be they're all equal.
Calixa2010-06-15 22:47:30
Afaik they are all equal. Edited previous post for a two-type fix.
Unknown2010-06-19 13:14:28
They're all equal in strength. However, a mob gains resistance against an 'attack' the more times it's used. Thus, 1-2-3 is better than 1-1-1 or even 3-3-3.
Calixa2010-06-19 20:13:58
QUOTE
match="setemp"
enabled="y"
send_to="12"
sequence="100"
>
SetVariable ("influencetype", "empower")


Added that alias to the plugin to manually override in case you do not want to use weaken or paranoia (like your own city guards). By the same example you could make some for every influence type.
Okin2010-06-20 03:00:02
Wouldn't an alias that did:

CODE
match="setemp (.*)$"
enabled="y"
send_to="12"
sequence="100">
SetVariable ("influencetype", "empower") SetVariable ("target", "%1")


work even better? That way, instead of ANALYZE GUARD, SETEMP, INF, you can just do SETEMP GUARD, INF? You might hit a few guards that aren't laidback, but that'll just kill the battle straight away and you can keep cycling through looking for them, like you would with ANALYZE.
Okin2010-06-20 03:51:20
I'm being a doofus and can't get it to work at all (i.e. I made that alias suggestion before installing it. I've never had it working.) I added the plugin through the plugin screen, but it doesn't seem to have done anything. None of the aliases or triggers work, even though it's added and enabled. Help? sad.gif I'm sure I'm just being a moron.
Ssaliss2010-06-20 10:12:51
QUOTE (Okin @ Jun 20 2010, 05:51 AM) <{POST_SNAPBACK}>
I'm being a doofus and can't get it to work at all (i.e. I made that alias suggestion before installing it. I've never had it working.) I added the plugin through the plugin screen, but it doesn't seem to have done anything. None of the aliases or triggers work, even though it's added and enabled. Help? sad.gif I'm sure I'm just being a moron.

If you made changes before installing the plugin, have you tried installing a "clean" version? I doubt there's an issue with MUSH-versions (the functions used are, likely, very basic ones that have existed for quite a while).
Calixa2010-06-20 21:27:00
I always analyze things so having a step less wouldn't really benefit me, if you want to go for maximum efficiency your way should work though. Also, check edited script for typos and missing brackets. Or begin from scratch on a clean version. Might be you're just overlooking a mistake.
Zallafar2010-06-20 22:28:51
I don't read lua so if my comment doesn't apply, I apologize in advance. But you don't need to go through each guard in a stack to find which ones can be influenced. If you just influence "hunter" or whatever the generic guard name is the game will pick one for you that's available to be influenced, skipping the ones already done.
Unknown2010-06-20 23:59:32
QUOTE (Zallafar @ Jun 20 2010, 06:28 PM) <{POST_SNAPBACK}>
I don't read lua so if my comment doesn't apply, I apologize in advance. But you don't need to go through each guard in a stack to find which ones can be influenced. If you just influence "hunter" or whatever the generic guard name is the game will pick one for you that's available to be influenced, skipping the ones already done.


Really? I mean, I need the code I did for that anyways for other reasons, but I would have figured it would be just like any other command, where you have to specify the one you want to interact with specifically.

Then again, having a table of each type of object, with subtables of every one of them specifically by number can be useful for other things too, but influencing without one that cycles through would be a lot easier that way. Would almost make the influencing scripts kind of frivolous.
Sylphas2010-06-21 00:25:24
QUOTE (demonnic @ Jun 20 2010, 07:59 PM) <{POST_SNAPBACK}>
Really? I mean, I need the code I did for that anyways for other reasons, but I would have figured it would be just like any other command, where you have to specify the one you want to interact with specifically.

Then again, having a table of each type of object, with subtables of every one of them specifically by number can be useful for other things too, but influencing without one that cycles through would be a lot easier that way. Would almost make the influencing scripts kind of frivolous.


My influencing script is just a function to grab a list, return the first member, then stick it back on the end. It cycles through influence abilities until you influence something that's already been done, then stops. It's rather trivial, really.

It used to be that you had to influence a certain creature, but it was so much more onerous then hunting that it was changed. You can just KILL KROKANI over and over until you run out, since you can't target corpses. Influencing now works the same way.