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
ronen
Beginner


Joined: 07 Aug 2005
Posts: 18

PostPosted: Fri Jan 05, 2007 5:05 pm   

a variable question
 
is it possible to make a variable for a list of monster like rabbit,dog,cat,crow etc... so when i type "Kill" it puts "Kill [monster]" and also finds the monster in the room to replace the variable with the correct monster in the room. if so please someone show me how thanks
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4672
Location: Pensacola, FL, USA

PostPosted: Fri Jan 05, 2007 5:31 pm   
 
#VAR monster {rabbit|dog|cat|crow|ect}

#TR {({@monster})} {#SUB {<send 'kill %1'>%1</send>}}

that should turn them into a clickable link that kills
_________________
Discord: Shalimarwildcat
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Fri Jan 05, 2007 5:43 pm   
 
Kind of.... in the general way that everything -can- be done. You need a way to capture the list of mobs in the room, and then you can make a string lists of mobs you want to attack, and have it so that it'll go through the list of things you want to attack and see if it can match any of those words in the list of mobs in the room and then automatically use that one....

However, some foreseeable problems... 1) If you get a list that is something like: A rabbit is dead here. A dog is here. Then it would (as described) keep attempting to kill the rabbit. If you can set up some other script to automatically remove dead things and -then- capture the list of what's there, that would fix it. 2) You will have to update the list of what's (alive) in the room every time something enters/exits or is killed.

Maybe if you post more information about the game you play and what things look like then you can get more help.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Jan 05, 2007 7:34 pm   
 
Shalimar's way is the best way to do what you're after - just change the monster list to whatever you want the script to automagically pick up as monsters.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
ronen
Beginner


Joined: 07 Aug 2005
Posts: 18

PostPosted: Fri Jan 05, 2007 10:48 pm   
 
ok i play "Bat Mud" and when you enter a room with a monster the letters are bright green and it will say something like this "A large kobold is wielding a trident and looking for trouble" and you would have to type kill kobold but the mobs description is not always the same

Obvious exit is: west.
a hideous and hostile creeper
Hp:847/858 Sp:15/15 Ep:252/252 >
You probably mean 'look at something' or what?
Hp:847/858 Sp:15/15 Ep:252/252 >
The creeper is frustratingly agile for a big toad.
Creeper misses you.
You bump Creeper mutilating intestinal tissue.
You cut Creeper causing heart tissue to fly everywhere.
Creeper's bash sends you sprawling.
Creeper misses you.
You thump Creeper causing heart tissue to fly everywhere.
Because of the low amount of unidle players you receive some additional
experience for your kill.
You hear the horrendous death-cry of the Creeper as it dies.
Creeper is DEAD, R.I.P.
hp: 842 (858) [-5] sp: 15 (15) [] ep: 252 (252) cash: 15401 [] exp: 7455 [+4219]
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Sat Jan 06, 2007 2:22 am   
 
Completely untested and therefore no guarantees. You need to add the things to the monsters variables that you want it to match. It might also not work if your prompt changes or if the exits line changes... Let me know how it breaks.
Code:
#ALIAS kill {#if !%null( %1) {#send {kill %1}} {#if !%null( @klist) {#send {kill %pop( klist)}} {#show {Nothing on the list to kill.}}}}
#VAR monsters {creeper|rabbit|dog|cat|crow|etc}
#VAR klist {} {}
#TRIGGER "mob.kill.prompt" {^Hp:} {
  #t- "mob.kill.parser"
  #t- "mob.kill.prompt"
  }
#TRIGGER "mob.kill.parser" {({@monsters})} {klist = %additem( %1, @klist)}
#TRIGGER {^Obvious exit} {
  klist = %null
  #t+ "mob.kill.prompt"
  #t+ "mob.kill.parser"
  }
Reply with quote
ronen
Beginner


Joined: 07 Aug 2005
Posts: 18

PostPosted: Sat Jan 06, 2007 3:23 pm   
 
for some reason i can't get variables to work correctly, I put the right information into the box its just not working at all im using V 7.21 any clue why? also is there a way to copy this script in zmud with out having to make a variable and trigger for all of them?

also this is what it keeps doing with that script


Obvious exits are: nw, n, ne, w, e, sw, s and se.
a happy brown pigeon
a thin purple pigeon
a thin spotted pigeon
Hp:865/865 Sp:15/15 Ep:255/255 >
Nothing on the list to kill.
Nothing on the list to kill.
Nothing on the list to kill.
# # Cobblestone paths cross the central square from north to
#.#/#.# south and east to west. Few benches are placed in the
....... middle of the square around the old stone well. Small trees
#.&@&.# and green brushes line the paths giving the square a warm
#.p&p.# park-like feeling.
#.ppp.#
.....

Obvious exits are: nw, n, ne, w, e, sw, s and se.
a happy yellow pigeon
a happy grey pigeon
a happy purple pigeon
Hp:865/865 Sp:15/15 ENothing on the list to kill.
Nothing on the list to kill.
Nothing on the list to kill.
p:255/255 >
#. # Cobblestone paths cross the central square from north to
##.#/#. south and east to west. Few benches are placed in the
....... middle of the square around the old stone well. Small trees
#.@&&. and green brushes line the paths giving the square a warm
#.p&p. park-like feeling.
#.ppp.
.....

Obvious exits are: nw, n, ne, w, e, sw, s and se.
a happy yellow pigeon
Hp:865/865 Sp:15/15 Ep:255/255 >
Nothing on the list to kill.
#.#/# Cobblestone paths cross the central square from north to
...... south and east to west. Few benches are placed in the
#.&&&. middle of the square around the old stone well. Small trees
#.@&p. and green brushes line the paths giving the square a warm
#.ppp. park-like feeling.
......
#.###

Obvious exits are: nw, n, ne, w, e, sw, s and se.
Hp:865/865 Sp:15/15 Ep:255/255 >
Pigeon struts from northeast.
Nothing on the list to kill.
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Sat Jan 06, 2007 4:26 pm   
 
You should be able to simply copy the whole thing, paste it into the command line, and hit enter--and that should set up all of the triggers and aliases and whatnot.

In your example, are you entering "kill"? (I cannot see any user input at all but I may be overlooking it.) Did you add "pigeon" to the @monsters list?
Reply with quote
ronen
Beginner


Joined: 07 Aug 2005
Posts: 18

PostPosted: Sat Jan 06, 2007 4:48 pm   
 
yeah i did all that but when i copy and past it only makes the aliase for the kill commands and does not make all the other triggers also varriables is not working

so i have no clue what is up
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Sat Jan 06, 2007 8:10 pm   
 
Make sure you go to Show > All in the settings editor.

Does it give you any kind of feedback when you copy-paste all of it into the command line and press enter?
Reply with quote
ronen
Beginner


Joined: 07 Aug 2005
Posts: 18

PostPosted: Sat Jan 06, 2007 9:59 pm   
 
it just does not make all the commands or triggers the whole script stays in the aliase commands

EXMPLE: Aliase; kill

all the variables and stuff stay in that window even when i press save
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Mon Jan 08, 2007 4:27 am   
 
It is normal for everything to still be on the command line, but highlighted, after you press enter (same as if you enter north and enter then it will highlight north but still be avaliable so that you can just hit enter again to go north again).

However, I cannot recreate the problem you're describing. The commands I pasted were copied directly from ZMud so I haven't got any missing braces or anything and when I copy them back to a different profile it all sets up correctly.

Have you perhaps changed your command character in the options?

Are you able to manually set other #VARs and #TRIGGERs via command line?
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