AutoIt skript problem

12/13/2012 20:54 itoy70#1
Hey epvp ich bin ein anfänger in autoit und habe mich mal an einem
relogger für metin versucht und habe bzw wollte es so machen das
er sich reloggt sobald man f12 drückt aber irgendwie tut sich garnichts
hier das script
Code:
$id = InputBox ("Daten","ID")
$pw = InputBox ("Daten","Passwort","","*")
Run ("~MerKury2~.exe")
WinActive ("Merkury2-The Legend Returns")
Sleep (2000)
MouseMove (729,743)
MouseClick ("left")
MouseMove (765,876)
MouseClick ("left")
Send (""& $id)
Send ("{tab}")
Send (""& $pw)
Send ("{enter}")

HotKeySet("{F12}","start")

	Func start()
MouseMove (729,743)
MouseClick ("left")
MouseMove (765,876)
MouseClick ("left")
Send (""& $id)
Send ("{tab}")
Send (""& $pw)
Send ("{enter}")
	EndFunc
	While 1
	Sleep(100)
	WEnd
wäre sehr dankbar wenn ihr mir sagt was falsch ist und was man besser machen könnte
12/14/2012 20:44 Croco™#2
Also bei mir bewegt sich alles.
Ein paar Anmerkungen:
  1. Gib dem Script Adminrechte : #RequireAdmin
  2. Füge ein WinWait(<title>) ein um das Script zu pausieren bis das Fenster offen ist
  3. Arbeite mit ControlSend und ControlClick (ist sicherer)

[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]
12/15/2012 15:09 itoy70#3
und was bringe admin rechte?
12/15/2012 15:25 Croco™#4
Dadurch hat das Programm alle Rechte.
D.h. man kann sicher sein das Windows keine Komponenten sperrt gerade wenn es darum geht die Maus zu bewegen.
12/15/2012 18:31 omer36#5
du brauchst also admin rechte um deine maus zu bewegen?

kaum ein normaler user hat administrator rechte auf seinem rechner.
12/15/2012 23:25 Croco™#6
Es war eine Vermutung das Windows vl. Programmen verbietet auf solche Grunddinge Zugriff
zu nehmen. Wäre ja auch irgendwie logisch oder irre ich mich ?
12/16/2012 00:30 Futur94#7
Nein du irrst dich nicht, in diesem fall, gebe ich croco recht das es mit ControlSend und ControlClick besser ist.
12/16/2012 01:03 logical691#8
Code posted below is cleaned up, ive not tested it because im not installing whatever merkey is you press F1 to start your script where you will enter you username and password (or you could just add $username = "whatever" $password = "whatever") and remove the input boxes.

As for admin required i dont know if thats required, also better to run this in a window i "think" that way you dont need control send but i could be wrong. Im just going from old Diablo 3 example. You need to check everything is right too, like i said im not installing merkury or whatever its called and make sure no sleep timers are needed, i normally add them on my scrips even if short random clicks = Sleep(random(200, 900))

Code:
HotKeySet("{F1}","_start") ; change to what you want f1 is best for me testing
HotKeySet("{ESC}","_exit") ;change, remove comment out

While 1
	sleep(10)
WEnd

Func _Start()
	$id = InputBox ("Daten","ID")
	$pw = InputBox ("Daten","Passwort","","*")
	;WinActive("[Class:Merkury2-The Legend Returns]") ; you need to double check this.
	If WinActive("[Class:Merkury2-The Legend Returns]") Then ; you need to double check this.
		Sleep (2000)
		MouseMove (729,743) ;no idea what these are could change to MouseClick("Left", 729, 743)
		MouseClick ("left")
		MouseMove (765,876) ;no idea what these are
		MouseClick ("left")
		Send ($id)
		Send ("{tab}")
		Send ($pw)
		Send ("{enter}")
	Else
		MsgBox(0, "Error:", "Unable to find application will exit in 5 seconds.", 5)
		Exit
	EndIf
EndFunc

Func _exit()
	Exit
EndFunc
12/17/2012 11:05 itoy70#9
Also mein momentanes skript sieht so aus
Code:
#RequireAdmin
$read = IniRead("Daten.ini", "Login", "ID", "")
$id = InputBox("ID", "Deine ID", $read)
IniWrite("Daten.ini", "Login", "ID", $id)

$read2 = IniRead("Daten.ini", "Login", "Passwort", "")
$pw = InputBox("Passwort", "Gib dein Passwort ein", $read2)
IniWrite("Daten.ini", "Login", "Passwort", $pw)

$read3 = IniRead("Datem.ini", "Login", "Exe", "")
$exe = InputBox("Exe", "Gib den namen der exe ein z.B. Metin2.exe", $read3)
IniWrite("Daten.ini", "Login", "Exe", $exe)

$read4 = IniRead("Datem.ini", "Login", "Windowname", "")
$Windowname = InputBox("Windowname", "Gib den namen des Fensters ein z.B. Metin2", $read4)
IniWrite("Daten.ini", "Login", "Windowname", $Windowname)

Run($exe)
;WinActive("[Class:MerKury2 - The Legend Returns]")
If WinActive("[Class:MerKury2 - The Legend Returns]") Then
	Sleep(2000)
	ControlClick("" $Windowname, "",,,, 729, 743)
	ControlClick("" $Windowname, "",,,, 729, 743)
	ControlSend("" $Windowname, & $id)
	ControlSend("" $Windowname, "tab")
	ControlSend("" $Windowname, & $pw)
	ControlSend("" $Windowname, "enter")
Else
	MsgBox(0, "Error:", "Unable to find application will exit in 5 seconds.", 5)
	Exit
EndIf
HotKeySet("^{r}", "start")

Func start()
	MouseMove(729, 743)
	MouseClick("left") Else
	MouseMove(765, 876)
	MouseClick("left")
	Send("" & $id)
	Send("{tab}")
	Send("" & $pw)
	Send("{enter}")
EndFunc   ;==>start

HotKeySet("^{y}", "pick")

Func pick()
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
	Send("y")
EndFunc   ;==>pick

HotKeySet("^{1}", "pott")

Func pott()
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
	Send("1")
EndFunc   ;==>pott

While 1
	Sleep(100)
WEnd

If = ("^{e}") Then Exit EndIf

HotKeySet("^{s}", "spamm")

Func spamm()
	$spam InputBox("Spammer", "Spamtext")
	$spams InputBox("Spammer", "Anzahl")
	$spamtime InputBox("Spammer", "Wartezeit zwischen den spams 1000=1 sek")
	ControlSend($Windowname, $spam,, "")
	Sleep($spamtime)


EndFunc   ;==>spamm
mit dem spammer habe ich das problem das ich nicht weis wie ich das machen muss das er es bestimmt oft macht und mit den inis für windowname und der exe das sie bei der inputbox nicht angezeigt werden und irgenwie erkennt das skript das fenster nicht bzw meint der name ist falsch obwohl es eig richtig ist und die controlclicks bzw send kommen auch nicht an wer mir über skype helfen könnte

bitte adden itoy70
12/17/2012 13:01 Croco™#10
Ich will jetzt nicht respektlos klingen aber vl. solltest du dir erstmal anschauen wie AutoIT so funktioniert. In deinem Script sind ca. 100 Fehler drinnen die man durch das einfachste Basiswissen herausfinden kann. Hier mal eine Anlaufstelle bei der du dir dieses Wissen aneignen kannst:

[Only registered and activated users can see links. Click Here To Register...]
Wenn du fragen hast einfach im Thread posten.