Results 1 to 10 of 10

Thread: Snippet for ToggleRunning

  1. #1
    Join Date
    Dec 2015
    Location
    where do you live!
    Posts
    30
    Mentioned
    2 Post(s)
    Quoted
    13 Post(s)

    Default Snippet for ToggleRunning

    Could be easy to integrate into TReflectLocalPlayer, no?

    Code:
    function TReflectLocalPlayer.toggleRunning(Enable: Boolean): Boolean;
    begin
      Result := False;
      if not Self.isLoggedin then
        Exit;
    
      if Enable then
      begin
        if Self.isRunOn then
          exit(true)
        else
        begin
          Mouse.Move(545,130,590,150, MOUSE_LEFT);
          exit(true);
        end;
      end else if not Enable then
        if Self.isRunOn then
        begin
          Mouse.Move(545,130,590,150, MOUSE_LEFT);
          Result := True;
        end;
    end;

    Does this work?
    Last edited by Keelijh; 01-09-2016 at 07:10 AM.

  2. #2
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default ??

    Code:
    procedure 
    TReflectLocalPlayer.SetRun(Toggle: Boolean);
    begin
      if (Toggle) and (Self.IsRunOn) then
        Exit;
      if (not Toggle) and (not Self.IsRunOn) then
        Exit;
      Mouse.Move(IntToBox(545, 130, 590, 150));
      Wait(250);
      Mouse.Click(Mouse_Left);
    end;
    OR

    Code:
     
    LocPlayer.SetRun(True);
    Sorry; my mistake the previous code was the aerolib include

    <------------------>



  3. #3
    Join Date
    Dec 2015
    Location
    where do you live!
    Posts
    30
    Mentioned
    2 Post(s)
    Quoted
    13 Post(s)

    Default

    Quote Originally Posted by AFools View Post
    Code:
       if not isUsingRun then begin
       toggleRunning(true); end;
    OR

    Code:
     
       if(getRunEnergy >= (40)) and not isUsingRun then begin
       toggleRunning(true); end;
    what is wrong with the current function? It is good that you are making your own functions though. =D

    I wasn't aware of this function. Where is this located?

  4. #4
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    @Keelijh; read what i corrected. It is very similar. I pinched this straight out of @Kyle; fight script

    <------------------>



  5. #5
    Join Date
    Dec 2007
    Posts
    289
    Mentioned
    4 Post(s)
    Quoted
    86 Post(s)

    Default

    Quote Originally Posted by AFools View Post
    Code:
       if not isUsingRun then begin
       toggleRunning(true); end;
    OR

    Code:
     
       if(getRunEnergy >= (40)) and not isUsingRun then begin
       toggleRunning(true); end;
    what is wrong with the current function? It is good that you are making your own functions though. =D
    You are getting confused between the Reflection include and AeroLib.

    Quote Originally Posted by Keelijh View Post
    I wasn't aware of this function. Where is this located?
    It is located in AeroLib, not the Reflection include. AFools was mistaken

    -----

    Good suggestion. I know Kyle is keen to remove the dependencies between the two includes.

  6. #6
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    Quote Originally Posted by honeyhoney View Post
    .......
    I had already corrected it.. but decided to correct the initial post rather make another post....

    <------------------>



  7. #7
    Join Date
    Dec 2007
    Posts
    289
    Mentioned
    4 Post(s)
    Quoted
    86 Post(s)

    Default

    Quote Originally Posted by AFools View Post
    I had already corrected it.. but decided to correct the initial post rather make another post....
    Must have posted just as you edited!

    Things like these are prime examples of why the includes should be separated!

  8. #8
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    Well the reflection include has been missing a few functions until now and as migrating from AL to reflection, it is part of progression to mix & match. Until one or the other include had entirely what is necessary. ( there are still some migration issues, so i am spending time to make my function a lot more concise.)

    <------------------>



  9. #9
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Done Thanks, and keep letting me know of missing functions that should be added!
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  10. #10
    Join Date
    Aug 2007
    Posts
    539
    Mentioned
    20 Post(s)
    Quoted
    266 Post(s)

    Default

    Rather than using fixed positions on the screen;
    Simba Code:
    Mouse.Move(545,130,590,150, MOUSE_LEFT);
    you can use widgets to locate the bounds of the run orb.

    Simba Code:
    Widget_Orbs_Container = 160;
          Orbs_RunToggle = 22;  

    W.GetWidget(Widget_Orbs_Container, Orbs_RunToggle);

    It'd be super useful to use widgets, maybe, just possibly, have resizable mode work with reflection.
    Discord: Guy#1693

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
  •