variable's

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
can u set 16 D variable's in same script ? if yes can any help me a lil pls i have tryed this but the vallue's showed arent corect

Code:
#act
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_dvkey,FLD_woomakey,FLD_astkey,FLD_psckey,FLD_rmvkey,FLD_ztkey,FLD_ptkey,FLD_bpkey,FLD_jpkey,FLD_uwkey,FLD_mskey,FLD_fdkey,FLD_nrkey,FLD_ogrekey,FLD_stkey,FLD_arkey" @getinventory


[@getinvetory()]
#act
mov A1 %ARG(1)
mov D1 %ARG(2)
mov D2 %ARG(3)
mov D3 %ARG(4)
mov D4 %ARG(5)
mov D5 %ARG(6)
mov D6 %ARG(7)
mov D7 %ARG(8)
mov D8 %ARG(9)
mov D10 %ARG(10) ;past the D9 cos i saw on extreme script leason that A,D,P9 work separatly or something like that 
mov D11 %ARG(11)
mov D12 %ARG(12)
mov D13 %ARG(13)
mov D14 %ARG(14)
mov D15 %ARG(15)
mov D16 %ARG(16)
mov D17 %ARG(17)

#say
dv  <$output(D1)>
wooma  <$output(D2)>
ast  <$output(D3)>
psc  <$output(D4)>
.................
this should be the list with the kye's u have for every kr .. so my problem to this is that the <$output(Dn)> doesnt show the right vallue ,,, if i use only 1 or 2 variable's they show the right vallue's , but id like to make only 1 list with the key's that's why i kinda need to put all the FLD's in the same script but using diferent variable's
 
Last edited:

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
You can only fetch 6 fields from the database at a time..

Do, fetch 6 fields and build a string to view it..

... and as usual.. not tested, so it might have a bug or 10 :)

/Mick

Code:
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_dvkey,FLD_woomakey,FLD_astkey,FLD_psckey,FLD_rmvkey,FLD_ztkey" @FetchNext1

[@FetchNext1()]
#ACT
Mov  D1  %ARG(1)
Mov  D2  %ARG(2)
Mov  D3  %ARG(3)
Mov  D4  %ARG(4)
Mov  D5  %ARG(5)
Mov  D6  %ARG(6)
Mov  A0  "Keys Obtained"
AddStr A0  "\DV - "
AddStr A0 %D1
AddStr A0 "\Wooma - "
AddStr A0 %D2
AddStr A0 "\AST - "
AddStr A0 %D3
AddStr A0 "\PSC - "
AddStr A0 %D4
AddStr A0 "\RMV - "
AddStr A0 %D5
AddStr A0 "\ZT - "
AddStr A0 %D6
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_ptkey,FLD_bpkey,FLD_jpkey,FLD_uwkey,FLD_mskey,FLD_fdkey" @FetchNext2

[@FetchNext2()]
#ACT
Mov  D1  %ARG(1)
Mov  D2  %ARG(2)
Mov  D3  %ARG(3)
Mov  D4  %ARG(4)
Mov  D5  %ARG(5)
Mov  D6  %ARG(6)
AddStr A0  "\PT - "
AddStr A0 %D1
AddStr A0 "\BP - "
AddStr A0 %D2
AddStr A0 "\JP - "
AddStr A0 %D3
AddStr A0 "\UW - "
AddStr A0 %D4
AddStr A0 "\MS - "
AddStr A0 %D5
AddStr A0 "\FD - "
AddStr A0 %D6
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_nrkey,FLD_ogrekey,FLD_stkey,FLD_arkey" @FetchNext3

