qwertylol Posted July 7, 2007 Posted July 7, 2007 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?
MerkurAlex Posted July 8, 2007 Posted July 8, 2007 (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 July 8, 2007 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]
PsaltyDS Posted July 8, 2007 Posted July 8, 2007 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! 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
MerkurAlex Posted July 8, 2007 Posted July 8, 2007 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! yea thats better then mine [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]
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