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

Thread: Help Plz!!

  1. #1
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help Plz!!

    whats wrong here.....i want it to sit idle when i am using the mouse. for some reason its fine at first but then after the script starts it moves the mouse every so often even if i am using the mouse. does this make sense?
    SCAR Code:
    {.include SRL\SRL.scar}

    const
      Secs = 55;  //Seconds until the mouse is moved.
      SecUM = 50;  //Seconds in which the Mouse is inactive?

    var
      b, c: Boolean;
      x, y, MIT: Integer;

    begin
      SetupSRL;
      MarkTime(MIT);
      repeat
        GetMousePos(x, y);
        if(not(((x>x) or (x<x)) or ((y>y) or (y<y)))) then
          if(GetTimeRunning-(SecUM*1000)>GetTimeRunning-TimeFromMark(MIT)) then
            repeat
              Wait(Secs*1000+Random((Secs*1000)/2));
              MMouse(MSX1, MSY1, MSX2+1, MSY2+1);
              if(IsFKeyDown(2)) then
                b:=True;
            Until(b);
      Until(b);
    end.

  2. #2
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    The problem is that "if(not(((x>x) or (x<x)) or ((y>y) or (y<y)))) then" will never return false, because "((x>x) or (x<x))" will always return false as will "((y>y) or (y<y))" and the "not" turns them into true since x will only be equal to x and y will only be equal to y. I think what you wanted here was to store 2 different co-ordinates and compare them.
    SCAR Code:
    GetMousePos(x1, y1);
        Wait(50);
        GetMousePos(x2, y2);
        if((x1=x2) and (y1=y2)) then
    That should work fine and has a much simpler logic to follow for the "if" - just remove the variables x and y and add in x1,x2,y1,y2 and it should work.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  3. #3
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    now i get unknown identifier x1

  4. #4
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    add x1,x2,y1,y2 to your integer variables so it becomes:
    SCAR Code:
    var
      b, c: Boolean;
      x1, x2 ,y1 ,y2, MIT: Integer;
    I did say that at the bottom of my last post though...
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  5. #5
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    did not see that at the bottom of your post...thank you going to try it

  6. #6
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    the script is still taking over even when i am using the mouse. but it looks more stable now. maybe i need to explain a little better what i am trying to do. i want it to keep me logged in so the script should sit idle when i am using the mouse.
    after 50 seconds of mouse inactivity the script starts then when i move the mouse the script waits again ect. ect.

  7. #7
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by roboroofer1 View Post
    whats wrong here.....i want it to sit idle when i am using the mouse. for some reason its fine at first but then after the script starts it moves the mouse every so often even if i am using the mouse. does this make sense?
    SCAR Code:
    {.include SRL\SRL.scar}

    const
      Secs = 55;  //Seconds until the mouse is moved.
      SecUM = 50;  //Seconds in which the Mouse is inactive?

    var
      b: Boolean;
      x, y, MIT: Integer;

    begin
      SetupSRL;
      MarkTime(MIT);
      repeat
        GetMousePos(x, y);
        if(not(((x>x) or (x<x)) or ((y>y) or (y<y)))) then
          if(GetTimeRunning-(SecUM*1000)>GetTimeRunning-TimeFromMark(MIT)) then
            repeat
              Wait(Secs*1000+Random((Secs*1000)/2));
              MMouse(MSX1, MSY1, MSX2+1, MSY2+1);
              if(IsFKeyDown(2)) then
                b:=True;
            Until(b);
      Until(b);
    end.

    Cleaned up code:

    SCAR Code:
    {.include SRL\SRL.scar}

    const
      Secs = 55;  //Seconds until the mouse is moved.
      SecUM = 50;  //Seconds in which the Mouse is inactive?

    var
      b, c: Boolean;
      x1, y1, x2, y2, MIT: Integer;

    begin
      SetupSRL;
      MarkTime(MIT);
      repeat
        GetMousePos(x1, y1);
        Wait(100);
        GetMousePos(x2, y2);
        if((x1=x2) and (y1=y2))then
          if(TimeFromMark(MIT)>(SecUM*1000)) then
            repeat
              Wait((Secs*1000)+Random(Secs*500); //basic math, *1000/2 is the same as *500 :)
              MouseBox(MSx1, MSy1, MSx2, MSy2, 2);
              Wait(100+random(200));
              MouseBox(MSx1, MSy1, MSx2, MSy2, 3);
              MarkTime(MIT); // <- You need to remark the time, otherwise, your time will keep running and it defeats the purpose, so it will ALWAYS return true at that last if statement.
              if(IsFKeyDown(2)) then
                b:=True;
            Until(b);
      Until(b);
    end.


    ^ Read the comments.

    Hope that fixes your problems, and you can see your problems. Its all logic my dear Watson, Logic.

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  8. #8
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    so sorry to be a scripting noob but i don't get this part.

    MarkTime(MIT); // <- You need to remark the time, otherwise, your time will keep running and it defeats the purpose, so it will ALWAYS return true at that last if statement.

  9. #9
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Okay, well if you don't do that, then you are just going to keep the same mark. Hence, when the script repeats, it will think that the time is up already. Remember, it can only think as much as you tell it to.

    Understand?

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  10. #10
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yes i understand that part ..i guess what i am unsure of is where to fill it in or how.

    guess i need to learn more... and get more aspirin

  11. #11
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    You fill it in the same way do you understand the functions I used? Also why?

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  12. #12
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    aspirin for my frustration but yes i do understand what MarkTime(MIT); does just dont understand how it works. can you give me example how to fill that part out?

  13. #13
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    when i fill that part out i get identifier expected.

    maybe this is not my cup of tea

  14. #14
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    for which line? Because, I don't see any begins/ends missing.

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  15. #15
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    the marktime part so it will stay idle when i'm using the mouse

    MarkTime(MIT); // <- You need to remark the time, otherwise, your time will keep running and it defeats the purpose, so it will ALWAYS return true at that last if statement.

  16. #16
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    {.include SRL\SRL.scar}

    const
      Secs = 55;  //Seconds until the mouse is moved.
      SecUM = 50;  //Seconds in which the Mouse is inactive?

    var
      b, c: Boolean;
      x1, y1, x2, y2, MIT: Integer;

    begin
      SetupSRL;
      MarkTime(MIT);
      repeat
        GetMousePos(x1, y1);
        Wait(100);
        GetMousePos(x2, y2);
        if((x1=x2) and (y1=y2))then
          if(TimeFromMark(MIT)>(SecUM*1000)) then
            repeat
              Wait((Secs*1000)+Random(Secs*500); //basic math, *1000/2 is the same as *500 :)
              MouseBox(MSx1, MSy1, MSx2, MSy2, 2);
              Wait(100+random(200));
              MouseBox(MSx1, MSy1, MSx2, MSy2, 3);
              MarkTime(MIT); // <- You need to remark the time, otherwise, your time will keep running and it defeats the purpose, so it will ALWAYS return true at that last if statement.
              if(IsFKeyDown(2)) then
                b:=True;
            Until(b);
        else
          MarkTime(MIT);// <- If the mouse is being moved, it will remark the time.
      Until(b);
    end.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  17. #17
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    line 29 error identifier expected? did you set it up so i don't have to fill that part out?

  18. #18
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  19. #19
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i did that all ready. that's when the line 29 error identifier expected started happening.

    it was a comma error till i added it ..now its error identifier expected

  20. #20
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    {.include SRL\SRL.scar}

    const
      Secs = 55;  //Seconds until the mouse is moved.
      SecUM = 50;  //Seconds in which the Mouse is inactive?

    var
      b: Boolean;
      x1, y1, x2, y2, MIT: Integer;

    begin
      SetupSRL;
      ActivateClient;
      MarkTime(MIT);
      repeat
        GetMousePos(x1, y1);
        Wait(100);
        GetMousePos(x2, y2);
        if((x1=x2) and (y1=y2))then
        begin
          if(TimeFromMark(MIT)>(SecUM*1000)) then
            repeat
              Wait((Secs*1000)+Random(Secs*500)); //basic math, *1000/2 is the same as *500 :)
              MouseBox(MSx1, MSy1, MSx2, MSy2, 2);
              Wait(100+random(200));
              MouseBox(MSx1, MSy1, MSx2, MSy2, 3);
              MarkTime(MIT); // <- You need to remark the time, otherwise, your time will keep running and it defeats the purpose, so it will ALWAYS return true at that last if statement.
              if(IsFKeyDown(2)) then
                b:=True;
            Until(b);
        end else
          MarkTime(MIT);// <- If the mouse is being moved, it will remark the time.
      Until(b);
    end.

    Now compiles.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  21. #21
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    still getting line 29 error identifier expected. it has nothing to do with the comma i fixed that before i posted about the identifier expected error on line 29

  22. #22
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    am i at a dead end now? i can not figure out what it needs at the end.

  23. #23
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    I messed up on the if then else statement. Scar wants a begin end else instead. Simple

    Nava2
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  24. #24
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    {.include SRL\SRL.scar}

    const
    Secs = 5; //Seconds until the mouse is moved.
    SecUM = 5; //Seconds in which the Mouse is inactive?

    var
    b, c: Boolean;
    x1, y1, x2, y2, MIT: Integer;

    begin
    SetupSRL;
    MarkTime(MIT);
    repeat
    GetMousePos(x1, y1);
    Wait(100);
    GetMousePos(x2, y2);
    if((x1=x2) and (y1=y2))then
    if(TimeFromMark(MIT)>(SecUM*1000)) then
    repeat
    Wait((Secs*1000)+Random(Secs*500)); //basic math, *1000/2 is the same as *500
    MouseBox(MSx1, MSy1, MSx2, MSy2, 2);
    Wait(100+random(200));
    MouseBox(MSx1, MSy1, MSx2, MSy2, 3);
    MarkTime(MIT); // <- You need to remark the time, otherwise, your time will keep running and it defeats the purpose, so it will ALWAYS return true at that last if statement.
    if(IsFKeyDown(2)) then
    b:=True;
    Until(b);
    MarkTime(MIT);// <- If the mouse is being moved, it will remark the time.
    Until(b);
    end.
    this look right? cause i got it to run but now it just sits there with no mouse movements

  25. #25
    Join Date
    Apr 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    guess i hit a dead end cause i cant figure out whats wrong

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
  •