[@FetchNext3()]
#ACT
Mov  D1  %ARG(1)
Mov  D2  %ARG(2)
Mov  D3  %ARG(3)
Mov  D4  %ARG(4)
AddStr A0 "\NR - "
AddStr A0 %D1
AddStr A0 "\Ogre - "
AddStr A0 %D2
AddStr A0 "\ST - "
AddStr A0 %D3
AddStr A0 "\AR - "
AddStr A0 %D4
#SAY
<$OUTPUT(A0)>\\
<[ Exit ]/@Exit>\\\
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
after a first look seems that it's makes some mistakes ... i mean i killed bp km and he added 1 key to pt .. but after i killed a pt km he added a key to pt and after rest worked fine i mean if i kill a bp km now he add's to bp .. il test it a lil better tomorow cos im tierd now but ty ida , will post tomorow if it needs any changes
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
the script works ok ida ty a lot the problem is that i have "null" value in table untill i kill at least 1 km that's why it didnt showed the key were it should .. if i make all the vallue's 0 it works fine .. so ty need to find a way to add 0 in all field's now :P
 
Upvote 0

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
114
didnt read your entire script, but im guessing it looks something like below. not going to make the entire thing.. but here is a snippet of what it should look like..


#ACT
FormatStr "'%s',%s" %USERNAME 0
Mov A8 %A9
FormatStr "FLD_nume='%s'" %USERNAME
Mov A2 %A9
WriteValueSql "TBL_KeyMaker" %A2 "FLD_nume,FLD_nrkey" %A8


also i am not sure exactly whats going on.. im guessing its a remake of zedina's script, i would advise not to use words and numbers in the same field. it probably wont read im guessing or add properly.
 
Last edited:
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
i have that but that only add 0 to FLD_nrkey and the rest FLD's remain NULL's .... and atm have some problem to add more fld's in that script but .. still working :D works only with 2 if i add the 3rd FLD it doesnt work (and yep basicaly needs to do same thing wot zed's script does )
 
Upvote 0

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
114
so.. this doesnt work either? i've added multiple things into different fields at once before


#ACT
FormatStr "'%s',%s,%s" %USERNAME 0 0
Mov A8 %A9
FormatStr "FLD_nume='%s'" %USERNAME
Mov A2 %A9
WriteValueSql "TBL_KeyMaker" %A2 "FLD_nume,FLD_nrkey,FLD_ogrekey" %A8
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
this is the scipt triggered from 00default

Code:
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_dvkey,FLD_woomakey[COLOR="Red"],FLD_astkey[/COLOR]" @LoadKeys

[@LoadKeys()]
#ACT
Mov   A1   %ARG(1)

#IF
Equal  A1  ""
#ACT
Mov  A1  %USERNAME

FormatStr "'%s',%s,%s[COLOR="red"],%s[/COLOR]" %A1 0 0 [COLOR="red"]0[/COLOR]  
Mov A8 %A9
FormatStr "FLD_nume='%s'" %A1
WriteValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_dvkey,FLD_woomakey[COLOR="red"],FLD_astkey[/COLOR]" %A8

if i add the red one's to the script .. nothing is added in the table , without it all works
 
Upvote 0

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
114
hmm it must have a limit to what you can write into sql i suppose.

also to be fair i think there is an easier way to make this script, pretty much without using sql. well.. a little bit :) though im guessing someone already told you this :)

a mondie script on each gatekeeper that gives each group member a unique flag for the krdoor, to enter into the door. which triggers a timer.. say 30minutes after which the flag is removed, the gatekeeper spawns once again outside
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
i thik this is the best way to do it ... ofcourse after il make it work proparly :P , if i use flags ppl wount be able to "collect" key's
 
Upvote 0

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
114
well if you wish to do it with sql, thats fine aswell. but it looks like mir3 can't handle too many sql processes at once with these scripts. i think its best to split the script up.. into each mondie script for the gatekeepers... something like whats below, after the gatekeeper dies, it checks whether the user has an entry for woomakey, if its null, it creates the entry, then it goes on to add 1 key to the user. not entirely sure if this will work, as i havent scripted something for mir3 in like a year :)

