SkellySoul Posted February 18, 2014 Posted February 18, 2014 (edited) For whatever reason when I call the function with the hotkey , it works just fine...however once the function has ran it doesn't go back to the 'while loop' , instead it exits and gives no warning. #include <Misc.au3> #include <Array.au3> ;_Singleton(@ScriptName) HotKeySet("{HOME}", "_Pre") While 1 Sleep(1000) WEnd Func _Pre() Local $Array[8] = [".", "n", "m", "Switch", "v", "c", "Switch", "Main"] ;_ArrayDisplay($Array) ; Debug For $i = 0 To UBound($Array) +1 If $Array[$i] = "Main" Then Send("/") Sleep(500) ElseIf $Array[$i] = "Switch" Then Sleep(1000) Send("w") Sleep(1000) Else Send($Array[$i]) Sleep(300) MouseClick("Right") Sleep(500) EndIf Next EndFunc Edited February 18, 2014 by SkellySoul
Danp2 Posted February 18, 2014 Posted February 18, 2014 Are you running this in Scite? If so, post the results from the Output window. Also, what app are you attempting to automate? Latest Webdriver UDF Release Webdriver Wiki FAQs
this-is-me Posted February 18, 2014 Posted February 18, 2014 That should be UBound($Array) MINUS 1 instead of PLUS 1 Who else would I be?
SkellySoul Posted February 19, 2014 Author Posted February 19, 2014 Thanks for the help. It turns out it was the Ubound() causing the problem because I did +1 instead of -1...*whoops* Thanks again to the both of you
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