tigerray00 Posted September 3, 2011 Posted September 3, 2011 (edited) ControlSend("Title","","","8")Sleep(400)ControlSend("Title","","","9")Sleep(400)ControlSend("Title","","","0") While 1$check = ProcessExists("title.exe")If $check = 0 Then Terminate()$rand = Random(1,7,1)ControlSend("title","","",$rand)If $rand < 5 Then$rand2 = $rand(1000)Sleep($rand2)ElseSleep(1100)EndIfWEnd When I run this I keep getting an expression error listed in the line ControlSend("Title","","","0"), error says line 14 which is the line that is on. I had an If then statement after that, but would recieve and error on line 15 which had nothing written. the only thing above the first control send are comments I removed the if then and now it's error on 14 The controlsends do complete before I get the error and it never enters the While loopWhat it's supposed to do is send 8,9,0, then generate a random number between 1 and 7 send that number then if the number is under 5 sleep that many seconds before the next send and keep doing the random sends Also getting an issue with $ProEx = ProcessExists("title.exe")If $ProEx = 0 Then Terminate()EndIf Getting syntax error on EndIf Edited September 3, 2011 by tigerray00
martin Posted September 3, 2011 Posted September 3, 2011 ControlSend("title","","",$rand) is wrong because you do not have a control ID. If condition then somethingendif is wrong; it should be if condition then something ;no endif for a single-line IF or if condition then somethingendif Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
tigerray00 Posted September 3, 2011 Author Posted September 3, 2011 idk, it's an attempt at math, can't find in the help file how to multiply a variable by x amound
monoscout999 Posted September 3, 2011 Posted September 3, 2011 plus + rest - multiply * divide / this?
tigerray00 Posted September 3, 2011 Author Posted September 3, 2011 supposed to be the random number*1000, sleep for that amount of milisec's after the send
tigerray00 Posted September 3, 2011 Author Posted September 3, 2011 ControlSend("title","","",$rand) is wrong because you do not have a control ID There is no control ID, I'm sending to the window itself, which actually doesn't have to have a speicific ID. The sends do happen exactly as instructed, but after the last on it errors then doesn't enter the loop, and I get an expression error at ControlSend("title","","","0"), should I have it set for raw or is there something else? Thanks for the info on the if statements, that fixed that part of it.
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