Jump to content

Newbie Script Help


Guest Soltari
 Share

Recommended Posts

Ok well i used to use autoit a while back, then i switch computers and sorta forgot about it. In the process I stopped playing with scripts so i guess I've regressed sadly >.<. Onto the point i used to use the script below but it no longer works properly. I want to change it but i seem to keep messing it up I'm not really sure why but all i want to do is set it up to type out the stuff, since i use a windower now i don't need to have it waiting for FFXI to load up.

Sleep(100000);

WinWaitActive("FFXiApp");

$j = 0;

While $j < 100

AutoItSetOption("SendKeyDelay", 30);
AutoItSetOption("SendKeyDownDelay", 10);

$i = 0;
Sleep(2500);
Do
Send("/ma Cure <me>{ENTER}");
Sleep(Random(9500,11500));
Send("/ma Cure <me>{ENTER}");
Sleep(Random(9500,11500));
Send("/ma Cure <me>{ENTER}");
Sleep(Random(9500,11500));
Send("/ma Cure <me>{ENTER}");
Sleep(Random(9500,11500));
Send("/ma Cure <me>{ENTER}");
Sleep(Random(9500,11500));
Send("/ma Cure <me>{ENTER}");
Sleep(Random(9500,11500));
Send("/ma Cure <me>{ENTER}");
Sleep(Random(9500,11500));
Send("/ma Cure <me>{ENTER}");
Sleep(Random(9500,11500));
$i = $i + 1;
Until $i = 5
Send("/heal{ENTER}");
Sleep(160000);
Send("/heal{ENTER}");
$j = $j +1;

WEnd
Edited by Soltari
Link to comment
Share on other sites

Why you have all these sleeps is beyond me, but I'm sure you have your reasons. I modified your script a bit so I could show you an easier way of doing it:

AutoItSetOption("SendKeyDelay", 30)
AutoItSetOption("SendKeyDownDelay", 10)
Sleep(100000)

While 1
    If WinActive("FFXiApp") Then
        For $Loop_One = 0 To 100 Step 1
            Sleep(2500)

            For $Loop_Two = 0 To 40 Step 1
                Send("/ma Cure <me>{ENTER}")
                Sleep(Random(9500,11500))
            Next

            Send("/heal{ENTER}")
            Sleep(160000)
            Send("/heal{ENTER}")
                Next
    EndIf
    Sleep(10)
WEnd

I replaced your original While loops with For loops (See AutoIt.chm for more details) and I also removed all the extra Send's and Sleeps and placed them into a larger For loop. You were sending 8 commands and 8 sleeps in a loop that went 5 times (8*5=40) so I just simplified it a bit. As for the WinWaitActive, you said you didn't need that, so I added the if statement so it would only send all that stuff if the game is active (the fore-most window). Now this script will run forever so you might want to add an exit function with a hotkey (See AutoIt.chm for HotKeySet).

Hope this helps,

-CMR

Edited by CodeMaster Rapture
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...