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


Joined: 06 May 2002
Posts: 0
Location: USA

PostPosted: Thu Apr 04, 2002 8:51 pm   

warzone help
 
ok, I'm in need of a pretty simple script for the warzone in the MUD I'm playing. I know a brute way to do it with straight triggers and variables, but I need it to be quick (I already have a horridly slow connection so I need some edge).

Input is as follows:

south : dummy
far south : dummy
Immediate Area : dummy

this continues for all directions (only n,s,e,w,u,d). The only one capitalized is the Immediate area one. What I need is to be able to scan (which gives the input seen above) and to there location and perform an action (say backstab). This is not a pkill mud and is only used for wz action, so I need to be able to set the script to different characters quickly, and turn it off just as quickly.

Can anyone help?





Err.. what happens if I press THIS button? Oops.
Reply with quote
deberiha
Newbie


Joined: 06 May 2002
Posts: 0
Location: USA

PostPosted: Thu Apr 04, 2002 8:54 pm   
 
ok, there should be spaces between south and the colon and far south and the colon. The length of all of these should be exactly the same, IE dummy should be in the same exact place on all of the inputs (so add spaces after south and far south accordingly).

Err.. what happens if I press THIS button? Oops.
Reply with quote
heidi
Newbie


Joined: 04 May 2002
Posts: 1

PostPosted: Thu Apr 04, 2002 9:57 pm   
 
I'm a bit confused what you want to do. Does the following get close?

#var Directions {n|north|s|south|e|east|w|west|u|up|d|down}
#alias {AutoHunt} {#Class AutoHunt 1;#Var Target %1;#Var Action %2}
#alias {NoHunt} {#Class AutoHunt 0}
#trigger {^Immediate Area%s:%s@Target} {#Class AutoHunt 0;@action @target} AutoHunt
#trigger {^({@Directions})%s:%s@Target} {%1} AutoHunt
#trigger {^Far({@Directions})%s:%s@Target} {%1} AutoHunt

These scripts will hunt down a single target and start the action against it. Now, there are issues if the target is shown in multiple directions. e.g.:

north : Troll
south : Troll
far south :
Immediate Area : Troll

In this case the scripts will send "north", then "south" then "backstab troll". Before we get into how to get around this, does the script do what you wanted in general?

El_Dickman
Reply with quote
deberiha
Newbie


Joined: 06 May 2002
Posts: 0
Location: USA

PostPosted: Thu Apr 04, 2002 10:20 pm   
 
basically yes, I want to hunt down and perform an action <backstab>, there is not chance of a single character being in two places at once (none of the warzones are maze types). I'd also like it to be a class so I can have an alias to run it on/off easily...

Err.. what happens if I press THIS button? Oops.
Reply with quote
deberiha
Newbie


Joined: 06 May 2002
Posts: 0
Location: USA

PostPosted: Thu Apr 04, 2002 10:24 pm   
 
also, to change the target, would I have to use the aliases like TARGET=dummy, ACTION=backstab for this to function correctly?

Err.. what happens if I press THIS button? Oops.
Reply with quote
heidi
Newbie


Joined: 04 May 2002
Posts: 1

PostPosted: Thu Apr 04, 2002 11:10 pm   
 
Sounds like we are pretty close here. If your target is unique and can't show up in the list multiple times then the code I wrote should do a pretty good job.

To start hunting you would enter the command:

AutoHunt [Target] [Action]

To stop you enter:

NoHunt


Also, you could change the alias to:

#alias {AutoHunt} {#Class AutoHunt 1;#if ("%1" <> "") {#Var Target %1};#if ("%2" <> "") {#Var Action %2}}

and you could set the Target and Action variables directly and call AutoHunt without parameters to turn on the class.

Naturally, you can change the names to whatever you wanted, augment them with other aliases, etc. If you wanted to toggle in and out of hunting you could assign the aliases to function keys and use the variables to control the target and action.

Hope that helps,

El_Dickman
Reply with quote
deberiha
Newbie


Joined: 06 May 2002
Posts: 0
Location: USA

PostPosted: Fri Apr 05, 2002 5:36 am   
 
nod, works pretty much as expected (had to make a couple changes, but its mostly just surface stuff like number of spaces) thanks for all your help!

Err.. what happens if I press THIS button? Oops.
Reply with quote
deberiha
Newbie


Joined: 06 May 2002
Posts: 0
Location: USA

PostPosted: Fri Apr 05, 2002 9:27 pm   
 
well, thats great, they've put in an area with multiple targets (aka same person is north and south at the same time), how do I get around this?
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 873
Location: USA

PostPosted: Fri Apr 05, 2002 9:48 pm   
 
quote:

well, thats great, they've put in an area with multiple targets (aka same person is north and south at the same time



I assume your difficulty is that both direction triggers fire when you see someone in two places.

Can you just turn off the directional triggers when you see the first direction that works, and then turn it back on again next time you look around to see where your enemies are?

-Tarn
Reply with quote
deberiha
Newbie


Joined: 06 May 2002
Posts: 0
Location: USA

PostPosted: Fri Apr 05, 2002 9:53 pm   
 
hrmm... how do I turn off database after first direction is used? (I've read the help files, but I think I should read again, I'm still a total newbie to scripting)

Err.. what happens if I press THIS button? Oops.
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 873
Location: USA

PostPosted: Fri Apr 05, 2002 10:05 pm   
 
quote:

hrmm... how do I turn off database after


Take a look at the "#T -" command. (Also #T + to get it going again).

-Tarn
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