one flaw with this script.. it assumes the user is already registered under the database.. you can make a simply script to register the user.. and keep all values of the key's null.. till they actually kill a boss.

Code:
#act
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_woomakey" [@woomanext]

[@woomanext()]
#ACT
    Mov    D1      %ARG(2)
    Mov   A3      %ARG(1)
#IF
   Equal  D1   "" 
#ACT
FormatStr "'%s',%s" %USERNAME 0
Mov A8 %A9
FormatStr "FLD_nume='%s'" %USERNAME 
Mov A2 %A9
WriteValueSql "TBL_KeyMaker" %A2 "FLD_nume,FLD_woomakey" %A8
goto @woomanext2
#ELSEACT
goto @woomanext2

[@woomanext2]
#ACT
Mov D6 1
Inc D1 %D6
FormatStr "FLD_nume='%s'" %USERNAME
Mov A8 %A9
UPDATEVALUESQL "TBL_KeyMaker" %A8 "FLD_nume,FLD_woomakey" %D1
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
i have script for when km dies and that work's fine even if the vallue in sql is null befour u kill it .. my problem is with the key's list ... im using the script ida wrote but beeing split in 3 fetchnext it doesnt show the right vallue from sql becouse until ppl will kill all the km at least once they will have null vallue .. and when u kill a km in the list u will see that u have key in the first line from the fetchnext ... to see exectly wot i mean il explain on script hope u understand me better:P

Code:
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_dvkey,FLD_woomakey,FLD_astkey,FLD_psckey,FLD_rmvkey,FLD_ztkey" @FetchNext1

[@FetchNext1()]
#ACT
Mov  D1  %ARG(1)
Mov  D2  %ARG(2)
Mov  D3  %ARG(3)
Mov  D4  %ARG(4)
Mov  D5  %ARG(5)
Mov  D6  %ARG(6)
Mov  A0  "Keys Obtained"
AddStr A0  "\\DeathValley - "
AddStr A0 %D1
AddStr A0 "\WoomaTemple - "
AddStr A0 %D2
AddStr A0 "\StoneTomb - "
AddStr A0 %D3
AddStr A0 "\PrajnaStoneCave - "
AddStr A0 %D4
AddStr A0 "\RedMoonValley - "
AddStr A0 %D5
AddStr A0 "\ZumaTemple - "
AddStr A0 %D6
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_ptkey,FLD_bpkey,FLD_jpkey,FLD_uwkey,FLD_mskey,FLD_fdkey" @FetchNext2

[@FetchNext2()]
#ACT
Mov  D1  %ARG(1)
Mov  D2  %ARG(2)
Mov  D3  %ARG(3)
Mov  D4  %ARG(4)
Mov  D5  %ARG(5)
Mov  D6  %ARG(6)
AddStr A0  "\PrajnaTemple - "   [COLOR="Red"]; in here u have null value in sql untill u kill 1 km [/COLOR]
AddStr A0 %D1
AddStr A0 "\BlackPalace - "    [COLOR="red"]when u kill this km the vallue is showed next to "prajnaTemple" instead of "BlackPalace" [/COLOR]
AddStr A0 %D2
AddStr A0 "\JinchonPalace - "
AddStr A0 %D3
AddStr A0 "\DesertCity - "
AddStr A0 %D4
AddStr A0 "\MisteryShip - "
AddStr A0 %D5
AddStr A0 "\SnowPalace - " [COLOR="red"]:even if i kill here and all the other vallues in sql are nulls the "1" from killing 1 SnowPalaceKM will be put next to "PrajnaTemple" [/COLOR]
AddStr A0 %D6
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_nrkey,FLD_ogrekey,FLD_stkey,FLD_arkey" @FetchNext3

