|
jed Adept
Joined: 18 Dec 2005 Posts: 246
|
Posted: Mon Jun 04, 2007 3:48 am
[1.33]Script dies half way through execution |
I am working on developing a script to generate one string of text from many (50+) variables, and have had some success getting it to work. I actually had the whole thing working, but then went to fix some math in one part, and now the script executes part of the way, then stops executing. Here's a snip of the spot where it is hanging up:
Code: |
$tempkeyringqty = {}
$tempshootdammin = {}
$tempshootdammax = {}
$tempshootdambonus = {}
$tempmaxshootload = {}
$tempnotake = {}
#say maybenow
#var tempac3 ""
#say or now
#say itemsac @item.ac
#show tempac3 @tempac3
#var tempac3 @item.ac
#say after tempac3
;#call %vartype(@tempac3,7)
#say after calltempac3
;#var tempac2 {}
#say after vartempac2
;#call %vartype(@tempac2,7)
#say after calltempac2
#var tempac2 @tempac3/10
#say after tempac2
;#show tempac2 @tempac2
#say howsaboutnow |
right now the output for this section of code looks like this:
it doesnt show me any of the lines i put in with #show or #say after the maybenow line. For some reason it seems to stop parsing after the @tempac3 variable is assigned. if I comment out these three lines, it works (although not correctly, but at least it doesnt stop parsing)
Code: |
#var tempac3 @item.ac
#var tempac2 {}
#var tempac3 "" |
I don't know if I'm initializing these variables incorrectly or what... but either way I wouldn't think it should cause the whole alias from stopping. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Mon Jun 04, 2007 9:11 am |
What value does @item.ac contain when you assign it to tempac3?
|
|
_________________ Asati di tempari! |
|
|
|
jed Adept
Joined: 18 Dec 2005 Posts: 246
|
Posted: Mon Jun 04, 2007 12:35 pm |
right now it has a value of -20 i've tried it with also with 3
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Mon Jun 04, 2007 2:35 pm |
Sounds like something isn't quite right with that variable since there doesn't seem to be any inherent problem with the code.
Have you tried deleting that particular variable or all variables in general? Have you tried just issuing the #VARIABLE command by itself on the command line to see all the variables defined? It's possible you may have another one defined somewhere that's throwing off your scripts. |
|
_________________ Asati di tempari! |
|
|
|
jed Adept
Joined: 18 Dec 2005 Posts: 246
|
Posted: Tue Jun 05, 2007 12:32 am |
hmmm not sure what exactly has caused it, but the script now works after a couple guesses... Heres the same snippit of code... working.... for now...
Code: |
$tempshootdammin = ""
$tempshootdammax = ""
$tempshootdambonus = ""
$tempmaxshootload = ""
$tempnotake = ""
#var tempac2 {@item.ac}
#call %vartype( tempac2,7)
#math tempac2 @tempac2/10
#if (@item.hit = {}) {#say "hit is empty"} {
$temphit = %concat(" ", @item.hit,"Hit")
}
#if (@item.dam = {}) {#say "dam is empty"} {
$tempdam = %concat(" ", @item.dam,"Dam")
}
#if (@item.ac = {}) {#say "AC is empty"} {
$tempac = %concat(" ", @tempac2,"AC")
} |
Anyway as always thanks for the reply... one of these days ill be able to help others too!!! |
|
|
|
jed Adept
Joined: 18 Dec 2005 Posts: 246
|
Posted: Tue Jun 05, 2007 12:53 am |
Hmm it was broken again... but I think i've got it now. I checked it with some other items and it worked/didnt work.
in another script i initialize @item like this
When I run that script on an item that causes a value to be written to @item.ac the above code works. When I run that script on an item that doesnt have an ac value (in which case the value for @item.ac would be null???) it didn't work. So i put the code inside the if statement a bit farther down, so if the @item.ac value is empty, it doesn't try to set @tempac2 to it. This doesn't seem quite right that I had to do this, but either way, its working! heres the whole working alias as it sits right now
Code: |
$tempdam = ""
$temphit = ""
$tempac = ""
$tempminlevel = ""
$tempwearloc = ""
$tempweight = ""
$tempdex = ""
$tempint = ""
$tempstr = ""
$tempcon = ""
$tempwis = ""
$temphp = ""
$tempmindam = ""
$tempmaxdam = ""
$tempavedam = ""
$tempmv = ""
$tempsavevsspell = ""
$tempmana = ""
$tempforged = ""
$tempbarsqtyforged = ""
$tempaffect1 = ""
$tempaffect2 = ""
$tempaffect3 = ""
$tempaffect4 = ""
$tempaffect5 = ""
$tempaffect6 = ""
$tempcpspellpower = ""
$tempcpspell = ""
$tempcpduration = ""
$tempscrolllevel = ""
$tempscrollspell = ""
$tempbankable = ""
$tempnosteal = ""
$tempbsweapon = ""
$tempdoselevel = ""
$tempdosespells = ""
$tempdamtype = ""
$tempchargemax = ""
$tempchargelevel = ""
$tempchargespell = ""
$tempminammodam = ""
$tempmaxammodam = ""
$tempvisibility = ""
$tempdropable = ""
$tempcombinedeffects = ""
$tempcpqty = ""
$tempnorent = ""
$tempremoval = ""
$tempammotype = ""
$tempscrollqty = ""
$tempbpouchqty = ""
$temppotioncaseqty = ""
$tempfoodpackqty = ""
$tempkeyringqty = ""
$tempshootdammin = ""
$tempshootdammax = ""
$tempshootdambonus = ""
$tempmaxshootload = ""
$tempnotake = ""
#if (@item.hit = {}) {#say "hit is empty"} {
$temphit = %concat(" ", @item.hit,"Hit")
}
#if (@item.dam = {}) {#say "dam is empty"} {
$tempdam = %concat(" ", @item.dam,"Dam")
}
#if (@item.ac = {}) {#say "AC is empty"} {#var tempac2 @item.ac;#call %vartype( tempac2,7);#math tempac2 @tempac2/10;$tempac = %concat(" ", @tempac2,"AC")
}
#if (@item.minlevel = {}) {#say "minlevel is empty"} {
$tempminlevel = %concat( " ","L", @item.minlevel)
}
#if (@item.wearloc = {}) {#say "wearloc is empty"} {$tempwearloc = %proper(@item.wearloc)
}
#if (@item.wearloc = "weapon") {#if (@item.weight = {}) {#say "weight is empty"} {
$tempweight = %concat(" ","WT", @item.weight)
} {}
}
#if (@item.dex = {}) {#say "dex is empty"} {
$tempdex = %concat(" ", @item.dex,"Dex")
}
#if (@item.int = {}) {#say "int is empty"} {
$tempintgos = %concat(" ", @item.int,"Int")
}
#if (@item.str = {}) {#say "str is empty"} {
$tempstr = %concat(" ", @item.str,"Str")
}
#if (@item.con = {}) {#say "con is empty"} {
$tempcon = %concat(" ", @item.con,"Con")
}
#if (@item.wis = {}) {#say "wis is empty"} {
$tempwis = %concat(" ", @item.wis,"Wis")
}
#if (@item.hp = {}) {#say "hp is empty"} {
$temphp = %concat(" ", @item.hp,"HP")
}
#if (@item.mindam = {}) {#say "mindam is empty"} {
$tempmindam = %concat(" ","(", @item.mindam,"-")
}
#if (@item.maxdam = {}) {#say "maxdam is empty"} {
$tempmaxdam = %concat( @item.maxdam,")")
}
#if (@item.avedam = {}) {#say "avedam is empty"} {
$tempavedam = %concat( @item.avedam,"Avg")
}
#if (@item.mv = {}) {#say "mv is empty"} {
$tempmv = %concat(" ", @item.mv,"MV")
}
#if (@item.savevsspell = {}) {#say "SaveVsSpell is empty"} {
$tempsavevsspell = %concat(" ", @item.savevsspell,"S vs spell")
}
#if (@item.mana = {}) {#say "mana is empty"} {
$tempmana = %concat(" ", @item.mana,"Mana")
}
#if (@item.forged = {}) {#say "forged is empty"} {
$tempforged = %concat(" ", @item.forged,"Forged")
}
#if (@item.barsqtyforged = {}) {#say "barsqtyforged is empty"} {
$tempbarsqtyforged = %concat(" ", @item.barsqtyforged,"Frg Bars")
}
#if (@item.affect1 = {}) {#say "affect1 is empty"} {
$tempaffect1 = %concat(" ","(", @item.affect1,")")
}
#if (@item.affect2 = {}) {#say "affect2 is empty"} {
$tempaffect2 = %concat(" ","(", @item.affect2,")")
}
#if (@item.affect3 = {}) {#say "affect3 is empty"} {
$tempaffect3 = %concat(" ","(", @item.affect3,")")
}
#if (@item.affect4 = {}) {#say "affect4 is empty"} {
$tempaffect4 = %concat(" ","(", @item.affect4,")")
}
#if (@item.affect5 = {}) {#say "affect5 is empty"} {
$tempaffect5 = %concat(" ","(", @item.affect5,")")
}
#if (@item.affect6 = {}) {#say "affect6 is empty"} {
$tempaffect6 = %concat(" ","(", @item.affect6,")")
}
#if (@item.cpspellpower = {}) {#say "cpspellpower is empty"} {
$tempcpspellpower = %concat(" ","(", @item.cpspellpower,")")
}
#if (@item.cpspell = {}) {#say "cpspell is empty"} {
$tempcpspell = %concat(" ", @item.cpspell,"Foci")
}
#if (@item.scrolllevel = {}) {#say "scrolllevel is empty"} {
$tempscrolllevel = %concat(" ", @item.scrolllevel,"ScrLev")
}
#if (@item.scrollspell = {}) {#say "scrollspell is empty"} {
$tempscrollspell = %concat(" ", @item.scrollspell, "ScrSpell")
}
#if (@item.bankable = {}) {#say "bankable is empty"} {
$tempbankable = %concat(" ",%proper( @item.bankable))
}
#if (@item.nosteal = {}) {#say "nosteal is empty"} {
$tempnosteal = %concat(" ",%proper( @item.nosteal))
}
#if (@item.bsweapon = {}) {#say "bsweapon is empty"} {
$tempbsweapon = " BKSTB"
}
#if (@item.doselevel = {}) {#say "doselevel is empty"} {
$tempdoselevel = %concat(" ", @item.doselevel,"Dose Lev")
}
#if (@item.dosespells = {}) {#say "dosespells is empty"} {
$tempdosespells = %concat(" ", @item.dosespells,"Dose SP")
}
#if (@item.Damtype = {}) {#say "Damtype is empty"} {
$tempdamtype = %concat(" ",%proper( @item.damtype)," Dam")
}
#if (@item.chargemax = {}) {#say "chargemax is empty"} {
$tempmana = %concat(" ", @item.mana,"Mana")
}
#if (@item.chargemax = {}) {#say "chargemax is empty"} {
$tempchargemax = %concat(" ", @item.chargemax,"Charges")
}
#if (@item.chargelevel = {}) {#say "chargelevel is empty"} {
$tempchargelevel = %concat(" ", @item.chargelevel,"ChargeLev")
}
#if (@item.chargespell = {}) {#say "chargespell is empty"} {
$tempchargespell = %concat(" ", @item.chargespell," Spell")
}
#if (@item.minammodam = {}) {#say "minammodam is empty"} {
$tempminammodam = %concat(" ","(", @item.minammodam,"-")
}
#if (@item.maxammodam = {}) {#say "maxammodam is empty"} {
$tempmaxammodam = %concat( @item.maxammodam,")Dam")
}
#if (@item.visibility = {}) {#say "visibility is empty"} {
$tempvisibility = %concat(" ", @item.visibility)
}
#if (@item.dropable = {}) {#say "mana is dropable"} {
$tempdropable = %concat(" ",%proper(@item.dropable))
}
#if (@item.combinedeffects = {}) {#say "combinedeffects is empty"} {
$tempcombinedeffects = %concat(" ", @item.combinedeffects)
}
#if (@item.cpqty = {}) {#say "cpqty is empty"} {
$tempcpqty = %concat(" ", @item.cpqty,"Vol")
}
#if (@item.norent = {}) {#say "norent is empty"} {
$tempnorent = %concat(" ",%proper( @item.norent))
}
#if (@item.removal = {}) {#say "removal is empty"} {
$tempremoval = %concat(" ",%proper( @item.removal))
}
#if (@item.mana = {}) {#say "mana is empty"} {
$tempmana = %concat(" ", @item.mana,"Mana")
}
#if (@item.ammotype = {}) {#say "ammotype is empty"} {
$tempammotype = %concat(" ",%proper( @item.ammotype)," Ammo")
}
#if (@item.scrollqty = {}) {#say "scrollqty is empty"} {
$tempscrollqty = %concat(" ", @item.scrollqty,"Vol")
}
#if (@item.bpouchqty = {}) {#say "bpouchqty is empty"} {
$tempbpouchqty = %concat(" ", @item.bpouchqty,"Vol")
}
#if (@item.potioncaseqty = {}) {#say "potioncaseqty is empty"} {
$temppotioncaseqty = %concat(" ", @item.potioncaseqty,"Vol")
}
#if (@item.keyringqty = {}) {#say "keyringqty is empty"} {
$tempkeyringqty = %concat(" ", @item.keyringqty,"Vol")
}
#if (@item.shootdammin = {}) {#say "shootdammin is empty"} {
$tempshootdammin = %concat(" ","(", @item.shootdammin,"-")
}
#if (@item.shootdammax = {}) {#say "shootdammax is empty"} {
$tempshootdammax = %concat( @item.shootdammax,")")
}
#if (@item.shootdambonus = {}) {#say "shootdambonus is empty"} {
$tempshootdambonus = %concat(" ", @item.shootdambonus,"Dam")
}
#if (@item.maxshootload = {}) {#say "maxshootload is empty"} {
$tempmaxshootload = %concat(" ", @item.maxshootload,"MaxLoad")
}
#if (@item.notake = {}) {#say "notake is empty"} {
$tempnotake = " NoTake"}
#say %concat($tempwearloc,$tempminlevel,$tempweight,$tempbsweapon,$tempmindam,$tempmaxdam,$tempavedam,$tempstr,$tempint,$tempwis,$temphit,$tempdam,$tempac,$temphp,$tempmana,$tempmv,$tempsavevsspell,$tempforged,$tempbarsqtyforged,$tempaffect1,$tempaffect2,$tempaffect3,$tempaffect4,$tempaffect5,$tempaffect6,$tempcpspellpower,$tempcpspell,$tempcpduration,$tempscrolllevel,$tempscrollspell,$tempbankable,$tempnosteal,$tempdoselevel,$tempdosespells,$tempdamtype,$tempchargespell,$tempchargelevel,$tempchargemax,$tempminammodam,$tempmaxammodam,$tempvisibility,$tempdropable,$tempcombinedeffects,$tempcpqty,$tempnorent,$tempremoval,$tempammotype,$tempscrollqty,$tempbpouchqty,$temppotioncaseqty,$tempfoodpackqty,$tempkeyringqty,$tempshootdammin,$tempshootdammax,$tempshootdambonus,$tempmaxshootload,$tempnotake) |
|
|
|
|
|
|
|
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
|
|