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
GooseFire
Novice


Joined: 08 Sep 2003
Posts: 32
Location: USA

PostPosted: Wed Mar 24, 2004 5:16 am   

An auto targetting system
 
Alright, what I'd like to do is have a system that automatically takes in targets after I enter a command. Then have an alias that hits those targets. But I also want it to be selective of the things I specify. Here's what will show me the things I can hit in the room.

When I do IH, short for info here, it shows me all mobiles, items, and things in the room.

"totem822" a runic totem
"grate11178" a sewer grate
"knight97427" a Knight of the Illuminati
"archer134031" a mounted archer
"archer134006" a mounted archer
"witch117911" a War Witch
"knight56033" a Knight of the Illuminati
"snake62124" a small black cobra
Number of objects: 8

That's just an example. Now, I dont want the system to target grates, totems, or certain mobiles, because they are things that wont die, or I dont want to hit them. >.<, This is Achaea for any of you who might like to know.

I have another system that knows how to pick up information in the sense I'm thinking I need, though I didnt make it so I'm not sure how to manipulate it to waht I need.

This is the pattern for it:
%w vial&%d{vialnumber}%sempty%s&%d{sipnumber}%s&%d{months}

And this is what it picks up:
Walnut vial188619 an elixir of mana 60 101
Walnut vial264139 an elixir of mana 60 116
Walnut vial264450 an elixir of mana 60 116

I dont know if that'd be helpful or not.

Now, on the attacks that I can do is I can either track one target to hit or I can track 2 or 3 at a time. I'd like to know if it'd be possible to switch which one I'd like at a time.

So, if anyone can help me get started with some ideas, or know what might help me in creating this, I'd appreciate it.


Thanks.
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Wed Mar 24, 2004 1:56 pm   
 
You could set your targets in a variable and then asign them to a trigger
#VAR targets knight97427|knight56033|archer134006
#TRIG {{@targets}} {#FORALL @targets {kill %i}}
that would make you send a kill command for every target in the @targets variable. Maybe %param would do it a bit tidier.
Reply with quote
GooseFire
Novice


Joined: 08 Sep 2003
Posts: 32
Location: USA

PostPosted: Wed Mar 24, 2004 3:44 pm   
 
OK. Your idea is working nicely thus far DeReP, but working on it briefly, everything seems to be fine in the process of turning on and off, executing right triggers, except for the part where it puts the ###### of the mobile into the variable. Maybe One of you can help?

#CLASS {Mobile Targetting}
#ALIAS AddMobs {#T+ addmobiles;ih;#ECHO Mobiles Added! Kill, maim, destroy!}
#VAR MobileID {}
#CLASS 0

#CLASS {Mobile Targetting|addmobiles}
#TRIGGER {"%d{mobileid}"} {#IF %ismember( %d, @MobileID) {} {#ADDITEM MobileID @mobileid}}
#TRIGGER {%dh, %dm %w-} {#T- addmobiles} "" {nocr|prompt}
#CLASS 0

Oh, and I didn't do it exactly how you said because sometimes their is up to 5 or so mobiles in a room and it would spam the hell out of me if it tried to kill them each time. The thing is that the #ADDITEM doesn't seem to be putting the {mobileid} into the variable.
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Wed Mar 24, 2004 3:53 pm   
 
Try this:

#alias ih {~ih;#T+ mobcapture}
#alias MobKill {hit %item(@MobsToAttack,1);#delnitem MobsToAttack 1}
#var NoAttack {grate|totem}
#class MobCapture
#Trigger {"(%a)" (*)} {#IF ("%2" =~ {@NoAttack}) {} {#var MobstoAttack {%additem( %1,@MobstoAttack)}}}
#trigger {Number of objects:} {#T- MobCapture}
#class 0

Any mobs that you don't want to attack, add to the variable NoAttack.
Reply with quote
GooseFire
Novice


Joined: 08 Sep 2003
Posts: 32
Location: USA

PostPosted: Wed Mar 24, 2004 6:54 pm   
 
Before I even attempt to check that out, some mobs take up to 8-12 hits to die. That deletes it from the list when you hit it, doesnt it? :C
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Wed Mar 24, 2004 6:59 pm   
 
Yes it does, but it only goes onto the next mob when you reuse the MobKill alias. Anyway, that is easily changed:

