Skip to content

Instantly share code, notes, and snippets.

@robotanarchy
Last active August 29, 2015 14:19
Show Gist options
  • Save robotanarchy/dcc399645e4f36be5de7 to your computer and use it in GitHub Desktop.
Save robotanarchy/dcc399645e4f36be5de7 to your computer and use it in GitHub Desktop.
AutoIt3 Syntax highlighting for Geany (Quick 'n' dirty!)
# This is a quick 'n' dirty made syntax highlighting file for Geany.
# It is based on the ASM-lexer with all its limitations.
#
# Source:
# https://gist.github.com/robotanarchy/dcc399645e4f36be5de7
#
# Installation:
# - Save this file as ~/.config/geany/filedefs/filetypes.AutoIt3.conf
# - add this line to "filetype_extensions.conf" (inside Geany menu Tools
# / Config Files):
# AutoIt3=*.au3;
# - restart geany, open any *.au3 file
# - PROFIT!
[styling]
default=default
comment=comment_line
commentblock=comment
commentdirective=comment
number=number_1
string=string_1
operator=operator
identifier=identifier_1
cpuinstruction=keyword_1
mathinstruction=keyword_2
register=type
directive=preprocessor
directiveoperand=keyword_3
character=character
stringeol=string_eol
extinstruction=keyword_4
[keywords]
instructions=false true continuecase continueloop default dim global local const do until enum exit exitloop for to step next for in next func return endfunc if then if elseif else endif null redim select case endselect static switch case endswitch volatile while wend with endwith not and or
registers=@appdatacommondir @appdatadir @autoitexe @autoitpid @autoitversion @autoitx64 @com_eventobj @commonfilesdir @compiled @computername @comspec @cpuarch @cr @crlf @desktopcommondir @desktopdepth @desktopdir @desktopheight @desktoprefresh @desktopwidth @documentscommondir @error @exitcode @exitmethod @extended @favoritescommondir @favoritesdir @gui_ctrlhandle @gui_ctrlid @gui_dragfile @gui_dragid @gui_dropid @gui_winhandle @homedrive @homepath @homeshare @hotkeypressed @hour @ipaddress1 @ipaddress2 @ipaddress3 @ipaddress4 @kblayout @lf @localappdatadir @logondnsdomain @logondomain @logonserver @mday @min @mon @msec @muilang @mydocumentsdir @numparams @osarch @osbuild @oslang @osservicepack @ostype @osversion @programfilesdir @programscommondir @programsdir @scriptdir @scriptfullpath @scriptlinenumber @scriptname @sec @startmenucommondir @startmenudir @startupcommondir @startupdir @sw_disable @sw_enable @sw_hide @sw_lock @sw_maximize @sw_minimize @sw_restore @sw_show @sw_showdefault @sw_showmaximized @sw_showminimized @sw_showminnoactive @sw_showna @sw_shownoactivate @sw_shownormal @sw_unlock @systemdir @tab @tempdir @tray_id @trayiconflashing @trayiconvisible @username @userprofiledir @wday @windowsdir @workingdir @yday @year
directives=abs acos adlibregister adlibunregister asc ascw asin assign atan autoitsetoption autoitwingettitle autoitwinsettitle beep binary binarylen binarymid binarytostring bitand bitnot bitor bitrotate bitshift bitxor blockinput break call cdtray ceiling chr chrw clipget clipput consoleread consolewrite consolewriteerror controlclick controlcommand controldisable controlenable controlfocus controlgetfocus controlgethandle controlgetpos controlgettext controlhide controllistview controlmove controlsend controlsettext controlshow controltreeview cos dec dircopy dircreate dirgetsize dirmove dirremove dllcall dllcalladdress dllcallbackfree dllcallbackgetptr dllcallbackregister dllclose dllopen dllstructcreate dllstructgetdata dllstructgetptr dllstructgetsize dllstructsetdata drivegetdrive drivegetfilesystem drivegetlabel drivegetserial drivegettype drivemapadd drivemapdel drivemapget drivesetlabel drivespacefree drivespacetotal drivestatus envget envset envupdate eval execute exp filechangedir fileclose filecopy filecreatentfslink filecreateshortcut filedelete fileexists filefindfirstfile filefindnextfile fileflush filegetattrib filegetencoding filegetlongname filegetpos filegetshortcut filegetshortname filegetsize filegettime filegetversion fileinstall filemove fileopen fileopendialog fileread filereadline filereadtoarray filerecycle filerecycleempty filesavedialog fileselectfolder filesetattrib filesetpos filesettime filewrite filewriteline floor ftpsetproxy funcname guicreate guictrlcreateavi guictrlcreatebutton guictrlcreatecheckbox guictrlcreatecombo guictrlcreatecontextmenu guictrlcreatedate guictrlcreatedummy guictrlcreateedit guictrlcreategraphic guictrlcreategroup guictrlcreateicon guictrlcreateinput guictrlcreatelabel guictrlcreatelist guictrlcreatelistview guictrlcreatelistviewitem guictrlcreatemenu guictrlcreatemenuitem guictrlcreatemonthcal guictrlcreateobj guictrlcreatepic guictrlcreateprogress guictrlcreateradio guictrlcreateslider guictrlcreatetab guictrlcreatetabitem guictrlcreatetreeview guictrlcreatetreeviewitem guictrlcreateupdown guictrldelete guictrlgethandle guictrlgetstate guictrlread guictrlrecvmsg guictrlregisterlistviewsort guictrlsendmsg guictrlsendtodummy guictrlsetbkcolor guictrlsetcolor guictrlsetcursor guictrlsetdata guictrlsetdefbkcolor guictrlsetdefcolor guictrlsetfont guictrlsetgraphic guictrlsetimage guictrlsetlimit guictrlsetonevent guictrlsetpos guictrlsetresizing guictrlsetstate guictrlsetstyle guictrlsettip guidelete guigetcursorinfo guigetmsg guigetstyle guiregistermsg guisetaccelerators guisetbkcolor guisetcoord guisetcursor guisetfont guisethelp guiseticon guisetonevent guisetstate guisetstyle guistartgroup guiswitch hex hotkeyset httpsetproxy httpsetuseragent hwnd inetclose inetget inetgetinfo inetgetsize inetread inidelete iniread inireadsection inireadsectionnames inirenamesection iniwrite iniwritesection inputbox int isadmin isarray isbinary isbool isdeclared isdllstruct isfloat isfunc ishwnd isint iskeyword isnumber isobj isptr isstring log memgetstats mod mouseclick mouseclickdrag mousedown mousegetcursor mousegetpos mousemove mouseup mousewheel msgbox number objcreate objcreateinterface objevent objget objname onautoitexitregister onautoitexitunregister ping pixelchecksum pixelgetcolor pixelsearch processclose processexists processgetstats processlist processsetpriority processwait processwaitclose progressoff progresson progressset ptr random regdelete regenumkey regenumval regread regwrite round run runas runaswait runwait send sendkeepactive seterror setextended shellexecute shellexecutewait shutdown sin sleep soundplay soundsetwavevolume splashimageon splashoff splashtexton sqrt srandom statusbargettext stderrread stdinwrite stdioclose stdoutread string stringaddcr stringcompare stringformat stringfromasciiarray stringinstr stringisalnum stringisalpha stringisascii stringisdigit stringisfloat stringisint stringislower stringisspace stringisupper stringisxdigit stringleft stringlen stringlower stringmid stringregexp stringregexpreplace stringreplace stringreverse stringright stringsplit stringstripcr stringstripws stringtoasciiarray stringtobinary stringtrimleft stringtrimright stringupper tan tcpaccept tcpclosesocket tcpconnect tcplisten tcpnametoip tcprecv tcpsend tcpshutdown, udpshutdown tcpstartup, udpstartup timerdiff timerinit tooltip traycreateitem traycreatemenu traygetmsg trayitemdelete trayitemgethandle trayitemgetstate trayitemgettext trayitemsetonevent trayitemsetstate trayitemsettext traysetclick trayseticon traysetonevent traysetpauseicon traysetstate traysettooltip traytip ubound udpbind udpclosesocket udpopen udprecv udpsend vargettype winactivate winactive winclose winexists winflash wingetcaretpos wingetclasslist wingetclientsize wingethandle wingetpos wingetprocess wingetstate wingettext wingettitle winkill winlist winmenuselectitem winminimizeall winminimizeallundo winmove winsetontop winsetstate winsettitle winsettrans winwait winwaitactive winwaitclose winwaitnotactive
[settings]
# comment_single, comment_open, comment_close get ignored?
# default extension used when saving files
extension=au3
lexer_filetype=ASM
comment_use_indent=true
# context action command (please see Geany's main documentation for details)
context_action_cmd=
[build_settings]
# %f will be replaced by the complete filename
# %e will be replaced by the filename without extension
# (use only one of it at one time)
# wine aut2exe or something here.
compiler=
@robotanarchy
Copy link
Author

