Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 13:12

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

Advertisement



AutoIt skript problem

Discussion on AutoIt skript problem within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2011
Posts: 103
Received Thanks: 8
AutoIt skript problem

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
itoy70 is offline  
Old 12/14/2012, 20:44   #2
 
Croco™'s Avatar
 
elite*gold: 235
Join Date: Jan 2012
Posts: 920
Received Thanks: 377
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)



Croco™ is offline  
Thanks
1 User
Old 12/15/2012, 15:09   #3
 
elite*gold: 0
Join Date: Jan 2011
Posts: 103
Received Thanks: 8
und was bringe admin rechte?
itoy70 is offline  
Old 12/15/2012, 15:25   #4
 
Croco™'s Avatar
 
elite*gold: 235
Join Date: Jan 2012
Posts: 920
Received Thanks: 377
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.
Croco™ is offline  
Thanks
1 User
Old 12/15/2012, 18:31   #5
 
omer36's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,254
du brauchst also admin rechte um deine maus zu bewegen?

kaum ein normaler user hat administrator rechte auf seinem rechner.
omer36 is offline  
Thanks
1 User
Old 12/15/2012, 23:25   #6
 
Croco™'s Avatar
 
elite*gold: 235
Join Date: Jan 2012
Posts: 920
Received Thanks: 377
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 ?
Croco™ is offline  
Thanks
1 User
Old 12/16/2012, 00:30   #7

 
Futur94's Avatar
 
elite*gold: 0
Join Date: Aug 2011
Posts: 263
Received Thanks: 177
Nein du irrst dich nicht, in diesem fall, gebe ich croco recht das es mit ControlSend und ControlClick besser ist.
Futur94 is offline  
Thanks
1 User
Old 12/16/2012, 01:03   #8
 
elite*gold: 0
Join Date: Aug 2011
Posts: 442
Received Thanks: 78
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
logical691 is offline  
Thanks
1 User
Old 12/17/2012, 11:05   #9
 
elite*gold: 0
Join Date: Jan 2011
Posts: 103
Received Thanks: 8
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
itoy70 is offline  
Old 12/17/2012, 13:01   #10
 
Croco™'s Avatar
 
elite*gold: 235
Join Date: Jan 2012
Posts: 920
Received Thanks: 377
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:


Wenn du fragen hast einfach im Thread posten.
Croco™ is offline  
Thanks
1 User
Reply




All times are GMT +2. The time now is 13:12.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.