Results 1 to 7 of 7

Thread: some improvement needed

  1. #1
    Join Date
    Dec 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default some improvement needed

    This is not part of a script i made. I found it while web surfing. it works all fine and dandy but when it goes to this procedure in the script it gets all laggy i was wondering if theres anything that should b changed?

    Procedure CheckNPC;
    begin
    Wait(2000);
    Check := 0;
    if FindNpcChatText('ions') or FindNpcChatText('dation') or FindNpcChatText('oins') then
    begin
    Wins := Wins + 1;
    WriteLn('- Game: WON!');
    WriteLn('');
    ClickToContinue;
    exit;
    end;
    if FindNpcChatText('illed') then
    begin
    loses := loses + 1;
    WriteLn('- Game: Lose =[');
    WriteLn('');
    ClickToContinue;
    exit;
    end;
    if FindNpcChatText('ticed') then
    begin
    NotEnough := NotEnough + 1;
    WriteLn('- Game: Won, but not enough points! so you lose!');
    WriteLn('');
    ClickToContinue;
    exit;
    end;
    NoSt := NoSt + 1
    WriteLn('- No game status found');
    WriteLn('');
    end;

  2. #2
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Please use scar tags ([*scar][*/scar] - the *'s or the little scar icon) as it makes it much easier to read.

    It looks like it is for RS, but where in it I'm not sure. I would suggest looking at the 'ClickToContinue' procedure as that's called a few times, so it could be to do with that and maybe removing the wait at the beginning (unless it's called in a repeat loop with no wait time in that).

  3. #3
    Join Date
    Dec 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this is for pest control its for after winning the game u talk to the squire and it lags a good bit when it comes to this part

  4. #4
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    I think its because it calls FindNPCChatText 5 times. To speed it up you could try making it find only one text instead of three when checking for a win.

  5. #5
    Join Date
    Dec 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yea but it needs to b able to click to continue for it to get back on the boat and back to pc

  6. #6
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    What I mean is instead of having three FindNPCChatText calls like this:
    SCAR Code:
    if FindNpcChatText('ions') or FindNpcChatText('dation') or FindNpcChatText('oins') then

    if you have 1 FindNPCChatText only it will be quicker.

  7. #7
    Join Date
    Dec 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oh ok ill try it out tyvm

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. eek. A little help needed:
    By malotthouse in forum OSR Help
    Replies: 4
    Last Post: 02-18-2008, 06:01 PM
  2. So has the RS Shop "Improvement" Improved?
    By Jackrawl in forum Discussions & Debates
    Replies: 1
    Last Post: 10-07-2007, 08:24 AM
  3. Help needed
    By faster789 in forum OSR Help
    Replies: 2
    Last Post: 09-30-2007, 03:11 AM

Posting Permissions

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