Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

req: tutorial autoit to autohotkey


  • Please log in to reply
5 replies to this topic
drmrfrk
  • Members
  • 6 posts
  • Last active: Sep 01 2013 10:17 PM
  • Joined: 14 Aug 2013
I'm aware autohotkey supports easy conversion of autoitv2 scripts. Is there any official or 3rd party solutions to convert from the new autoit v3 version to autohotkey? I'm going to try taking my autoit v3 script and see if i can rework it to make it functionable in the old autoitv2 editor.

I have 4 or 5 700+ line scripts in the autoitv3 format that i'm hoping i can port over to the autohotkey format.


edit: i found the thread over at http://www.autohotke...ng/#entry599935

I'm hoping that will help out with the process as I've always used the scite editor in the past and am very pleased with it.

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
Is there any official or 3rd party solutions to convert from the new autoit v3 version to autohotkey?

 

On a side note, autoit v2 & ahk < v1.1 had pretty close syntax. As each are being developed, however, their syntaxes are becoming less & less similar. Sure, their scripts could be ported - just like a VB script could be ported to AHK. However, call me scripting masochist, but say you may be better updating the scripts by hand. It'll help you learn AHK better.



fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007

I'm aware autohotkey supports easy conversion of autoitv2 scripts.

No longer true as of AHK v1.1.09 (IIRC).

drmrfrk
  • Members
  • 6 posts
  • Last active: Sep 01 2013 10:17 PM
  • Joined: 14 Aug 2013

I spent a good 3-4 hours yesterday and learned the in's and out's of some of the syntax changes.

Some things that are still bugging me

seems alot of variables that are "supposed" yo be global don't seem to be accesible within a custom defined function.

Differentiating between when variables being referenced if they requre being enclosed by % %. It seems like there isn't a standard rule for calling variables in different built in functions.



Limitations of when and where you can use the standard "if" check. several times I'd be in a

while 1 = 1


return


loop, and for example

if 1= 1
msgbox "this if statement is working"




then if I change the if statement to include more than one command and enclose it in { } it wont work while inside the while loop.

Maybe I'm doing something wrong but the only solution i can find is to use the one command to call another user defined function that can include more than one line.

This was a simple autoit script I chose to port over to autohotkey to learn the syntax

One specific thing I couldn't get working was referencing the A_Sec variable inside the last
_startmining(x,y,dropx,dropy) custom function.

This is a personal script for gaming. I have a handful of thousand line scripts that facilitate automatic installs, management of data, and communications with a domain contoller running active directory on microsoft server 2008.

I've heard good things about autohotkey as well as seen quite a bit of advanced capabilities that could be used in the workplace. I'm hesitant to make the switch though.

Excuse any typos, I'm using an iphone with the p0s keyboard.
 

Spoiler


drmrfrk
  • Members
  • 6 posts
  • Last active: Sep 01 2013 10:17 PM
  • Joined: 14 Aug 2013

No longer true as of AHK v1.1.09 (IIRC).


/cry

I've used the scite editor since day one in autoit. I setup the beta autohotkey release. I like the editor due to the similar layout however...

Does anyone have a good autohotkey script editor that has built in auto syntax suggestions?
aka: in autoit scite when you type in msgbox... it pops up with a quick reminder of what different variables and options that function uses/requires

That or an editor that has a built in tool/help file to find different functions an their info. Having to constantly go back to the function documentation on the website and having 15+ tabs open is not very efficient. It may just be me that does that but having a way to quick and easily lookup functions is a HUGE time saver.

In the autoit scite version you can simply have ur cursor by a function... for example

pixelsearch(100,200,300,300,x0fffff) if your cursor was anywhere within the pixelsearch text, you can press f1 and instantly bring up all the relevant info on that function as well as many related functions that may or may not improve the way you want to achieve something.

I'm more of a visual/hands on learner. If I can find info on the function i want to use and then an example of how someone else has used it in even a slightly similar manner, I can easily learn the proper syntax needed to implement and custimize the function the way I need it.

I'm a seasoned veteran of using google site searches to search support forums, but with the current autohotkey script documentation/examples setup being all through the website and forums, I almost always find 2-3 results with not even remotely similar uses of the function or 30+ results of forum threads where the thread could be 8 pages long and almost all results that come back are where someone simply replies with "this .... function would work best for your need" When the post/entire thread doesn't have any hands on custimization of the function.


-------------------------

I'll keep looking around but suggestions on choosing an editor with some of the functions above, coming from you scripters with much more autohotkey experience would be a GREAT help.

I appreciate all your help.


Once again excuse any typos on my p0s on screen phone keyboard.

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009

Does anyone have a good autohotkey script editor that has built in auto syntax suggestions?
aka: in autoit scite when you type in msgbox... it pops up with a quick reminder of what different variables and options that function uses/requires

SciTE4AutoHotkey does that. Type Ms + tab + space & you'll get MsgBox typed out for you, that space, & a tooltip letting you know the parameters & info on command.
 

Having to constantly go back to the function documentation on the website and having 15+ tabs open is not very efficient.

I typically use the AutoHotkey Help file that comes with the installation if I need to see the documentation.
 

Some things that are still bugging me

Much of that is just learning how AHK is different. Again, the syntaxes are different. For instance, you seem to be confusing a variable in the global scope (global variable?) with a Super-Global variable (accessible anywhere in the script - including functions). While 1=1 - that's just an infinite loop - just use the Loop command. If 1=1 - again, just a true statment - just use If true, or If (1=1). Concerning deferencing variables, you need to understand the difference between literal text & an expression. Commands use literal text, whereas functions use expressions. Generally speaking, if it's between parenthesis, it's an expression.