James Posted August 11, 2007 Posted August 11, 2007 Hey,I am still working on my game. Just to let anyone know, whom may be interested, I have done the following:If you are 10 away from reaching 0 then the number you need to make turns green (almost)You now need to make 0 (equation entered is taken away from the number you need to make)Registration (With the function I created (found in my blog))Errors are now logged in error.logThanks to larry, it now draws on the screen, Winner! or Try Again!Animated WindowHelp is now in a seperate file for easy updatingAnyway, I have now decided I will work on the first point in my list.Func RealTime() $MathRead = GUICtrlRead($NumberEntry) $Equation = GUICtrlRead($ToMake) If $MathRead <> $CTRLRead And StringLen($MathRead) > 1 Then $value = $Random - Execute($MathRead) GUICtrlSetData($ToMake, $value) EndIf If $Equation < 11 Then GUICtrlSetColor($ToMake, 0x00ff00) Else GUICtrlSetColor($ToMake, 0x4682b4) EndIf EndFunc ;==>RealTimeBut the control just keeps flashing. It tries to update itself with nothing. Any ideas?-James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted August 11, 2007 Author Posted August 11, 2007 (edited) Well, I have changed the flickering to only start when the number has changed. Func RealTime() $MathRead = GUICtrlRead($NumberEntry) $Equation = GUICtrlRead($ToMake) If $MathRead <> $CTRLRead And StringLen($MathRead) > 1 Then $value = $Random - Execute($MathRead) GUICtrlSetData($ToMake, $value) EndIf If $Equation < $CTRLRead Then If $Equation < 11 Then GUICtrlSetColor($ToMake, 0x00ff00) Else GUICtrlSetColor($ToMake, 0x4682b4) EndIf EndIf EndFunc ;==>RealTime It now starts flickering after a while. Edited August 11, 2007 by JamesB Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Moderators SmOke_N Posted August 11, 2007 Moderators Posted August 11, 2007 You don't give much to help you... but looking at your data provided... I can see that you're probably calling this function every loop. 2 things you might think of... 1. Remove the data from the $NumberEntry control and see if that helps. 2. And or, store the last known value (after you've committed the statement to be true) in a Global variable, and use that as an extra Condition, if it = the last known value, then don't update. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
James Posted August 11, 2007 Author Posted August 11, 2007 Sorry, I thought I explained. So I could create a new function, which will check if the number = the old number if not it updates. Thanks Smoke, -James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Moderators SmOke_N Posted August 11, 2007 Moderators Posted August 11, 2007 Sorry, I thought I explained. So I could create a new function, which will check if the number = the old number if not it updates.Thanks Smoke,-JamesYou might have explained... but the code uses vars outside what you have provided... so you leave us guessing.Let's ASSume for a moment... that i know what you are doing based on your "Var" names.GUICtrlRead() may return the numbers you've entered, but they are strings, not numbers/int's.... that should be enough of a hint to help with some issues (such as this would turn false even if it were true $Equation < $CTRLRead a lot.) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
James Posted August 11, 2007 Author Posted August 11, 2007 Right, so I could use arrays? But I think they would get big right? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now