superboi Posted October 16, 2010 Share Posted October 16, 2010 I think this is somewhat of a tricky request. I have a script with a few variables. $b - this is a constant $a - This is part of a loop, and ends at $b $x - this is the one giving me trouble I need $x = 1 when $b - $a = 9. I also need $x to increase by $a's step. I hope this can be done, because as of right now, the only variable I have to change before using the script is $b. I didn't really need $x before because $b was well... constant, and it was actually 12 for a while, but now its 15, and I don't know what it'll be in the future. Link to comment Share on other sites More sharing options...
superboi Posted October 16, 2010 Author Share Posted October 16, 2010 Actually I think I may have thought of a better solution to this problem.If there is some way to send("$a"), and have a numerical value come out on the other end, then my problem is solved. Link to comment Share on other sites More sharing options...
Delta Posted October 16, 2010 Share Posted October 16, 2010 I'm not sure what your trying to do since you haven't posted any code however it sounds like your having problems with basic math. You should start by learning how to use for next loops. ; example for $i = 0 to 10 step 2 consolewrite($i&@CRLF) next [size="1"]Please stop confusing "how to" with "how do"[/size] Link to comment Share on other sites More sharing options...
Varian Posted October 16, 2010 Share Posted October 16, 2010 (edited) If you just want to send the value of $a, that can be done by removing the quotes from around it Run('notepad.exe') WinWait('[CLASS:Notepad]') For $a = 1 to 20 ControlSend('[CLASS:Notepad]', '', 'Edit1', $a) ControlSend('[CLASS:Notepad]', '', 'Edit1', '{ENTER}') Next Edited October 16, 2010 by Varian Link to comment Share on other sites More sharing options...
superboi Posted October 16, 2010 Author Share Posted October 16, 2010 It wasn't a problem with my math. It was a problem of making a variable appear when something occurred. I knew when it occurred, I just didn't know how to let the computer know.Anyway I found out how to send what I wanted to.At first I was thinking of having 20 different "if" clauses:If $a = 1 then send("1")If $a = 2 then send("2")If $a = 3 then send("3")...Apparently though you can say:Send("{&$a&}")and it'll send the numerical value for your variable. This way I don't need to click the link, and I can just change the URL. Link to comment Share on other sites More sharing options...
Varian Posted October 16, 2010 Share Posted October 16, 2010 (edited) To send {1}Send("{" & $a) Send("}")To send 1Send($a)To send {NUMPAD1}Send("{NUMPAD" & $a & "}") Edited October 16, 2010 by Varian Link to comment Share on other sites More sharing options...
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