jammu Posted December 27, 2009 Share Posted December 27, 2009 This is my script HotKeySet("{F3}", "StartProg") HotKeySet("{F4}", "ExitProg") Func StartProg() While 1 sleep(300) MouseClick("left",463, 216) sleep(300) MouseClick("left",964, 752) sleep(300) MouseClick("left",964, 752) sleep(300) MouseClick("left",492, 215) Sleep(300) MouseClick("left",970, 753) WEnd Func ExitProg() Exit EndFunc And it gives this error always when i syntaxcheck : ERROR: syntax error Func ^ : ERROR: ExitProg(): undefined function. HotKeySet("{F4}", "ExitProg") Link to comment Share on other sites More sharing options...
Developers Jos Posted December 27, 2009 Developers Share Posted December 27, 2009 Run it through tidy and you will understand (i hope): HotKeySet("{F3}", "StartProg") HotKeySet("{F4}", "ExitProg") Func StartProg() While 1 Sleep(300) MouseClick("left", 463, 216) Sleep(300) MouseClick("left", 964, 752) Sleep(300) MouseClick("left", 964, 752) Sleep(300) MouseClick("left", 492, 215) Sleep(300) MouseClick("left", 970, 753) WEnd ;### Tidy Error -> func Not closed before "Func" statement. ;### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement. Func ExitProg() Exit EndFunc ;==>ExitProg ;### Tidy Error -> func is never closed in your script. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 27, 2009 Moderators Share Posted December 27, 2009 jammu,You do not end StartProg before you start ExitProg!. You need to add an EndFunc between these 2 lines:WEnd ; <<<<<<<<<<<<<<<<<<<<< Add EndFunc here Func ExitProg()2 tips:1. Use Tidy on your scripts - it will pick up on these errors. Press Ctrl-T within SciTE or use the Tools menu.2. When you post code, please use Code tags. Put [autoit ] before and [/autoit ] after your posted code (but omit the trailing space - it is only there so the tags display here).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...
jammu Posted December 27, 2009 Author Share Posted December 27, 2009 i made it like this now HotKeySet("{INSERT}", "StartProg") HotKeySet("{END}", "ExitProg") Func StartProg() While 1 sleep(300) MouseClick("left",463, 216) sleep(300) MouseClick("left",964, 752) sleep(300) MouseClick("left",964, 752) sleep(300) MouseClick("left",492, 215) Sleep(300) MouseClick("left",970, 753) WEnd EndFunc Func ExitProg() Exit EndFunc When i start it and press INSERT it wont start clicking :S annoying Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 27, 2009 Moderators Share Posted December 27, 2009 jammu,You need to add some form of loop to keep your script active, otherwise it exits as soon as you have set the HotKeys. I would suggest:While 1 Sleep(10) WEndM23P.S. Did you read what I posted above about code tags? 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...
jammu Posted December 27, 2009 Author Share Posted December 27, 2009 damn, i'm just stupid can you type that to my script please? i just can't get it Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 27, 2009 Moderators Share Posted December 27, 2009 jammu,Where do you think it might go? 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...
jammu Posted December 27, 2009 Author Share Posted December 27, 2009 i have no idea seriously :S i have while and wend there already? Link to comment Share on other sites More sharing options...
Developers Jos Posted December 27, 2009 Developers Share Posted December 27, 2009 (edited) damn, i'm just stupid can you type that to my script please? i just can't get itc'mon, learn some basics to help yourself. Edited December 27, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 27, 2009 Moderators Share Posted December 27, 2009 jammu,You only have a While...WEnd loop inside one of your functions. Run through what you want your script to do:It has 2 functions which you want to run when HotKeys are pressed - those are now properly defined by Func...EndFunc. The main part of the script sets these HotKeys and then does what? At the moment: nothing, it just exits. So you you need to keep the script active at this point:Set HotKeys Loop FunctionsWhen this is done the script remains active so your HotKeys can activate the functions. 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...
jammu Posted December 27, 2009 Author Share Posted December 27, 2009 While 1 HotKeySet("{INSERT}", "StartProg") HotKeySet("{END}", "ExitProg") WEnd Func StartProg() While 1 sleep(300) MouseClick("left",463, 216) sleep(300) MouseClick("left",964, 752) sleep(300) MouseClick("left",964, 752) sleep(300) MouseClick("left",492, 215) Sleep(300) MouseClick("left",970, 753) WEnd EndFunc Func ExitProg() Exit EndFunc ? yeahyeah call me dumb whatever.. -.- Link to comment Share on other sites More sharing options...
Info Posted December 27, 2009 Share Posted December 27, 2009 (edited) ;\\\\\\\\\\\\\\\\\\\\Set hotkeys HotKeySet("{F3}", "_Start") HotKeySet("{F4}", "_Pause") HotKeySet("{F5}", "_Exit") ;//////////////////// ;\\\\\\\\\\\\\\\\\\\\Declare vars Global $i ;//////////////////// ;\\\\\\\\\\\\\\\\\\\\Main loop While 1 Sleep(1000) WEnd ;//////////////////// ;\\\\\\\\\\\\\\\\\\\\Functions Func _Start() While 1 Sleep(100) $i += 1 ToolTip($i) WEnd EndFunc ;==>_Start Func _Pause() ToolTip("Program paused.") While 1 Sleep(10) WEnd EndFunc ;==>_Pause Func _Exit() Exit EndFunc ;==>_Exit ;//////////////////// Edited December 27, 2009 by Info Link to comment Share on other sites More sharing options...
jammu Posted December 27, 2009 Author Share Posted December 27, 2009 Ok it works now but not in the game :/ I have KAROS online minimized and i open the script, then i go to karos and press "INSERT" it won't start but when i dont go to karos it starts.. Like the autoit wouldnt receive the command from me :e Sorry for bad english. I hope you understand Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 27, 2009 Moderators Share Posted December 27, 2009 jammu,And does that match what I suggested? NO! You are redeclaring your HotKeys every pass of that loop and you will run into huge problems with CPU usage - in fact I think you might well be at 100% and so you will not get your script to work properly.Go and read what I posted above AGAIN and try and put the loop I suggested in the place I recommended.M23P.S. And if you post your code again without CODE TAGS, I will NOT help any more. 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...
jammu Posted December 27, 2009 Author Share Posted December 27, 2009 So, what i should type to that script if i want to get it working in game... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 27, 2009 Moderators Share Posted December 27, 2009 jammu,Which part of:You need to add some form of loop to keep your script active, otherwise it exits as soon as you have set the HotKeys. I would suggest:While 1 Sleep(10)WEndandSet HotKeysLoopFunctionsdo you not understand?M23P.S. That nice man Info has given you solution directly if you look carefully! 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...
jammu Posted December 27, 2009 Author Share Posted December 27, 2009 Melba23, i have hotkeys working now but when i'm inside game, hotkeys won't work. If i'm not inside game, they work perfectly. :| Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 27, 2009 Moderators Share Posted December 27, 2009 jammu, This is not good: While 1 HotKeySet("{INSERT}", "StartProg") HotKeySet("{END}", "ExitProg") WEnd It uses far too much of your processor and can even crash your system. As I said before, you only need to declare the HotKeys once. The code should read: HotKeySet("{INSERT}", "StartProg") HotKeySet("{END}", "ExitProg") While 1 Sleep(10) WEnd As to why it does not work in your game - ask a gamer! Although I seem to have heard somewhere that certain games might be protected against things like botting - I wonder if that could have something to do with it? 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...
jammu Posted December 27, 2009 Author Share Posted December 27, 2009 Haha i understand, i removed those while and wend in hotkeyset thing^^ Yeah, only problem is that hotkeys doesnt follow to KAROS online i would need it so bad. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 27, 2009 Developers Share Posted December 27, 2009 Likely your game is protected by some protection mechanism. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts