Page 1 of 2 12 LastLast
Results 1 to 25 of 26

Thread: Simba freezes

  1. #1
    Join Date
    Mar 2016
    Posts
    192
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Question Simba freezes

    Hey,
    when I run my script everything goes fine for 2-3 hours, sometimes less, somethimes more and then something strange happens, in debug I see:

    Code:
    Currently fishing: True
    Currently fishing: True
    Currently fishing: True
    Currently fishing: True
    Currently fishing: True
    ordinary response from a function in main loop, play button in simba is on, but it's frozen, doesn't perform any procedure or function, rs goes to lobby and I have to restart my script. As I said above it happens randomly, never happened to me before with this script and started happening after nxt update.

    Any tips, solutions?

  2. #2
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Happen on any other scripts? Is the script perhaps entering an infinite loop?

  3. #3
    Join Date
    Mar 2016
    Posts
    192
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    Happen on any other scripts? Is the script perhaps entering an infinite loop?
    Well, I don't think so, you can take a look, it's a simply script so it won't take long (Priffi Waterfall Fisher by Scob 1.21 with temp client fix): https://villavu.com/forum/showthread.php?t=116008
    It has a random break function which is simply waiting, but it writes 'Random break activated' and starts again after a short break, in described case it doesn't start again and write any debug.

    I'm currently checking another script

  4. #4
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    He doesn't free any DTMs and loads them every time a proc or func is called
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  5. #5
    Join Date
    Mar 2016
    Posts
    192
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Oh, and now it makes sense, thank you @Harrier!


    EDIT: @Harrier unfortunately even after adding FreeDTM, problem still exists :/

  6. #6
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    Quote Originally Posted by scob View Post
    Oh, and now it makes sense, thank you @Harrier!


    EDIT: @Harrier unfortunately even after adding FreeDTM, problem still exists :/
    Show us the code. Are you loading them onstart and freeing them on end? It's the best way normally.
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  7. #7
    Join Date
    Mar 2016
    Posts
    192
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Quote Originally Posted by Harrier View Post
    Show us the code. Are you loading them onstart and freeing them on end? It's the best way normally.
    It's uploaded in my thread. Funny thing about it is that this problem wasn't happening even without freedtm procedure, I left this bot overnight many times and it was working just fine at the morning. Maybe I should reinstall simba?

  8. #8
    Join Date
    Dec 2011
    Posts
    77
    Mentioned
    5 Post(s)
    Quoted
    31 Post(s)

    Default

    Quote Originally Posted by scob View Post
    It's uploaded in my thread. Funny thing about it is that this problem wasn't happening even without freedtm procedure, I left this bot overnight many times and it was working just fine at the morning. Maybe I should reinstall simba?
    Same issue here using your script. Last couple of days it's been doing exactly what you describe, so it's not unique to you.

  9. #9
    Join Date
    Mar 2016
    Posts
    192
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Quote Originally Posted by Sulferx View Post
    Same issue here using your script. Last couple of days it's been doing exactly what you describe, so it's not unique to you.
    Did it start happening for you after last nxt update too? We have a new SRL update, I'm checking if it still happens

  10. #10
    Join Date
    Dec 2011
    Posts
    77
    Mentioned
    5 Post(s)
    Quoted
    31 Post(s)

    Default

    Quote Originally Posted by scob View Post
    Did it start happening for you after last nxt update too? We have a new SRL update, I'm checking if it still happens
    Yup, that's when it started.

  11. #11
    Join Date
    Mar 2016
    Posts
    192
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Problem still occurs, added alot more writeln(''); to spot when exactly it freezes. Any ideas?


    BTW I couldn't find what's the difference between
    Simba Code:
    procedure SomeThing();
    and
    Simba Code:
    procedure SomeThing;

    same thing with calling a particular procedure in mainloop, does () make any difference?

    Thanks

  12. #12
    Join Date
    Dec 2013
    Location
    Sweden
    Posts
    269
    Mentioned
    17 Post(s)
    Quoted
    161 Post(s)

    Default

    Quote Originally Posted by scob View Post
    Problem still occurs, added alot more writeln(''); to spot when exactly it freezes. Any ideas?


    BTW I couldn't find what's the difference between
    Simba Code:
    procedure SomeThing();
    and
    Simba Code:
    procedure SomeThing;

    same thing with calling a particular procedure in mainloop, does () make any difference?

    Thanks
    I was wondering that too, searched and found this: http://stackoverflow.com/questions/1...-dots-braces-f

    So as far as I get it, it's fine to omit the parnethesis as long as the method does not contain any params, I just do it because it looks good :P
    "Once you begin to think, you can't stop."

    Life > 0

  13. #13
    Join Date
    Dec 2013
    Location
    Pitcairn Island
    Posts
    288
    Mentioned
    20 Post(s)
    Quoted
    166 Post(s)

    Default

    Quote Originally Posted by kristi View Post
    it's fine to omit the parnethesis as long as the method does not contain any params
    Well that isn't exactly true, because type methods require parentheses even if they take no parameters, for example:

    Simba Code:
    program new;

    type
      TestType = record
        A: Integer;
      end;

    var
      T: TestType;
      I: Integer;

    function TestType.GetA(P: Boolean = True): Integer;
    begin
      case P of
        True: Result := Self.A;
        False: Result := -Self.A;
      end;
    end;

    function Integer.Double(): Integer;
    begin
      Result := Self * 2;
    end;

    begin
      T.A:= 10;
      I := T.GetA.Double(); // Uh oh, missing ()
      WriteLn(I);
    end;

  14. #14
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    If "isFishing" ever fails, it will repeatedly set "F := 0". The repeat loop within your main, continues again because it only breaks when "F = 10". Infinite loops in Simba will 100% freeze it. There isn't even a sleep anywhere in there. So if for whatever reason it fails to find that you are fishing, it will repeat infinitely without sleeping. Hence Simba locking up.


    Your if statements are also very costly. They in no way relate to each other so they should have an else if and not if-if-if-if. When one if is true, none of the others will ever execute anyway. So you are wasting time checking if the text is in the chatbox because it isn't since it can't have both at the same time.
    Last edited by Brandon; 04-23-2016 at 01:29 AM.
    I am Ggzz..
    Hackintosher

  15. #15
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by TSN View Post
    ...
    Actually a Lape bug and is fixed in newer versions

  16. #16
    Join Date
    Mar 2016
    Posts
    192
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    If "isFishing" ever fails, it will repeatedly set "F := 0". The repeat loop within your main, continues again because it only breaks when "F = 10". Infinite loops in Simba will 100% freeze it. There isn't even a sleep anywhere in there. So if for whatever reason it fails to find that you are fishing, it will repeat infinitely without sleeping. Hence Simba locking up.


    Your if statements are also very costly. They in no way relate to each other so they should have an else if and not if-if-if-if. When one if is true, none of the others will ever execute anyway. So you are wasting time checking if the text is in the chatbox because it isn't since it can't have both at the same time.
    Thank you @Brandon I've made a few tweaks following your suggestions and now it works great:



    What I've changed:

    This procedure is no more in mainloop:
    Simba Code:
    var
     L2, L3, L4, L5, L6, L7, L8, L9, L10: integer;

    procedure ChatBoxSearch;

     begin
     if chatBox.findText(['It is now level 2']) then
     begin
        if L2 = 0 then
          begin
            writeln('Rod level is 2 now');
            Lvl := 2;
            L2 := 1;
          end;
     end;
      if chatBox.findText(['It is now level 3']) then
     begin
          if L3 = 0 then
           begin
             writeln('Rod level is 3 now');
             Lvl := 3;
             L2 := 0;
             L10 := 0;
             L3 := 1;
           end;
     end;
      if chatBox.findText(['It is now level 4']) then
     begin
          if L4 = 0 then
           begin
            writeln('Rod level is 4 now');
            Lvl := 4;
            L3 := 0;
            L4 := 1;
           end;
     end;
      if chatBox.findText(['It is now level 5']) then
     begin
          if L5 = 0 then
           begin
            writeln('Rod level is 5 now');
            Lvl := 5;
            L4 := 0;
            L5 := 1;
           end;
     end;
      if chatBox.findText(['It is now level 6']) then
     begin
          if L6 = 0 then
           begin
            writeln('Rod level is 6 now');
            Lvl := 6;
            L5 := 0;
            L6 := 1;
           end;
     end;
      if chatBox.findText(['It is now level 7']) then
     begin
          if L7 = 0 then
           begin
            writeln('Rod level is 7 now');
            Lvl := 7;
            L6 := 0;
            L7 := 1;
           end;
     end;
     if chatBox.findText(['It is now level 8']) then
     begin
          if L8 = 0 then
           begin
            writeln('Rod level is 8 now');
            Lvl := 8;
            L7 := 0;
            L8 :=1;
           end;
     end;
     if chatBox.findText(['It is now level 9']) then
     begin
          if L7 = 0 then
           begin
            writeln('Rod level is 9 now');
            Lvl := 9;
            L8 := 0;
            L9 := 1;
           end;
     end;
    if chatBox.findText(['It is now level 10']) then
      begin
         if L10 = 0 then
           begin
             writeln('Rod level is 10 now! Dissasembling...');
             Lvl := 10;
             L10 := 1;
             L9 := 0;
             CheckRod;
          end;
       end;
    end;

    instead of this I put:

    Simba Code:
    function isLvlMsg(): boolean;
    begin
     if chatBox.findText(['It is now level']) then
     begin
        ChatBoxSearch;
     end;
    end;

    I don't know why I made it a function, it could be also a procedure, but I think it doesn't really matter.

    It is now several times faster and runs ChatboxSearch procedure only if it spots the lvlup msg.

    I'm going to make a failsafe based on time instead of F variable.

    Thanks again

  17. #17
    Join Date
    Dec 2013
    Location
    Pitcairn Island
    Posts
    288
    Mentioned
    20 Post(s)
    Quoted
    166 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    Actually a Lape bug and is fixed in newer versions
    Lol, it's actually quite a useful bug then, because you can easily spot functions versus variables

    T.A.Double()
    T.GetA().Double()

    I can imagine it won't be integrated into a simba release for a while though

  18. #18
    Join Date
    Mar 2016
    Posts
    192
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    @Brandon I restarted my bot and it still happens :/, I have completely no idea why. Script is now rearranged I've added separate mainloop; procedure and deleted failcount based on inc(F), now it's based on FailTimer, procedure checkChatBox; has now 'else' after every if, I've also added additional procedure to check for text in chatbox which activates more complex procedure which makes the bot much more efficient.

    After 40 mins everything stopped, play button was still on, game lobby opened, nothing in debug:

    Code:
    Currently fishing: True
    Currently fishing: True
    Currently fishing: True
    Currently fishing: True
    Currently fishing: True
    Currently fishing: True
    https://villavu.com/forum/showthread.php?t=116008
    Note that it started crashing after latest game update :c

  19. #19
    Join Date
    Mar 2016
    Posts
    192
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Sorry for double post but if I just edit my previous post nobodody will notice.

    The problem with freezing and stability was caused by Tesseract filter. After adding _Tesseract_Free(); at the end of procedure which uses tess and making checkrod; procedure more economic with using tesseract everything is working fine, no crashes, no freezes.

  20. #20
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by scob View Post
    Sorry for double post but if I just edit my previous post nobodody will notice.

    The problem with freezing and stability was caused by Tesseract filter. After adding _Tesseract_Free(); at the end of procedure which uses tess and making checkrod; procedure more economic with using tesseract everything is working fine, no crashes, no freezes.

    Show your changes. There might be a leak in the include then if you actually have to call _Tesseract_Free yourself. As noted by the underscores, it is a private/internal API. You should not have to call this in your script unless you are using the internal version of it in the first place.
    I am Ggzz..
    Hackintosher

  21. #21
    Join Date
    Mar 2016
    Posts
    192
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Show your changes. There might be a leak in the include then if you actually have to call _Tesseract_Free yourself. As noted by the underscores, it is a private/internal API. You should not have to call this in your script unless you are using the internal version of it in the first place.
    Take a look, tesseract is used and freed in procedure CheckRod();, after hours of testing it unfortunately happened again, even after reinstalling simba (with ccleaner, cleaning registry etc.) ;/ I announced the victory too early. Again
    Attached Files Attached Files

  22. #22
    Join Date
    Dec 2013
    Location
    Pitcairn Island
    Posts
    288
    Mentioned
    20 Post(s)
    Quoted
    166 Post(s)

    Default

    Quote Originally Posted by scob View Post
    Take a look, tesseract is used and freed in procedure CheckRod();, after hours of testing it unfortunately happened again, even after reinstalling simba (with ccleaner, cleaning registry etc.) ;/ I announced the victory too early. Again
    Done some edits, no idea if it works: http://hastebin.com/cufecoqije.pas

  23. #23
    Join Date
    Mar 2016
    Posts
    192
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Quote Originally Posted by TSN View Post
    Done some edits, no idea if it works: http://hastebin.com/cufecoqije.pas
    I'm testing it right now, thanks for help

  24. #24
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    I wrote a script doing exactly what Scob's does (but just lost my main account b/c of hijack so I stopped developing it). This tended to work though:

    Simba Code:
    //Returns true if the string s is in string str. Taken from https://villavu.com/forum/showthread.php?t=82205
    //Credit to Janilabo
    function StrContains(str, s: string): Boolean;
    begin
      if ((str <> '') and (s <> '')) then
        Result := (Pos(s, str) > 0)
      else
        Result := False;
    end;
    //Too lazy to write a proper functions, this'll have to do.
    function StrGetNum(str : string) : integer;
    begin
      if StrContains(str, '2') then exit(2);
      if StrContains(str, '3') then exit(3);
      if StrContains(str, '4') then exit(4);
      if StrContains(str, '5') then exit(5);
      if StrContains(str, '6') then exit(6);
      if StrContains(str, '7') then exit(7);
      if StrContains(str, '8') then exit(8);
      if StrContains(str, '9') then exit(9);
      if StrContains(str, '10') then exit(10);
      if StrContains(str, '1') then exit(1);
      exit(-1);
    end;    
    function getLevel() : integer;
    var
      x, y : integer;
    begin
      findDTM(equipDTM, x, y, tabBackpack.getBounds());
      mouse(point(x, y), MOUSE_LEFT);
      wait(gaussRangeInt(200, 300));
      mouse(point(randomRange(632, 640) , randomRange(430, 440)), MOUSE_MOVE, MOUSE_HUMAN);
      wait(gaussRangeInt(100, 200));
      exit(strGetNum(Tesseract_GetText(intToBox(582, 467, 770, 550), TESS_FILTER_SMALL_CHARS)));
    end;
    //Checks the level of the rod and updates the value of the rod level, happens every 1-5 minutes
    function checkLevel() : boolean;
    var
      level : integer;
    begin
      level := getLevel();
      if(level < rodLevel) then
      begin
        writeLn('Something probably messed up, looking for item level one more time');
        pickUpMouse();
        level := getLevel();
      end;
      rodLevel := level;
      paintProgress(true);
      exit(level = 10);
    end;

    It's definitely not efficient, but I didn't have trouble running this for over 4 hours

  25. #25
    Join Date
    Mar 2016
    Posts
    192
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Quote Originally Posted by yourule97 View Post
    I wrote a script doing exactly what Scob's does (but just lost my main account b/c of hijack so I stopped developing it). This tended to work though:

    Simba Code:
    //Returns true if the string s is in string str. Taken from https://villavu.com/forum/showthread.php?t=82205
    //Credit to Janilabo
    function StrContains(str, s: string): Boolean;
    begin
      if ((str <> '') and (s <> '')) then
        Result := (Pos(s, str) > 0)
      else
        Result := False;
    end;
    //Too lazy to write a proper functions, this'll have to do.
    function StrGetNum(str : string) : integer;
    begin
      if StrContains(str, '2') then exit(2);
      if StrContains(str, '3') then exit(3);
      if StrContains(str, '4') then exit(4);
      if StrContains(str, '5') then exit(5);
      if StrContains(str, '6') then exit(6);
      if StrContains(str, '7') then exit(7);
      if StrContains(str, '8') then exit(8);
      if StrContains(str, '9') then exit(9);
      if StrContains(str, '10') then exit(10);
      if StrContains(str, '1') then exit(1);
      exit(-1);
    end;    
    function getLevel() : integer;
    var
      x, y : integer;
    begin
      findDTM(equipDTM, x, y, tabBackpack.getBounds());
      mouse(point(x, y), MOUSE_LEFT);
      wait(gaussRangeInt(200, 300));
      mouse(point(randomRange(632, 640) , randomRange(430, 440)), MOUSE_MOVE, MOUSE_HUMAN);
      wait(gaussRangeInt(100, 200));
      exit(strGetNum(Tesseract_GetText(intToBox(582, 467, 770, 550), TESS_FILTER_SMALL_CHARS)));
    end;
    //Checks the level of the rod and updates the value of the rod level, happens every 1-5 minutes
    function checkLevel() : boolean;
    var
      level : integer;
    begin
      level := getLevel();
      if(level < rodLevel) then
      begin
        writeLn('Something probably messed up, looking for item level one more time');
        pickUpMouse();
        level := getLevel();
      end;
      rodLevel := level;
      paintProgress(true);
      exit(level = 10);
    end;

    It's definitely not efficient, but I didn't have trouble running this for over 4 hours
    I created this thread because mine was working for 70hrs straight before nxt update and after the update it freezes, I get errors like: "Simba has stopped working", it never happened before and I don't think it's a problem with my script but with simba. No matter what I change in this script I get this problems sooner or later, and funny thing is that it works well for other ppl, it's a little bit frustrating

Page 1 of 2 12 LastLast

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
  •