Help please
I like to challenge myself - I've tried this on my own and it keeps coming out with "You havn't enough integrals" - where am I going wrong?
;;;;;;I have made new field in tbl_char called FLD_INTEGRAL- same format as gold, ie integer, etc...
[@main]
#say
do you want to buy anything with integrals?\\
<yes/@yes> <no/@exit>
[@yes]
#say
what do you want to buy?\\
<Vitality Potion Integral/@getit(VitalityPotion,10)>\
[@getit()]
#act
mov a2 %arg(1)
mov d1 %arg(2)
#say
are you sure?\
<yes/@getit2> <no/@exit>
[@getit2]
#act
mov %a0 %username
formatstr "FLD_CHARACTER='%s'" %a0
readvaluesql "TBL_CHARACTER" %a9 "FLD_CHARACTER,FLD_INTEGRAL" [@si1]
close
[@si1()]
#act
mov d2 %arg(2)
#if
elarge d2 %d1
#act
mov a0 %a9
goto @si2
#elsesay
You havn't enough integrals\\
<exit/@exit>
[@si2]
#act
give %a9
formatstr "fld_character='%s'" %a0
dec d2 %d1
formatstr "fld_integral='%s'" %d2
updatevaluesql "tbl_character" %a0 %d2
#say
You have aquired <$output/%a9>\\
<buy something else/@buy>
<exit/@exit>
I like to challenge myself - I've tried this on my own and it keeps coming out with "You havn't enough integrals" - where am I going wrong?
;;;;;;I have made new field in tbl_char called FLD_INTEGRAL- same format as gold, ie integer, etc...
[@main]
#say
do you want to buy anything with integrals?\\
<yes/@yes> <no/@exit>
[@yes]
#say
what do you want to buy?\\
<Vitality Potion Integral/@getit(VitalityPotion,10)>\
[@getit()]
#act
mov a2 %arg(1)
mov d1 %arg(2)
#say
are you sure?\
<yes/@getit2> <no/@exit>
[@getit2]
#act
mov %a0 %username
formatstr "FLD_CHARACTER='%s'" %a0
readvaluesql "TBL_CHARACTER" %a9 "FLD_CHARACTER,FLD_INTEGRAL" [@si1]
close
[@si1()]
#act
mov d2 %arg(2)
#if
elarge d2 %d1
#act
mov a0 %a9
goto @si2
#elsesay
You havn't enough integrals\\
<exit/@exit>
[@si2]
#act
give %a9
formatstr "fld_character='%s'" %a0
dec d2 %d1
formatstr "fld_integral='%s'" %d2
updatevaluesql "tbl_character" %a0 %d2
#say
You have aquired <$output/%a9>\\
<buy something else/@buy>
<exit/@exit>