flozcag Posted September 3, 2015 Share Posted September 3, 2015 (edited) Hey, I'm trying to write a script, I just started on this forum, still learning and need help, basically everything is working but function F2 and the pause, please look in to it, also I would like to add simple copyright message, could someone help me with it?The script doesn't read function F2, looks like its skipping itThe pause is not working, you can start it but can't pause it expandcollapse popupHotKeySet("!{PAUSE}", "_Start") HotKeySet("{ESC}", "_Exit") ;sets the hot key "alt+pause" for function _start ;sets the hot key "esc" for function _exit Global $isPaused = True ;bool for toggle start/pause While 1 If $isPaused = False Then ;checks if bot is on/off ;if on then... ;everything in this while will be repeated until you press alt+pause again Send("{F1}") ;sends key F1 Sleep(2000) ;sleeps for 2000ms = 2s MouseClick("Right") ;uses right click (mouse) Send("{F2}") Sleep(2000) MouseClick("Right") $timer = TimerInit() ;sets a timer $diff = TimerDiff($timer) ;reads the time difference to TimerInit() While $diff < 120000 ;while the timer difference is less than 120000ms (2min)..... $diff = TimerDiff($timer) ;read diff again otherwise it will always be as big as before the while Send("{F3}") Sleep(2000) MouseClick("Right") WEnd EndIf ;if off then ask again WEnd Func _Start() ;function which is called by pressing alt+pause If $isPaused = False Then $isPaused = True If $isPaused = True Then $isPaused = False EndFunc Func _Exit() Exit EndFunc Edited September 3, 2015 by flozcag Link to comment Share on other sites More sharing options...
Developers Jos Posted September 3, 2015 Developers Share Posted September 3, 2015 Where does your script "read" f2? .. and have a closer look at your _Start() udf, the outcome of your 2 If statements is that $ispaused is always eq False!Also make sure you read up on our forumrules as you are mentioning the magic word "bot" in there.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...
Exit Posted September 3, 2015 Share Posted September 3, 2015 (edited) Func _Start() ;function which is called by pressing alt+pause ;If $isPaused = False Then $isPaused = True ;If $isPaused = True Then $isPaused = False $isPaused = NOT $isPaused EndFunc Edited September 3, 2015 by Exit App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
flozcag Posted September 3, 2015 Author Share Posted September 3, 2015 What I meant is the script doesn't send the F2 function, like it's just not working or skipping it in the whole script.Could you help me with the pause? I don't really know what you mean Link to comment Share on other sites More sharing options...
flozcag Posted September 3, 2015 Author Share Posted September 3, 2015 Also it's not a bot, It's supposed to be a floor clearing program for my map's on my game server. Link to comment Share on other sites More sharing options...
Developers Jos Posted September 3, 2015 Developers Share Posted September 3, 2015 (edited) The second question is just answered by somebody without giving you the chance to think about it first. The F2 is send, but the questions probably is which application received it.Jos Edited September 3, 2015 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...
flozcag Posted September 3, 2015 Author Share Posted September 3, 2015 (edited) Should I try "controlsend" instead of "send" regarding the F2 function? Edited September 3, 2015 by flozcag Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 3, 2015 Moderators Share Posted September 3, 2015 flozcag,It's supposed to be a [...] program for [...] my game server I have pointed you at the rules already - so which bit of:Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects:[...]Launching, automation or script interaction with games or game servers, regardless of the game.was unclear? You have used up al flex we are prepared to give you - best you stick within those rules from now on. Thread 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