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


Joined: 12 Dec 2002
Posts: 2

PostPosted: Thu Dec 12, 2002 3:07 am   

Trigger help
 
I need some basic info regarding triggers.. let say i play a mud (tele-arena) that let you attack each of your attack, so let say it says:

Your attack hit the apollyon dragon for 34 damage!

5 times.. how would i capture each damage value, and add them together to show the sum of them? Or let say display them to show friends a round of attack on a single line, cause right now i'm learing zmud, and it's pretty simple and complicated for complex stuff.. so right now i only have a pattern of Your attack hit the apollyon dragon for (%d) damage! and in the command %1, that's all.. how would i either put them on a single line, and/or show the sum of all the attack (i wanna do both..)

And i'm also trying to do an arena script (if you know tele-arena) which would ring a monster in when it's empty, attack the current monster when there is one, go heal myself when i'm lower than a value specified of hp, and at the same time keeping track of the hp... etc...

Another things i thought, how could i substract two values, let say i check my exp before a round, and after one, to tell how much i made.. but i guess if you can answer my damage question i'll be able to figure this one out!

Thanks for your time and info!

Pierre-Andre
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Dec 12, 2002 4:07 am   
 
#TR {Your attack hit * for (%d) damage} {#ADD damage %1}
#TR {some message that indicates you've reached the end of the round} {say I just hit that thing for a total of @damage damage!;#VAR damage 0}
#TR {some message that indicates the arena is empty} {ring a monster in}
#TR {some message that shows there's a (*) here} {attack %1} // * = current monster's name
#TR {message that shows your (%d) hitpoints(prompt maybe?)} {#VAR hp %1;#IF (%1 < 34) (go heal}} //number of your choice which indicates low hp's.

There you go. Just change the phrases and commands to match your MUD. Here's the basic info on triggers:
#TR {identifiable text pattern} {action to take when that pattern shows up}

LightBulb
Senior Member
Reply with quote
pleclair
Newbie


Joined: 12 Dec 2002
Posts: 2

PostPosted: Thu Dec 12, 2002 4:51 am   
 
Ok i tried what you told me, it worked.. but on the game i play, there are no end of round, the end of round is when you attack with your last attack. So if you got 5 attack, you are resting for 15 seconds after the next one. So for the damage counter, i made it work like this, after my 5th attack, i say end of round, and that's the trigger for it. It seems to work fine.. but for the arena script, it's complicated, cause when you ring a monster in, you are 5 seconds resting, then you can attack, and must attack if you want to leave, or it says cannot leave in the heat of battle.. so you must attack a round to go heal. and there is no prompt in this game.. only the room description.. and since in every room there is a line that say there is no one here, (i tried to made a little sets of trigger to automate the arena, didn't worked) zmud catches every no one here and when you get back in the arena and even if there is a monster in, since the room before zmud saw no one, well, it's gonna ring another one.. i found a small workaround but it's not perfect.. with states.. i got a trigger You are in the arena. then next state is There is no one here. but when i leave the arena, it's gonna say ring gong, since he saw You are in the arena, and in the next room he sees There is no one here. Not that it matters much.. but here is what i did

I put a tick timer at 23 seconds, (the round is 15 but since in this game, if you move too fast, based on your agility, you can trip and fall, so did another trigger state with each room on the path to the temple. not very quick tho, hence the 23 seconds) so right now every 23 seconds, the character goes to the temple, heals himself, go back in the arena, then there are trigger to check if there is a monster, if yes, attack 5 times this one.. after the tick timer, he goes back to the temple, heals himself again, and so on, until he comes back no one here, ring another one.. but then, when i ring, it says monster's name appears in a puff of thick black smoke.. then i have a trigger for that, which #ALARM+5 my attack so +5 +15 for my resting time, =20.. and i have a tick at 23 to go heals.. but with lags, it's not perfect, and i died twice using it.. to go heal myself every 23 seconds, i issue a timeout command, like HEAL!! then a trigger gets it and does the routine to heal.. not very optimized and not very safe indeed.. i found a way to make my character heals when he's lower than a number like you told me, i put health at the end of my attack to check my health, and it's working.. but what if i'm resting? and the character cannot move yet.. it's not gonna work, it's gonna send me to the temple to heal, but i wont cause i wont be able to move.. there is the problem, how can i set zmud that if i can't move try again in let say a second? and it wouldn't be complete.. the character have to eat too, and buy potions.. but we'll begin with that! :) hint.. when my potions of str is finished, it says an odd tingling sensations washes over you.. then i could trigger on that and go buy potions, but what if i'm resting.. like i'll probably always be.. it's a catch isn't it?

Thanks a great deal for your help, it is indeed appreciated!

Pierre-Andre
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Dec 12, 2002 6:13 pm   
 
These long-winded descriptions make it very difficult not only to figure out what you are doing, but even to figure out what your questions are. Why don't you try posting the actual text received from the MUD, the actual commands used by the MUD, and the actual triggers, aliases, alarms, etc. that you are using? That way, answers won't have to use made-up things like "some message that indicates the arena is empty" and "your attack command".

I might also add that it sounds like you are trying to create a "bot" to do the arena. A bot is a script which will do everything without you ever having to touch a key, or even look at the screen. However, as you've discovered, they are long, complex, and difficult to get right. In other words, they are VERY ADVANCED scripts. For now, you should probably concentrate on simpler tasks while you learn how to use the scripting language.

LightBulb
Senior Member
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