Jump to content

Autoit Wrappers


Valuater
 Share

Recommended Posts

; Control XP Style for Colors

; Author gafrost /Valuater

Dim $XS_n

 Func XPStyle($OnOff = 1)   
    If $OnOff And StringInStr(@OSTYPE, "WIN32_NT") Then
        $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties")
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
        Return 1
    ElseIf StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0])
        $XS_n = ""
        Return 1
    EndIf
    Return 0
EndFunc   ;==>XPStyle

example use...

http://www.autoitscript.com/forum/index.ph...st&p=319500

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

hello, I'm new to the autoit forums :whistle:

im peter and i'm 15 years old and im come from the netherlands

here is my program to lock UPX packed autoit EXEs

It is not maded in AutoIT

** Link removed till more is know about it **

if the hacker tries to unpack the EXE happens this

upx: C:\Documents and Settings\peter\Bureaublad\test.exe: CantUnpackExcep
tion: file is modified/hacked/protected; take care!!!

have fun with it :P

Edited by JdeB
Link to comment
Share on other sites

  • Developers

hello, I'm new to the autoit forums :whistle:

im peter and i'm 15 years old and im come from the netherlands

here is my program to lock UPX packed autoit EXEs

It is not maded in AutoIT

Download....

if the hacker tries to unpack the EXE happens this

upx: C:\Documents and Settings\peter\Bureaublad\test.exe: CantUnpackExcep
tion: file is modified/hacked/protected; take care!!!

have fun with it :P

I am Jos , a bit older and also from the Netherlands :D

You posted an Executable of which we don't really know if it can be trusted or not.

Now tell us what this program is all about and where it comes from ?

Till we have a good explanation, the link is removed ...

:lmao:

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I am Jos , a bit older and also from the Netherlands :whistle:

You posted an Executable of which we don't really know if it can be trusted or not.

Now tell us what this program is all about and where it comes from ?

Till we have a good explanation, the link is removed ...

:P

Sorry that i cant post the source :lmao:

it is created with a closed-source freeware program with the name codefusion

but aim going to port it to autoit and then i post the source :D

Edited by peterwilli
Link to comment
Share on other sites

  • Developers

Sorry that i cant post the source :P

it is created with a closed-source freeware program with the name codefusion

but aim going to port it to autoit and then i post the source :whistle:

There is no issue when it is legitimate .... just need some sort of confirmation of that ....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

; Get Key State Pressed/Released

; Author - Toady

Func GetKeyState($VK_Code)
    Local $a_Return = DllCall("user32.dll","short","GetKeyState","int",$VK_Code)
    If $a_Return[0] < -126 Then 
        Return 1    ;Key is pressed
    Else
        Return 0    ;Key is released
    EndIf
EndFunc

8)

This is interesting... but I'm curious: is there a reason to use this code instead of _IsPressed? Or perhaps they do different things???
Link to comment
Share on other sites

This is interesting... but I'm curious: is there a reason to use this code instead of _IsPressed? Or perhaps they do different things???

Its the Release of a specific key thats important here

EDIT: I took Toad's word for it,,,,but

Func _IsPressed($s_hexKey, $v_dll = 'user32.dll')
    ; $hexKey must be the value of one of the keys.
    ; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is.
    Local $a_R = DllCall($v_dll, "int", "GetAsyncKeyState", "int", '0x' & $s_hexKey)
    If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1
    Return 0
EndFunc   ;==>_IsPressed

??

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

; Run a timed program daily

; Author - Valuater

; #NoTrayIcon ; for testing 

Dim $Minutes = 30 
Dim $Title = "My Window Title" 

; settings
Dim $Show_Clock = 1 ; 0 = no show
Dim $Clock_Title = $Minutes & "  Minute Time Machine"

If WinExists($Clock_Title) Then Exit
AutoItWinSetTitle($Clock_Title)

; ***** for testing only ******
HotKeySet("{F9}", "Runner")
Func Runner()
    Run("notepad.exe")
EndFunc   ;==>Runner
$Minutes = 3 ; for testing
$Title = "Untitled" ; for testing
; *****************************

While 1
    If WinExists($Title) Then Clockit()
    Sleep(100)
WEnd

