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


Joined: 10 Aug 2002
Posts: 35
Location: USA

PostPosted: Tue May 17, 2005 8:31 pm   

cant get this to work.
 
[code]
#CLASS {akill}
#TRIGGER {* the (%d){st|nd|rd|th} {small shadow}*} {#T- walk;#SUSPEND a1;claw shadow;#T- akill}
#TRIGGER {With a crash, everything it was carrying falls to the ground before you.} {q c;get coin;get coin;#T+ akill;#T+ walk;look;#ALARM +2 {#RESUME a1}}
#TRIGGER {You must move closer to your opponent's rank to engage in combat.} {#wa 5000;claw shadow}
#TRIGGER {You claw at * (%w)!} {}
#COND {You claw at * (%w)!} {claw %1}
#CLASS 0

#CLASS {walk}
#TRIGGER {^obvious exits:*} {#ALARM "a1" +2 {#STEP;#PAUSE}} "" {notrig}
#CLASS 0
[code]

this is whats meant to happen.
1) walk a path: {#slow hunt}
2) match text with a target name {shadow}:
3) wait for the mob to advance to my tactical range for claws
4) claw the matching targets name {claw shadow}:
5) clear the commands that have been que'd when mob dies {q c}
6) pick-up coins {get coin}
7) check the room to see if there are anymore matching targets--
-- {large shadow|small shadow|shadowlord} in that room
if there's a match repeat steps 4,5 and 6 untill the room is clear.
8) continue along the path, repeat steps 1-8 if encoutered by shadow

sounds great in theory but i can't get my path to stop when the strings have been matched. my claw trigger only fires once if i type look and see another shadow in the room all in all i'm pretty flustered 1-8 does not do what i intended it to do.

I was hoping that someone could help me out please.

below are snippets of things i've been trying to capture and use to fire my triggers just so you get the idea of what i'm seeing

upon entering this room and seeing the shadows my path should AutoStop

This room is not illuminated.
You see the 1st small shadow, the 2nd small shadow, the 3rd small shadow and the 1st shadowlord.
Obvious exits: southwest.


I then should claw once to see if there is a target within my reach.

If i get the message.

You must move closer to your opponent's rank to engage in combat.

I would need to wait until i saw this message.

The * shadow advances towards you.

Once the shadows moves within my reach the script should auto-claw until it was dead.

The shadows death message is:

With a crash, everything it was carrying falls to the ground before you.

Then check the room for more shadows if there are non pick up the coins and begine to move again.

If anyone has the time can they look over what i have and tell me what i'm doing wrong

Thank You,
Thalir
Reply with quote
Aarlot
Adept


Joined: 30 Dec 2003
Posts: 226

PostPosted: Tue May 17, 2005 9:43 pm   
 
Hrm... with your first trigger,

#TRIGGER {* the (%d){st|nd|rd|th} {small shadow}*} {#T- walk;#SUSPEND a1;claw shadow;#T- akill}

you turn off the class akill with the #T- akill. This will make it so that the other triggers in this class will not fire. Thus, unless you're turning off:

#TRIGGER {With a crash, everything it was carrying falls to the ground before you.} {q c;get coin;get coin;#T+ akill;#T+ walk;look;#ALARM +2 {#RESUME a1}}
#TRIGGER {You must move closer to your opponent's rank to engage in combat.} {#wa 5000;claw shadow}
#TRIGGER {You claw at * (%w)!} {}
#COND {You claw at * (%w)!} {claw %1}

which will never fire unless you have some outside source turning them back on.



What you need to do is name the trigger rather than the class:

#CLASS {akill}
#TRIGGER "sdet" {* the (%d){st|nd|rd|th} {small shadow}*} {#T- walk;#SUSPEND a1;claw shadow;#T- sdet}
#TRIGGER {With a crash, everything it was carrying falls to the ground before you.} {q c;get coin;get coin;#T+ sdet;#T+ walk;look;#ALARM +2 {#RESUME a1}}
#TRIGGER {You must move closer to your opponent's rank to engage in combat.} {#WAIT 5000;claw shadow}
#TRIGGER {You claw at * (%w)!} {}
#COND {You claw at * (%w)!} {claw %1}
#CLASS 0


#CLASS {walk}
#TRIGGER {^obvious exits:*} {#ALARM "a1" +2 {#STEP;#PAUSE}} "" {notrig}
#CLASS 0


*Untested, I'm not at my home comp so I don't have zmud access atm*
_________________
Everyone is entitled to their beliefs - until they die. Then only the truth matters.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed May 18, 2005 2:05 am   
 
