Search found 1186 matches

by Flipeador
08 Dec 2019, 15:18
Forum: Pedir Ayuda
Topic: Una funcion con argumento dentro de otra funcion,
Replies: 4
Views: 1122

Re: Una funcion con argumento dentro de otra funcion,

Creo que el script no hace lo que crees. Deberías explicar el uso que le estas dando. El primer parámetro de la función TurnL1 especifica la cantidad de movimiento en el eje X, el tercer parámetro especifica el tiempo, en milisegundos, que dura el bucle while , con un retraso de 11 milisegundos ( sl...
by Flipeador
08 Dec 2019, 12:43
Forum: Pedir Ayuda
Topic: LCtrl/LControl se mantiene apretado incluso con KeyWait
Replies: 1
Views: 886

Re: LCtrl/LControl se mantiene apretado incluso con KeyWait

Code: Select all

*LCtrl::
SendInput {LCtrl}
return

*LCtrl Up::
SendInput {LCtrl}
return
by Flipeador
08 Dec 2019, 11:56
Forum: Pedir Ayuda
Topic: Una funcion con argumento dentro de otra funcion,
Replies: 4
Views: 1122

Re: Una funcion con argumento dentro de otra funcion,

No puedes. Esta es una forma de hacerlo: #SingleInstance Force #NoEnv SetBatchLines -1 TurnL1(x, y, t){ local start := A_TickCount while (A_TickCount-start) < t { MouseSpd(x, y) Sleep 11 } } MouseSpd(x, y) { DllCall("User32.dll\mouse_event", "UInt", 1, "Int", x, "Int", y, "UInt", 0, "Ptr", 0) } f2::...
by Flipeador
31 Oct 2019, 16:27
Forum: Pedir Ayuda
Topic: Multiples condiciones para un if Topic is solved
Replies: 2
Views: 2465

Re: Multiples condiciones para un if Topic is solved

Hola, hay varias formas. ⠀ Usando expresiones regulares : var := "Go" if (var ~= "i)^ir|abrir|go|open|goto$") MsgBox El operador ~= es una forma corta para hacer uso de la función RegExMatch (ver Regular Expressions (RegEx) - Quick Reference ). Por defecto, las expresiones regulares distinguen entre...
by Flipeador
27 Oct 2019, 12:20
Forum: Ask for Help (v1)
Topic: How many items in a Folder ? Topic is solved
Replies: 6
Views: 805

Re: How many items in a Folder ? Topic is solved

Code: Select all

fso := ComObjCreate("Scripting.FileSystemObject")
folder := fso.GetFolder("C:\")
MsgBox %  "Folders: " . folder.SubFolders.Count
MsgBox %  "Files: "   . folder.Files.Count

Code: Select all

MsgBox %  ComObjCreate("wscript.shell").exec("cmd /c dir C:\*.* /b /a drhasilo").stdout.readall
by Flipeador
27 Oct 2019, 08:20
Forum: Pedir Ayuda
Topic: script como enfoco? Topic is solved
Replies: 3
Views: 3034

Re: script como enfoco? Topic is solved

Hola, ¿que quieres decir con que el script no enfoca cuando haces clic en otra ventana?. ¿que parte exactamente del código deja de funcionar? (puedes usar ToolTip para ver que parte se ejecuta). Con respecto a lo de que se quita el cursor, ¿es por ControlClick o como?. El código esta bastante bien, ...
by Flipeador
27 Oct 2019, 07:25
Forum: Bug Reports
Topic: A_Args - Assignment and Force-local mode
Replies: 4
Views: 2075

A_Args - Assignment and Force-local mode

This behavior can be observed in both v1.1.31.01 and v2 . The code shown here is for v2.0-a106 . Built-in variables such as Clipboard, ErrorLevel, and A_TimeIdle are never local (they can be accessed from anywhere), and cannot be redeclared. source: https://lexikos.github.io/v2/docs/Functions.htm#Lo...
by Flipeador
24 Oct 2019, 05:24
Forum: Ask for Help (v2)
Topic: Direct2D QuickStart - Drawing a Simple Rectangle Topic is solved
Replies: 10
Views: 4112

Re: Direct2D QuickStart - Drawing a Simple Rectangle Topic is solved

I restarted the system and now it seems to work correctly. That error was really weird.
Thank you!
by Flipeador
23 Oct 2019, 21:25
Forum: Ask for Help (v2)
Topic: Direct2D QuickStart - Drawing a Simple Rectangle Topic is solved
Replies: 10
Views: 4112

Direct2D QuickStart - Drawing a Simple Rectangle Topic is solved

Does anyone have any idea why this script works on 32-Bit but not on 64-Bit?: ; Direct2D QuickStart - Drawing a Simple Rectangle ; https://docs.microsoft.com/en-us/windows/win32/direct2d/getting-started-with-direct2d #DllLoad D2d1.dll Gui := GuiCreate(, "Direct2D QuickStart - Drawing a Simple Rectan...
by Flipeador
15 Oct 2019, 02:22
Forum: Ask for Help (v2)
Topic: How to read specific line from file?
Replies: 5
Views: 4431

Re: How to read specific line from file?

MsgBox(FileReadLine(FileSelect(),InputBox())) FileReadLine(Filename, LineNum) { local File := FileOpen(Filename, "r-wd") if (LineNum < 0) { local Pos := File.Pos local Lines := 0 while (!File.AtEOF) ++Lines, File.ReadLine() LineNum := Lines - Abs(LineNum) + 1 File.Seek(Pos) } while (!File.AtEOF) { ...
by Flipeador
12 Oct 2019, 15:29
Forum: Ask for Help (v2)
Topic: Return value of __New() and alternative way of instantiating a class object
Replies: 8
Views: 3303

Re: Return value of __New() and alternative way of instantiating a class object

So... I've decided to use a function, something like this: MsgBox Type(Image(32,32,0)) MsgBox Type(Image(32,32,1)) class Image { Ptr := 0 __New(Ptr) => this.Ptr := Ptr static New(Ptr) => Ptr ? base.New(Ptr) : 0 __Delete() => this.Ptr && MsgBox(A_ThisFunc) } Image(W, H, R) { return Image.New(CreateIm...
by Flipeador
09 Oct 2019, 07:51
Forum: Pedir Ayuda
Topic: Impr Pant Topic is solved
Replies: 1
Views: 2485

Re: Impr Pant Topic is solved

Hola,
Mira aquí: https://www.autohotkey.com/docs/KeyList.htm#other.
Script: PrintScreen:: SendInput ^#s.
by Flipeador
08 Oct 2019, 16:10
Forum: Pedir Ayuda
Topic: Reproducir pulsación de teclas Topic is solved
Replies: 1
Views: 3141

Re: Reproducir pulsación de teclas Topic is solved

Hola!

Code: Select all

3::
SendInput {Up 2}  ; 2 veces flecha arriba.
SendInput {Right}  ; Flecha derecha.
SendInput {Enter}. ; Enter.
return
Lee la documentación aquí: https://www.autohotkey.com/docs/Hotkeys.htm.
by Flipeador
08 Oct 2019, 05:31
Forum: Pedir Ayuda
Topic: Ayuda para complementar script
Replies: 1
Views: 1696

Re: Ayuda para complementar script

Hola, prueba este script. #NoEnv #SingleInstance Force #Persistent SetBatchLines -1 Contador := 0 return F1:: SetTimer PressTheKey, 3100 ; F1 para iniciar. F2:: SetTimer PressTheKey, Off ; F2 para parar. F3:: Contador := 0 ; F3 para reiniciar contador. Esc:: ExitApp ; Escape para terminar el script....
by Flipeador
08 Oct 2019, 05:25
Forum: Pedir Ayuda
Topic: Ayuda con 1 script
Replies: 2
Views: 2386

Re: Ayuda con 1 script

Hola, si es para un juego abría que cambiar cosas.

Code: Select all

LButton::
Click 2
return

RButton::
Click 1
return

F1:: ExitApp
(F1 para termina el script)

Lo de presionar alt+shift, puede ser, ¿cuando quieres que se presionen estas dos teclas?.
by Flipeador
07 Oct 2019, 12:08
Forum: Ask for Help (v2)
Topic: Return value of __New() and alternative way of instantiating a class object
Replies: 8
Views: 3303

Re: Return value of __New() and alternative way of instantiating a class object

So... this example (which would work in previous versions): Img := Image.New(32, 32) MsgBox Format("Img:`s{}`nType:`s{}`nHandle:`s{}", Img, Type(Img), IsObject(Img)?Img.Handle:"Error") class Image { Handle := 0 __New(Width, Height) { this.Handle := CreateImage(Width, Height) if (this.Handle == 0) re...
by Flipeador
06 Oct 2019, 22:11
Forum: Ask for Help (v2)
Topic: Return value of __New() and alternative way of instantiating a class object
Replies: 8
Views: 3303

Re: Return value of __New() and alternative way of instantiating a class object

I'm not sure about this. I'd like to see an example anyway. if I change __New () to static New () in my first example, .Value is unassigned. How is ignoring the return value of __New () a positive thing?. Sorry, looks like I'm missing something, I appreciate if someone takes the time to explain. :cr...
by Flipeador
06 Oct 2019, 08:38
Forum: Ask for Help (v2)
Topic: Return value of __New() and alternative way of instantiating a class object
Replies: 8
Views: 3303

Re: Return value of __New() and alternative way of instantiating a class object

I'd already read the decumentation on the link you provided; But I see no way to do it from __New(), do I have to use static New()?.
I'd appreciate an example of how you would do it.
:wave:
by Flipeador
05 Oct 2019, 15:51
Forum: Ask for Help (v2)
Topic: Return value of __New() and alternative way of instantiating a class object
Replies: 8
Views: 3303

Return value of __New() and alternative way of instantiating a class object

⠀ How do I indicate an error when trying to create an instance of a class object through its __New() constructor without using Throw ?. class Num { Value := 255 __New(Number) { local ReturnValue := Number is "Number" ? this : 0 MsgBox("ReturnValue: " . ReturnValue . "`nValue: " . this.Value) return ...
by Flipeador
29 Sep 2019, 07:44
Forum: Bug Reports
Topic: [v2] __Enum Method - NumberOfVars is always equal to 2 Topic is solved
Replies: 2
Views: 2360

[v2] __Enum Method - NumberOfVars is always equal to 2 Topic is solved

Code: Select all

class IColor
{
    __New() => MsgBox("Constructor")
    __Enum(NumberOfVars)
    {
        MsgBox("NumberOfVars: " . NumberOfVars)
        return (*) => A_Index < 2
    }
}


Color := IColor.New()
for k, v in Color
    MsgBox("k,v")

for k in Color
    MsgBox("k")

Go to advanced search