Func Clockit()
    Local $log = @WindowsDir & "\temp\"
    Local $log_file = $log & @YDAY & ".pak"
    If Not FileExists($log_file) Then 
        FileDelete($log & "*.pak")
        FileWriteLine($log_file, $Minutes)
    EndIf
    Local $M_Minutes = FileReadLine($log_file, 1)
    Local $begin = TimerInit(), $60Count = 0
    If $M_Minutes <= 0 Then
        WinClose($Title)
        MsgBox(64, $Clock_Title,  "Time-Up!! ...Your daily time usage has passed.    ", 5)
        Return
    EndIf
    While $M_Minutes > 0 And WinExists($Title)
        $dif = TimerDiff($begin)
        $Count = Int($dif / 1000)
        If $Count >= 60 Then
            $60Count += 1
            $M_Minutes -= 1
            $begin = TimerInit()
        EndIf
        If $Show_Clock Then ToolTip("Minutes Remaining = " & $M_Minutes & @CRLF & "Minutes Past = " & $60Count & @CRLF & "Seconds Count = " & $Count, 20, 20, $Clock_Title, 1)
        Sleep(100)
    WEnd
    ToolTip("")
    FileDelete($log_file)
    Sleep(300)
    If $Count >= 20 And $M_Minutes > 0 Then $M_Minutes -= 1
    FileWriteLine($log_file, $M_Minutes)    
EndFunc   ;==>Clockit

8)

NEWHeader1.png

Link to comment
Share on other sites

There are two on this page

; Charactor Generator - chars (0-9, A-Z), from   x to x characters in length

; author - JdeB

; ( It Generates all posible options and till the lenght specified and dumps it into file test.txt: )

$STR = "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
$MLEN = 2                 ; max length of the output
$CHARS = StringSplit($STR, "")
$FILE = FileOpen("test.txt", 2)
$TOUT = ""
Dim $NTOUT[$MLEN + 1]
$t = TimerInit()
For $X = 1 To $MLEN
    $NTOUT[$X] = Chr(0)
Next
$NTOUT[1] = Chr(0)
; endless loop
$out = ""
While 1
    For $X = 1 To $CHARS[0]
        $out = $out & $TOUT & $CHARS[$X] & @LF
    Next
    $TOUT = ""
    $N2 = 0
    For $X = 1 To $MLEN
        If $X = 1 Then
            $N = Asc($NTOUT[$X]) + 1
        Else
            $N = Asc($NTOUT[$X]) + $N2
        EndIf
        $N2 = 0
        If $N > $CHARS[0] Then
            $N = 1
            $N2 = 1
        EndIf
        $NTOUT[$X] = Chr($N)
        If $N > 0 Then
            $TOUT = $CHARS[$N] & $TOUT
        EndIf
    Next
    If StringLen($TOUT) = $MLEN Then
        ExitLoop
    EndIf
