yummy22543 Posted June 16, 2005 Share Posted June 16, 2005 last night i was trying to make a simple script that would repeat over and over until i hit a certain hotkey, and what it was doing was basically clicking in too different spots (used to log into a game, in which the login servers have a hard time connecting you and it takes many tries). i dont have much experience with autoit, or prgramming really, but i tinkered around for awhile last night. could someone make me an *.au3 file with the continuing and hotkey to end script? i can add the mouse click variables on my own. i need some help to set me in the right direction. Link to comment Share on other sites More sharing options...
w0uter Posted June 16, 2005 Share Posted June 16, 2005 read up on the helpfile on WHILE and HOTKEYSET (hotkeyset should actually have a pretty nice example for your use) My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
yummy22543 Posted June 16, 2005 Author Share Posted June 16, 2005 (edited) so i just figured this out:HotKeySet("END", "MyExit")WinActivate("Gunz", "")While 1 = 1 MouseClick("left", 936, 563, 50) MouseClick("left", 936, 630, 50)WendFunc MyExit() Exit EndFunci just need help with the hotkey. Edited June 16, 2005 by yummy22543 Link to comment Share on other sites More sharing options...
w0uter Posted June 16, 2005 Share Posted June 16, 2005 {END} My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
yummy22543 Posted June 16, 2005 Author Share Posted June 16, 2005 you are a life saver. thanks a lot w0uter Link to comment Share on other sites More sharing options...
Wb-FreeKill Posted June 16, 2005 Share Posted June 16, 2005 last night i was trying to make a simple script that would repeat over and over until i hit a certain hotkey, and what it was doing was basically clicking in too different spots (used to log into a game, in which the login servers have a hard time connecting you and it takes many tries). i dont have much experience with autoit, or prgramming really, but i tinkered around for awhile last night.could someone make me an *.au3 file with the continuing and hotkey to end script? i can add the mouse click variables on my own. i need some help to set me in the right direction.<{POST_SNAPBACK}>Hmm, something like this HotkeySet("{ESC}","_ESC") While 1 $msg = GUIGetMsg() WEnd Func _ESC() msgbox(0,"","Exiting") Exit EndFunc Link to comment Share on other sites More sharing options...
Wb-FreeKill Posted June 16, 2005 Share Posted June 16, 2005 lol i call that quick support! Link to comment Share on other sites More sharing options...
Wb-FreeKill Posted June 16, 2005 Share Posted June 16, 2005 lol i call that quick support!<{POST_SNAPBACK}>we have one minut support here, take a look at the post times!07:5107:5207:53 07:5407:5507:56 Link to comment Share on other sites More sharing options...
yummy22543 Posted June 16, 2005 Author Share Posted June 16, 2005 so i thought about making this script a litte bit more complex. before the whole clicking starts, is there a way to have input values for each of the clicks? like 1 and 2? because my resulution is 1600 by 1200, and my click spots could differ from someone elses. so how would i have inoput values for click1 and click2? and to get those values, a person would click. first click's value would be set as click1, and the second click would be set as click2. someone point me in the right direction? Link to comment Share on other sites More sharing options...
sanbin Posted June 16, 2005 Share Posted June 16, 2005 you can try the SciTE4Au3.exe ! I Think :SciTE4Au3 has some tools can help you ! Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted June 16, 2005 Share Posted June 16, 2005 MouseGetPos() with hotkeys or a Splash Text should help Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
yummy22543 Posted June 16, 2005 Author Share Posted June 16, 2005 this is my starting codeHotKeySet("{end}", "mouse1")func mouse1()$pos = MouseGetPos()MsgBox(0, "Mouse x,y:", $pos[0]& "," & $pos[1])endfuncwhen i run the script nothing happens. can someone help? Link to comment Share on other sites More sharing options...
/dev/null Posted June 16, 2005 Share Posted June 16, 2005 this is my starting codewhen i run the script nothing happens. can someone help?<{POST_SNAPBACK}>because your script ended. You will need an endless loop.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
yummy22543 Posted June 17, 2005 Author Share Posted June 17, 2005 (edited) i think im way out of my legue here...this is what the script is suppost to do:1. Get first mouse click's posistion by pressing number button 1.2. Get second mouse click's position by pressing number button 2.3. Go back and forth between mouse click 1 and 2 positions.4. Only stop when paused or terminated.Global $PausedHotKeySet("{PAUSE}", "TogglePause")HotKeySet("{ESC}", "Terminate")HotKeySet("1", "mouse1")while 1 = 1sleep(100)wendfunc mouse1()$pos = MouseGetPos()endfuncHotKeySet("2", "mouse2")while 1 = 1sleep(100)wendfunc mouse2()$pos = MouseGetPos()endfunc MouseClick($mouse1,$pos[0],$pos[1],50) MouseClick($mouse2,$pos[0],$pos[1],50)While 1 Sleep(100)WEnd;;;;;;;;Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") Edited June 17, 2005 by yummy22543 Link to comment Share on other sites More sharing options...
buzz44 Posted June 17, 2005 Share Posted June 17, 2005 (edited) I think the keyword in HotKeySet() is KEY!. Is a mouse a key? No, why is the keyboard called keyboard? Because it has keys on it. Mouse = Not keyboard = No key.Use the search function on the forums to search in 'Scripts and Scraps' for a UDF called _IsPressed(). Edited June 17, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
yummy22543 Posted June 17, 2005 Author Share Posted June 17, 2005 I think the keyword in HotKeySet() is KEY!. Is a mouse a key? No, why is the keyboard called keyboard? Because it has keys on it. Mouse = Not keyboard = No key.Use the search function on the forums to search in 'Scripts and Scraps' for a UDF called _IsPressed().<{POST_SNAPBACK}>this is why forums are used for help. Link to comment Share on other sites More sharing options...
yummy22543 Posted June 17, 2005 Author Share Posted June 17, 2005 HotKeySet("1", "mouse1") when button 1 is pushed, it makes a function called mouse1. i dont see what is wrong with this. could you try to explain instead of calling me stupid? Link to comment Share on other sites More sharing options...
HardCopy Posted June 17, 2005 Share Posted June 17, 2005 HotKeySet("1", "mouse1")when button 1 is pushed, it makes a function called mouse1. i dont see what is wrong with this. could you try to explain instead of calling me stupid?<{POST_SNAPBACK}> Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad Link to comment Share on other sites More sharing options...
yummy22543 Posted June 17, 2005 Author Share Posted June 17, 2005 hardcopy that was an absolutly worthless spam post.i see that i made a mistake on the "1", which is now fixed. i need help with this.HotKeySet("{END}", "mouse2")func mouse2()$pos = MouseGetPos()endfuncwhile 1 = 1 MouseClick($mouse1)Wendi need mouseclick to be the position when button END is pressed. Link to comment Share on other sites More sharing options...
HardCopy Posted June 17, 2005 Share Posted June 17, 2005 hardcopy that was an absolutly worthless spam post.i see that i made a mistake on the "1", which is now fixed. i need help with this.i need mouseclick to be the position when button END is pressed.<{POST_SNAPBACK}>****-----------Dude it wasnt spam / I forgot to post a gift for you.expandcollapse popup;;; by hardcopy June17 2005 / Autoit beta 3.1.1.46 ;;; moves mouse pointer between to specified regions on screen ;;; operation - move mouse to first location + Press "1" (will show a tooltip) ;;; move mouse to second location + Press "2" ;;; once "2" has been pressed script will move mouse between these 2 points ;;;; & executing a left mouse click - until "Esc" key pressed. ;;;; ;;;; Quick + dirty code. Global $Paused dim $pos_one dim $pos_two HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("1", "mouse1") HotKeySet("2", "mouse2") while 1 sleep(10) wend func mouse1() $pos_one = MouseGetPos() ToolTip("First Location Set here",$pos_one[0],$pos_one[1]) endfunc func mouse2() $pos_two = MouseGetPos() ToolTip("Second Location Set here",$pos_two[0],$pos_two[1]) while 1 MouseClick("left",$pos_one[0],$pos_one[1],1,100) MouseClick("left",$pos_two[0],$pos_two[1],1,100) sleep(10) wend endfunc Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc func Terminate() Exit 0 EndFunchthHardCopy( I too am a newbie to autoit but i learn by solving others problems.) Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now