|
DarkBeo Newbie
Joined: 17 Mar 2003 Posts: 4 Location: Brazil
|
Posted: Sun Aug 31, 2003 2:27 am
why they %delitem this not functioning |
#ALIAS addspell {spellup_spell_name="";#IF (%numwords( @spellup_list, "|")>0) {#ECHO {Current spellnames:};#LOOP 1,%numwords( @spellup_list, "|") {#ECHO %word( @spellup_list, %i, "|")}} {#ECHO No spells listed.};#prompt spellup_spell_name "Enter the spell name";spellup_list=%additem( @spellup_list, @spellup_spell_name);spellup_list=%replace( @spellup_list, ~")}
why alias does not function? it does not remove spell of the list
#ALIAS remspell {spellup_spell_name=%pick("p:Select the spell you want to delete:",@spellup_list);#IF (@spellup_spell_name != "") {spellup_list=%delitem(@spellup_spell_name,@spellup_list)} {#ECHO You must select a spell to delete!}}
#ALIAS listspells {#IF (%numwords(@spellup_list,"|")>0) {#ECHO {Current spellnames:};#LOOP 1,%numwords(@spellup_list,"|") {#ECHO %word(@spellup_list,%i,"|")}} {#ECHO No spells listed.}}
#ALIAS spellup {spellup_list=%replace( @spellup_list, ~");spellup_temp=@spellup_list;#T+ spellup;#T+ success;af}
#ALIAS spell_setup {#yesno (Do you wish to add or remove a spell?) {Add:addspell} {Remove:remspell}}
#ALIAS spellup_castspells {#T+ spellup_success;#LOOP 1,%numwords(@spellup_temp,"|") {c ~'%word(@spellup_temp,%i,"|")~'}}
#TRIGGER {You are not affected by any spells.} {#T- spellup;spellup_castspells} {spellup}
this is to trigger that it removes the magic if you already will be with it
#TRIGGER {Spell: (*):} {spellup_spell_name=%trimright(%1);#IF (%ismember(@spellup_spell_name,@spellup_temp)) {spellup_temp=%delitem(@spellup_spell_name,@spellup_temp)}} {spellup}
#TRIGGER {You are not affected by any skill modifiers} {#IF (@spellup_temp != "") {spellup_castspells};#T- spellup} {spellup}
#TRIGGER {Skill/Spell modifiers} {#IF (@spellup_temp != "") {spellup_castspells};#T- spellup} {spellup}
#TRIGGER {You lost your concentration while trying to cast (*).} {cast '%1'} {spellup_success}
#TRIGGER {You don't have enough mana} {#T- spellup_success;#ECHO Ran out of mana.} {spellup_success}
#TRIGGER {You don't know any spells of that name.} {#T- spellup_success;#ECHO Check the spelling of your spells!} {spellup_success}
#T- spellup
#T- spellup_success
#VAR spellup_list {}
#VAR spellup_temp {}
#VAR spellup_spell_name {} |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Aug 31, 2003 4:39 am |
It doesn't work because you reversed the order of parameters in %additem in your addspell alias. I also made some other changes to addspell to streamline it a bit, mainly by using list functions instead of string functions. The rest of your script would probably benefit from similar changes.
#AL addspell {spellup_spell_name = "";#IF (%numitems( @spellup_list) > 0) {#ECHO {Current spellnames:};#EC %expandlist( @spellup_list, %cr)} {#EC No spells listed.};#PR spellup_spell_name "Enter the spell name";spellup_list = %additem( @spellup_spell_name, @spellup_list)} |
|
|
|
|
|
|
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
|
|