Sign in to follow this  
Followers 0
Paki

Help with hotkey plz

12 posts in this topic

Sry for my newb question but i very need this

Can i made some ini file or something else to change hotkey? I need it cose i have a lil script where i set hotkey to Backspace. But other people may be want set hotkey to other key without editing script. Can it be done?

Share this post


Link to post
Share on other sites



Have you tried to do it yet?

$HKValue = IniRead('Path to ini', 'Section', 'key', 'Not Found')
HotKeySet('"' & $HKValue & '"', 'FunctionToCall')

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

here what i try

$HKValue = IniRead('C:\Temp\myfile.ini', 'Section1', 'key', 'Hotkey')
HotKeySet('"' & $HKValue & '"', 'go')


While 1 
sleep ("10") 
WEnd 

Func go() 

Sleep(100) 
Send("{F8}") 
MouseClick("right") 
Sleep(1250) 
MouseMove(369,237, 3)
MouseClick("left") 
Sleep(200) 
Send("p") 
Sleep(50) 
MouseMove(108,144, 0) 
MouseClick("left") 

EndFunc

and this ini file

Section1
Key=F10

but it didnt do anything when i push F10. I do something wrong here?

Share this post


Link to post
Share on other sites

Your ini should look like:

[section]

Key={F10}

Your section has to have brackets, and curly brackets for the F10 hotkey command.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Hmm i change this but it does not want to work :o

$HKValue = IniRead('C:\Temp\myfile.ini', 'Section', 'key', 'Not Found')
HotKeySet('"' & $HKValue & '"', 'go')


While 1 
sleep ("10") 
WEnd 

Func go() 

Sleep(100) 
Send("{F8}") 
MouseClick("right") 
Sleep(1250) 
MouseMove(369,237, 3)
MouseClick("left") 
Sleep(200) 
Send("p") 
Sleep(50) 
MouseMove(108,144, 0) 
MouseClick("left") 

EndFunc

I make ini file this path C:\Temp\myfile.ini

here it is

[section]Key={F10}

btw big thanks for help

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Just out of curiousity... is your actual ini file in C:\Temp?

$HKValue = IniRead('C:\Temp\myfile.ini', 'Section', 'key', 'Not Found')
If Not $HKValue <> 'Not Found' Then MsgBox(0, 'Error', 'IniFile is not where you say it is')
HotKeySet('"' & $HKValue & '"', 'go')


While 1
    Sleep(10)
WEnd

Func go()
    Sleep(100)
    Send("{F8}")
    MouseClick("right")
    Sleep(1250)
    MouseClick("left", 369, 237, 1, 3)
    Sleep(200)
    Send("p")
    Sleep(50)
    MouseClick("left", 108, 144, 1, 1)
EndFunc
Run this code... Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

may be i am so stupid but i have check it 100 times ini file in the right place but script dont see him.....

Share this post


Link to post
Share on other sites

Just out of curiousity... is your actual ini file in C:\Temp?

$HKValue = IniRead('C:\Temp\myfile.ini', 'Section', 'key', 'Not Found')
If Not $HKValue <> 'Not Found' Then MsgBox(0, 'Error', 'IniFile is not where you say it is')
HotKeySet('"' & $HKValue & '"', 'go')
While 1
    Sleep(10)
WEnd

Func go()
    Sleep(100)
    Send("{F8}")
    MouseClick("right")
    Sleep(1250)
    MouseClick("left", 369, 237, 1, 3)
    Sleep(200)
    Send("p")
    Sleep(50)
    MouseClick("left", 108, 144, 1, 1)
EndFunc
Run this code...
SmOke_N,

Do you have some time to look at this to see if there is something that sticks out at you now as being wrong? I am unable to get it to work, but I like your concept.

Thanks.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

SmOke_N,

Do you have some time to look at this to see if there is something that sticks out at you now as being wrong? I am unable to get it to work, but I like your concept.

Thanks.

taurus905

You're either being funny or you forgot to post/upload what you wanted SmOke_N to look at. Then again there's the forum bug could have messed up your message :)

Share this post


Link to post
Share on other sites

Maybe the problems was the ini file use this script to make it :)

DirCreate ( "C:\Temp\" )
Iniwrite('C:\Temp\myfile.ini', 'Section', 'key', '{F10}')

Share this post


Link to post
Share on other sites

Umm, just a small guess here, but when he edited the INI I think he accidently delited the @CRLF.


[center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw

Share this post


Link to post
Share on other sites

Umm, just a small guess here, but when he edited the INI I think he accidently delited the @CRLF.

That what I think too :)

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