I am having problems with the mouseclick command.
whenever I click something it does it twice.
Just like the problem Stupot is/was having.
I have read that thread and tried out the
if mouseclick() = 1 and flag = 0
flag = 1
`Do stuff here
endif
if mouseclick() = 0 and flag = 1 then flag = 0
but it did not work for me.
Here a section of my code to work with:
`Check for Upgrade
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463
paste image upgrade#,398,390
endif
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# > 500 and rank# = 10
dec rank#,1
dec chips#,500
else
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# < 500 and rank# = 10
paste image nomoolaa#,160,120
wait 1500
goto editmembermenu
endif
endif
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# > 1000 and rank# = 9
dec rank#,1
dec chips#,1000
else
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# < 1000 and rank# = 9
paste image nomoolaa#,160,120
wait 1500
goto editmembermenu
endif
endif
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# > 1500 and rank# = 8
dec rank#,1
dec chips#,1500
else
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# < 1500 and rank# = 8
paste image nomoolaa#,160,120
wait 1500
goto editmembermenu
endif
endif
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# > 2000 and rank# = 7
dec rank#,1
dec chips#,2000
else
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# < 2000 and rank# = 7
paste image nomoolaa#,160,120
wait 1500
goto editmembermenu
endif
endif
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# > 3500 and rank# = 6
dec rank#,1
dec chips#,3500
else
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# < 3500 and rank# = 6
paste image nomoolaa#,160,120
wait 1500
goto editmembermenu
endif
endif
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# > 4000 and rank# = 5
dec rank#,1
dec chips#,4000
else
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# < 4000 and rank# = 5
paste image nomoolaa#,160,120
wait 1500
goto editmembermenu
endif
endif
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# > 4500 and rank# = 4
dec rank#,1
dec chips#,4500
else
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# < 4500 and rank# = 4
paste image nomoolaa#,160,120
wait 1500
goto editmembermenu
endif
endif
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# > 5000 and rank# = 3
dec rank#,1
dec chips#,5000
else
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# < 5000 and rank# = 3
paste image nomoolaa#,160,120
wait 1500
goto editmembermenu
endif
endif
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# > 6000 and rank# = 2
dec rank#,1
dec chips#,6000
else
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and chips# < 6000 and rank# = 2
paste image nomoolaa#,160,120
wait 1500
goto editmembermenu
endif
endif
if mousex()>398 and mousex()<568 and mousey()>390 and mousey()<463 and mouseclick() = 1 and rank# = 1
paste image cantupgrade#,160,120
wait 1500
goto editmembermenu
endif
My project is a database that stores someones name,rank,chips(money),and their income (which is based on their rank)
The problem I am having is that when you click on the upgrade button and you have sufficient chips(money) if upgrades you, but then gives the insufficient funds error because it clicked the button teice because you cant let off fast enough, it is slmost humanly impossible to click the button fast enough for it to only happen once.
Hope I explained it good enough!
Cap'n
EDIT: Well i sorta fixed it by using the 'wait' command now I just have it wait 100 millaseconds or whatever.
I would still like to know how to set flags as currently stated by Izzy as it seems a more logical solution to the problem.

Cheers,
Capt. America