Results 1 to 7 of 7

Thread: Use of FindNPCChatText

  1. #1
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Use of FindNPCChatText

    I have this in my script:
    SCAR Code:
    repeat
      if FindRandoms then
        if not LoggedIn then Exit;
      Bars := BarCount;
      Smelt(Players[CurrentPlayer].Strings[0], IntToStr(Amount-Bars));
      Wait(1000+Random(500));
      repeat
        if FindRandoms then
          if not LoggedIn then Exit;
        if FindNPCChatText('ongra', ClickLeft) then
        begin
          Writeln('Level up!');
          Inc(Players[CurrentPlayer].Integers[2]);
          Break;
        end;
        if (BarCount = Bars) then Break;
        Bars := BarCount;
        Writeln('Bars made:' + IntToStr(Bars));
        Writeln('But actually: ' + IntToStr(BarCount));
        AntiBan;
        Wait(1700+Random(300));
      until (Bars = Amount);
    until not FindDTM(MOreDTM, x, y, MIX1, MIY1, MIX2, MIY2);

    But when I get a level up this happens:
    It doesn't break the repeat loop and keeps printing in the debug 'Level up!' until I terminate the script...Oh and it stops printing 'Bars made: blah' and 'But actually: nah' stuff. It keeps printing only 'Level up!'

    EDIT: I need it to break the inner loop if I get a level up.
    Last edited by bugger0001; 06-02-2009 at 09:10 PM.
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

  2. #2
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    u are in 2 loops, it only breaks from the inner one
    too bad labels don't work in loops :-\ that sucks very bad

    u should make a boolean variable, GotLevel, and set it true if u get lvl, then make the outer loop look like

    repeat
    ...
    until(GotLevel or ...)


    edit: oopsie, i answered to a wrong question. I assume it doesnt click the text?
    Last edited by marpis; 06-02-2009 at 09:16 PM.

  3. #3
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It should but it doesn't...
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

  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 you haven't pressed "Click To Continue" yet so the message still remains there and it just thinks you're leveling over and over again.

  5. #5
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, if it's caused by that NPCChat, then why on earth doesn't it print the 'Bars made: blah' and 'But actually: nah'? There's no loops about these only the if statements and even the if's shouldn't stop printing these...

    PS Shouldn't FindNPCChatText click it if it's set up the way I have it?
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

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

    Default

    Quote Originally Posted by bugger0001 View Post
    Well, if it's caused by that NPCChat, then why on earth doesn't it print the 'Bars made: blah' and 'But actually: nah'? There's no loops about these only the if statements and even the if's shouldn't stop printing these...

    PS Shouldn't FindNPCChatText click it if it's set up the way I have it?
    If you think about it step by step it will enter the first loop then enter the second. It will find the npctext then break the second loop and therefore going back to the begining of the first loop again (and skipping the Bar Count writeln's). So now (cos its at the beginning of the first loop) will go back into the second loop again, find the text again, break and then continues in a circle.

    Secondly, if FindNPCChatText('ongra', ClickLeft) then will try to click 'ongra' which of course isn't what you want to click. You want to click the blue "Click To Continue" text at the bottom. For that you can call an SRL function called ClickContinue(True, True). That will click the continue text for you.

  7. #7
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh, Thanks

    EDIT: But still a suspicious thing for me...if it started the outer loop after the Break, then why didn't it try to start smelting, which is before the inner loop, before printing the 'Level up!' in the inner loop?

    EDIT2: Tried it the way Zeph suggested, but it's still the same...

    (To sum it up: my mistake was that I thought the text 'ongra' was only to recognise the NPCChat screen and then the action would apply for the blue text.) But it seems not to be the only reason why it got into an endless loop...
    Last edited by bugger0001; 06-02-2009 at 10:19 PM.
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

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
  •