[King] SQL / Book learning script problem

TheDayIDie

Banned
Banned
Dedicated Member
Jul 29, 2011
4,071
97
135
UK
Code:
[@Swordmanship]
#IF
chkmagiclevel Swordmanship 0
#SAY
You have swordmanship already...\
#ELSEACT
FormatStr "FLD_Char='%s'" %USERNAME
ReadValueSql  "TBL_SKPts"  %A9  "FLD_Char,FLD_Points" [@swordmanship1]

[@swordmanship1]
#IF
ELARGE D1 5
#ACT
Dec D1 5
   FormatStr "FLD_Char='%s'" %USERNAME
   Mov   A8     %A9
   FormatStr "FLD_Points='%s'" %D1
   UPDATEVALUESQL "TBL_SKPts" %A8 %A9
[B]actcmd ADDSKILL Swordmanship[/B]
#SAY
DONE\
#ELSESAY
You do not have enough skill points.\
<Back/@main>___<Exit/@exit>\

well i dont know whats wrong exactly.. the only thing that i can spot is wrong is
Code:
actcmd ADDSKILL swordmanship
because the EI says its wrong (anybody got command for that please?)

If i take out actcmd ADDSKILL and run the script to see if it works.. i click the link and nothing happens

It dont take my points or give me a message.. nowt

any help appreciated, ty /TDID
 

Yolom

LOMCN Veteran
Veteran
Aug 7, 2010
325
21
45
Spain
Forgot to move the tables to variables, if programming with SQL are the same holley and king.

Code:
[@Swordmanship]
#IF
chkmagiclevel Swordmanship 0
#SAY
You have swordmanship already...\
#ELSEACT
FormatStr "FLD_Char='%s'" %USERNAME
ReadValueSql  "TBL_SKPts"  %A9  "FLD_Char,FLD_Points" [@swordmanship1]

[COLOR="#008000"][@swordmanship1()]
#ACT
Mov A3 %ARG(1)
Mov D1 %ARG(2)
#IF
Equal A3 ""
#ACT
FormatStr "'%s',%s" %USERNAME 0
	Mov A8 %A9
	FormatStr "FLD_Char='%s'" %USERNAME 
	Mov A2 %A9
	WriteValueSql "TBL_SKPts" %A2 "FLD_Char,FLD_Points" %A8
goto @next
#ELSEACT
goto @next

[@next][/COLOR]
#IF
ELARGE D1 5
#ACT
Dec D1 5
   FormatStr "FLD_Char='%s'" %USERNAME
   Mov   A8     %A9
   FormatStr "FLD_Points='%s'" %D1
   UPDATEVALUESQL "TBL_SKPts" %A8 %A9
actcmd ADDSKILL Swordmanship
#SAY
DONE\
#ELSESAY
You do not have enough skill points.\
<Back/@main>___<Exit/@exit>\

Forgot the part that is green.
 
Last edited:
  • Like
Reactions: aleano
Upvote 0