|
nazradin Apprentice
Joined: 23 Mar 2003 Posts: 114 Location: New Zealand
|
Posted: Tue Jun 03, 2003 5:35 am
using variable information question |
i use as a master spellup
#CLASS {SpellupMaster}
#ALARM {*1} {#IF (%numitems( @spellup) AND (@castRT = 0)) {
%item( prep @spellup, 1)
cast
#DELN spellup 1
}}
#CLASS 0
which makes it easy to change the spellup variable string
such as
#ALIAS spellrefresh {spellup = 425|430|920}
the first didget of each number is the sphere of the spell, the next to didgets are the spell rank which equates to mana cost
i want to add an argument to the master spell up that will make sure i have enough mana to cast spell or pause untill i do
something like AND (#if @mana > (%n))
where %n is the last two didgets of current spellup var
but i am not sure how to extract the last two didgets from the varible.
is it possible?
thanks Nazradin |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Tue Jun 03, 2003 11:57 am |
First, the line that says:
%item( prep @spellup, 1)
should be:
prep %item(@spellup, 1)
Now, to get the last two digits of the number, use the %rightback function. Example:
#IF (%numitems( @spellup) AND (@castRT = 0) AND (@mana > %rightback(%item(@spellup, 1), 2))) {do stuff}
Kjata |
|
|
|
nazradin Apprentice
Joined: 23 Mar 2003 Posts: 114 Location: New Zealand
|
Posted: Tue Jun 03, 2003 5:50 pm |
thanks Kjata
it was working with the incorrect formatting , thanks for the correction though.
here is what i have now, the temp is due to not all my characters that use this have a 0 second prep time , and spell ready is universal message, yet after casting the first spell it is not slowing down, repeatably tries to cast the next variable even when @castRT is in effect, i also tried putting an #alarm +3 at end after the delN but that did nothing, Am i missing a set of brackets or do i need to put another alarm in some where, they syntax is correct just need to get it to obey the IF arguments, I have yet to test if it holds when mana is not enough to cast a spell until,l i get basic operation working
thanks Nazradin
#CLASS {SpellupMaster}
#VAR castRT {0}
#VAR castRTmax {3}
#TRIGGER "castRTtrig" {Cast Roundtime (%d) Seconds.} {
#var castRT {%1}
#var castRTmax {@castRT}
}
#COND {} {
#add castRT (-1)
#if (@castRT<@castRTmax) {#if (@castRT>0) {#state castRTtrig (1)}} {#state castRTtrig (0)}
} {wait|param=1000}
#ALARM {*1} {#IF (%numitems( @spellup) AND (@castRT = 0) AND (@mana > %rightback( %item( @spellup, 1), 2))) {
%item( prep @spellup, 1)
#temp {Your spell is ready.} {
cast
#DELN spellup 1
}
}}
#CLASS 0
>prep 601
You make a simple motion, quietly invoking the Natural Colors spell...
Your spell is ready.
cast
>prep 601
You gesture.
You seem to blend into the surroundings better.
Cast Roundtime 3 Seconds.
(Forcing stance down to guarded)
>
Wait 2 sec.
>exp
Exp Change: 25 Exp Until: 15967
>prep 601
You make a simple motion, quietly invoking the Natural Colors spell...
Your spell is ready.
cast
cast
>
You gesture.
You seem to blend into the surroundings better.
Cast Roundtime 3 Seconds.
>
You don't have a spell prepared! |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Tue Jun 03, 2003 8:24 pm |
Try giving the alarm an ID. Disable it right after creating the temporary trigger and enable it again when you recieve the message that you have a roundtime.
Kjata |
|
|
|
nazradin Apprentice
Joined: 23 Mar 2003 Posts: 114 Location: New Zealand
|
Posted: Thu Jun 05, 2003 3:15 pm |
quote:
Try giving the alarm an ID. Disable it right after creating the temporary trigger and enable it again when you recieve the message that you have a roundtime.
Kjata
I think you mean something like the below but i am not sure. The Temp Trigger forms totally seperate from the alarm? or do i need to make a trigger out side the alarm pattern so it doesnt turn itslef off?
#ALARM "spellmasteralarm" {*1} {#IF (%numitems( @spellup) AND (@castRT = 0) AND (@mana > %rightback( %item( @spellup, 1), 2))) {
%item( prep @spellup, 1)
#temp {Your spell is ready.} {{#T- SpellupMaster|spellmasteralarm;cast;#T+ SpellupMaster|spellmasteralarm;
#DELN spellup 1
}
}} |
|
|
|
nazradin Apprentice
Joined: 23 Mar 2003 Posts: 114 Location: New Zealand
|
Posted: Thu Jun 05, 2003 5:00 pm |
I couldnt work out how to just turn of the alarm , it kept creating a class folder
tried T- SpellupMaster|spellmasteralarm [trigger]
with and with out the [trigger] on the end.
so i put alarm in a sub folder
still haveing same troble with it not slowing down
#CLASS {SpellupMaster}
#VAR castRT {0}
#VAR castRTmax {3}
#TRIGGER "castRTtrig" {Cast Roundtime (%d) Seconds.} {
#var castRT {%1}
#var castRTmax {@castRT}
}
#COND {} {
#add castRT (-1)
#if (@castRT<@castRTmax) {#if (@castRT>0) {#state castRTtrig (1)}} {#state castRTtrig (0)}
} {wait|param=1000}
#CLASS 0
#CLASS {SpellupMaster|spelluptriggeralarm}
#ALARM "spellmasteralarm" {*1} {#IF (%numitems( @spellup) AND (@castRT = 0) AND (@mana > %rightback( %item( @spellup, 1), 2))) {
%item( prep @spellup, 1)
#temp {Your spell is ready.} {
#T- SpellupMaster|spelluptriggeralarm
cast
#T+ SpellupMaster|spelluptriggeralarm
#DELN spellup 1
}
}}
#CLASS 0
>prep 601
You make a simple motion, quietly invoking the Natural Colors spell...
Your spell is ready.
cast
>
You gesture.
You seem to blend into the surroundings better.
Cast Roundtime 3 Seconds.
>
Gaoi asks, "Not too bad. You?"
>prep 601
You make a simple motion, quietly invoking the Natural Colors spell...
Your spell is ready.
cast
>Gaoi glances at Torlain.
>prep 606
You gesture.
You seem to blend into the surroundings better.
Cast Roundtime 3 Seconds.
>
>
Wait 2 sec.
>prep 606
You make a simple motion, quietly invoking the Phoen's Strength spell...
[Spell preparation time: 10 seconds]
>prep 606
You already have a spell readied! You must RELEASE it if you wish to prepare another!
>prep 606
prep 606
You already have a spell readied! You must RELEASE it if you wish to prepare another!
>You already have a spell readied! You must RELEASE it if you wish to prepare another!
>prep 606
You already have a spell readied! You must RELEASE it if you wish to prepare another!
>prep 606
You already have a spell readied! You must RELEASE it if you wish to prepare another!
>prep 606
>You already have a spell readied! You must RELEASE it if you wish to prepare another!
>prep 606
You already have a spell readied! You must RELEASE it if you wish to prepare another!
>prep 606
Torlain murmurs a simple, mystical chant...
>
You already have a spell readied! You must RELEASE it if you wish to prepare another!
>prep 606
You already have a spell readied! You must RELEASE it if you wish to prepare another!
>prep 606
cast
prep 606
Your spell is ready.
cast
cast
cast
cast
cast
cast
cast
cast
cast
cast
cast
cast
cast
You already have a spell readied! You must RELEASE it if you wish to prepare another!
You gesture.
Your body suddenly fills with a warm strength.
Cast Roundtime 3 Seconds.
>Torlain's right leg looks better.
Wait 3 sec.
>
You don't have a spell prepared!
>
Sorry, you may only type ahead 2 commands.
Sorry, you may only type ahead 2 commands.
Sorry, you may only type ahead 2 commands.
Sorry, you may only type ahead 2 commands.
Sorry, you may only type ahead 2 commands.
Sorry, you may only type ahead 2 commands.
Sorry, you may only type ahead 2 commands.
Sorry, you may only type ahead 2 commands.
Sorry, you may only type ahead 2 commands.
You don't have a spell prepared!
You don't have a spell prepared!
You don't have a spell prepared!
>
> |
|
|
|
nazradin Apprentice
Joined: 23 Mar 2003 Posts: 114 Location: New Zealand
|
Posted: Sun Jun 08, 2003 5:23 pm |
ok getting better
have what seems to be a working version now
doesnt do the mana check though, or is taking @mana as the value when the script begins
do i need to add another set of % to some of the variables to allow for passing
#CLASS {SpellupMaster|spelluptriggeralarm}
#ALARM "spellmasteralarm" {*1} {#IF (%numitems( @spellup) AND (@castRT = 0) AND (@mana > %rightback( %item( @spellup, 1), 2))) {
prep %item( @spellup, 1)
#T- SpellupMaster|spelluptriggeralarm
#temp {Your spell is ready.} {
cast
#alarm +3 {
#T+ SpellupMaster|spelluptriggeralarm
#DELN spellup 1
}
}
}}
#CLASS 0 |
|
|
|
|
|
|
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
|
|