I can never understand why it is so common to only think of triggering on the text you are looking to see and not other useful surrounding text. In this particular case your prompts are key vital pieces of information. I also think this will cover your other posts that somewhat surrounded this topic. I am going to make the assumption that there is no prompt received during a round of combat since you did not include one your previous post about preforming the clawing once and only once each round. I am also going to assume that there actually is a prompt received after you are told about the damages. Next assumption is that you will receive a prompt after the mob dies and another after picking up coins. That makes triggering on the prompt and checking the state of things all the more attractive. This also allows us to do some nifty things like issuing an order for our trigger to check the state of autokilling simply with #CR the least offensive possible command to send to the mud.

So all in all here is what I came up with. It seems to meet the requirements of what you describe in this post and 2 others. First the automatic clawing, second the need to auto target (simply add the right words to the TargetWords list), and finally automation of #STEP, #PAUSE, attack, and get coins. A few side notes this is a very simple hunting script. It can readily be messed up by malicious players, for example dropping a few thousand copper coins is a very cheap method that I commonly use to slow and stop bots. It does have some protections against internal errors, but in no way should be left unattended until throroughly tested on your system.

What is does not have is way to issue the "#SLOW hunt" since you provided no initial example of that. For hunting bots I have found it better, in the past, to write my own walking routines as integrating in the mappers is not easy. I have not written any recently and no longer have samples of such scripts since I refuse to play on MUDs that would make such necessary anymore. Such integrations is not impossible since I do have a fully integrated walking system that I currently use which automatically pauses to drink from fountains that I pass, open doors that are openable, cast pass door if I need it to continue walking, retry pass door if I failed, etc., and continue on my merry way to my destination. If you want an example of that I will happily post it without any explanation what so ever. It would be up to you to understand it.
Code:

#CLASS {AKill}
#ALIAS AKillReset {Attacking=0;AKillCmd="";Targets="";Target="";look}
#VAR AKillActive {0} {0}
#VAR Attacking {1} {0}
#VAR Targets {2nd shadow spawn and|1st small shadow} {}
#VAR TargetWords {shadow|spawn|shadowlord}
#VAR Target {2nd shadow spawn and} {}
#VAR AKillCmd {and} {}
#BUTTON AKillCtrl "AutoKill: %if(@AkillActive,On,Off)" {AKillActive=%eval(!@AKillActive);#IF (@AKillActive) {#T+ AKillTriggers;AKillReset} {#T- AKillTriggers}} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} "" {} {} {}
#CLASS 0

#CLASS {AKill|AKillTriggers} {disable}
#TRIGGER {^You see the (*).$} {Targets=%replace("%1"," the ","|")} "" {case|notrig}
#TRIGGER {^Obvious exits~: *.$} {#IF ((@Attacking=3)&(@Targets="")) {Attacking=0};#PAUSE} "" {case|notrig}
#TRIGGER {^With a crash, everything it was carrying falls to the ground before you. $} {Attacking=2;#DELITEM Targets {@Target}} "" {case|notrig}
#TRIGGER {^You must move closer to your opponent's rank to engage in combat.$} {Attacking=-1} "" {case|notrig}
#TRIGGER {^The (*) advances towards you.$} {Attacking=0;#CR;#UNTRIGGER AKillTemp} "" {case|notrig}
#TRIGGER {^~>} {#IF (@Attacking=-1) {#ALARM "AKillTemp" {+10} {AKillReset}} {#IF (@Attacking=0) {#IF (@Targets="") {#STEP} {Target=%item(@Targets,1);AKillCmd=%numwords(@Target);#WHILE (%isnumber(@AKillCmd)) {#IF (%ismember(%word(@Target,@AKillCmd),@TargetWords)) {AKillCmd=%word(@Target,@AKillCmd)} {#ADD AKillCmd -1};#IF (@AKillCmd=-1) {AKillCmd="Auto Kill Error: No kill word known for @Target"}};#IF (%numwords(@AKillCmd)=1) {Attacking=1;claw @AKillCmd}}} {#IF (@Attacking=1) {claw @AKillCmd} {#IF (@Attacking=2) {get coins;Attacking=0} {#ECHO AutoKill Error: Unknown Attacking value @Attacking}}}}} "" {nocr|prompt|notrig}
#CLASS 0
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Thalir
Novice


Joined: 10 Aug 2002
Posts: 35
Location: USA

PostPosted: Wed May 18, 2005 6:16 pm   
 
Vijilante that's pretty impressive i'm very grateful for your time and effort the script looks amazing i'm testing it out now.