WEnd
FileWriteLine($FILE, $out)
FileClose($FILE)
MsgBox(0, 'time', TimerDiff($t))
Exit

 oÝ÷ Ù«­¢+Ø((ì
¡ÉѽȹÉѽÈ((ìÕÑ¡½È´)½Í¡()±½°ÀÌØí­ålÄÀÁt(ÀÌØíµ¥¸ôÔ(ÀÌØíµàôÄÈ()¥±±Ñ Ìäí=ÕÑÁÕйÑáÐÌäì¤(ÀÌØí¥±ô¥±=Á¸ Ìäí=ÕÑÁÕйÑáÐÌäì°Ä¤()MÑÕÀ ÀÌØíµ¥¸¤((ÀÌØí¥¸ôQ¥µÉ%¹¥Ð ¤()]¡¥±Ä(%I½ÑÑ ÀÌØíµ¥¸¤ô´Ä¹ÀÌØíµ¥¸±ÐìÀÌØíµàQ¡¸(¥±]É¥Ñ ÀÌØí¥±°Ìäì´´´´´´´´´´´´´´ÌäìµÀì
I1µÀìÌäíAɽÕɽ¹¥¸ÌäìµÀìQ¥µÉ¥ ÀÌØí¥¸¤¼ÄÀÀÀµÀìÌäìͽ¹Ì¸ÌäìµÀì
I1µÀìÌäì´´´´´´´´´´´´´´ÌäìµÀì
I1¤(ÀÌØíµ¥¸¬ôÄ(MÑÕÀ ÀÌØíµ¥¸¤(±Í%ÀÌØíµ¥¸ÐìôÀÌØíµàQ¡¸(¥±]É¥Ñ ÀÌØí¥±°Ìäì´´´´´´´´´´´´´´ÌäìµÀì
I1µÀìÌäíAɽÕɽ¹¥¸ÌäìµÀìQ¥µÉ¥ ÀÌØí¥¸¤¼ÄÀÀÀµÀìÌäìͽ¹Ì¸ÌäìµÀì
I1µÀìÌäì´´´´´´´´´´´´´´ÌäìµÀì
I1¤(á¥Ð(¹%)]¹()Õ¹I½ÑÑ ÀÌØí¤¤(%Í ÀÌØí­ålÀÌØí¥t¤ôäÜQ¡¸(ÀÌØí­ålÀÌØí¥tô
¡È äÀ¤(±Í%Í ÀÌØí­ålÀÌØí¥t¤ôØÔQ¡¸(ÀÌØí­ålÀÌØí¥tô
¡È Ôܤ(±Í%Í ÀÌØí­ålÀÌØí¥t¤ôÐàQ¡¸(%ÀÌØí¤ôÄ=ÈÍ ÀÌØí­ålÅt¤ôÐàQ¡¸IÑÕɸ´Ä((I½ÑÑ ÀÌØí¤´Ä¤((ÀÌØí­ålÀÌØí¥tô
¡È ÄÈȤ(±Í(ÀÌØí­ålÀÌØí¥tô
¡È¡Í ÀÌØí­ålÀÌØí¥t¤´Ä¤(¹%((ÀÌØíÙÈôÌäìÌäì((½ÈÀÌØí¤ôÄQ¼ÀÌØíµ¥¸(ÀÌØíÙȵÀìôÀÌØí­ålÀÌØí¥t(9áÐ((¥±]É¥Ñ ÀÌØí¥±°ÀÌØíÙȵÀì
I1¤)¹Õ¹()Õ¹MÑÕÀ ÀÌØíµà¤(½ÈÀÌØí¤ôÄQ¼ÀÌØíµà(ÀÌØí­ålÀÌØí¥tôÌäíèÌäì(9áÐ)¹Õ¹((

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

; Get Key State Pressed/Released

; Author - Toady

Func GetKeyState($VK_Code)
    Local $a_Return = DllCall("user32.dll","short","GetKeyState","int",$VK_Code)
    If $a_Return[0] < -126 Then 
        Return 1    ;Key is pressed
    Else
        Return 0    ;Key is released
    EndIf
EndFunc

8)

Thanks for giving me credit, I really appreciate that :shocked:

www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Link to comment
Share on other sites

; Charactor Generator - chars (0-9, A-Z), from   x to x characters in length

; author - JdeB

; ( It Generates all posible options and till the lenght specified and dumps it into file test.txt: )

8)

... I made one of these, asked if I could post it, and the thread was locked and I was denied the right to post it. I didn't even postm it, I just asked ...

Could I post it here?

It's about as long, and although it would be a duplicate script, I'm proud of it and it's just a bit shorter - Albeit, it has a few more functions (logging of time taken, etc)

Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite
Link to comment
Share on other sites

... I made one of these, asked if I could post it, and the thread was locked and I was denied the right to post it. I didn't even postm it, I just asked ...

Could I post it here?

It's about as long, and although it would be a duplicate script, I'm proud of it and it's just a bit shorter - Albeit, it has a few more functions (logging of time taken, etc)

sure!

post it here and i will place it just under JdeB's within the SAME post

@Toady... Welcome!

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Global $key[100]
$min = 5
$max = 12

FileDelete('Output.txt')
$file = FileOpen('Output.txt',1)

Setup($min)

$begin = TimerInit()

While 1
    If Rotate($min) = -1 And $min < $max Then
        FileWrite($file,'--------------'  & @CRLF & 'Procedure done in ' & TimerDiff($begin)/1000 & ' seconds.' & @CRLF & '--------------'  & @CRLF)
        $min += 1
        Setup($min)
    ElseIf $min >= $max Then
        FileWrite($file,'--------------'  & @CRLF & 'Procedure done in ' & TimerDiff($begin)/1000 & ' seconds.' & @CRLF & '--------------'  & @CRLF)
        Exit
    EndIf
WEnd

Func Rotate($i)
    If Asc($key[$i])=97 Then
        $key[$i] = Chr(90)
    ElseIf Asc($key[$i])=65 Then
        $key[$i] = Chr(57)
    ElseIf Asc($key[$i])=48 Then
        If $i = 1 Or Asc($key[1])=48 Then Return -1
        
        Rotate($i-1)
        
        $key[$i] = Chr(122)
    Else
        $key[$i] = Chr(Asc($key[$i])-1)
    EndIf

    $var = ''
    
    For $i = 1 To $min
        $var &= $key[$i]
    Next
    
    FileWrite($file,$var & @CRLF)
EndFunc

Func Setup($max)
    For $i = 1 To $max
        $key[$i] = 'z'
    Next
EndFunc

There ya are.

How JdeB did it is novel - I like how he arranged it all in a single string, instead of jumping it all around like I rid in the Rotate() function.

I think they both have merits, though.

Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite
Link to comment
Share on other sites

  • 3 weeks later...

; Mouse repel - keep mouse away from an area

; Author - The Kandie Man

Global $GUI = GUICreate("Can't Touch This", 200, 100, 200, 200)
GUISetState()
AdlibEnable("CallMouseRepel", 10)

While 1
    Sleep(1000)
WEnd


Func CallMouseRepel()
    $coords = WinGetPos($GUI)
    _MouseRepel($coords[0], $coords[1], $coords[0] + $coords[2], $coords[1] + $coords[3])
EndFunc   ;==>CallMouseRepel

;===============================================================================
;
; Description:    _MouseRepel
; Parameter(s):   $i_left - Left coord
;                 $i_top - Top coord
;                 $i_right - Right coord
;                 $i_bottom - Bottom coord
; User CallTip:   _MouseRepel([$i_left = 0[, $i_top = 0[, $i_right = 0[, $i_bottom = 0]]]]) Repel the Mouse Cursor to specified coords.
; Author(s):      The Kandie Man
; Note(s):        This function must be called constantly to prevent the mouse cursor from entering the area.
;                 It is therefore recommended that you call this function from another function that is called by AdlibEnable every 1 to 50ms.
;
;===============================================================================

Func _MouseRepel($i_left = 0, $i_top = 0, $i_right = 0, $i_bottom = 0)
    Local $a_MousePos = MouseGetPos()
    Local $i_XCordinate = -1, $i_YCordinate = -1
    If $a_MousePos[0] >= $i_left And $a_MousePos[0] <= $i_right Then
        If ($a_MousePos[0] - $i_left) < ($i_right - $a_MousePos[0]) Then
            $i_XCordinate = $i_left - 1
        Else
            $i_XCordinate = $i_right + 1
        EndIf
    EndIf
    If $a_MousePos[1] >= $i_top And $a_MousePos[1] <= $i_bottom Then
        If ($a_MousePos[1] - $i_top) < ($i_bottom - $a_MousePos[1]) Then
            $i_YCordinate = $i_top - 1
        Else
            $i_YCordinate = $i_bottom + 1
        EndIf
    EndIf
    If $i_XCordinate <> -1 And $i_YCordinate <> -1 Then
        If Abs($i_XCordinate - $a_MousePos[0]) > Abs($i_YCordinate - $a_MousePos[1]) Then
            MouseMove($a_MousePos[0], $i_YCordinate, 1)
        ElseIf Abs($i_XCordinate - $a_MousePos[0]) < Abs($i_YCordinate - $a_MousePos[1]) Then
            MouseMove($i_XCordinate, $a_MousePos[1], 1)
        Else
            MouseMove($i_XCordinate, $i_YCordinate, 1)
        EndIf
    EndIf
EndFunc   ;==>_MouseRepel

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

I would like to present my application....A folder redirection utility that can be used like magic Folder,Folder Lock out thr........The nice thing abt it is that the application appears 2 be in heart shaped window

FunDirect

Welcome to Autoit... see my post after your referenced post above

8)

NEWHeader1.png

Link to comment
Share on other sites

  • 1 month later...
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...