Sign in to follow this  
Followers 0
holly

Help! Someone can convert this to Autoit!

10 posts in this topic

Hi all, i'm a newbie and my name is Holly, nice to meet all :D

I'd like to put a gui over a game, it's not game automation, i need only a timer for remember me when to stop playing :D

Searching on the web, i have find only dll hoocking but today i have see a post can resolve my problem:

I created a timer window and set it as a child to the full screen window, then added a style so that the child wouldn't take focus over the parent.

You most likely need to set +WS_CHILD -WS_POPUP for the child window. For instance:

Gui, 1:+LastFound

hwnd1 := WinExist()

Gui, 2:+LastFound

Gui, 2:+0x40000000 -0x80000000 ; Add WS_CHILD, remove WS_POPUP

hwnd2 := WinExist()

DllCall("SetParent", "uint", hwnd2, "uint", hwnd1)

Gui, 2:Show, x0 y0 w200 h200, GUI 2

Gui, 1:Show, w400 h400, GUI 1

return

GuiClose:

ExitApp

If you uncomment the Gui, 2:+0x4... line, GUI 2 is set as the foreground window whenever you try to focus GUI 1. Pressing Alt+F4 closes GUI 2 (or does nothing if it's already closed), and pressing GUI 1's close button doesn't work. After adding WS_CHILD and removing WS_POPUP, AHK Window Info shows that GUI 1 is the foreground/active window, and GUI 2 is the focused control. MSDN wrote: For compatibility reasons, SetParent does not modify the WS_CHILD or WS_POPUP window styles of the window whose parent is being changed. Therefore, if hWndNewParent is NULL, you should also clear the WS_CHILD bit and set the WS_POPUP style after calling SetParent. Conversely, if hWndNewParent is not NULL and the window was previously a child of the desktop, you should clear the WS_POPUP style and set the WS_CHILD style before calling SetParent.

Example image:

http://i50.tinypic.com/mvp3tf.jpg

I'm searching for someone can convert the 11 lines of AutoHotKey into autoit language.

Pleeeeeeeeeeese :D

Holly

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I would go at it at a different approach. I would make a script that at a time, or after a set time it starts dinging at you just annoyingly enough to get you to exit the game to close it. Don't want to loose to uber boss just because a window popped up on you.

I have a clock/egg timer script at home, I might post it later.

Edited by DicatoroftheUSA

Share this post


Link to post
Share on other sites

We dont do personal requests

But did you ask yourself what will autoit help file do if you type in its search

WinExist, or gui, or DllCall or SetParent?


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

You don't need a GUI to remind you when to stop playing a game. If you want to create a timed alarm then I would use some kind of annoying beeping sound to remind you.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

something like

$oShell = ObjCreate("SAPI.SpVoice") ; Get the Windows SAPI Object
$oShell.Speak("30 minutes of playing left.")

well it's more like annoying voice than a sound, but it will work :)

Edited by bogQ
1 person likes this

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

I am using that for every rule-breaking post from now on. :D

$oShell = ObjCreate("SAPI.SpVoice") ; Get the Windows SAPI Object
$oShell.Speak("I will not break the forum rules. I will not break the forum rules!")

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

@bogQ I think 30 minutes is a bit excessive. I don't understand AutoHotKey anyway.

Edit

Just sayin' what JohnOne said: there's plenty of people here who will help you, providing the code doesn't interact with a game in any way whatsoever.

Edited by czardas

Share this post


Link to post
Share on other sites

I just want to say that at this point I'm completely disappointed in AHK. I was planning to get familiar with that language at some near future but seeing that example I think I'll pass.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Interesting stuff.

In AutoIt there are these functions as alternatives for AHK ones:

WinGetHandle()
WinExists()
_WinAPI_SetParent()
_WinAPI_SetWindowLong() + $GWL_STYLE
WinSetState() + @SW_SHOW
WinMove()

So just look into helpfile at these functions and their examples ...

Edited by Zedna

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0