Skerb Posted August 24, 2006 Share Posted August 24, 2006 I was curious if it is possible to set a variable with a long string of commands. I repeat like 15 commands multiple times and was wondering if I can just set it as a variable; if so, how would I write it? Thanks! Link to comment Share on other sites More sharing options...
Valuater Posted August 24, 2006 Share Posted August 24, 2006 Maybe... $command = StringSplit("dothis,dothat,thenthis,thenthat,thendothis,thendothat", ",") For $x = 1 To $command[0] MsgBox(64, "test", $command[$x], 2) Next 8) Link to comment Share on other sites More sharing options...
buzz44 Posted August 24, 2006 Share Posted August 24, 2006 Can you post an example or some pseudocode? qq Link to comment Share on other sites More sharing options...
Skerb Posted August 24, 2006 Author Share Posted August 24, 2006 MouseClick("left", 89,221) Sleep(500) MouseClick("left", 130,367) Sleep(1500) Send("{PGDN}") Sleep(500) MouseClick("left", 119,563) Sleep(1000) Send("Skerb's Message") Sleep(1000) Send("{TAB}") Sleep(200) Send("{TAB}") Sleep(200) Send("{TAB}") Sleep(200) I need to run this script a bunch of times, I tried Valuater's StringSplit, but it did not work. Any other ideas? Thanks! Link to comment Share on other sites More sharing options...
Valuater Posted August 24, 2006 Share Posted August 24, 2006 then maybe expandcollapse popup; Press Esc to terminate script, Pause/Break to "pause" Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d ;;;; Body of program would go here ;;;; While 1 MouseClick("left", 89, 221) Sleep(500) MouseClick("left", 130, 367) Sleep(1500) Send("{PGDN}") Sleep(500) MouseClick("left", 119, 563) Sleep(1000) Send("Skerb's Message") Sleep(1000) Send("{TAB}") Sleep(200) Send("{TAB}") Sleep(200) Send("{TAB}") Sleep(200) WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func ShowMessage() MsgBox(4096, "Thanks ...", "... Valuater! ") EndFunc ;==>ShowMessage 8) Link to comment Share on other sites More sharing options...
Skerb Posted August 24, 2006 Author Share Posted August 24, 2006 Wait, I think I described my problem wrong, hehe. I do not have to keep running this same script, but I have to write it over and over. I want to make a variable so I wouldn't have to repeat writing it over and over. Such as: something something something *That big routine* something different something different something different *that big routine* and etc, etc...I hope I explained myself well enough now, sorry for the confusion before...Lol, unless you were right with the last script, then my apologizes and Im a noob Link to comment Share on other sites More sharing options...
Gondus Posted August 24, 2006 Share Posted August 24, 2006 I would just make two diffrent exe files and make my main one run the one i want it to do and sleep for a sec then continue with the program....thats only because im lazy though -----------Current Programming Language Status:Beginner: J#, Ruby Intermediate: Autoit, Java, C#, C++Advanced: Basic, Visual Basic, Fortran Link to comment Share on other sites More sharing options...
buzz44 Posted August 24, 2006 Share Posted August 24, 2006 (edited) You want to put it in a function and call it whenever you need it. While 1 _DoStuff() WEnd Func _DoStuff() MouseClick("left", 89, 221) Sleep(500) MouseClick("left", 130, 367) Sleep(1500) Send("{PGDN}") Sleep(500) MouseClick("left", 119, 563) Sleep(1000) Send("Skerb's Message") Sleep(1000) Send("{TAB}") Sleep(200) Send("{TAB}") Sleep(200) Send("{TAB}") Sleep(200) EndFunc ? *WARNING* The above script will call the fcuntion over and over again sending keystrokes and clicking. I couldn't be bothered adding a Hotkey and just wanted to show you how to do it ^6^. Edited August 24, 2006 by Burrup qq Link to comment Share on other sites More sharing options...
Skerb Posted August 24, 2006 Author Share Posted August 24, 2006 Thanks man! Thats exactly what I needed, thanks for everyones help. 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