[Beginner] AutoIt

01/19/2013 13:32 DJ_Freeze#1
Hi all epvp mermbers..
I need a little help.. I am very beginner in AutoIt and i want to know something..;)
How i make to send a key like "q" and then stop?
Is it good:
Code:
Send("q")
If it's good how i stop it?
If it's not good how it is the code pls help.
Thanks!
01/19/2013 13:42 logical691#2
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 236, 78, 192, 124)
$Notepad = GUICtrlCreateButton("Notepad", 16, 32, 89, 25)
$Close = GUICtrlCreateButton("Close", 120, 32, 97, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Notepad
			Run(@WindowsDir & "\notepad.exe", "", @SW_MAXIMIZE)
		Case $Close
			Exit
	EndSwitch
WEnd
01/19/2013 17:50 DJ_Freeze#3
Quote:
Originally Posted by logical691 View Post
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 236, 78, 192, 124)
$Notepad = GUICtrlCreateButton("Notepad", 16, 32, 89, 25)
$Close = GUICtrlCreateButton("Close", 120, 32, 97, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Notepad
			Run(@WindowsDir & "\notepad.exe", "", @SW_MAXIMIZE)
		Case $Close
			Exit
	EndSwitch
WEnd


Thanks but i said it wrong srry.
I was meant to say when i press that button go to a specified page like [Only registered and activated users can see links. Click Here To Register...] .
Like this:
Code:
ShellExecute("www.google.com")
But i want that a button do that.
Srry 4 my bad english and thanks.;)
01/19/2013 18:16 omer36#4
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"23678192124)
$googleGUICtrlCreateButton("google"16328925)
$Close GUICtrlCreateButton("Close"120329725)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$google
            ShellExecute
("www.google.com")
        Case 
$Close
            
Exit
    EndSwitch
WEnd 
where is ur problem?
01/19/2013 18:27 DJ_Freeze#5
Thanks that's what i wanted.;]

Edit: How i make to send a key like "q" and then stop?
Is it good:
Code:
Send("q")
If yes how i stop it?
If it's not good then please help me!;)
01/19/2013 19:05 reCougar#6
No. $google is the button. If you want to go to elitepvpers just change the text in the " " where www google com is written.
01/19/2013 19:17 DJ_Freeze#7
Yeah i got it i think..Didn't see the first time :D.
It's like that right:
Code:
$Button1 = GUICtrlCreateButton("Google", 40, 16, 91, 33) ;if this is the button .
Case $Button1
ShellExecute("www.google.com") ;i am right?
01/20/2013 01:45 butter123#8
dont ask that much, just try it ;) if it fails try different way, and then ask for help.
if it works, be happy ;)
01/20/2013 07:13 DJ_Freeze#9
Quote:
Originally Posted by butter123 View Post
dont ask that much, just try it ;) if it fails try different way, and then ask for help.
if it works, be happy ;)
Tried with:
Code:
Send("q") ;don't worked,also tried
HotKeySet("q")
Send{"q"}
What i want to do is to send keys to a webbrowser page.. If it is possible ii need some help can't find the right code...:(
01/20/2013 10:27 reCougar#10
Use google!

PHP Code:
HotKeySet ("z""Start")
HotKeySet ("y""Start2")

Func Start()
Send ("{BACKSPACE}")
Send ("y")
EndFunc

Func Start2
()
Send ("{BACKSPACE}")
Send ("z")
EndFunc 
01/20/2013 10:34 omer36#11
Quote:
Originally Posted by Mr. Cube View Post
Use google!

PHP Code:
HotKeySet ("z""Start")
HotKeySet ("y""Start2")

Func Start()
Send ("{BACKSPACE}")
Send ("y")
EndFunc

Func Start2
()
Send ("{BACKSPACE}")
Send ("z")
EndFunc 
this is totally fail.
if u have a hotkey started with "y" and u send a text with this letter it will call your funktion again.

your code will send "BACKSPACE" permanently


DJ_Freeze
just read some tutorials.
01/20/2013 12:46 logical691#12
Quote:
Originally Posted by omer36 View Post
this is totally fail.
your code will send "BACKSPACE" permanently
Actually his code will send nothing.
01/20/2013 12:51 DJ_Freeze#13
Quote:
Originally Posted by omer36 View Post
this is totally fail.
if u have a hotkey started with "y" and u send a text with this letter it will call your funktion again.

your code will send "BACKSPACE" permanently


DJ_Freeze
just read some tutorials.
Thanks but i can't really find some good ones.
There are lots but i can't german..And google translator fail..
At moment im looking at functions and experiment with them, but im getting a little angry because i can't get them to work..
A simple function like this..:
Code:
MouseClick ( "left" [, 422, 224 [, 2 [, 20]]] ) ;can't get it to work..

;i know such a simple function  but i don't see the problem
;i want a button do that if someone know help me pls
01/20/2013 16:51 logical691#14
Dj there are still tutorials in english its where i learnt my basics of autoit and made scripts that work autoit has english tutorials on there website basic but you get the gist

Ps its:
Mouseclick("left", 442, 224, 2) ;button, x, y, button clicks

I never used speed. (your 20)

Ps there is also a tutorial here: [Only registered and activated users can see links. Click Here To Register...] which is a sticky and also a tutorial here: [Only registered and activated users can see links. Click Here To Register...]

So i dont see how you an say there are none n english.
01/20/2013 17:06 DJ_Freeze#15
Thanks..huh..
But i want to learn to create a hack for online game.
And im still searching for a good tutorial step by step...