Results 1 to 6 of 6

Thread: Something in my script is causing lag.

  1. #1
    Join Date
    Sep 2006
    Posts
    322
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default Something in my script is causing lag.

    This is a tutorial island solver and account creator. Going through the code in the procedure tutorial1 you'll find writeln's where the lag is occuring. I really don't know what the problem is, except ClickToContinue;

    Any help?

  2. #2
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Which line is it? Because i can't seem to find it, and there are lot's of ClickToContinues..
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  3. #3
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't see why it would cause lag unless you have a slow computer. Maybe try making your own click to continue? You could just do if get color = whatever then mousebox. May cause less lag for you I don't know.

    On another note, things like this:
    SCAR Code:
    ClickToContinue;
      Wait(200+random(200));
      ClickToContinue;
      Wait(200+random(200));
      ClickToContinue;
      Wait(200+random(200));
      ClickToContinue;
      Wait(200+random(200));
      ClickToContinue;
      Wait(200+random(200));
      ClickToContinue;
      Wait(200+random(200));
      ClickToContinue;
      Wait(200+random(200));
      ClickToContinue;
      Wait(200+random(200));
      ClickToContinue;
      Wait(200+random(200));
      ClickToContinue;
      Wait(200+random(200));
      ClickToContinue;

    Should really be shortened to:

    SCAR Code:
    var i: Integer;
    for i := 1 to 10 do
    begin
      ClickToContinue;
      Wait(200+random(200));
    end;

    Much cleaner, right? I'm not sure how many you actually did, but just replace 10 with however many times that clicks to continue + waits.

  4. #4
    Join Date
    Sep 2006
    Posts
    322
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Alright jad thanks, @ other guy: I don't have a slow computer, I even set smart at the max settings, just for some reason every time I run it, right after the cutscene it lags.

    Edit:

    SCAR Code:
    Wait(1000+random(500));Writeln('1');//numbers for debugging
      MouseBox(236, 449, 375, 456,1);Writeln('2');
      Wait(32000+random(1000));Writeln('3');
      ClickToContinue;Writeln('4');
      Wait(10000+random(1000));Writeln('5');
      ClickToContinue;Writeln('6');

    The big waits will eventually be dropped and replaced with failsafes, but I'm more worried about getting it working correctly.
    Last edited by uncfan1119; 10-15-2009 at 12:45 AM.

  5. #5
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by uncfan1119 View Post
    Alright jad thanks, @ other guy: I don't have a slow computer, I even set smart at the max settings, just for some reason every time I run it, right after the cutscene it lags.

    Edit:

    SCAR Code:
    Wait(1000+random(500));Writeln('1');//numbers for debugging
      MouseBox(236, 449, 375, 456,1);Writeln('2');
      Wait(32000+random(1000));Writeln('3');
      ClickToContinue;Writeln('4');
      Wait(10000+random(1000));Writeln('5');
      ClickToContinue;Writeln('6');

    The big waits will eventually be dropped and replaced with failsafes, but I'm more worried about getting it working correctly.

    I see no problem with that code and no reason it should cause lag. The only explanation could be ClickToContinue.

    Try making a simple getcolor click to continue of your own. Something like:

    SCAR Code:
    function ClickCont: Boolean;
    begin
      Result := GetColor(500,500) = 222222;
      if(Result)then
        MouseBox(100,100,200,200,1);
    end;

    Simple, but effective if used properly. Just pick a color on the ClickToContinue text and replace the point (500,500) with those coordinates and replace 222222 with the actual color. You could take multiple points and do if GetColor() = col and GetColor(different spot) = col2 then.

    Change the MouseBox coordinates with the coords of the clicktocontinue text.

    Get what I'm saying? Give it a try and see if that gets rid of the lag.

  6. #6
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    PHP Code:
    {*******************************************************************************
    function 
    ClickContinue(ClickWaitBoolean): Boolean;
    ByEvilChicken!
    DescriptionReturns true if the blue 'Click To Continue' text in the chat box
    is found
    . If will click if Click Truecalls ChatWait if Wait True.
    *******************************************************************************} 
    SCAR Code:
    ClickContinue(True,True);

    Could also try that.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •