Sign in to follow this  
Followers 0
tsue

question

9 posts in this topic

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)

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (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.

:D

Edit:

Fixed wording

Edited by MHz

Share this post


Link to post
Share on other sites

"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.

:D

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

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by Saunders

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0