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
Segojan
Newbie


Joined: 08 Sep 2005
Posts: 2

PostPosted: Thu Sep 08, 2005 3:01 am   

I'm losing my hair over this.
 
Hello fellow forum friends.

I have been mudding for quite a while but I've never become fluent at scripting the way I'd like to be. I've been reading the zmud manuals and forums and I have what I consider to be some 'loose' knowledge floating around in my brain but I can't seem to put it all together and make this script work.

What I'm shooting for here is a script that will allow me to SCAN and go to a MOB on my list and kill it as well as other mobs in the room (I will have to make one of those list variables I'm thinking) then be able to SCAN again and repeat the whole process.

I'm not sure how to even go about this in an efficient way.

I believe I will need the following variables...
@mobscandesc
@huntattack
@hunttarget

I'm thinking @mobscandesc and @hunttargets will need to be list.

then maybe I'll have to have..
#CLASS autohunt

#CLASS endhunt

I would really appreciate some help with this.

The @targetscandesc are different than the @hunttargets.

Here is some sample text.


1455/1455hp 2843/2843mn 787/791mv 409 -109680621 > scan
You carefully search the surroundings...

a crazed warrior -- a little bit above you
the bronze guard -- Right Here
the bronze guard -- Right Here
the silver guard -- Right Here
the silver guard -- Right Here
a huge giant -- a little bit to the East
a crazed warrior -- a ways off to the East
a crazed warrior -- a little bit to the West



the bronze guard is DEAD!!
You receive 588200 exps of 588200 total.
Your blood freezes as you hear the city guard's death cry.


I'm severely lacking but I want to learn and I don't even know if this is possible.
Thanks in advance for any help.
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Thu Sep 08, 2005 4:21 pm   
 
what message do you get if there are no mobs on scan?
Reply with quote
Segojan
Newbie


Joined: 08 Sep 2005
Posts: 2

PostPosted: Thu Sep 08, 2005 5:55 pm   
 
Whenever I scan it always says this..

You carefully search the surroundings...


even if nothing is around.

I'm not wanting this to do anything if nothing shows up on scan.
I want to walk around on my own BUT if something comes up in scan THEN I'll automatically go and start killing (if it's in my @hunttarget)
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Thu Sep 08, 2005 8:02 pm   
 
here is one i wrote for another mud VERY similar output to yours:

Code:

#CLASS {auto_kill}
#ALIAS startauto_kill {#CLASS "auto_kill|main" 1;#RESET auto_kill;#IF (%class( auto_kill|main) = 1) {auto_kill}}
#VAR kill_list {an academy bishop|an academy priestess|an academy monk|a small rat|an academy hound|an academy page|a half-elf tracker| an academy sorcerer|an academy wizard|a large cockroach|a young footpad|an academy poliir|a young amazon|a barbarian}
#VAR to_kill {} {}
#VAR did_scan {0} {0}
#VAR next_direction {} {}
#VAR target {footpad}
#VAR full_inv {0}
#TRIGGER {^Your inventory is full.$} {full_inv = 1}
#TRIGGER {^The gods bestow you with %d gold for your offering.$} {full_inv = 0}
#TRIGGER {^A gong echoes loudly through the halls as a new class begins.$} {#IF (%class( auto_kill|main) = 0) {#SHOW {Enabling AutoKill};#WAIT 120;startauto_kill}}
#CLASS 0
#CLASS {auto_kill|main} {disable}
#ALIAS auto_kill {#IF (@to_kill = "") {doscan} {#FORALL @kill_list {#IF %ismember( @to_kill, %i) {target = %numwords( %i);target = %word( %i, 3);#IF (@target = "") {target = %word( %i, 2)};kill @target;#ABORT}}}}
#ALIAS doscan {#IF (@did_scan = 1) {@next_direction;#RESET autokill;did_scan = 0;#IF (%class( auto_kill|main) = 1) {auto_kill}} {scan;did_scan =1}}
#TRIGGER {^You scan over your surroundings...$} {#RESET auto_kill;#CLASS "auto_kill|support" 1}
#TRIGGER {^You receive * ~(} {#IF (%class( auto_kill|main) = 1) {auto_kill}}
#TRIGGER {^You scan over your surroundings...$$$~[} {#CLASS "auto_kill|main" 0;#SAY {No More Targets};#IF (@full_inv = 1) {drop all;#WAIT 2000;sacr all}}
#TRIGGER {^They aren't here.$} {doscan}
#CLASS 0
#CLASS {auto_kill|support} {disable}
#TRIGGER {  (*) ~(%d~)%s-- Right Here$} {#VAR to_kill {%1};did_scan = 1}
#TRIGGER {  %w*%w%s-- * to the (%w)$} {next_direction = %1;did_scan = 1}
#TRIGGER {^~[H:%d~] ~[M:%d~] ~[S:%d~] ~[E:%d~]} {#CLASS "auto_kill|support" 0;#IF (%class( auto_kill|main) = 1) {auto_kill}} "" {nocr|prompt}
#TRIGGER {  (%w)(%*)(%w)%s-- Right Here$} {#VAR to_kill {%1%2%3};did_scan = 1}
#TRIGGER {  %w*%w ~(%d~)%s-- * to the (%w)$} {next_direction = %1;did_scan = 1}
#CLASS 0


Look it over, youll havta change some patterns,
like the prompt one "{^~[H:%d~] ~[M:%d~] ~[S:%d~] ~[E:%d~]}" to match your prompt

the scan message twice "You scan over your surroundings..."

and the kill list: kill_list = {mob1|mob2|mob3}, the script assumes 2 or 3 word names in scan, with or without the number of mobs "a barbarian (2)" and also assumes the last word of the name is the kill word, "barbarian"
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