Jump to content

question


tsue
 Share

Recommended Posts

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

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

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
Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...