Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Kyrinoz
Newbie


Joined: 08 Mar 2007
Posts: 3

PostPosted: Thu Mar 08, 2007 8:07 am   

Pk Target Checking Trigger/Script Proofread & Assistance please.
 
In plain english I am trying to write a complex trigger that checks if EITHER of two different people are friend/foe/should be foe/enemy or target, in a fashion that would allow me to help the friend or leap on a foe regardless of which variable they are in the pattern, and execute my pk alias against the foe/enemy, add them as a target if need be (and execute pk alias) or do nothing if neither party checks against my lists of friends/foes/targets/enemies. And for an innocent bystander who is neither friend or foe, the trigger would do nothing. I started the script but was double checking to see whether or not I needed to move the last set of commands up a few sets of brackets so that it is one consistent multi-expansion of IF Then statements, to check all of the variables in a fashion that doesn't accidentally pk a friend or a neutral party but will not ignore a target who may already be distracted by combat.

My pattern is simple enough to get and I am wanting to be able to use this script in other similar instances, in a fashion that will assist a friend in trouble, or leap on a target regardless of which variable they happen to be at the time in the equation of the pattern.

Am I missing anything?
Are my brackets, and if then statements in the right spots to do everything I am meaning to accomplish in ONE trigger?
Do I need to move any of my scripting around within the if then statements to avoid accidentally attacking a friend, but so that it still properly attacks enemies without nailing an innocent bystander?
Do I need to add any other commands to make sure the right variable is checked or cleared or re-added at each depth of the equation?

Proofreading, Help, Explanation, Input, Suggestions please?
Or A finished script that does what I am meaning to accomplish would be highly appreciated, my brain is about to explode from working this :P

Example trigger pattern:
(&Name) pounds the snot out of (&Name2) with a wet noodle or whatever.

Command:

#IF (%ismember( @Name, @orgmate_list) or %ismember( @Name, @orgmate_list, @council_list)) {
#IF (%ismember( @Name2, @target_list) or %ismember( @Name2, @enemy_list)) {
#T+ pk
#ECHO Pk triggers enabled
pkalias1
}
} {
addtarget %lower( @Name2)
pkalias1
} {}
#IF (%ismember( @Name, @target_list) or %ismember( @Name, @enemy_list) or %ismember( @Name)) {
#IF (%ismember( @Name2, @orgmate_list) or %ismember( @Name2, @orgmate_list, @council_list) or %ismember( @Name, @friend_List)) {
att %lower( @Name)
#T+ pk
#ECHO Pk triggers enabled
pkalias1
}
} {} {}


Thanks a ton,
Kyrinoz
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Mar 08, 2007 3:21 pm   
 
You seem to have an extra sets of brackets with nothing in at the end. You don't need any of the three sets of brackets with nothing in, if there's no else command #if won't do anything.

Secondly, you seem to be doing some weird stuff with your %ismembers. One of them doesn't have both parameters it needs, and a couple have three.

If you're not using the @Name and @Name2 variables for anything else, it'll be faster if you use this pattern:

(%w) pounds the snot out of (%w) with a wet noodle or whatever.

And then substitute @Name for %1 and @Name2 for %2.

I'm not sure if you had any other questions.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Kyrinoz
Newbie


Joined: 08 Mar 2007
Posts: 3

PostPosted: Sun Mar 11, 2007 5:52 am   
 
What I was intially asking (and worded quite awkwardly after a night of mental exhaustion from writing triggers), was whether or not it would be possible to have a trigger that would check both variables against a series of string lists which represent my friends, party members, clanmates, clanmate council, targets and enemies. The problem I am having with this is the trigger needs to be able to check BOTH variables to see if either of them are friend, for the sake of autoassisting them or foe, for the sake of jumping them while they are distracted, if neither variable is a member of any of those mentioned string lists the trigger will do nothing. That is what I ideally am requesting and intending to do with this, but I am not sure if the way I have my if / then arguments will do so in a fashion that will attack the enemy and not accidentally hit a friend/clanmate or an innocent bystander.... Something useful for assisting in pk situations that I am not expecting, and would also serve purpose to lend a hand or take advantage of an opportunity to catch a foe with their guard down or while they are distracted. I hope that helps clarify what I am intending the script to do. Please let me know either way if you have questions.

I would like to be able to use the command script over several seperate trigger pattern messages (most likely mud combat spam) so that in walking through a room if a friend or clanmate is in a jam I will leap on the jerk jumping them, or if a foe is already distracted or leaping on a buddy I can take them while their guard is down.

I am still fairly new to the commands to call a %1 etc in a trigger pattern to a variable so if I have left anything out and or am asking something impossible let me know. I am pretty sure it can be done though and I hope that the framework there is a start. Realistically I see it being multiple layers deep of if then statements. My problem being new to triggers that in depth is I am unsure as to exactly how many. Any futher assistance someone can offer on this would be HIGHLY appreciated.


Thanks,
Kyrinoz
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Mar 11, 2007 5:27 pm   
 
Would %ismember() accept a %concat() of the two variables? Something like:

%ismember(@name, %concat(@stringvar1,~|,@stringvar2))

If it works, that would combine your several lists into one long list. It'd be good if there were no distinction between the subgroups, but if you need to do other things you should probably stick to checking each one individually.
_________________
EDIT: I didn't like my old signature
Reply with quote
Kyrinoz
Newbie


Joined: 08 Mar 2007
Posts: 3

PostPosted: Tue Mar 13, 2007 7:12 pm   
 
Yeah I could possibly combine the target/enemy list and then seperately combine the friend/orgmate/org council/and party member lists to run those checks but the main problem I am having with this trigger is getting the if/then statements deep enough with arguments and checking in a fashion that still checks BOTH variables in the pattern against BOTH sets of lists. The pattern could be applied to any mud combat spam message but with what I am seeking the trigger to do is if I am walking through a room, or already in a multiplayer combat scenario that it will auto-assist friends and auto-attack foes, but with a check style that does this for both variables, and if EITHER variable in the pattern is friend or foe it will either assist or attack the other party in the opposing variable accordingly UNLESS both check against the friend lists which would then be broken down by priority (Council then orgmates then friends, then party members). I need to ensure that the finished product of this will NOT attack an innocent bystander, UNLESS they are attacking a friend (or combination of clan etc) and WILL add the other member of the opposing variable to my target/enemy variables and attack them. The other check this trigger command needs to do is to attack an enemy already in combat (REGARDLESS of whether or not they are in combat with a friend), to take advantage of an oppotune situation catching them distracted. The mud I play on is very pk oriented, and unless you prefer playing a merchant class or a service class guild, most players tend to design their characters to be pk oriented in some fashion upon maxxing their characters.

Thanks again for the prompt responses,
Kyrinoz
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net