Click to See Complete Forum and Search --> : Khalid check this out please!


Shampie
05-31-2003, 01:24 PM
Hello,

Well I've been little bit busy with my scripts..
now it works alright (if you dont count buggy crap)

The last scripting I added is the potionselling part.. and that is the most crappiest and buggiest part in the script so far (as I know!) if you can check it out PLEASE! you will see all the problems come up when you try to sell potions.

it's hard to see the forrest with the tree infront!

Tnx in advanced!

Richard

This is the script to d/l (members.chello.nl/~r.verbrugge/phpgame80b.zip)

khalidali63
05-31-2003, 05:26 PM
Originally posted by Shampie
you will see all the problems come up when you try to sell potions.



I think I have lost you or some reasone,Can u please elaborate on what kind of errors are you recieveing,since I do not see any errors when I run your app,or may let me know a test scenario that causes your app to break..

Shampie
06-01-2003, 05:46 AM
I fixed the error.. a spelling mistake.. called function that aint there..
however that doesnt make that part of the script less buggy..

the following functions are used for the potionpart:
checkgold(),sellpot(),thissellspot(),syscheck(),ddp3(),calcpotsell(),sellpot()

How to generate one of the bugs I came up with:
fill in the box where you want to sell an amount (the X in the X/Y boxes) select the box and move your cursor away from it, now fill in a value above the max potions.
now go with the mouse over the sellbutton, it will give an error you dont have that muchpotions.
however clicking the button now without moving the curser will still give you the amount of money showing in the box next to it. am I calling a wrong function here?

tnx!

khalidali63
06-01-2003, 07:55 AM
I can not really tell if its an error or not,here is the reason.

in the function ddp3

you have these lines

if (form.sellamount2.value > form.sellamount.value){
alert(" you do not have that many of that kind of potions, setting max.")
form.sellamount2.value = form.sellamount.value;
}

this function is invoked onmouseover event of this text field named

sellamount2

if you look at the condition bove,it clearly says that if the value in "sellamount2" text field is greater then that of

sellamount

then show the message you see.

You have to dig into your logic that what exactly is that you want to happen in this situation and change the value in the "sellamount" as soon as value is changed in
"sellamount2"

I hope it made any sense..:-)

Shampie
06-01-2003, 03:19 PM
in a matter of fact it did.. i figured it out.. and the potion part is fully working! it can show a big number in sell amount but then when you try to sell it will either not sell or it will sell but for the correct amount.
I do not know if you want to help me making this program or expending it.. and if you have the time for it..
if possible to put it on for php with a database.. to put online perhaps.. but thats only a dream.. so far I had good comment that it's a neat page..
even that i'm not that good with js ..

Shampie
06-01-2003, 03:20 PM
P.S tnx for your help!