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
Ash
Novice


Joined: 17 Nov 2000
Posts: 31
Location: USA

PostPosted: Sun Sep 15, 2002 8:03 am   

Dificult Prob
 
This is a pretty complicated problem and dont expect anyone to really have an answer. But what im trying to do is keep track of all the spells on me, so that I can easily let others know what I have and what I dont. I multi-play so it get tedious to constantly switch screens and try to let others know what you need. So what im trying to do is create some sort of list that I can just type showspells, and it'll echo the spells I got on my tank to my other screen, as well as gt (group-talk) it to the group. Im thinkin you could keep track of when the spells go on and off of you with a trigger.

You feel your skin begin to harden.
#VAR magic-vest on
You sense the magical armor wearing off.#VAR magic-vest off

Though this might mess up occassionaly it might be good to be able to recalibrate it by using the magic command which tells you waht spells you have on you. This is what the command shows. The problem with the magic command is sometimes it'll show the spell more than once on it, not really sure why it does this. Its also not that neat as you add spells some might move location up or down a line. So it may not be possible to recalibrate with the magic command.

Affecting spells:
shield shield faith magic vestment


I think as the spells are on it could add to a variable list, which then would be able to be shown. #ECHO %expand @spellson

This would also help, because I have a macro to spell up (F12). Sometimes the spells wear at different moments and would be useful to hit the F12 key and not try recasting the spells that are already on.
Instead it would just recast the spells that are off or gone.

Hope this is clear, im really confussed and prob about to give up on it. But if it is possible, some hints or help would be awesome. Thanks.

-Ash
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Sep 15, 2002 4:05 pm   
 
Yes, you can use variables and triggers to track your spells. Since you want to echo these to yourself and over gt, a list would probably be better than individual variables. To "recalibrate", use an alias and another set of triggers.
#AL recalibrate {#VAR affects %null;#T+ affects;magic}
#CLASS affects disable
#TR {Affecting spells:} {#VAR affects-flag 1 0}
#TR {shield} {#ADDITEM {affects} {shield}}
#TR {faith} {#ADDITEM {affects} {faith}}
#TR {magic} {#ADDITEM {affects} {magic}}
#TR {vestment} {#ADDITEM {affects} {vest}}
#TR {$} {#IF (@affects-flag) {#T- affects;#VAR affects-flag 0}}
#CLASS 0
#AL {showspells} {#VAR spells %null;#FORALL @affects {#IF (@spells) {#VAR spells {@spells, %i}} {#VAR spells {%i}}};#ECHO {Spells: @spells};gt Spells up: @spells}


The final trigger looks for a blank line following the list of affects. You may need or prefer to trigger on the prompt instead. What is needed is something that indicates you've reached the end of the list.

You only told us the name of one spell, I took guesses at some others from your affects list. Modify to suit yourself.

LightBulb
Senior Member
Reply with quote
Ash
Novice


Joined: 17 Nov 2000
Posts: 31
Location: USA

PostPosted: Mon Sep 16, 2002 3:48 am   
 
Awesome seems to work great, but when a spell fades or gets dispelled how would I make it so that spell is removed from the list. I sapose I would have to use a trigger with the DELITEM. And also how would I make it add the spell, when it is casted on me. Agian I think a trigger would be needed and the ADDITEM im assuming here.

<I>Heres what i'll see when magic-vestment is casted on me.</I>
<B>You feel your skin begin to harden.</B>
Heres what i'll see when it fades or is dispelled.
<B>You sense the magical armor wearing off.</B>

Thanks Tons.

-Ash
Reply with quote
Ash
Novice


Joined: 17 Nov 2000
Posts: 31
Location: USA

PostPosted: Mon Sep 16, 2002 3:52 am   
 
Oh, I just realized this, but since these are triggers, how would I make it so that when someone says shield or sanctuary it wouldnt add it into my list. IS this what the class affects is for to put all those triggers in them. Thanks.

-Ash
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Sep 16, 2002 5:50 am   
 
Indeed Lightbulb is using a class folder "affects" which turns on/off when it sees the affects trigger/empty line.

Exactly, what you'll need to do is make triggers like:

#TRIGGER {You feel your skin begin to harden.} {#ADDITEM {affects} {magic vestment}}
#TRIGGER {You sense the magical armor wearing off.} {{#DELITEM {affects} {magic vestment}}



As it appears that the "magic vestment" is one thing and not 2, I revised his work:#AL recalibrate {#VAR affects %null;#T+ affects;magic}
#CLASS affects disable
#TR {Affecting spells:} {#VAR affects-flag 1 0}
#TR {shield} {#ADDITEM {affects} {shield}}
#TR {faith} {#ADDITEM {affects} {faith}}
#TR {magic vestment} {#ADDITEM {affects} {magic vestment}}
#TR {vestment} {#ADDITEM {affects} {vest}}
#TR {$} {#IF (@affects-flag) {#T- affects;#VAR affects-flag 0}}
#CLASS 0
#AL {showspells} {#VAR spells %null;#FORALL @affects {#IF (@spells) {#VAR spells {@spells, %i}} {#VAR spells {%i}}};#ECHO {Spells: @spells};gt Spells up: @spells}



Ton Diening
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