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


Joined: 11 Jun 2002
Posts: 10
Location: USA

PostPosted: Tue Jun 11, 2002 2:47 am   

Spell queuing
 
Second time in one day I'm running into problems, hehe. Lets try this one too, I have the basic idea though.

I want to make a bot to spellup clannies, but I do NOT want it casting if im currently chanting a spell. So I was going to do this.

Evangelist tells the group ':armor'
%w tells the group ':%w'
command would be c '%2' %1

You cast the spell for 24 mana. Thats what I see when I cast a spell succussefully.

You cast the spell for %d mana.

Here my problem, I want the one for you cast the spell for blah mana to be in a class called GroupCastSuccess and the one for soando tells the group ':spell' to be in a class called GroupCast

Which left me with

%w tells the group ':%w'
c '%2' %1
T+ GroupCastSuccess

and

You cast the spell for %d mana.
T+ GroupCast
T- GroupCastSuccess

I don't know how to make say a new class folder with zmud 6.15. On previous versions I know you could just click on the trigger and type in a class name, but all I seem to be able to do in this version is click on the class dropdown box and choose an existing class, I cant name it one that does not exist.

Could I get some help with this please, maybe just syntax how to make the trigger in a class folder.

I did try:
#TRIGGER {%w tells the group ':%w'}{C '%2' %1;T+ GroupCastSuccess}{GroupCast} but tthat didnt work, i also tried :
#TRIGGER {%w tells the group ':%w'}{C '%2' %1;T+ GroupCastSuccess}{}{GroupCast}

both of these were suggestions from other people and neither have worked, and I am unable to figure it out on my own, I would appreciate any help.

Pr0fiT
www.phidar.com
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Jun 11, 2002 2:58 am   
 
You have the basic idea. Here is a limited concept which has the basics of your idea:

#TRIGGER {^(%w) tells the group ~'~:(%w)~'} {#ADDITEM V_Spell_Queue {C ~'%2~' %1};#T+ GroupCastSuccess;#IF (!@V_Bot_Casting) {%item(@V_Spell_Queue,1);#VAR V_Bot_Casting 1}} "GroupCast"
Makes a queue list called V_Spell_Queue. If you aren't emptying that queue (@V_Bot_Casting is 1)
then it will cast the first item and start the process.


#TRIGGER {^You cast the spell for %d mana.} {#IF (%items(@V_Spell_Queue) > 1) {#DELITEM V_Spell_Queue %item(@V_Spell_Queue,1);%item(@V_Spell_Queue,1)} {#VAR V_Bot_Casting 0;#VAR V_Spell_Queue "";#T- GroupCastSuccess}} "GroupCast|GroupCastSuccess"
If the queue list @V_Spell_Queue isn't empty then it deletes the last casted spell
and casts another. When the list gets empty it declares the queue empty (@V_Bot_Casting 0)
and turns off looking for the success message when you cast.


#T- GroupCastSuccess
Turn off that class so it starts disabled when you enter the 2 triggers into the command line

That should give you the rudiments. Not tested but seems ok.

Limitations will be that
a) you can't queue up 2 spells of the same type as I'm using #ADDITEM.
Some muds let you have 2 bless's casted upon yourself. However this stops
the panic'ing fool who spams you with repetitious crap.
b) it assumes all people grouped are friendly and you will cast upon them
c) there is no prioritizing in the queue. The main tank has no priority over the
wussy magic user who doesnt get hit but wants defensive protective spells anyhow.
d) there is no logic for who gets what and under what conditions
e) all bot casted spells are 1 word as we are using %w to capture the spell
f) all group members name is 1 word and their requests are always on a newline.
g) if you manually cast a spell during the emptying of the spell queue, it will think
it belonged to the spell request in the queue

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