AutoIt Script (:p)

11/27/2009 17:31 stefan654#1
Here's a script:
my problem?
Well when u press ok i want to get the stuff saved :o
(which it doesn't do atm)

Quote:

#include <GUIConstantsEx.au3>
Hotkeyset("{F1}", "_send1")
Hotkeyset("{F2}", "_send2")
Hotkeyset("{F3}", "_send3")
Hotkeyset("{F4}", "_send4")
Hotkeyset("{F5}", "_send5")
Hotkeyset("{F6}", "_send6")
Hotkeyset("{F7}", "_send7")
Hotkeyset("{F8}", "_send8")
Hotkeyset("{F9}", "_send9")
Hotkeyset("{F10}", "_send10")
Hotkeyset("{F11}", "_send11")
Hotkeyset("{ESC}", "_exit")
global $var
global $file1
global $file2
global $file3
global $file4
global $file5
global $file6
global $file7
global $file8
global $file9
global $file10
global $file11

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $Button_1, $Button_2, $msg

Local $file1, $btn, $msg
Local $file2, $btn, $msg
Local $file3, $btn, $msg
Local $file4, $btn, $msg
Local $file5, $btn, $msg
Local $file6, $btn, $msg
Local $file7, $btn, $msg

GUICreate("Option Menu, Made by Stefan", 590, 443, 194, 131) ; will create a dialog box that when displayed is centered

GUICtrlCreateLabel("Add the macro's urself: ", 16, 8, 114, 17)
GUICtrlCreateLabel("1) Select the Macro's u want to use", 152, 8, 171, 17)
GUICtrlCreateLabel("2) Type the wanted texts in the input boxes!", 152, 24, 210, 17)

GUICtrlCreateCheckbox("Macro 1 (Hotkey : F1)", 16, 32, 129, 25)
$file1 = GUICtrlCreateInput("", 16, 56, 513, 21)
GUICtrlCreateCheckbox("Macro 2 (Hotkey : F2)", 16, 88, 177, 17)
$file2 = GUICtrlCreateInput($file2, 16, 104, 513, 21)
GUICtrlCreateCheckbox("Macro 3 (Hotkey : F3)", 16, 136, 177, 25)
$file3 = GUICtrlCreateInput("", 16, 160, 513, 21)
GUICtrlCreateCheckbox("Macro 4 (Hotkey : F4)", 16, 192, 129, 25)
$file4 = GUICtrlCreateInput("", 16, 216, 513, 21)
GUICtrlCreateCheckbox("Macro 5 (Hotkey : F5)", 16, 248, 121, 25)
$file5 = GUICtrlCreateInput("", 16, 272, 513, 21)
GUICtrlCreateCheckbox("Macro 6 (Hotkey : F6)", 16, 304, 169, 25)
$file6 = GUICtrlCreateInput("", 16, 328, 513, 21)
GUICtrlCreateCheckbox("Macro 7 (Hotkey : F7)", 16, 360, 129, 25)
$file7 = GUICtrlCreateInput("", 16, 384, 513, 21)


$Button_1 = GUICtrlCreateButton("ok", 88, 408, 153, 25)
$Button_2 = GUICtrlCreateButton("Cancel", 320, 408, 145, 25)

GUISetState() ; will display an dialog box with 2 button

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_1

$var = MsgBox( 4, "Option Menu, Made by Stefan", "Oké Ur Macro has been saved")
if $var = 6 Then
msgbox(1, "Option Menu, Made by Stefan", "All Credits go to stefan :p")

EndIf


if $var = 7 Then
msgbox(0, "Option Menu, Made by Stefan", "You Pushed no, the script won't be executed")
exit
EndIf

Case $msg = $Button_2
MsgBox(0, 'Canceled', "You Canceled this application, the script won't be executed") ; Will demonstrate Button 2 being pressed
Exit
EndSelect
WEnd
EndFunc ;==>Example


Func _send1()
send("{enter}")
sleep(100)
Send($file1)
sleep(100)
send("{enter}")
endfunc

Func _send2()

Send($file2)

endfunc

Func _send3()
send("{enter}")
sleep(100)
Send($file3)
sleep(100)
send("{enter}")
endfunc

Func _send4()
send("{enter}")
sleep(100)
Send($file4)
sleep(100)
send("{enter}")
endfunc

Func _send5()
send("{enter}")
sleep(100)
Send($file5)
sleep(100)
send("{enter}")
endfunc

Func _send6()
send("{enter}")
sleep(100)
Send($file6)
sleep(100)
send("{enter}")
endfunc

Func _send7()
send("{enter}")
Send($file7)
send("{enter}")
endfunc

Func _send8()
send("{enter}")
sleep(100)
Send($file8)
sleep(100)
send("{enter}")
endfunc

Func _send9()
send("{enter}")
sleep(100)
Send($file9)
sleep(100)
send("{enter}")
endfunc

Func _send10()
send("{enter}")
sleep(100)
Send($file10)
sleep(100)
send("{enter}")
endfunc

Func _send11()
send("{enter}")
sleep(100)
Send($file11)
sleep(100)
send("{enter}")
endfunc

func _exit()
exit
endfunc
11/27/2009 17:39 R4Yx#2
ganz ehrlich wer den dreck versteht kann auch gleich c schreiben .. warum ausgerechnet autoit?
11/27/2009 17:44 Timo264#3
das ist nur nen macro send tool
dafür brauch man kein c und zwichen autoit und c is nochmal nen gewaltiger unterschied
11/27/2009 17:55 rolubo#4
Quote:
Originally Posted by Timo264 View Post
das ist nur nen macro send tool
dafür brauch man kein c und zwichen autoit und c is nochmal nen gewaltiger unterschied
ich glaube du hast die Aussage nicht richtig verstanden,er meinte.
Wieso mit so einem bescheuerten autoit schreiben,dass ja in der
Komplexheit wohl ähnlich schwierig ist wie c oder c++,wenn man
nicht gleich c oder c++ nehmen kann,damit stehen einem viel mehr Möglichkeiten offen..
11/27/2009 18:03 Timo264#5
doch, doch das habe ich sehr wohl verstanden
nur c bzw. c++ is halt eben noch ein wenig schwerer als c
11/27/2009 18:24 stefan654#6
Please keep it english :p
Why Autoit?
well i do understand c++ aswell, since there ain't a big difference between them :o
but i've been told that it's easier to create a GUI with autoit than c++
11/27/2009 18:24 MoepMeep#7
"c bzw c++ is halt eben noch ein wenig schwerer als c" jo, ist klar. C ist schwerer als C..^^

This is still the WRONG section. And fucking use code-tags -.-
btw you suck at coding, better quit it.


edit: There are HUGE difference's between autoit and c/c++
11/27/2009 18:31 R4Yx#8
why keep english? its a german board !

naja hier zeigt sich, wer was von programmieren versteht .. man lernt keine programmiersprache sondern man lernt programmieren. die syntax zu erlernen dauert max einen tag .. wer programmieren kann, kann jede sprache muss sich nur an sie gewöhnen!
11/27/2009 19:48 katze123#9
if you look at that source :-D no structure ! stolen many things out of example .au3's? xD

just rewrite the source and make it cleaner next time. maybe it'll work
11/27/2009 20:12 BorSti#10
iam the new c++ pro xD

hab info 2 - da lernen wa objektbezogenes proggen - templates classen konstruktor dekonstruktor und lbablabla totaler bullshit xD
11/27/2009 20:19 katze123#11
na dann herzlichen glückwunsch =D
11/27/2009 20:21 MoepMeep#12
fail borsti, das macht c++ aus ;D
11/27/2009 21:14 R4Yx#13
classen rocken :) man muss natürlich wissen wie man damit umgeht und sie machen auch net immer sinn.
aber wenn man sie richtig benutzt ersparen sie einem viel arbeit.
11/27/2009 21:15 stefan654#14
Quote:
Originally Posted by katze123 View Post
if you look at that source :-D no structure ! stolen many things out of example .au3's? xD

just rewrite the source and make it cleaner next time. maybe it'll work
it does have structure ;)
For me it does anyway.
if anyone could give me an example, on how i make a gui working
...that would be nice -.-
11/27/2009 21:27 R4Yx#15
naja für dich vielleicht ..
aber WIR sollen ja für DICH nach fehlern suchen. Also passe dich der genormten struktur an oder frag nicht.

Ein beispiel für GUI unter AutoIT findest du bei google sicherlich.

[Only registered and activated users can see links. Click Here To Register...] Hier findest du bestimmt alles, was du brauchst.