Jump to content

MachinistProgrammer

Active Members
  • Posts

    108
  • Joined

  • Last visited

Everything posted by MachinistProgrammer

  1. I think it would be better to have both @CmdLine and @CmdLineRaw. A macro better expresses the behavior of $cmdline and by keeping both. But this would also make breaking changes for little gain.
  2. ​a reasonably easy solution would be ;BEGIN UPLOADER For $i = 1 To $arrayLength - 1 WinActivate(" File & Image Uploader 7.1.3 = Freeware =","") sleep (300) Controlclick(" File & Image Uploader 7.1.3 = Freeware =","","[CLASS:SysHeader32; INSTANCE:1]","left", 1, 483, 9) ;set the listing by alphabetical order Controlclick(" File & Image Uploader 7.1.3 = Freeware =","","[CLASS:TPanel; INSTANCE:1]","left", 1, 14, 23) ;click on the select file input sleep (500) ControlSend ("Open","","[CLASSNN:Edit1]", $array[$i]) sleep (400) Controlclick("Open","","[CLASSNN:Button2]") sleep (400) ;this lines actually say what file to upload starting from the first file in the array list Do sleep (100) ClipPut("") ;clipoard empty sleep (100) Controlclick(" File & Image Uploader 7.1.3 = Freeware =","","[CLASSNN:TTntListView.UnicodeClass1]") ;click to the output area of uptool to get either error code or down link Send("{HOME}") Send("{SHIFTDOWN}{END}{SHIFTUP} ") Send("{DEL}") Local $LINKZ = ClipGet() Select Case $LINKZ = "Error: Download link not found!" ContinueLoop Case $LINKZ <>"Error: Download link not found!" AND $LINKZ <> "" ExitLoop Until $LINKZ <> ""
  3. I seem to remember hearing that au3check used yacc or bison or something so dose anyone know where I can get a copy of the AutoIt grammar?
  4. has anyone come across a way to take a regex and generate a random string that matches like $my_random_string = randregex("[0-9_a-zA-z]+") msgbox(0,'',StringRegExp($my_random_string,"[0-9_a-zA-z]+"))
  5. This UDF divides the gui into halves. Is it possible to divide it into thirds like ISN AutoIt studio does?
  6. I don't think I've made the issue clear enough. I'll give an example. A couple of weeks ago I was writing a program to open a file on an external HDD, write some data then delete it every 5 minuets (it was to stop the problem with windows 8 turning of the HDD after 5 minuets when watching videos on external HDD's) I used to >Safely Eject a USB Drive check if a drive was an external HDD, And I used >_NTService to start the script as a service. Safely Eject a USB Drive includes winapi which includes securityconstants. _NTService had some of the same constants as securityconstants (probably was written before they were added) so securityconstants constants conflicted with _NTService constants
  7. A common problem I have is trying to use new and old autoit code, where the new code relies on newer UDF's and the UDF's have constants which are identical to constants declared in the the older code. I have come up with 3 potential solutions 1. access modifyers for #include (e.g. private #include "somefile.au3") 2. The autoit not raising an error if a constant or function was redeclared if it is identical to their original decleration 3. making global variables not used in the main script invisible to other #includes I hope the autoit team takes one of these ideas onboard as re-writing old autoit code to work with new autoit code is quite anoying.
  8. C is primarily procedural but if you look around there are various examples of OOP in C. anyway I wasn't saying autoit is going OOP just that Hash Tables will make doing OOP in autoit easier. its like lua it "dosen't" have OOP but it can be implemented. (it was already possable via autoitObject)
  9. I have been away from Autoit for a while (Learning Digital Mars D) and I just had a poke around and noticed Autoit has associative arrays or hash tables as they are also known (like lua tables or D's associative array) and I noticed you cannot get dot access for calling functions but you can still use funcname name. I presume that it must be a bug. I also noticed that Manadar said that at 100k keys plus that there is a speed drop off. I think that would be because Autoit would have to check for duplications before assigning toe next key. Finally I am very happy with the implementation of Maps because it means a proper OOP future for Autoit is now in sight local $class[] Func somefunc($str) MsgBox(0,'',$str) EndFunc $class.afunc = somefunc somefunc(FuncName($class.afunc)) $class.afunc("s")
  10. how dose autoitObject create new com classes dynamically? i thought that com objects were static
  11. i ave writen the following in VB.Net <ComClass(core.ClassId, core.InterfaceId, core.EventsId)> Public Class core Public Const ClassId As String = "790D4506-D57D-4E2D-935A-1CC02C4B7CB4" Public Const InterfaceId As String = "0568FCF5-248C-4853-AFC6-309A838EA978" Public Const EventsId As String = "E81585D3-D5C3-4344-A830-D18A54F6A64E" Public Sub New() MyBase.New() End Sub Public Event AnEvent(test As String) Public Sub newevent(yourstring As String) RaiseEvent AnEvent(yourstring) End Sub End Class it works fine. however when i use objevent in autoit to hook AnEvent objevent sets @error to 1. where have i err'd should it be called with Called with <dllname>.core <dllname>.core.AnEvent or <dllname>.AnEvent or have i written the VB.Net Event Wrong
  12. what happens if you pass an autoit function to a com object can you manipulate the function in any way? (eg call it or somthing)
  13. for some reason the dialog is not returning a proper hexdecemel
  14. i had a brife look and I think that this may be very usefull thanks for sharing
  15. What really I looked at the script and couldn't Find the bit that creates the button EDIT: Stupid Autocomplete
  16. if you know of a Dllwrapper for ribbons in autoit please tell me!
  17. if you read my first post it says "it is impossable to a ribbon in just autoit" i've already read that thread and it requires RibRes.Dll which is an external Dll written by trancexx. Sure it creates a ribbon, but in order to create your own you would have to write your own Dll. you canno individually create the tabs and buttons from autoit. so its not "just autoit". sure i rely on 3 Dlls but they are icon resources
  18. Absolutly And compleatly mindblowing If you couple this with '?do=embed' frameborder='0' data-embedContent>> and '?do=embed' frameborder='0' data-embedContent>> you could have it as an icon editing utility (p.s please do. I would really like an icon editor written in autoit )
  19. As far as I know it is impossable to a ribbon in just autoit. But That dosent mean that we can't emulate the look & feal of a ribbon on autoit.de (the german autoit forum). I found this. Unfortunatly It Had Major Lag Problems when changing tabs (see for your self). but with the help of _WinAPI_SetParent i created a replacment for it GUICtrlRibbon The example is in german because Im too lazy to make one of my own. Update bugfixes & the udf is now complient with autoit best coding practices (If you find a non-complient bit please tell me so I can fix it) (p.s how can i strike out previous files) GUICtrlRibbon.zip GUICtrlRibbon.zip
  20. i don't want source or anything just the theory of how it works as in dose it actually compile the code or use a special version of the autoit interpreter (autoit.bin) with the source code attached
  21. i know De-complication of autoit exe's is not allow but if i used a De-assembler to convert them into raw machine code so i can execute it in another thread (AKA multithreading autoit) is that OK and if so how can i execute the machine code in another thread
  22. Added Source Code And Updated to Version 1.1 Chanellog
  23. I don't know if it has been done before But Here is a CMD version of Autoit. source code now available #NoTrayIcon #region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=..\..\..\..\Desktop\Autoit CMD.exe #AutoIt3Wrapper_Res_Description=Command Line Interpreter for Autoir3 #AutoIt3Wrapper_Res_Fileversion=1.0.0.0 #AutoIt3Wrapper_Res_LegalCopyright=Sycam Inc #AutoIt3Wrapper_Res_requestedExecutionLevel=highestAvailable #AutoIt3Wrapper_Run_AU3Check=n #AutoIt3Wrapper_Run_Tidy=y #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** ;#AutoCMD.au3#================================== ;File Name.......:AutoCMD.au3 ;Creator.........:sean.campbell7 ;Created with....:Created with ISN AutoIt Studio ;Version.........:0.95 BETA ;============================================= #include <console.au3> #include <array.au3> #include <file.au3> #include <string.au3> Local $CharSet = "qwertyuiopasdfghjkzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890_" Assign("$cd", @UserProfileDir, 2) Cout('Welcome to the Autoit Command line interpreter' & @LF) While 1 _CMD() WEnd Func _CMD() Local $cmd Cout(">>") Cin($cmd) $exe = DoCmd($cmd) If $exe = '' Then $exe = "Null" ElseIf StringInStr($exe, "-ret") Then Return Cout(StringReplace($exe, "-ret", '')) EndIf Cout('Ret:' & $exe & @LF) EndFunc ;==>_CMD Func DoCmd($cmd) If StringLeft($cmd, 1) = "$" Then $var = StringLeft($cmd, StringInStr($cmd, "=") - 1) $icmd = StringReplace(StringTrimLeft($cmd, StringInStr($cmd, "=")), " ", '') $exe = _Execute($icmd) Assign(StringReplace($var, ' ', ''), $exe, 2) Return $exe ElseIf $cmd = "exit" Then Exit Else Return _Execute($cmd) EndIf EndFunc ;==>DoCmd Func About() $ret = "Name....: Autoit Console" & @LF & _ "Creator.: Sycam Inc (sean Campbell)" & @LF & _ "Version.: 1.1" & @LF & _ "About...: Command line interpreter For AutoIt3-ret" & @LF Return $ret EndFunc ;==>About Func _Execute($icmd) Local $cmd = $icmd Local $varpos[1][2] Local $vars[1] Local $str_3[1][2] $str_1 = _StringGetSub($cmd, '"') For $i = 0 To UBound($str_1) - 1 If $str_1[$i] <> '' Then $rep = _StringRepeat(';', StringLen($str_1[$i])) $cmd = StringReplace($cmd, '"' & $str_1[$i] & '"', $rep) ReDim $str_3[UBound($str_3) + 1][2] $str_3[UBound($str_3) - 1][0] = $rep $str_3[UBound($str_3) - 1][1] = '"' & $str_1[$i] & '"' EndIf Next $str_2 = _StringGetSub($cmd, "'") For $i = 0 To UBound($str_2) - 1 If $str_2[$i] <> '' Then $rep = _StringRepeat(';', StringLen($str_2[$i])) $cmd = StringReplace($cmd, "'" & $str_2[$i] & "'", $rep) ReDim $str_3[UBound($str_3) + 1][2] $str_3[UBound($str_3) - 1][0] = $rep $str_3[UBound($str_3) - 1][1] = "'" & $str_2[$i] & "'" EndIf Next For $i = 1 To _StringGetOccurances($cmd, "$") $chars = StringMid($cmd, StringInStr($cmd, "$", 0, $i) + 1) ReDim $vars[UBound($vars) + 1] $vars[UBound($vars) - 1] = "$" For $x = 1 To StringLen($chars) $chr = StringMid($chars, $x, 1) If StringInStr($CharSet, $chr) Then $vars[UBound($vars) - 1] &= $chr Else ExitLoop EndIf Next Next For $i = 1 To UBound($vars) - 1 $cmd = StringReplace($cmd, $vars[$i], &"'" Eval($vars[$i]) & "'") Next Local $x = 0 For $i = 1 To UBound($str_3) - 1 Do $x += 1 $cmd = StringReplace($cmd, $str_3[$i][0], $str_3[$i][1], 0, $x) Until $x >= UBound($str_3) - 1 Next Return Execute($cmd) EndFunc ;==>_Execute Func CmdPad($icmd) Local $cmd = StringReplace($icmd, "'", '"') Local $varpos[1][2] Local $vars[1] Local $str_3[1][2] $str_1 = _StringGetSub($cmd, '"') For $i = 0 To UBound($str_1) - 1 If $str_1[$i] <> '' Then $rep = _StringRepeat(';', StringLen($str_1[$i])) $cmd = StringReplace($cmd, '"' & $str_1[$i] & '"', $rep) ReDim $str_3[UBound($str_3) + 1][2] $str_3[UBound($str_3) - 1][0] = $rep $str_3[UBound($str_3) - 1][1] = '"' & $str_1[$i] & '"' EndIf Next $str_2 = _StringGetSub($cmd, "'") For $i = 0 To UBound($str_2) - 1 If $str_2[$i] <> '' Then $rep = _StringRepeat(';', StringLen($str_2[$i])) $cmd = StringReplace($cmd, "'" & $str_2[$i] & "'", $rep) ReDim $str_3[UBound($str_3) + 1][2] $str_3[UBound($str_3) - 1][0] = $rep $str_3[UBound($str_3) - 1][1] = "'" & $str_2[$i] & "'" EndIf Next For $i = 1 To _StringGetOccurances($cmd, "$") $chars = StringMid($cmd, StringInStr($cmd, "$", 0, $i) + 1) ReDim $vars[UBound($vars) + 1] $vars[UBound($vars) - 1] = "$" For $x = 1 To StringLen($chars) $chr = StringMid($chars, $x, 1) If StringInStr($CharSet, $chr) Then $vars[UBound($vars) - 1] &= $chr Else ExitLoop EndIf Next Next For $i = 1 To UBound($vars) - 1 $cmd = StringReplace($cmd, $vars[$i], &"'" Eval($vars[$i]) & "'") Next Local $x = 0 For $i = 1 To UBound($str_3) - 1 Do $x += 1 $cmd = StringReplace($cmd, $str_3[$i][0], $str_3[$i][1], 0, $x) Until $x = UBound($str_3) - 1 Next system($cmd) Return "-ret" EndFunc ;==>CmdPad Func CD($dir = '') If FileExists(Eval("$cd") & "\" & $dir) And StringInStr(FileGetAttrib(Eval("$cd") & "\" & $dir), "d") Then Assign("$cd", Eval("$cd") & "\" & $dir) Return Eval("$cd") ElseIf FileExists($dir) And StringInStr(FileGetAttrib($dir), "d") Then Assign("$cd", $dir) Return Eval("$cd") EndIf Return Eval('$cd') EndFunc ;==>CD Func Dir($dir = 0, $filter = '*') If $dir = '0' Then $dir = Eval("$cd") EndIf $a = _FileListToArray($dir, $filter) Cout($dir & @LF) For $i = 1 To UBound($a) - 1 Sleep(10) Cout(@TAB & "|- " & $a[$i] & @TAB & FileGetAttrib($dir & "\" & $a[$i]) & @LF) Next Return "-ret" EndFunc ;==>Dir Func Repeat($Func, $times = 1) Local $tz For $i = 0 To $times - 1 $tz &= DoCmd($Func) & @LF Next Return StringTrimRight($tz, 1) & @LF & "-ret";remove last line feed EndFunc ;==>Repeat Func Echo($text) Cout($text & @LF) Return "-ret" EndFunc ;==>Echo Func NSLookUp($ip) RunWait(@SystemDir & '\NSLookUp.exe "' & $ip & '"') Return ' ' EndFunc ;==>NSLookUp Func RunSelf() If @Compiled Then Return Run(@ScriptFullPath) Else Return Run(@AutoItExe & ' "' & @ScriptFullPath & '"') EndIf EndFunc ;==>RunSelf Func _StringGetPos($string, $iStart, $iEnd) Return StringLeft(StringTrimLeft($string, $iStart), $iEnd) EndFunc ;==>_StringGetPos Func _StringReplacePos($string, $iStart, $iEnd, $value) $st = StringMid($string, 0, $iStart) $en = StringMid($string, $iEnd) Return $st & $value & $en EndFunc ;==>_StringReplacePos Func _StringGetSub($string, $iDelim = '"') Local $ret[1] Local $i = 1, $l Do $l = StringTrimLeft($string, StringInStr($string, $iDelim, 0, $i)) $l = StringLeft($l, StringInStr($l, $iDelim) - 1) $i += 2 ReDim $ret[UBound($ret) + 1] $ret[UBound($ret) - 1] = $l Until $i >= _StringGetOccurances($string, $iDelim) _ArrayDelete($ret, 0) Return $ret EndFunc ;==>_StringGetSub Func _StringGetOccurances($string, $iDelim) $lo = StringSplit($string, $iDelim) Return $lo[0] EndFunc ;==>_StringGetOccurances Func Help() $ret = 'This is the Autoit Command line interpreter it has most of the standart AutoIt3 commands.' & @LF & _ "however the following functions don't work:" & @LF & _ 'tcpaccept' & @LF & _ 'tcpclosesocket' & @LF & _ 'tcpconnect' & @LF & _ 'tcplisten' & @LF & _ 'tcpnametoip - however there is NSLookUp' & @LF & _ 'tcprecv' & @LF & _ 'tcpsend' & @LF & _ 'tcpshutdown' & @LF & _ 'tcpstartup' & @LF & _ 'DllStructCreate' & @LF & _ 'DllStructGetData' & @LF & _ 'DllStructGetSize' & @LF & _ 'DllStructGetSize' & @LF & _ 'DllStructSetData' & @LF & _ 'And anything that uses an Array' & @LF & _ 'For further help go to www.autoitscript.com' & @LF & _ 'the command line version of autoit dose have some extra commands such as' & @LF & _ 'Repeat("command",times) - will Repeat any command' & @LF & _ 'RunSelf() - open a new instance of Autoit Command line interpreter' & @LF & _ 'Echo("text") - Prints text to console. however putting somthing as a string will do the same' & @LF & _ 'About() - prints information about Autoit Command line interpreter' & @LF & _ 'Clear() - Clears Autoit Command line interpreter' & @LF & _ 'Dir(dir = $cd) - Lists a directory' & @LF & _ 'Cd(dir) - sets the current directory (same as cmd''s cd)' & @LF & _ 'CmdPad("comand"&$variable) - executes a CMD DOS command' & @LF & _ 'For further help go to www.autoitscript.com' & @LF & _ "Autoit Command line interpreter is baced on Sycam Inc's _Execute function-ret" & @LF Return $ret EndFunc ;==>Help Func Clear() ;clears termanal system("cls") Return "-ret" EndFunc ;==>Clear i would add screen shots but the forums don't like embedded images from Google drive Autoit CMD.zip
  24. i compiled a script with autoitwrapper and clicked attach source. how can i retrieve the source (i tried opening it with res hacker and under RCdata there was script but it was gibberish)
  25. it's an example script in Beta #include <WinAPILocale.au3> #include <APILocaleConstants.au3> Local $ID = _WinAPI_GetUserGeoID() ConsoleWrite('ID: 0x' & Hex($ID) & @CRLF) ConsoleWrite('Latitude: ' & _WinAPI_GetGeoInfo($ID, $GEO_LATITUDE) & @CRLF) ConsoleWrite('Longitude: ' & _WinAPI_GetGeoInfo($ID, $GEO_LONGITUDE) & @CRLF) ConsoleWrite('Name: ' & _WinAPI_GetGeoInfo($ID, $GEO_FRIENDLYNAME) & @CRLF) ConsoleWrite('ISO code: ' & _WinAPI_GetGeoInfo($ID, $GEO_ISO3) & @CRLF)
×
×
  • Create New...