Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 14:09

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



_IsPressed acting strange

Discussion on _IsPressed acting strange within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2014
Posts: 43
Received Thanks: 1
_IsPressed acting strange

Hi

I have this piece of script, but _IsPressed dont work normal or its problem in game, problem is when i press and hold SHIFT it send keys, but after send every key its like i released SHIFT but i still hold it

Here is record on video im holding SHIFT all time

Edit : i made it works its seems that its problem with game and shift key, now my other problem how i made it to toogle pause / run with ^y key and its seems like its in endless loop i pause it with F3 but i cant turn off on X button

Code:
#RequireAdmin
#include <Misc.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $run = False
Local $hDLL = DllOpen("user32.dll")

HotKeySet("^y", "_go")
HotKeySet("{F3}", "_pause")
HotKeySet("{ESC}", "_end")

GUICreate("Form1", 275, 155, -1, -1)
GUICtrlCreateGroup(" Bar 1 ", 8, 8, 257, 65)
$bar1keys = GUICtrlCreateInput("", 24, 36, 225, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup(" Bar 2 ", 9, 79, 257, 65)
$bar2keys = GUICtrlCreateInput("", 25, 107, 225, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

	EndSwitch
WEnd

Func _go()
	$run = True
While True

	If $run Then
		If _IsPressed ("12", $hDLL) Then
				Send("{SHIFTDOWN}")
				Sleep(10)
					While _IsPressed ("12", $hDLL)
						Send(GUICtrlRead($bar2keys))
						Sleep(100)
					WEnd
				Send("{SHIFTUP}")
				Sleep(10)
		Else
			Send(GUICtrlRead($bar1keys))
			Sleep(100)
		EndIf

	EndIf

WEnd

DllClose($hDLL) ; close dll

EndFunc

Func _end()
	Exit
EndFunc

Func _pause()
	$run = False
EndFunc
LiveLong23 is offline  
Old 06/25/2015, 12:59   #2
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
If you want to turn it off with the X Button switch to OnEventMode and register an exit function.
Code:
GUISetOnEvent(-3, "ExitFunction")

Func ExitFunction()
	;Pause or Exit whatever
EndFunc
alpines is offline  
Old 06/25/2015, 19:05   #3
 
elite*gold: 0
Join Date: Jan 2014
Posts: 43
Received Thanks: 1
And what about endless loop or sending keys ?
And it send me key like plain text but i need it to send key by key with sleep between.
LiveLong23 is offline  
Reply


Similar Threads Similar Threads
[Verlosung]Strange Flamethrower|Strange Kunai
10/05/2011 - Team Fortress 2 - 16 Replies
Schreibt einfach eine Zahl zwischen 1 und 5. Jeder kann nur eine der beiden Waffen gewinnen. Viel Glück!
Can anyone trade a strange rocket launcher for a strange pistol?
09/27/2011 - Team Fortress 2 - 1 Replies
bleh
Hacks are acting strange
05/16/2010 - Dekaron - 3 Replies
K after the patch i put in the new offsets but its not the same, the monsters arnt running as close to me as they were before and the agro doesnt pull them from as far away anymore...but its the same code...whats going on?
_IsPressed
04/18/2009 - General Coding - 10 Replies
Hallo Leute, Ich habe jetzt irgend eine Taste mit _IsPressed belegt z.B. die Taste "B". Wenn ich nun auf "B" drücke, glaubt _IsPressed, dass ich die Taste "B" mehrmals als einmal gedrückt habe. Ich glaube, dass das daran liegt, dass _IsPressed sich zu schnell "aktualisiert". Kann man da irgendwie was drehen, also, dass wenn man jetzt "B" drückt, dass dann _IsPressed sagt, dass "B" nur einmal gedrückt worden ist? Danke LG Manlius



All times are GMT +1. The time now is 14:10.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.