thenewkid Posted October 7, 2007 Share Posted October 7, 2007 Hi ive been trying to fix this script but i cant find whats wrong with the code what is wrong is when it makes the sum it sets the label as 0*0 all the time but it shold not be can any one help thanks expandcollapse popup#include <GUIConstants.au3> $ini = "Timestableswizz.ini" #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Time tables wizz", 223, 170, 193, 115) GUISetFont(10, 400, 0, "MS Sans Serif") GUISetBkColor(0x008000) $Label1 = GUICtrlCreateLabel("THE SUM:", 8, 24, 68, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Label2 = GUICtrlCreateLabel("ALabel2", 96, 24, 54, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Label3 = GUICtrlCreateLabel("IS IT", 8, 64, 31, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Radio1 = GUICtrlCreateRadio("", 96, 64, 113, 17) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Radio2 = GUICtrlCreateRadio("", 96, 80, 113, 17) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Radio3 = GUICtrlCreateRadio("", 96, 96, 113, 17) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Radio4 = GUICtrlCreateRadio("", 96, 112, 113, 17) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Button1 = GUICtrlCreateButton("Next", 8, 96, 75, 25, BitOR($BS_CENTER,$BS_VCENTER,$BS_PUSHLIKE,$BS_FLAT,$WS_BORDER,$WS_CLIPSIBLINGS), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Label4 = GUICtrlCreateLabel("Your Socre", 8, 136, 71, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Label5 = GUICtrlCreateLabel("", 88, 136, 54, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Func _newsum() ;gets the mode $Mode = IniRead($ini,"SETINGS", "MODE", "EASY") ;easy If $Mode = "EASY" Then $1 = 10 $2 = 0 EndIf ;medium If $Mode = "MEDIUM" Then $1 = 12 $2 = 1 EndIf ;hard If $Mode = "HARD" Then $1 = 20 $2 = 1 EndIf ;make the sum $number = Random( $1, $2, 1) GUICtrlSetData( $Label2, $number & "*" & $number) EndFunc While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _newsum() EndSwitch WEnd some of my scripts check them out and give feedback so i can learn from them :)autoclicker a autoclickernote taker a script to take notes with Link to comment Share on other sites More sharing options...
Nahuel Posted October 7, 2007 Share Posted October 7, 2007 expandcollapse popup#include <GUIConstants.au3> $ini = "Timestableswizz.ini" #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Time tables wizz", 223, 170, 193, 115) GUISetFont(10, 400, 0, "MS Sans Serif") GUISetBkColor(0x008000) $Label1 = GUICtrlCreateLabel("THE SUM:", 8, 24, 68, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Label2 = GUICtrlCreateLabel("ALabel2", 96, 24, 54, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Label3 = GUICtrlCreateLabel("IS IT", 8, 64, 31, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Radio1 = GUICtrlCreateRadio("", 96, 64, 113, 17) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Radio2 = GUICtrlCreateRadio("", 96, 80, 113, 17) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Radio3 = GUICtrlCreateRadio("", 96, 96, 113, 17) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Radio4 = GUICtrlCreateRadio("", 96, 112, 113, 17) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Button1 = GUICtrlCreateButton("Next", 8, 96, 75, 25, BitOR($BS_CENTER,$BS_VCENTER,$BS_PUSHLIKE,$BS_FLAT,$WS_BORDER,$WS_CLIPSIBLINGS), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Label4 = GUICtrlCreateLabel("Your Socre", 8, 136, 71, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) $Label5 = GUICtrlCreateLabel("", 88, 136, 54, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x008000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _newsum() EndSwitch WEnd Func _newsum() ;gets the mode $Mode = IniRead($ini,"SETINGS", "MODE", "EASY") ;easy If $Mode = "EASY" Then $1 = 10 $2 = 0 EndIf ;medium If $Mode = "MEDIUM" Then $1 = 12 $2 = 1 EndIf ;hard If $Mode = "HARD" Then $1 = 20 $2 = 1 EndIf ;make the sum $number = Random($2, $1, 1) GUICtrlSetData( $Label2, $number & "*" & $number) EndFunc The syntax of Random is Random(min,max) and yours was like Random(max,min) Link to comment Share on other sites More sharing options...
thenewkid Posted October 7, 2007 Author Share Posted October 7, 2007 thank you lol i know it was somethink simple like that some of my scripts check them out and give feedback so i can learn from them :)autoclicker a autoclickernote taker a script to take notes with Link to comment Share on other sites More sharing options...
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