Results 1 to 12 of 12

Thread: Little questions

  1. #1
    Join Date
    Oct 2012
    Location
    Porto, Portugal
    Posts
    218
    Mentioned
    0 Post(s)
    Quoted
    42 Post(s)

    Question Little questions

    1. What is the predefined MouseSpeed?

    2. how the function AddOnTerminate works?

    Thanks

  2. #2
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    1. I have no clue, totally forgot.

    2. Whenever the script terminates, it will call that method. Use it like so:
    Simba Code:
    procedure printMe;
    begin
      WriteLn('Printed!');
    end;

    ...

    AddOnTerminate('printMe');
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  3. #3
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    When he says terminated, he means in any manner. Naturally, script exception, force shutdown (stop button at least). I also don't know the mouse speed...

  4. #4
    Join Date
    Oct 2012
    Location
    Porto, Portugal
    Posts
    218
    Mentioned
    0 Post(s)
    Quoted
    42 Post(s)

    Default

    That only works when the script is terminated properly right? When an error occurs that function is not called?

    Where should I place the addonterminate in the script?

  5. #5
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    18 is default iirc.

  6. #6
    Join Date
    Oct 2012
    Location
    Porto, Portugal
    Posts
    218
    Mentioned
    0 Post(s)
    Quoted
    42 Post(s)

    Default

    I found at srl.simba I guess it is 15

  7. #7
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    Place the AddOnTerminate as early on in your program as you can that is also helpful. It only needs to be called once (for each method you want it to act on) per run.

    IE: typical use is to have a method that frees all DTMs and call the AddOnTerminate on that. But no sense in having it possibly run before the DTMs are created so something along these lines:

    Simba Code:
    procedure DeclareDTMs;
    begin
      DTMa:= DtmFromString('fhdwuiafghiaoh');
      DTMb:= DtmFromString('fhdwwfafwauiafghiaoh');
      DTMc:= DtmFromString('fhdwuiafghiagawgwagasoh');
    end;

    procedure FreeMyDTMs;
    begin
      Free(DTMa);
      Free(DTMb);
      Free(DTMc);
    end;

    begin
      SetupSRL;
      DeclareDTMs;
      AddOnTerminate('FreeMyDTMs');//Notice the name of the method is in quotation marks.
      repeat
        dostuff;
      until(ReasonToEnd);
    end.

  8. #8
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    If the script errors out, then the AddOnTerminate method will not be called. Only if the script completes, or is manually turned off, with that be called.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  9. #9
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    If the script errors out, then the AddOnTerminate method will not be called. Only if the script completes, or is manually turned off, with that be called.
    If I call TerminateScript that would count as completing right?

  10. #10
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    Quote Originally Posted by Sin View Post
    18 is default iirc.
    Quote Originally Posted by Nirvana View Post
    I found at srl.simba I guess it is 15
    Yeah I think it's 15.

  11. #11
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    If I call TerminateScript that would count as completing right?
    Yes.

  12. #12
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    Yes.
    Thanks. Also there are a lot of inactive people returning.

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
  •