enter_ok problem

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
i have this script for entering in a kr ,

Code:
[@astKR]

#if 
check [412] 1
#act
enter_ok
#elseact
goto @astkr_1

[@astkr_1]
#IF
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_astkey" @LoadKeys

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

#if
Large D1 0
#act
[COLOR="Red"]enter_ok[/COLOR]
delaygoto [LOCAL] 1 @enterast
#elseact 
enter_fail
#elsesay
u have <$output(D1)> key's how do u whant to go in

[@enterast]
#if
CHECKHUM D705 1
#act
set [412] 1
Mov  A1  %USERNAME
DEC  D1  1
FormatStr "FLD_astkey=%s" %D1
Mov A8 %A9
FormatStr "FLD_nume='%s'" %A1
UpdateValueSql "TBL_KeyMaker" %A9 %A8

#elseact
goto @enterast1

[@enterast1]
#if
CHECKMONMAP "D705" 1 BoarKing 
#act
set [412] 1
Mov  A1  %USERNAME
DEC  D1  1
FormatStr "FLD_astkey=%s" %D1
Mov A8 %A9
FormatStr "FLD_nume='%s'" %A1
UpdateValueSql "TBL_KeyMaker" %A9 %A8
#elseact
goto @enterast2

[@enterast2]
#if
CHECKMONMAP "D705" 1 WhiteBoar 
#act
set [412] 1
Mov  A1  %USERNAME
DEC  D1  1
FormatStr "FLD_astkey=%s" %D1
Mov A8 %A9
FormatStr "FLD_nume='%s'" %A1
UpdateValueSql "TBL_KeyMaker" %A9 %A8
mongenp "D705,30,30,20" BoarKing   1 

#elseact
set [412] 1
Mov  A1  %USERNAME
DEC  D1  1
FormatStr "FLD_astkey=%s" %D1
Mov A8 %A9
FormatStr "FLD_nume='%s'" %A1
UpdateValueSql "TBL_KeyMaker" %A9 %A8

mongenp "D705,30,30,20" BoarKing   1 
mongenp "D705,30,30,20" WhiteBoar   2

all script work's fine exept u need to go into the door more then 1 time to go in , if ppl know to wait 1 sec betwen the trys to go in they get inside from second try but if they dont and they just smash into the door they cant go in untill they chill out for 1 sec :P , the problem is for ppl that wil use space and time in kr , they will have to use 2 space's and times to go in , and i would like to make it work from the first time , so when some1 go into the door(on the coords that are conected to kr) to go str8 in kr without backing up and try again , how should i change the script so the
enter_ok work from first time and only after when the char's in kr to take hes key and rs the bosses , cos from how i see it the scrips needs to wait for all the script to be read and used until the chars go inside
 

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
after some more tryes to make the script diferent i still cant make it work well , but i find something else that doesnt work and duno why but i think if i could make that work then the script would work fine , i tryed a verry simple script just to check the key's and let u go inside , but it doesnt work .. heres the script

Code:
[@ogrekr]
#IF
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_ogrekey" @LoadKeys

[@LoadKeys()]
#ACT
Mov   A1   %ARG(1)
Mov   D1   %ARG(2)
goto @ogrekr_1


[@ogrekr_1]

#if 
Large D1 0
#act
enter_ok
#elsesay
You have <$output(D1)> key's how do u whant to go in

well this script should only check if the D1 is larger then 0 and let u in , but even if i have D1 = 1 he doesnt let me in and it gives me the msg from elsesay saing "You have 1 key's how do u whant to go in"
any1 know why doesnt the enter_ok works , but the enter_fail does ? .. and if he show's me the right vallue from D1 in the elsesay msg that means he knows the vallue of D1 when he makes the check @ if
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
yep , its in mapquesst . line from mapquest :

D2005 [0] 0 [Enter] * * [MapQuest_Def\Enterogre] [@ogreKR]

and as i said the first , long script works perfect just u need to go 2 times into the door to go in , but this happens only for ppl who dont have the flag 1 , so i assumed u need to go 2 times into the door cos the script check's the flag first and only the second the key's , so i whated to make it work from the first time when it check's the key's and it can work how ever it wonts when it check's the flag as that is only for ppl who died in kr without killing the boss so they can go back and finish the job without using key's
 