I've ripped the "instructions", "registers", "directives" variables directly from the online documentation in the web browser. Open up the specified URL, paste the Javascript code in the developers console (press F12) and you'll get these lines.

// https://www.autoitscript.com/autoit3/docs/functions.htm
var c = "functions"
var b = [];
var a =document.getElementsByTagName("a");
        for(var i=0;i<a.length;i++)
                if(a[i].href.indexOf(c+"/") > -1 && a[i].innerHTML.indexOf('#')==-1)
                        b.push(
                                a[i].innerHTML
                                .toLowerCase()
                                .split(".").join(" ")
                                .split("/").join(" ")
                        );

b = b.join(" ");
while(b.indexOf("  ")>-1) b = b.replace("  ", " ");
console.log("directives="+b);
// https://www.autoitscript.com/autoit3/docs/macros.htm
var c = "macros"
var b = [];
var a =document.getElementsByTagName("strong");
        for(var i=0;i<a.length;i++)
                if(a[i].innerHTML.indexOf("@") == 0)
                        b.push(
                                a[i].innerHTML
                                .toLowerCase()
                                .split(".").join(" ")
                                .split("/").join(" ")
                        );

b = b.join(" ");
while(b.indexOf("  ")>-1) b = b.replace("  ", " ");
console.log("registers="+b);
// https://www.autoitscript.com/autoit3/docs/keywords.htm
var b = [];
var a =document.getElementsByTagName("a");
        for(var i=0;i<a.length;i++)
                if(a[i].href.indexOf("keywords/") > -1 && a[i].innerHTML.indexOf('#')==-1)
                        b.push(
                                a[i].innerHTML
                                .toLowerCase()
                                .split(".").join(" ")
                                .split("/").join(" ")
                        );

b = b.join(" ");
while(b.indexOf("  ")>-1) b = b.replace("  ", " ");
console.log("instructions="+b+" not and or");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment