i tried with
Code: Select all
if _someVariable is an integer then
more specifically, I'm trying to make a 'PointsMultiplier' that will be resized when a variable is a 'complete number'
Code: Select all
on UpdateOverDriveClickBonus
add 1 to _sessionClicks
set the thumbPosition of scrollbar "ProgressOverDrive" to _sessionClicks
put CalculateOverDriveBonus() into _overDriveBonus
put "X" & _overDriveBonus into field "overDriveBonus"
ShowBetterOverDrive
end UpdateOverDriveClickBonus
function CalculateOverDriveBonus
return trunc (_sessionClicks / 20 ) +1
end CalculateOverDriveBonus
on ShowBetterOverDrive
if _overDriveBonus is an integer and _overDriveBonus > 1
then
--resetta lo scrollbar a 0
set the thumbPosition of scrollbar "ProgressOverDrive" to 0
set the location of fld "overDriveBonus" to 160, 80
--set the size of fld "overDriveBonus" to più grande
set the textSize of fld "overDriveBonus" to 115
set the width of fld "overDriveBonus" to 150
set the height of fld "overDriveBonus" to 130
send RepositionOverDrive to me in 1.5 seconds
else
end if
end ShowBetterOverDrive
on RepositionOverDrive
--resize
set the textSize of fld "overDriveBonus" to 30
set the width of fld "overDriveBonus" to 46
set the height of fld "overDriveBonus" to 31
--relocate
set the location of fld "overDriveBonus" to 285, 18
end RepositionOverDrive
i've found another problem, after the first time that ShowBetterOverDrive runs (when _sessionClicks becomes greater than 1) the progress bar will be always full because it's set to be the value of _sessionClicks , and that's a problem.
so basically this code works until _sessionClicks beacomes greater than 1, then nothing works properly
any other ideas?
thanks!!