Last edited:
Upvote 0

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
I am not sure what the problem is, I will have a look at my scripts when I get home and see if I can see what the problem is.

/Mick
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
ok i still have the problem and tryed this script in so many ways but it just doesnt work , tryed just the simple part of the script to see if the D1 is larger the 0 and let u in , with no complication , but the enter_ok still doesnt work and i added a #say to it witch works so im kinda sure it reads the vallue from D1 corectly

Code:
[@astkr]
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_astkey" @LoadKeys

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

#if
Large D1 0
#act
enter_ok
#say
bla bla u should be in kr ... ; [COLOR=Red]when D1 is 1 or more this one works , the enter_ok doesnt [/COLOR]
#elseact 
enter_fail
#elsesay
You have <$output(D1)> key's how do u want to go in  [COLOR=Red]; when D1 is 0 this one comes up and the enter_fail work's [/COLOR]

any1 know why the enter_ok doesnt work or in wot order should i make this scrip ? and yes the script is triggered from mapquest
 
Upvote 0

chimera

LOMCN VIP
VIP
Jul 30, 2003
1,054
23
235
UK
try making a test script to output A1 and D1, see if they produce the right numbers. Does your character name have any ansii symbols in it? (try doing a script to confirm username is being picked up correctly).

why larger than 0, why not equal 1 ???

wondering also why you made a seperate table and didn't just use the character table and just add a column for your use?

Also, don't know if makes a difference but all my mapquest lines end [@main] and the script starts
[@main]


HTH :)
 
Last edited:
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
try making a test script to output A1 and D1, see if they produce the right numbers. Does your character name have any ansii symbols in it? (try doing a script to confirm username is being picked up correctly).

why larger than 0, why not equal 1 ???

wondering also why you made a seperate table and didn't just use the character table and just add a column for your use?

Also, don't know if makes a difference but all my mapquest lines end [@main] and the script starts
[@main]


HTH :)

the script reads the corect vallues cos as i said when the D1=0 the #elsesay pop's up saying "you have 0 key's how do u whant to go in"
and when D1=1 or more the #say pop's up saying "bla bla u should be in kr"
this is why im saying the enter_ok doesnt work and duno why

and larger then 0 cos players can colect key's i mean they can kill more km's and then they have more then 1 key in the table

made separate table in sql as i have 16 colloms in that table not just 1 :P and its easyer to see thouse in a new table then add all 16 in character one

the mapquest work's fine with other end the [@main] :) i have 40+ lines in there with other end then [@main] and they all work

EDIT:
tryed the A1 and D1 in an output and both are ok , it show's my chars name and that i have 1 key
 
Last edited:
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
wot corectly means ? :D here's the lines betwen the last floor and the kr
, if i take the line from mapquest out i can enter with no problem , so i quess the entry it's ok

Code:
D704 193,227 -> D705 33,45 ; d704 last floor , D705 KR
 
Upvote 0

chimera

LOMCN VIP
VIP
Jul 30, 2003
1,054
23
235
UK
I mean have you tested that this is possible to go from D704 193,227 -> D705 33,45

take the enter script out of mapquest and make sure that bit works. if there are any obsticles, even a mob at D705 33,45 then your character wont move through to the new map :)
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
ok nevermind i added some doorman's next to the kr's door witch runs all the script and give the persone a flag , with the flags the enter_ok work's with no problem , ty for trying tho :D
 
Upvote 0

DarkDiablo

Dedicated Member
Dedicated Member
Sep 10, 2007
102
0
62
ok nevermind i added some doorman's next to the kr's door witch runs all the script and give the persone a flag , with the flags the enter_ok work's with no problem , ty for trying tho :D


Ive seen your doorman, why not check flag, and if no flag prompt if you would like to use key, if yes checkkey decrease key flag and move char to t that spot automatically?
 
Upvote 0

DarkDiablo

Dedicated Member
Dedicated Member
Sep 10, 2007
102
0
62
ok now my script having same space and time issue, anyone find a solution to kyerons issue and then either me or him can share our codes to everyone
 
Upvote 0