[@FetchNext3()]
#ACT
Mov  D1  %ARG(1)
Mov  D2  %ARG(2)
Mov  D3  %ARG(3)
Mov  D4  %ARG(4)
AddStr A0 "\NumaRuins - "
AddStr A0 %D1
AddStr A0 "\OgreTemple - "
AddStr A0 %D2
AddStr A0 "\SnowTemple - "
AddStr A0 %D3
AddStr A0 "\NumaWall - "
AddStr A0 %D4
#SAY
<$OUTPUT(A0)>\\
<[ Exit ]/@Exit>\\
hope u get why i need to set 0 in all fields from begining :P
 
Upvote 0

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
114
then i suggest you make a very large script to detect null values, and complete the null values hehe :) since i guess you can't add too many at once. :\ sorry for not understanding, now i get what your trying to do :)

and also may i congratulate you for making such a nice script :) don't see posts like these too often on lomcn anymore
 
Last edited:
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
hehe u need to congratulate ida cos i did wot i did only becouse of him helping me as this script are totaly new for me :P .... and @ the detect nulls vallue and complete them sry but i duno wot u mean by that :D
 
Upvote 0

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
114
well look at the mondie script i posted.. it detects null value and then adds in the 0.. im guessing you will have to do it many times over? :)
#IF
Equal D1 ""
#ACT
..
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
hmm i think i got u :P u whant to say to add a script to every km so when u kill the km that one to add 0 in every field's and 1 to the fld it need's to give u a key ? i can try that :P i case u didnt whanted to say that i anyway try it cos i think that can be done :P
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
problem solved :P

added new script trigger(with a lil more delay then the one witch adds the name in tablleso the name will already be there when these scripts try to act) in 00default for each km and added a script like this for each km .. now all are 0 from the start :P

Code:
#IF
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_astkey" @LoadKeys1

[@LoadKeys1()]
#ACT
Mov   A1   %ARG(1)
MoV   D1   %ARG(2)

 
#IF
Equal  A1  %Username
equal  D1  ""
#act
break


#elseACT
Mov  A1  %USERNAME



FormatStr "FLD_astkey=%s" 0 

mov A8 %A9
FormatStr "FLD_nume='%s'" %A1
UpdateValueSql "TBL_KeyMaker" %A9 %A8
ty for the info about equal D1 "" inflikted :P i used this command but didint really knew wot it does :D
 
Last edited:
Upvote 0

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
You are making it very hard for yourself..

The easiest thing to do is to set it up as soon as someone joins the server.. Then there is no reason to do this checking at all.

This is taken from one of my scripts.. just changed the table name to TBL_KeyStore

Sets 33 Variables in the TBL_KeyStore table to a '0' all assigned to a single Char. If you call this from 00Default, it will only run if [400] is a 0, which will only happen once as it sets it to a 1 after its been run. You can also add this script to an NPC, but that will not force people to use it, and they will only complain when they don't get there Keys stored.

Code:
[@SetupKeyLogs]
#IF
CHECK [400] 0
#ACT
Mov  A0  %USERID
FormatStr "'%s',%s" %A0 0
Mov A8 %A9
FormatStr "FLD_CHARACTER='%s'" %A0
WriteValueSql "TBL_KeyStore" %A9 "FLD_CHARACTER,FLD_VAR1" %A8
Goto @SetupKeyLogs1
#ELSEACT
Break

[@SetupKeyLogs1]
#ACT
FormatStr "FLD_CHARACTER='%s'" %USERID
mov   A8     %A9
FormatStr "FLD_VAR2='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR3='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR4='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR5='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR6='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR7='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR8='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR9='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR10='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR11='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR12='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR13='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR14='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR15='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR16='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR17='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR18='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR19='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR20='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR21='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR22='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR23='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR24='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR25='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR26='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR27='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR28='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR29='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR30='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR31='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR32='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
FormatStr "FLD_VAR33='%s'" 0
UPDATEVALUESQL "TBL_KeyStore" %A8 %A9
Set [400] 1
Break
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
ty ida but il use the one i made as im struggleing to make something else now :P , maybe il change it after im done with everything i wana make :D
 
Upvote 0