Results 1 to 20 of 20

Thread: Sleep (LogOutEvery)

  1. #1
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default Sleep (LogOutEvery)

    I saw in the SRL manual LogOutEvery(hours, forxmins: Integer); it seems really nice and easy just set two intgers one for hours, one for minutes, and there ya go, a sleep procedure. I test it out an it doesn't work. I open up my SRL/SRL/Core/Login.scar and find it's not in there anymore. I wish it still was, well does anyone know a procedure for it, like if it was updated, and called something else now. I haven't found one yet, I think I'm going to have to make my own sleeping procedure, I hope I dont though. Well if anyone knows if there's a new procedure or not please let me know, and if there is a new one, what is it? Thanks to anyone who helps.


    P.S. They should really think about putting that back in, it looks soooo simple.

  2. #2
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    {*******************************************************************************
    procedure LogOutEvery(hours, forxmins: Integer);
    By: Stupid3ooo
    Description: Logs you out every hours for forxmins
    *******************************************************************************}


    procedure LogOutEvery(hours, forxmins: Integer);
    var
      Mark: Integer;
    begin
      if ((TimeFromMark(LogOutMark) / 1000) / 3600 >= hours) then
      begin
        MarkTime(LogOutMark);
        MMouse(Random(500), -10, 0, 0)
          Logout;
        WriteLn('Logging out and coming back in about ' + IntToStr(forxmins) +
          ' min(s)');
        MarkTime(Mark);
        repeat
          MMouse(0, 0, 100, 100)
            Wait(90000 + Random(1000));
          Wait(15 + Random(15) + Random(15))
        until (TimeFromMark(Mark) >= forxmins);
        Wait(Random(30000) + Random(30000));
        LoginPlayer;
        Wait(Random(15000) + Random(15000));
      end;
    end;
    No idea if it still works, didnt even test to see if it compiles(which it probably doesnt) but i dug it out of the Login.scar from like SRL version 3.something...
    Post if you cant get it to work.

  3. #3
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by itschris917 View Post
    SCAR Code:
    {*******************************************************************************
    procedure LogOutEvery(hours, forxmins: Integer);
    By: Stupid3ooo
    Description: Logs you out every hours for forxmins
    *******************************************************************************}


    procedure LogOutEvery(hours, forxmins: Integer);
    var
      Mark: Integer;
    begin
      if ((TimeFromMark(LogOutMark) / 1000) / 3600 >= hours) then
      begin
        MarkTime(LogOutMark);
        MMouse(Random(500), -10, 0, 0)
          Logout;
        WriteLn('Logging out and coming back in about ' + IntToStr(forxmins) +
          ' min(s)');
        MarkTime(Mark);
        repeat
          MMouse(0, 0, 100, 100)
            Wait(90000 + Random(1000));
          Wait(15 + Random(15) + Random(15))
        until (TimeFromMark(Mark) >= forxmins);
        Wait(Random(30000) + Random(30000));
        LoginPlayer;
        Wait(Random(15000) + Random(15000));
      end;
    end;
    No idea if it still works, didnt even test to see if it compiles(which it probably doesnt) but i dug it out of the Login.scar from like SRL version 3.something...
    Post if you cant get it to work.
    If you read what I wrote you would've saw that it doesn't work anymore,(didn't mean for that to come off in a rude tone) I wish it did, but thanks for the function. Maybe the function's codes will still work then making the procedure work. I'll try, but I know the procedure alone does not work.

    EDIT: aww doesn't work, logoutmark is an unknown identifier.... you think if I made it an integer it would work? I'm about to try, see if there's any other errors in it, if making it an integer takes away the current error.

    EDIT2: Siiiiiick, I tried making it an integer and the script compiles, now I just gotta test it, to make sure it'll still make me sleep, then get permission from Stupid3ooo to use it, just to make sure Stupid doesn't mind, I don't think he would but still.

    can't get permission from him to use it, his public progile says last activity was on 7/5/06, almost 2 years ago.

  4. #4
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Whoops... sorry. Lol. Ok so what doesnt work about it? It compiles but doesnt work properly or it doesnt compile at all?

  5. #5
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    It didn't compile because LogOutMark wasn't set as an integer, I set it as one and now it compiles, now I'm going to test it to make sure it works (will make me sleep)

    EDIT: I have it as the first thing I call, it instantly logs me out, then logs me in when my integer for minutes is up, in this case one, but doesn't make me sleep again. I set hours to 1 / 60 so it'd sleep every minute, but it doesn't work, should I pur a repeat in somewhere, so it marks the time again? or do you think that;ll just make it instantly log out?

  6. #6
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ya know.. Im not sure exactly.. Let me play around with it a bit..

  7. #7
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    ok, thanks, if you can figure this out, it'd be a lot of help, sleeping is the only thing I left I want in my script for now, and I never messed around with MarkTime and TimeFromMark (or w/e the second is) so it's kinda hard for me to make my own sleeping procedure, it'd be much easier to just use this.

  8. #8
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Try this out:
    SCAR Code:
    procedure SleepEvery(mins, forxmins: integer);
    var
      Mark: Integer;
    begin
      if ((TimeFromMark(LogOutMark) / 1000) / 60 >= mins) then
      begin
        LogOut;
        WriteLn('Logging out and coming back in about ' + IntToStr(forxmins) +' min(s)');
        MarkTime(Mark);
        repeat
            Wait(1000 + Random(1000));
          Wait(15 + Random(15) + Random(15))
        until (TimeFromMark(Mark) / 60000 >= forxmins);
        LoginPlayer;
        MarkTime(LogOutMark);
      end;
    end;
    It works for me.. I changed it to every "Mins" instead of hours..

  9. #9
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    I don't know how that could've worked for you, you forgot to indentify LogOutMark as an integer, and it still logs me out right away, I don't know what's wrong with it. Maybe that's what they took it out??

  10. #10
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oh.. lol, i had LogOutMark declared as a global integer. hang on. let me post the whole script..

    EDIT:

    SCAR Code:
    program New;
    {.include SRL\SRL.scar}

    const
      StartPlayer      =0;

    var
      LogOutMark : Integer;

    procedure DeclarePlayers;
    begin
         RCMaster       := 'azy';        //<- fill in the Nickname of the RC master.
         RCLoc          := 'Chickens';
         SRLID          := '1062';
         SRLPassword    := '527614';
         HowManyPlayers := 1;
         CurrentPlayer  := StartPlayer;
         NumberOfPlayers(HowManyPlayers); // set arraylength

         Players[0].Name :='lazydude67';
         Players[0].Pass :='';
         Players[0].Nick :='azy';
         Players[0].integers[1] :=0;  //See Notes: 0,1,2,3,4
         Players[0].Skill:='Strength';  //Strength, Attack, Range, Random, Defense, or Pure
         Players[0].Active:=True;



    end;

     

    procedure SleepEvery(mins, forxmins: integer);
    var
      Mark: Integer;
    begin
      if ((TimeFromMark(LogOutMark) / 1000) / 60 >= mins) then
      begin
        LogOut;
        WriteLn('Logging out and coming back in about ' + IntToStr(forxmins) +' min(s)');
        MarkTime(Mark);
        repeat
            Wait(1000 + Random(1000));
          Wait(15 + Random(15) + Random(15))
        until (TimeFromMark(Mark) / 60000 >= forxmins);
        LoginPlayer;
        MarkTime(LogOutMark);
      end;
    end;

    begin
    SetupSRL;
    DeclarePlayers;
    MarkTime(LogOutMark);
    repeat
      SleepEvery(1, 1);
    until(False);
    end.

  11. #11
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    hmm, I don't know I tried putting it as logoutevery(5,1) instead of logoutevery(mins, forxmins) because I had them as const but it still logged me out right away, it doesn't log you out right away?

  12. #12
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nope. What you NEED TO MAKE SURE YOU DO IS: right after LoginPlayer is in your script, put MarkTime(LogOutMark) like in my example script. It is crucial.

  13. #13
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    do you mean declare players? in the main loop?

  14. #14
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I mean right after you have "LoginPlayer" wherever that may be..

  15. #15
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    your script doesn't even log your character in...??.... your starting to make me wonder if it even works for you either... I'm not 100% sure your telling the whole truth anymore about this procedure

  16. #16
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No it doesnt log me in at the beginning cause i start logged in. Just copy and paste the entire script that i posted, start logged in and run it. You will see that it stands around for a minute and then it logs out and waits for a minute and then logs back in etc etc.

    EDIT: Shit.. i did mean declareplayers. I said at LoginPlayer cause that's where that variable was assigned at in one of the old SRL versions...

  17. #17
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    mine just logs me in (I have it log me in) then this procedure logs me out, ais a min logs me in then does nothing. But I'll try yours.

  18. #18
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah, just try mine for right now and we'll see if that works for you and if it does, PM/post your script and i'll help you put that Sleep function in..

  19. #19
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    it did log me out after a minute then attempt to log me back in, with the SMART window though, it couldnt type, the windwo wasn't selected the top blu ebar that runs across was faint, not as dark as when the window is open , and after loginplayers; or delcareplayers;, all I have to do is MarkTime(LogOutMark)?

  20. #20
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, after DeclarePlayers.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sleep Every..?
    By D1zl3 in forum OSR Help
    Replies: 15
    Last Post: 12-17-2008, 05:56 PM
  2. Sleep
    By sirlaughsalot in forum OSR Help
    Replies: 6
    Last Post: 05-24-2008, 08:41 PM
  3. Procedure for sleep?
    By Richard in forum OSR Help
    Replies: 4
    Last Post: 02-11-2008, 06:00 PM

Posting Permissions

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