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


Joined: 11 Mar 2007
Posts: 2

PostPosted: Sun Mar 11, 2007 7:42 am   

Script to check alive npcs... should be easy, help?
 
Ok, so basically i'm useless witht he coding of Zmud, and believe me, I have tried :S.

What i'm trying to do is send commands to the mud to scry certain npcs. This will then determine weather they are alive or dead and worthwhile for me to go check/kill or not.

So lets say it's something like this (very different, but gives general idea):

scry rogue
scry giant
scry beast

etc etc. And for some the mud will output "cannot find target" (dead targets), and some it will output "rogue is at such and such" (hence alive). Trouble is when there's 20 off locations this can be a pain. Is it possible to put it into a script so I can scry all of them, then make it so any that get the response of being alive will be showed to me in say or something nicely structured so I can do a quick scan and see what is alive to kill?

Sorry I just have no idea how to do it is all! :(. It should be a simple sort of substitution idea like colour triggers use I guess, I dunno!

Anyways, someone help if you can please :D

Entity
Reply with quote
Numb3r
Newbie


Joined: 11 Mar 2007
Posts: 5

PostPosted: Sun Mar 11, 2007 11:13 am   
 
Hmm, you could do this in plenty of more ways than one.

For one, try gagging the dead target text.

Code:
#ALIAS {scryall} {scry rogue;scry giant;scry beast}
#TRIGGER {(%w) is dead or whatever your MUD says.} {#GAG}


If that doesn't look pretty enough, you could, as you said, color code the alive target text.

Code:
#ALIAS {scryall} {scry rogue;scry giant;scry beast}
#TRIGGER {(%w) is at} {#COLOR high,red}


The #COLOR would color the entire line, not just the triggered text.

For more elegant solutions, I'm sure someone else will come up with a way better method than the one I'm thinking of.
Reply with quote
Entity
Newbie


Joined: 11 Mar 2007
Posts: 2

PostPosted: Mon Mar 12, 2007 3:58 am   
 
Yeah the idea above seems what i'm after, but then someone way to print all the ones alive into a say so that it can be viewed easily? Used in grouping, etc.
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Mon Mar 12, 2007 4:05 am   
 
show us the output test from the mud and i can help.
Reply with quote
Fatal_Exception
Newbie


Joined: 25 Oct 2004
Posts: 3

PostPosted: Tue Mar 13, 2007 12:03 pm   
 
This is a more advanced way of doing it.

'scryAll' will scry each name listed in the variable @scrylist (each one separated by a pipe ( | ) symbol).

The trigger will pick up each npc that is alive and add it to the list of alive targets stored in @scryTargetsAlive.

'showAlive' and 'sayAlive' will print the list onscreen for you, and say it out loud in your MUD, respectively.

This is a best guess from the information you have provided. The 'say' command in sayAlive might need adjusting to conform with the say command for your MUD.

Code:
#VAR scryList {rogue|giant|beast}
#VAR scryTargetsAlive {}

#ALIAS scryAll {#VAR scryTargetsAlive {}; #FORALL @scryList {scry %1}}

#ALIAS showAlive {#SHOW Scry Targets Alive:; #FORALL @scryTargetsAlive {#show %i}}
#ALIAS sayAlive {say Scry Targets Alive: %expandlist( @scryTargetsAlive, " ")}

#TRIGGER {(%w) is at} {#ADDITEM scryTargetsAlive %1}


You could combine this with gag commands to hide the actual scry, and just record the results
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