flozcag Posted September 2, 2015 Share Posted September 2, 2015 (edited) Hello, to begin with I would like to say hello, I'm a new guy here, If the post doesn't belong here you are welcome to move it. Soo... I need help with writing simple script, below I'm showing you guys how would it look like.- Start/Stop key = Alt + Pause Breakwhen start key pressed:- Press F1, wait 2 seconds, use right clickwait 2 seconds- Press F2, wait 2 seconds, use right clickwait 2 seconds- Press F3, wait 2 seconds, use right clickcontinue pressing "F3, wait 2 seconds, use right click" for 1-2 minutes and then repeat F1, F2 and again F3Also I would like the script to use the right click where the mouse is set at, no need for setting coordinates.I'm looking forward to hear from you guys. Edited September 2, 2015 by flozcag Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 2, 2015 Moderators Share Posted September 2, 2015 flozcag,Welcome to the AutoIt forums.We do not write code to order, we help you get your code running correctly. Think of the old saying: "Give a man a fish, you feed him for a day; give a man a net and you feed him forever". We try to be net makers and repairers, not fishmongers.Look at MouseClick, Sleep, TimerInit/Diff, While...WEnd in the Help file and see how you get on with coding something yourself - you know where we are if you run into difficulties.M23P.S. Looking at your email address, you might also want to read the Forum rules just to make sure you do not stray over any of the lines drawn therein. 232showtime 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
flozcag Posted September 2, 2015 Author Share Posted September 2, 2015 (edited) Does that make any sense?HotKeySet("{end}", "_run") HotKeySet("{end}", "_stop") Func _keypress() Send("F1"); or should I use ControlSend? Sleep(2000) EndFunc ;==>_keypress Func _mouseclick() MouseClick("right") Sleep(2000) EndFunc ;==>_mouseclick Func _keypress() Send("F2"); or should I use ControlSend? Sleep(2000) EndFunc ;==>_keypress Func _mouseclick() MouseClick("right") Sleep(2000) EndFunc ;==>_mouseclick Func _keypress() Send("F3"); or should I use ControlSend? Sleep(2000) EndFunc ;==>_keypress Func _mouseclick() MouseClick("right") Sleep(2000) EndFunc ;==>_mouseclick; I don't know how to make the loop for the last key (F3) Edited September 2, 2015 by Melba23 Added code tags Link to comment Share on other sites More sharing options...
flozcag Posted September 2, 2015 Author Share Posted September 2, 2015 (edited) does that work any better?expandcollapse popup#include <MsgBoxConstants.au3> ; Press Esc to terminate script, Pause/Break to "pause" Global $g_bPaused = False HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") ; Shift-Alt-d While 1 Sleep(100) WEnd Func TogglePause() $g_bPaused = Not $g_bPaused While $g_bPaused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit EndFunc ;==>Terminate Func ShowMessage() MsgBox($MB_SYSTEMMODAL, "", "This is a message.") EndFunc ;==>ShowMessage Send("{F1}" Sleep(2000) MouseClick("right" ], x,y [, clicks = 1 [, speed= 10]]]) Sleep(2000) Edited September 2, 2015 by Melba23 Added code tags again Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 2, 2015 Moderators Share Posted September 2, 2015 flozcag,Sorry, dinner intervened.When you post code please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above after I added the tags.does that work any better?You tell me - does it do what you want? If not , what does not work?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
flozcag Posted September 2, 2015 Author Share Posted September 2, 2015 expandcollapse popup#include <MsgBoxConstants.au3> ; Press Esc to terminate script, Pause/Break to "pause" Global $g_bPaused = False HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") ; Shift-Alt-d While 1 Sleep(100) WEnd Func TogglePause() $g_bPaused = Not $g_bPaused While $g_bPaused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit EndFunc ;==>Terminate Func ShowMessage() MsgBox($MB_SYSTEMMODAL, "", "This is a message.") EndFunc ;==>ShowMessage Func _Send1() Send("{F1}" Sleep(2000) EndFunc Func _MouseClick1() MouseClick("right") Sleep(2000) EndFunc Func _Send2() Send("{F2}") Sleep(2000) EndFunc Func _MouseClick2() MouseClick("right") Sleep(2000) EndFunc Func _Send3() ; I don't know if that's right, corret me if so $i = 0 While $i < 120 Send("{F3}") $i+=4 WEnd EndFunc Func _MouseClick3() ; Should this go together with the Func _Send 3()? MouseClick("right") Sleep(2000) EndFuncI have no errors but the whole script doesn't work, it's not doing anything. I wan't to use it for my game I play in. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 2, 2015 Moderators Share Posted September 2, 2015 flozcag,I wan't to use it for my game I play in.I see you did not bother to read those Forum rules to which I linked you. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts