Results 1 to 7 of 7

Thread: Runespan Siphon Function

  1. #1
    Join Date
    Jan 2012
    Posts
    915
    Mentioned
    13 Post(s)
    Quoted
    87 Post(s)

    Default Runespan Siphon Function

    Simba Code:
    function Siphon(EsslingUpText:TStringArray; Color, Tol:integer; Hue, Sat:extended): Boolean;
    var
     Data:TIntegerArray;
     TPA: TPointArray;
     ATPA: Array of TPointArray;
     Box:Tbox;
     x,y: Integer;
    begin
      SetLength(Data, 4);
      Data[3]:=GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      ColorToleranceSpeed(Data[3]);
      ATPA:= TPAToATPAEx(TPA, 15, 15);
      Data[1]:=High(ATPA);
      for Data[0] := 0 to Data[1] do
      begin
        MiddleTPAEx(ATPA[Data[0]], x, y);
        Box.X1:=x;
        Box.Y1:=y;
        Box.X2:=x+2;
        Box.Y2:=y+2;
        MouseTBox(Box, Move);
        if WaitUpTextMulti(EsslingUptext, 300) then
        begin
          case Random(2) of
            0: begin
                 ClickMouse2(True);
                 if(DidRedClick())then
                   Wait(RandomRange(28000, 32000));
                   Break;
               end;
            1: begin
                 ClickMouse2(False);
                   Wait(Randomrange(28000, 30000))
                 else
                   FindRandoms;
                   Break;
               end;
          end;
          begin
            Result:= True;
          end;
        end;
      end;
    end;

    My function that I made, wanted to see if you guys wanted to add it to the SRL include, for Runecrafting, idk. I just wanted to contribute to SRL, along with the community. I'm going to make more functions.

  2. #2
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    I don't think things that skill-defined are in the SRL Include? o.O
    Simba Code:
    SetLength(Data, 4);
      Data[3]:=GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      ColorToleranceSpeed(Data[3]);
    Correct me if I'm wrong, but doesn't that just change it back to what it was previously?

  3. #3
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    I agree with NKN I'm sure its not skill defined.



    ^^

  4. #4
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NKN View Post
    I don't think things that skill-defined are in the SRL Include? o.O
    Simba Code:
    SetLength(Data, 4);
      Data[3]:=GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      ColorToleranceSpeed(Data[3]);
    Correct me if I'm wrong, but doesn't that just change it back to what it was previously?
    Yes it does LOL.

    Btw, what are these for? Just wondering, cuz I don't quite understand everything
    Simba Code:
    Color, Tol:integer; Hue, Sat:extended

    You're waiting from 28 to 32 seconds, but what if its gone in just 5 seconds? You're doing nothing for 23 to 27 seconds? I think maybe use a better function than simply just waits

    In the case statement, the second case, you're trying to right click and wait, choosing no options. With the else there, I don't think it compiles.
    Last edited by CephaXz; 08-01-2012 at 12:43 PM.

  5. #5
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    There is indeed a skill specific section.
    Simba > Includes > SRL > SRL > Skill > Runecrafting.simba

    Not against the idea, just have a few queries about your TPA function I'd like you to clear up
    Simba Code:
    function Siphon(EsslingUpText:TStringArray; Color, Tol:integer; Hue, Sat:extended): Boolean;
    var
     Data:TIntegerArray;
     TPA: TPointArray;
     ATPA: Array of TPointArray;
     Box:Tbox;
     x,y: Integer;
    begin
      SetLength(Data, 4); // why u no use Data[2]? :(
      Data[3]:=GetColorToleranceSpeed;
      ColorToleranceSpeed(2); // changes to 2
      ColorToleranceSpeed(Data[3]); // then immediately changed it back?
      ATPA:= TPAToATPAEx(TPA, 15, 15);   //no finding color anywhere to make TPA?
      Data[1]:=High(ATPA);
      for Data[0] := 0 to Data[1] do
      begin
        MiddleTPAEx(ATPA[Data[0]], x, y);
        Box.X1:=x;             //Lots of code
        Box.Y1:=y;             // that could be replaced with
        Box.X2:=x+2;           // MMouse(x,y,2,2);
        Box.Y2:=y+2;           //
        MouseTBox(Box, Move);  //
        if WaitUpTextMulti(EsslingUptext, 300) then
        begin
          case Random(2) of
            0: begin
                 ClickMouse2(True);
                 if(DidRedClick())then
                   Wait(RandomRange(28000, 32000));
                   Break;
               end;
            1: begin
                 ClickMouse2(False);     // right click then just wait 28sec?
                   Wait(Randomrange(28000, 30000))
                 else    // no if..then?
                   FindRandoms;
                   Break;
               end;
          end;
          begin // un-neccessary begin
            Result:= True;
          end;  // and end
        end;
      end;
    end;


    Got kind of bored so I filled in what I think the blanks should be.
    Simba Code:
    function Siphon(UpText: TStringArray; Color, Tol: Integer; HMod, SMod: Extended): Boolean;
    var
      TPA: TPointArray;
      ATPA: T2DPointArray;
      CTS, i, x, y: Integer;
    begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(HMod, SMod);
      if FindColorsSpiralTolerance(x, y, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tol) then
      begin
        SortTPAFrom(TPA, Point(MSCx, MSCy));
        ATPA := TPAToATPAEx(TPA, 15, 15);
        for i := 0 to High(ATPA) do
        begin
          MiddleTPAEx(ATPA[i], x, y);
          MMouse(x, y, RandomRange( - 2, 2), RandomRange( - 2, 2));
          if WaitUpTextMulti(UpText, 1500) then
          begin
            case Random(2) of
              0:
                begin
                  ClickMouse2(True);
                  if (DidRedClick()) then
                  begin
                    Result := True;
                    Wait(RandomRange(28000, 32000));
                    Break;
                  end
                  else
                  begin
                    FindNormalRandoms;
                    Result := False;
                  end;
                end;
              1:
                begin
                  ClickMouse2(False);
                  if WaitOption('ipho', 1500) then
                  begin
                    Result := True;
                    Wait(Randomrange(28000, 30000));
                    Break;
                  end
                  else
                  begin
                    FindNormalRandoms;
                    Result := False;
                  end;
                end;
            end;
          end;
        end;
      end;
      ColorToleranceSpeed(CTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
    end;
    Last edited by P1ng; 08-01-2012 at 12:59 PM.

  6. #6
    Join Date
    Feb 2012
    Location
    SRL Jail
    Posts
    1,319
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It could go in the animation section... there is infight which is combat specific.
    We should seriously think about adding animation detection for each skill

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

    Default

    Is it a generic function? If it is, might want to change the names of some the the variables and parameters.

    I rather see it go into SRL Snippits.
    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.


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
  •