Ok,
I've imported the script from a .txt file but cant seem to get this to work, Is there something i'm missing? the script is not firing when the strings match.

any suggestions? ohh, and Vijilante i've sent you a PM if ya get a chance to look at it.

Thank,
Thalir
Reply with quote
Thalir
Novice


Joined: 10 Aug 2002
Posts: 35
Location: USA

PostPosted: Wed May 18, 2005 6:50 pm   
 
i noticed you had mentioend i didnt supply anything on the #path in any of me previous posts. i guess it was key vital informatin and didnt realize it and forgot to add it in.

so this is what i have.

Alias {a1} {#SLOW hunt;#pause}
button {Hunt} {#slow hunt}

this will move me .kweseo4k

k = sw
l = se
o = ne
i = nw

Essentially the button #slow hunt will move me SE>W>E>S>E>NE>4xSW

i've not yet figured how to wrap and reverse those directions to continue a fluid path and circle this small cave non-stop.

i figured i'd try to make it down into the cave on auto pilot and worry about the the return journey on auto pilot, if i can get the first half to work maybe thats the wrong way to go about it, but i'm still learning Zmud after a 2-3 years break from Mud'ing

Thanks,
Thalir


Last edited by Thalir on Wed May 18, 2005 7:45 pm; edited 2 times in total
Reply with quote
Thalir
Novice


Joined: 10 Aug 2002
Posts: 35
Location: USA

PostPosted: Wed May 18, 2005 7:19 pm   
 
you also mentioned that i didnt supply enough information in regards to the different prompts which left you to make assumptions for certain things.

so i thought i'd post a short MUD LOG so you can see exactly what i see during combat.

[Shadow Caves.]

Oddly shaped yellow rocks line the entrance to the cave. Sharp and jagged, they jut from the cave floor, forming a semi-circle. Protruding from the rather low ceiling of the cave are more rocks in a matching formation. The effect is that of stalagmites and stalactites, striving to meet. The floor of the cave is littered with rock fragments, making passage slow and difficult.

This room is not illuminated.
You see the 1st large shadow.
Obvious exits: southwest.
>

The large shadow advances towards Thalir.
claw shad
You claw at the large shadow!
claw shadow
The attack misses its target.
[3 sec. delay]
You claw at the large shadow!
The attack goes wild.
[2 sec. delay]
>

The large shadow claws at you!
The attack is a good blow to the right arm.
Your heavy polished steel squire's mail absorbs about half of the damage!
Your thick scales absorbs a bit of the damage.
Your right arm takes 8 points of slash damage!
claw shad
You claw at the large shadow!
claw shadow
The attack is a well-delivered slash to the right leg.
[3 sec. delay]
You claw at the large shadow!
The attack is a strong slash to the torso.
[2 sec. delay]

The large shadow claws at you!
The attack misses.
claw shad
You claw at the large shadow!
claw shadow
The attack is a strong slash to the left leg.
The large shadow is knocked back!
[3 sec. delay]
You claw at the large shadow!
The attack is a strong slash to the left leg.
The large shadow is knocked back!
It stumbles and falls down!
[2 sec. delay]
You claw at the large shadow!
claw shadow
The attack is a decent slash to the left leg.
[3 sec. delay]
You claw at the large shadow!
The attack is a strong slash to the left leg.
[2 sec. delay]

The large shadow stands up.
You claw at the large shadow!
claw shadow
The attack is a strong slash to the torso.
The large shadow is knocked back!

The large shadow melts away.
[3 sec. delay]
But the large shadow is dead!
With a crash, everything it was carrying falls to the ground before you.
>
look
[Shadow Caves.]

Oddly shaped yellow rocks line the entrance to the cave. Sharp and jagged, they jut from the cave floor, forming a semi-circle. Protruding from the rather low ceiling of the cave are more rocks in a matching formation. The effect is that of stalagmites and stalactites, striving to meet. The floor of the cave is littered with rock fragments, making passage slow and difficult. Some gold coins, some silver coins, and a closed multicolored patched cotton carry-all are here.

This room is not illuminated.
Obvious exits: southwest.
>
get coin
You pick up 2 gold coins.
>
get coin
You pick up 40 silver coins.
>

2 small shadows just wandered in right next to you!

** Current hit points: 253 out of 256

** Current fatigue: 96 out of 113

The small shadow claws at you!
The attack is a good blow to the right arm.
Your heavy polished steel squire's mail absorbs about half of the damage!
Your thick scales absorbs a bit of the damage.
Your right arm takes 4 points of slash damage!

The 2nd small shadow claws at you!
The attack misses.
claw shad
You claw at the small shadow!
The attack misses its target.
[3 sec. delay]
You claw at the small shadow!
claw shadow
The attack is a decent slash to the torso.
The small shadow is knocked back!
It stumbles and falls down!
[2 sec. delay]
>

The small shadow stands up.

The 2nd small shadow claws at you!
The attack misses.
You claw at the small shadow!
The attack misses its target.
[3 sec. delay]
You claw at the small shadow!
claw shadow
The attack is a strong slash to the left leg.
The small shadow is knocked back!
[2 sec. delay]
>

The small shadow is staring at you.

The small shadow claws at you!
The attack misses.

The 2nd small shadow claws at you!
The attack is a strong blow to the left arm.
Your heavy polished steel squire's mail absorbs about half of the damage!
Your thick scales absorbs a bit of the damage.
Your left arm takes 4 points of slash damage!
You claw at the small shadow!
The attack misses its target.
[3 sec. delay]
You claw at the small shadow!
claw shadow
The attack is a strong slash to the left leg.
The small shadow is knocked back!
[2 sec. delay]
>

The small shadow claws at you!
The attack misses.

The 2nd small shadow claws at you!
The attack is a strong blow to the left leg.
Your heavy polished steel squire's mail absorbs about half of the damage!
Your thick scales absorbs a bit of the damage.
Your left leg takes 4 points of slash damage!
You claw at the small shadow!
The attack is a good slash to the torso.
The small shadow is knocked back!
[3 sec. delay]
You claw at the small shadow!
claw shadow
The attack is a strong slash to the head.
The small shadow is knocked back!

The small shadow melts away.
[2 sec. delay]
>
With a crash, everything it was carrying falls to the ground before you.
You claw at the small shadow!
The attack is a good slash to the left arm.
The small shadow is knocked back!
[3 sec. delay]
You claw at the small shadow!
claw shadow
The attack is a well-delivered slash to the head.
The small shadow is knocked back!
[2 sec. delay]
>

The small shadow claws at you!
The attack is a strong blow to the right arm.
Your heavy polished steel squire's mail absorbs about half of the damage!
Your thick scales absorbs a bit of the damage.
Your right arm takes 4 points of slash damage!
You claw at the small shadow!
The attack is a decent slash to the head.
The small shadow is knocked back!
[3 sec. delay]
You claw at the small shadow!
claw shadow
The attack is a strong slash to the torso.
The small shadow is knocked back!
[2 sec. delay]
>

The small shadow just picked up a closed baggy hemp bag.
You claw at the small shadow!
The attack is a well-delivered slash to the right leg.
The small shadow is knocked back!
[3 sec. delay]
You claw at the small shadow!
claw shadow
The attack is a well-delivered slash to the right arm.
The small shadow is knocked back!

The small shadow melts away.
[2 sec. delay]
>
With a crash, everything it was carrying falls to the ground before you.
sw
[Shadow Caves.]

A passage offers entry in and out of the great cavern. The ceiling and floor slope downward toward the south. The way becomes narrower as you pass through ring-shaped shards that must be the remains of a giant beast. Judging by the charred condition of much of the skeleton, it would appear that it met death through fiery combat.

This room is not illuminated.
You see the 1st shadowlord.
Obvious exits: northeast southwest.
>
claw shad
You claw at the shadowlord!
The attack is a good slash to the torso.
The shadowlord is knocked back!
[3 sec. delay]
You claw at the shadowlord!
claw shadowlord
The attack is a decent slash to the head.
The shadowlord is knocked back!
It stumbles and falls down!

The shadowlord slips away into chaos.
[2 sec. delay]
>
With a crash, everything it was carrying falls to the ground before you.
I don't see what you are referring to.

***END LOG***

hope this helps.

Thanks,
Thalir


Last edited by Thalir on Tue May 24, 2005 7:04 pm; edited 2 times in total
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu May 19, 2005 12:33 am   
 
Your log seems to show my assumptions were correct. Nearest I can guess is that either the import failed or the prompt trigger is not even firing. I don't have any time to tweak on it tonight, but will aim for tommorrow or Friday night to get it right.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Thalir
Novice


Joined: 10 Aug 2002
Posts: 35
Location: USA

PostPosted: Mon May 23, 2005 11:47 pm   
 
bump.
Hope no one minds me bumping this post.
_________________
Thalir
Who ever said bards lie?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue May 24, 2005 9:51 am   
 
Examining the log a little more closely it looks like the options for the prompt trigger are the only problem. Change them within the Settings Editor by unchecking "prompt" and checking "newline".
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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