tsue Posted April 10, 2008 Share Posted April 10, 2008 hi, im liking auto it more and more. but i got stuck in a function . can i do this if its posible then whats my error IniWrite("file.ini", "project" , if mouseclick("left",793,232) Then MsgBox(0, "jajaja", "jejeje" end if) Link to comment Share on other sites More sharing options...
Coolw Posted April 10, 2008 Share Posted April 10, 2008 What are you trying to accomplish? This doesn't look like what IniWrite is supposed to do. IniWrite ( "filename", "section", "key", "value" ) My ProgramsMy WIP'sSteam Server Restarter Link to comment Share on other sites More sharing options...
tsue Posted April 10, 2008 Author Share Posted April 10, 2008 What are you trying to accomplish? This doesn't look like what IniWrite is supposed to do. IniWrite ( "filename", "section", "key", "value" ) im new to auto it, im learning to combine stuff like $title = WinGetTitle("") IniWrite ( "filename", $title, "key", "value" ) so maybe i thought something like an if inside will work Link to comment Share on other sites More sharing options...
MHz Posted April 10, 2008 Share Posted April 10, 2008 (edited) im new to auto it, im learning to combine stuff like $title = WinGetTitle("") IniWrite ( "filename", $title, "key", "value" ) so maybe i thought something like an if inside will work"If" used within functions like your 1st attempt is invalid syntax. You are better off trying to keep it simple upon learning AutoIt3 and developing your skill as you progress. Your first attempt is invalid but your last attempt would be like the below. IniWrite ( "filename", WinGetTitle(""), "key", "value" ) The function parameter expects a value and since WinGetTitle() returns a value (even an empty string value) then it is valid. Edit: Fixed wording Edited April 10, 2008 by MHz Link to comment Share on other sites More sharing options...
tsue Posted April 11, 2008 Author Share Posted April 11, 2008 "If" used within functions like your 1st attempt is invalid syntax. You are better off trying to keep it simple upon learning AutoIt3 and developing your skill as you progress. Your first attempt is invalid but your last attempt would be like the below. IniWrite ( "filename", WinGetTitle(""), "key", "value" ) The function parameter expects a value and since WinGetTitle() returns a value (even an empty string value) then it is valid. Edit: Fixed wording thanks for the tip, but then how do i write various letters without a simple command, like a, b, c but not like this IniWrite ( "filename", "section", "key", "a,b,c" ) what i mean is seppareted or not even letters buttons too like when clicking cerain buttons or letters then the program writes them continuously (not separated by keys) not like this when it saves the ini: inifile [section1] key=1 key=1 key=1 key=button key=button something like this [section1] key=1,1,1,button,button Link to comment Share on other sites More sharing options...
therks Posted April 11, 2008 Share Posted April 11, 2008 (edited) I'm not totally sure I understand your question, but do you mean something like this? $newValue = Random() $oldValue = IniRead('File', 'Key', 'Value', '') IniWrite('File', 'Key', 'Value', $oldValue & ', ' & $newValue) Edited April 11, 2008 by Saunders My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
leias Posted April 11, 2008 Share Posted April 11, 2008 I'm not totally sure I understand your question, but do you mean something like this? $newValue = Random() $oldValue = IniRead('File', 'Key', 'Value', '') IniWrite('File', 'Key', 'Value', $oldValue & ', ' & $newValue) almost where it says new value IniWrite('File', 'Key', 'Value', $oldValue & ', ' & $newValue) how do i put a code that can get me repeated answer like if $newValue = left so the ini can look something like this key=left left left right up left here to put the numbers of left marked Link to comment Share on other sites More sharing options...
leias Posted April 11, 2008 Share Posted April 11, 2008 hello i think he means something like this but i dont know how to do it can someone tell me how to make something like this where it says new value IniWrite('File', 'Key', 'Value', $oldValue & ', ' & $newValue) how do i put a code that can get me repeated answer like if $newValue = left so the ini can look something like this key=left left left right up left here to put the numbers of left marked Link to comment Share on other sites More sharing options...
therks Posted April 12, 2008 Share Posted April 12, 2008 Hmm... have you looked at _StringRepeat? #Include <String.au3> $sString = 'Hello' $iRepeatCount = 5 MsgBox(0, '', _StringRepeat($sString, $iRepeatCount)) My AutoIt Stuff | My Github 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