Sign in to follow this  
Followers 0
qwertylol

reading commands from .ini files.

4 posts in this topic

This is my ini file:

[1]

command_type = mousemove

parameter_1 = 300

parameter_2 = 300

Once I inireadsection it, I want do something like this:

$one_command[1][1]($one_command[2][1], $one_command[3][1])

which I hope would equal to

mousemove(300, 300)

however, when I tried it, it didn't actually work.

What went wrong?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This is my ini file:

[1]

command_type = mousemove

parameter_1 = 300

parameter_2 = 300

Once I inireadsection it, I want do something like this:

$one_command[1][1]($one_command[2][1], $one_command[3][1])

which I hope would equal to

mousemove(300, 300)

however, when I tried it, it didn't actually work.

What went wrong?

i would try

$comtype=iniread("data.ini","1","command_type","")
$param1=iniread("data.ini","1","parameter_1","")
$param2=iniread("data.ini","1","parameter_2","")
sleep(200)
execute($comtype&"("&$param1&","&$param2&")")

i didnt test it just thought it up let me know if it works

EDITED CODE IT WORKS I TRIED IT

Edited by EagleClaw

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites

Since Execute() is limited in the commands it can run anyway, and you are probably only using a few functions with it, I think you would be better off with something like:

$comtype = IniRead("data.ini", "1", "command_type", "")
Switch $comtype
    Case "MouseMove"
        MouseMove(IniRead("data.ini", "1", "parameter_1"), IniRead("data.ini", "1", "parameter_2"))
        
    Case "MouseClick"
        MouseClick(IniRead("data.ini", "1", "parameter_1"), IniRead("data.ini", "1", "parameter_2"), IniRead("data.ini", "1", "parameter_3"))
        
    Case Else
        MsgBox(16, "Error", "Unhandled case: $comtype = " & $comtype)
EndSwitch

Hope that helps!

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Since Execute() is limited in the commands it can run anyway, and you are probably only using a few functions with it, I think you would be better off with something like:

$comtype = IniRead("data.ini", "1", "command_type", "")
Switch $comtype
    Case "MouseMove"
        MouseMove(IniRead("data.ini", "1", "parameter_1"), IniRead("data.ini", "1", "parameter_2"))
        
    Case "MouseClick"
        MouseClick(IniRead("data.ini", "1", "parameter_1"), IniRead("data.ini", "1", "parameter_2"), IniRead("data.ini", "1", "parameter_3"))
        
    Case Else
        MsgBox(16, "Error", "Unhandled case: $comtype = " & $comtype)
EndSwitch

Hope that helps!

:whistle:

yea thats better then mine :lmao:

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

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