Sql npc help

smoochy boys on tour

mapadale

Guest
Can anyone help me please.

It's not showing CHARNAME from %USERNAME and not saving to SQL DB

Also it doesn't seem to want to take the TiLungScroll and add it to the SQL DB as a value of 10


The whole script is not doing what I want it to.
 

Attachments

  • TCash-starter.txt
    2.4 KB · Views: 31

greatbat

Dedicated Member
Dedicated Member
Sep 8, 2007
13
0
47
[@Forward()]
#IF
#ACT
Mov D1 %ARG(2)
Mov A3 %ARG(1)
FormatStr "FLD_CHARNAME='%s'" %USERNAME
ReadValueSql "TBL_TILUNGPOINTS" %A9 "FLD_CHARNAME,FLD_TILUNGPOINTS" [@Start]
#ELSESAY
You are not in a guild go away\ \
< Close/@exit>\\\
#IF
Equal A3 ""
#ACT
FormatStr "'%s',%s" %GUILDNAME 0
Mov A6 %A9
FormatStr "FLD_CHARNAME='%s'" %USERNAME
Mov A5 %A9
WriteValueSql "TBL_TILUNGCASH" %A5 "FLD_CHARNAME,FLD_TILUNGCASH" %A6

goto @start

IMO try

[@Forward()]
#IF
#ACT
Mov D1 %ARG(2)
Mov A3 %ARG(1)

#IF
Equal A3 ""
#ACT
FormatStr "'%s','0'" %GUILDNAME
Mov A6 %A9
FormatStr "FLD_CHARNAME='%s'" %USERNAME
Mov A5 %A9
WriteValueSql "TBL_TILUNGCASH" %A5 "FLD_CHARNAME,FLD_TILUNGCASH" %A6

#IF
#ACT
FormatStr "FLD_CHARNAME='%s'" %USERNAME
ReadValueSql "TBL_TILUNGPOINTS" %A9 "FLD_CHARNAME,FLD_TILUNGPOINTS" [@Start]
#ELSESAY
You are not in a guild go away\ \
< Close/@exit>\\\

Also

[@Donate]
#SAY
{FCOLOR/11}<$OUTPUT(A3)>{FCOLOR/12} guild has {FCOLOR/1}<$OUTPUT(D1)>{FCOLOR/12} Guild Gold.
How Much gold would you like to donate to your guild bank?\
<Amount of Gold/@@goldamount>
[@@goldamount]
#ACT
Mov D9 %INPUTSTR
goto @checkgold

[@checkgold]

#IF
checkgold %D9
#ACT
Inc D2 %D9
FormatStr "FLD_CHARNAME='%s'" %USERNAME
Mov A8 %A9
FormatStr "FLD_TILUNGCASH='%s'" %D2
UPDATEVALUESQL "TBL_TILUNGCASH" %A8 %A9
take gold %D9
#SAY
{FCOLOR/10}<$OUTPUT(A3)>{FCOLOR/10} now has {FCOLOR/11}<$OUTPUT(D2)>{FCOLOR/10} gold in the bank.\
<[ Exit ]/@exit>\\\

Try

[@Donate]
#SAY
{FCOLOR/11}<$OUTPUT(A3)>{FCOLOR/12} guild has {FCOLOR/1}<$OUTPUT(D1)>{FCOLOR/12} Guild Gold.
How Much gold would you like to donate to your guild bank?\
<Amount of Gold/@@Donate2>

[@@Donate2]
#IF
#ACT
Mov D9 %INPUTSTR

#IF
checkgold %D9
#ACT
Inc D2 %D9
FormatStr "FLD_CHARNAME='%s'" %USERNAME
Mov A8 %A9
FormatStr "FLD_TILUNGCASH='%s'" %D2
UPDATEVALUESQL "TBL_TILUNGCASH" %A8 %A9
take gold %D9
#SAY
{FCOLOR/10}<$OUTPUT(A3)>{FCOLOR/10} now has {FCOLOR/11}<$OUTPUT(D2)>{FCOLOR/10} gold in the bank.\
<[ Exit ]/@exit>\\\

And the last one

[@Scroll]
#SAY
{FCOLOR/11}<$OUTPUT(A3)>{FCOLOR/12} guild has {FCOLOR/1}<$OUTPUT(D1)>{FCOLOR/12} Guild Gold.
How Much gold would you like to donate to your guild bank?\
<Amount of Gold/@@goldamount> ;; That was in donate for scroll you got to have difrent one
[@@goldamount]

#ACT
Mov D6 %INPUTSTR
goto @checkitem

[@checkitem]
#IF
checkitem TiLungScroll %D6
#ACT
Inc D1 %D6 ;; There is no place where D6 is multiplied by 10
FormatStr "FLD_CHARNAME='%s'" %USERNAME
Mov A7 %A9
FormatStr "FLD_TILUNGPOINTS='%s'" %D1
UPDATEVALUESQL "TBL_TILUNGPOINTS" %A7 %A9
take TiLungScroll 1 %D6
#SAY
{FCOLOR/10}<$OUTPUT(A3)>{FCOLOR/10} now has {FCOLOR/11}<$OUTPUT(D1)>{FCOLOR/10} gold in the bank.\
<[ Exit ]/@exit>\\\

Try

[@Scroll]
#SAY
{FCOLOR/11}<$OUTPUT(A3)>{FCOLOR/12} guild has {FCOLOR/1}<$OUTPUT(D1)>{FCOLOR/12} Guild Gold.
How Much gold would you like to donate to your guild bank?\
<Amount of Gold/@@Scroll2>

[@@Scroll2]
#IF
#ACT
Mov D6 %INPUTSTR
MOV D7 10 ;;change if diffrent value needed

#IF
checkitem TiLungScroll %D6
#ACT
MUL D6 %D7
Inc D1 %P9
FormatStr "FLD_CHARNAME='%s'" %USERNAME
Mov A7 %A9
FormatStr "FLD_TILUNGPOINTS='%s'" %D1
UPDATEVALUESQL "TBL_TILUNGPOINTS" %A7 %A9
take TiLungScroll %D6
#SAY
{FCOLOR/10}<$OUTPUT(A3)>{FCOLOR/10} now has {FCOLOR/11}<$OUTPUT(D1)>{FCOLOR/10} gold in the bank.\
<[ Exit ]/@exit>\\\
 
Last edited:
Upvote 0