#alias ih {~ih;#T+ mobcapture}
#alias MobKill {hit %item(@MobsToAttack,1);#temp {<Pattern Received When Mob Dies>} {#delnitem MobsToAttack 1}}
#var NoAttack {grate|totem}
#class MobCapture
#Trigger {"(%a)" (*)} {#IF ("%2" =~ {@NoAttack}) {} {#var MobstoAttack {%additem( %1,@MobstoAttack)}}}
#trigger {Number of objects:} {#T- MobCapture}
#class 0
Reply with quote
GooseFire
Novice


Joined: 08 Sep 2003
Posts: 32
Location: USA

PostPosted: Thu Mar 25, 2004 5:30 am   
 
Alright, well I found a complication. When you slay the mobile it says their whole name, not just the id name. Like, on the example above, snake is A small black cobra. You're targetting snake, but when you slay it it says, "You have slain a small black cobra." Is their anyway I could use a variable by manually adding in the way each one dies to have it removed?

#TRIGGER {You have slain %1 * * * *.} {#e ********** KILLED %1 **********}

This echo's everything I slay, maybe it can be used to know which target I killed.

Then again, on the first post of this I pointed out that trigger that added in the names to the variables.

#CLASS {Mobile Targetting}
#ALIAS AddMobs {#T+ addmobiles;ih;#ECHO Mobiles Added! Kill, maim, destroy!}
#VAR MobileID {}
#VAR MobileFullName {}
#TRIGGER {You have slain %1 * * * *.} {#IF %ismember( %1, @MobileFullName) {#DELITEM mobilefullname %1} {}}
#CLASS 0

#CLASS {Mobile Targetting|addmobiles}
#ALIAS %dh, %dm %w-ih {ih;#T+ addmobiles}
#TRIGGER {"%d{mobileid}"&{mobilefullname}} {#IF %ismember( %d, @MobileID) {} {#ADDITEM MobileID @mobileid};#ADDITEM mobilefullname @MobileFullName}
#TRIGGER {%dh, %dm %w-} {#T- addmobiles} "" {nocr|prompt}
#CLASS 0

That's an updated of what I just tried to do. Namely the trigger I showed above, but I dont know if anything I'm doing here looks remotely right.. *twitch*
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Thu Mar 25, 2004 7:03 am   
 
OK, try this. I have it set to use a variable Slay message in order to delete the MobileID, and it doesn't add a mobile to the list if you specify it in @NoAttack:

#CLASS {Mobile Targetting}
#ALIAS AddMobs {#ECHO Adding Mobiles! Kill, maim, destroy!;ih;#T+ "Mobile Targetting|addmobiles";#VAR MobileID {%null};#VAR MobileFullName {%null}}
#ALIAS MobKill {hit %item(@MobileID,1);#temp {You have slain %item(@MobileFullName,1).} {#delnitem MobileID 1;#delnitem MobileFullName 1}}
#CLASS 0

#CLASS {Mobile Targetting|addmobiles}
#TRIGGER {"(%a)" (*)} {#IF ("%2" =~ {@NoAttack}) {} {#var MobileID {%additem( %1,@MobileID)};#VAR mobilefullname {%additem(%2,@MobileFullName)}}}
#TRIGGER {%dh, %dm %w-} {#T- "Mobile Targetting|addmobiles"} "" {nocr|prompt}
#CLASS 0
Reply with quote
GooseFire
Novice


Joined: 08 Sep 2003
Posts: 32
Location: USA

PostPosted: Thu Mar 25, 2004 10:53 am   
 
Ok. It only seems to be adding the first creature, and when he dies he doesnt get deleted from the variable. :/
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Thu Mar 25, 2004 8:34 pm   
 
It works for me. Maybe you're not understanding how it works.
Since you don't want to attack totems, grates etc, you add these to the variable noattack: #var noattack {totem|grate}
Type AddMobs to start capturing mobiles ID's and full names. When it receives your prompt line, it stops capturing. Then, you type Mobkill to kill the first mob on the list.
When you receive the message: You have slain a small black cobra., it deletes that mobileid from the list, along with the slay message related to that mobile.
Type Mobkill to continue on with killing the next guy.

Note, you MUST use the MobKill alias to kill the mobiles, otherwise it doesn't set the temp trigger to remove the item from the list.
Reply with quote
GooseFire
Novice


Joined: 08 Sep 2003
Posts: 32
Location: USA

PostPosted: Fri Mar 26, 2004 6:20 am   
 
Oooh! I see, excellent. It does work, awesome! Thank you, Danlo. Thank you to everyone else who helped me, aswell.
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