Results 1 to 12 of 12

Thread: A universal fail safe/antiban

  1. #1
    Join Date
    Mar 2015
    Location
    Netherlands
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default A universal fail safe/antiban

    So if someone could make a code wich does the following: If you have not gained any xp in the last 5 minutes or so, it wil log you out to prevent you from getting banned if you are stuck.

    Idk if this is possible but you should be able to add this code to an existent script by yourself.

    I really think this is a great idea

  2. #2
    Join Date
    Aug 2012
    Location
    The Dark Tower
    Posts
    154
    Mentioned
    5 Post(s)
    Quoted
    56 Post(s)

    Default

    Quote Originally Posted by hectortje3 View Post
    So if someone could make a code wich does the following: If you have not gained any xp in the last 5 minutes or so, it wil log you out to prevent you from getting banned if you are stuck.

    Idk if this is possible but you should be able to add this code to an existent script by yourself.

    I really think this is a great idea
    Make sure when using While-do or Repeat-Until loops that you have something that always checks to see if the player has done something, or is doing something, that would cause it to become stuck. Timers, If statements, and conditionals should be sufficient failsafes to prevent your script(s) from leaving you high and dry.

  3. #3
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by hectortje3 View Post
    So if someone could make a code wich does the following: If you have not gained any xp in the last 5 minutes or so, it wil log you out to prevent you from getting banned if you are stuck.

    Idk if this is possible but you should be able to add this code to an existent script by yourself.

    I really think this is a great idea
    Most of the scripts I write have this. It is very simple to do. Basically you declare a timer globally, and each time your script performs an action (in this case mine a rock) you reset the timer back to 0. You check the timer each time it loops:

    Simba Code:
    1. program new;
    2. {$DEFINE SMART}
    3. {$i srl-6/srl.simba}
    4.  
    5.  
    6. var
    7.   failTimer: TTimeMarker; // Declare a timer globally
    8.  
    9. procedure mineRock();
    10. begin
    11.   // code to mine a rock ...
    12.  
    13.   if tabBackpack.waitForShift(5000) then
    14.   begin          // When we mine a rock, start the timer from 0 again
    15.     writeLn('We just mined a rock');
    16.     failTimer.start();
    17.   end;
    18.  
    19. end;
    20.  
    21. procedure mainLoop();
    22. begin
    23.   // All your mainLoop stuff
    24.  
    25.   if (failTimer.getTime() > 300000) then  // Each loop it will check the timer
    26.   begin
    27.     writeLn('Nothing happened in 5 minutes');
    28.     terminateScript();
    29.   end;
    30.  
    31. end;
    32.  
    33. begin
    34.   setupSRL();
    35.   failTimer.start(); // Start the timer when the script starts
    36.  
    37.   repeat
    38.     mainLoop();
    39.   until false;
    40. end.

  4. #4
    Join Date
    Mar 2015
    Posts
    189
    Mentioned
    3 Post(s)
    Quoted
    73 Post(s)

    Default

    I would suggest using a timer like the mayor showed because some scripts don't gain exp, therefor your script might be thinking it got stuck.

  5. #5
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    Most of the scripts I write have this. It is very simple to do. Basically you declare a timer globally, and each time your script performs an action (in this case mine a rock) you reset the timer back to 0. You check the timer each time it loops:

    Simba Code:
    1. program new;
    2. {$DEFINE SMART}
    3. {$i srl-6/srl.simba}
    4.  
    5.  
    6. var
    7.   failTimer: TTimeMarker; // Declare a timer globally
    8.  
    9. procedure mineRock();
    10. begin
    11.   // code to mine a rock ...
    12.  
    13.   if tabBackpack.waitForShift(5000) then
    14.   begin          // When we mine a rock, start the timer from 0 again
    15.     writeLn('We just mined a rock');
    16.     failTimer.start();
    17.   end;
    18.  
    19. end;
    20.  
    21. procedure mainLoop();
    22. begin
    23.   // All your mainLoop stuff
    24.  
    25.   if (failTimer.getTime() > 300000) then  // Each loop it will check the timer
    26.   begin
    27.     writeLn('Nothing happened in 5 minutes');
    28.     terminateScript();
    29.   end;
    30.  
    31. end;
    32.  
    33. begin
    34.   setupSRL();
    35.   failTimer.start(); // Start the timer when the script starts
    36.  
    37.   repeat
    38.     mainLoop();
    39.   until false;
    40. end.
    Forgive my noobie question. Can you use SRL-6 in OldSchool Runescape?

    Have been seeing a lot of functions in SRL6 that would be awesome but haven't had any luck executing them lol.

  6. #6
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    Quote Originally Posted by Dan the man View Post
    Forgive my noobie question. Can you use SRL-6 in OldSchool Runescape?

    Have been seeing a lot of functions in SRL6 that would be awesome but haven't had any luck executing them lol.
    We're all noobs at some point, don't worry.

    No, you can't use SRL-6 functions in 07. The reason for this is that the functions are designed to work with the official interface settings for SRL-6 and RS3. Since the SRL-6 include is a colour include, we use the colours of pixels to find and interact with interfaces. For example, bankScreen.open(BANK_CHEST_LUMBRIDGE) clicks on the colours found on the Lumbridge training area bank chest next to the furnace. Even if that chest were available in 07, unless they were almost the same, Simba wouldn't be able to find the chest because the correct type and number of coloured pixels wouldn't be visible on the screen.

    I hope that makes sense.



    New to scripting? Procedures & Functions for Beginners
    Do you use your computer at night? Just get f.lux

  7. #7
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Like Inc said SRL-6 is only compatible with RS3.

    The big goal for SRL in my eyes is the release of the hybrid include. This will let scriptwriters use the same code syntax for both versions of the game. You may have noticed that that nobody has released and maintained a script for OSR and RS3 at the same time, which is really disappointing, but it 100% understandable. All of these different includes have different names for the same thing (bankScreen.open() vs. openBank), which is like learning a whole different language.

    The sad thing is that this could have been achieved more than a year ago if people had communicated with other people before releasing personalised includes. But anyway, we may see it in the future.

  8. #8
    Join Date
    Mar 2013
    Location
    Earth some place
    Posts
    108
    Mentioned
    2 Post(s)
    Quoted
    66 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    Like Inc said SRL-6 is only compatible with RS3.

    The big goal for SRL in my eyes is the release of the hybrid include. This will let scriptwriters use the same code syntax for both versions of the game. You may have noticed that that nobody has released and maintained a script for OSR and RS3 at the same time, which is really disappointing, but it 100% understandable. All of these different includes have different names for the same thing (bankScreen.open() vs. openBank), which is like learning a whole different language.

    The sad thing is that this could have been achieved more than a year ago if people had communicated with other people before releasing personalised includes. But anyway, we may see it in the future.

    Was wondering why that was, but figured it was because of what you mentioned. Will there be any collabs in the future to make a hybrid include? Would be awesome

  9. #9
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by captainblast View Post
    Was wondering why that was, but figured it was because of what you mentioned. Will there be any collabs in the future to make a hybrid include? Would be awesome
    Yes, a few devs have started putting one together, although progress is slow.

  10. #10
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Quote Originally Posted by Incurable View Post
    We're all noobs at some point, don't worry.

    No, you can't use SRL-6 functions in 07. The reason for this is that the functions are designed to work with the official interface settings for SRL-6 and RS3. Since the SRL-6 include is a colour include, we use the colours of pixels to find and interact with interfaces. For example, bankScreen.open(BANK_CHEST_LUMBRIDGE) clicks on the colours found on the Lumbridge training area bank chest next to the furnace. Even if that chest were available in 07, unless they were almost the same, Simba wouldn't be able to find the chest because the correct type and number of coloured pixels wouldn't be visible on the screen.

    I hope that makes sense.
    Thanks for the info!

    Yeah it would be nice if the includes were hybrid.

  11. #11
    Join Date
    Aug 2014
    Location
    Australia
    Posts
    932
    Mentioned
    53 Post(s)
    Quoted
    495 Post(s)

    Default

    Quote Originally Posted by Dan the man View Post
    Thanks for the info!

    Yeah it would be nice if the includes were hybrid.
    Actually, @slacky and @Olly are slowly working on something like that, so we will have a hybrid include in the future.



    New to scripting? Procedures & Functions for Beginners
    Do you use your computer at night? Just get f.lux

  12. #12
    Join Date
    May 2012
    Posts
    108
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Thanks for the idea Mayor, have needed this in scripts.

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
  •