Page 1 of 5 123 ... LastLast
Results 1 to 25 of 104

Thread: [Color][SPS][Alpha] Ape Atoll Agility Course

  1. #1
    Join Date
    Nov 2011
    Posts
    255
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default [Color][SPS][Alpha] Ape Atoll Agility Course

    Script hasn't been updated since runescape update and most likely will not be. There is a new Ape Atoll Agility script being written by another author currently.
    The script is finally starting to take shape. SRL is setup in it and it now has a progress report.

    SPS is required, SMART is recommended.

    Start the script in the Ape Atoll Agility Course and it will do the rest.

    Script doesn't eat yet, so if you have a low agility/hp level be careful.

    Here is the code:

    Simba Code:
    program ApeAtolAgility;
    {$DEFINE SMART}
    {$i srl/srl.scar}
    {$i sps/sps.simba}
    {$I SRL/SRL/misc/paintsmart.scar}

     // author: [Nathan]
     // Version: 1.1 Beta
     // Runs ape atol agility course
     // Start in the course with a ninja greegree equipped
     // Does not eat currently so only run if your are 70+ agility
     // No antiban and no breaks yet, be cautious


    //SETUP
    const
    SERVER = 114; //Replace with desired server number
    Username = 'user';
    Password = 'pass';

    //Vars
    var i,x,y,ourLoc:LongInt;
    var Spots : Array [0..5] of Integer;
    var p:TPointArray;
    var stone,passed:Integer;
    var startingExp,currentExp,laps,gainedExp:Integer;




    function mmBlack:Boolean;
    var blackSpot : Array [0..3] of TPoint;
    var color : Array [0..3] of Integer;
    var i,kk,res:Integer;
    begin
      result:= false;
      blackSpot[0]:= Point(587,43);
      blackSpot[1]:= Point(667,55);
      blackSpot[2]:= Point(577,115);
      blackSpot[3]:= Point(672,122);

      color[0]:= 512;
      color[1]:= 393990;
      color[2]:= 0;
      color[3]:= 65537;
      res:=0;
      for i:=0 to 3 do
        begin
        for kk:=0 to 3 do
          begin
            if(FindColorTolerance(x,y,color[kk],blackSpot[i].x,blackSpot[i].y,blackSpot[i].x,blackSpot[i].y,7)) then
                begin
                res:= res +1;
                end;
           end;
        end;

      if(res > 3) then
          result:= true;
    end;

    Procedure sleepWhileMMBlack();
      var t:Integer;

        begin
        t:=0;
          while( (mmBlack) and (t < 25)) do
           begin
           sleep(250+random(5))
           t:=t+1;
           writeln('SLeeping while mm is blacked');
           end;
     end;

    function distanceTo(var point:TPoint): Extended;
    var myLoc:TPoint;
    begin
        myLoc:= SPS_GetMyPos();
        Result:= Sqrt((Sqr((Abs((point.x - myLoc.x)))) + Sqr((Abs((point.y - myLoc.y))))))
    end;


      procedure FreeAll;
    begin
      ClearRSCanvas(SMART_Canvas.canvas);
      //SMART_FreeDebug; <- contains a bug, don't use this.
      writeln('free');
    end;

    procedure Paint;
    begin

      SMART_DrawBox(IntToBox(5,35,350,120));
      SMART_DrawTextEx(False,80,40,'UpChars','Ape Atoll Agility By: [Nathan]', clBlue);
      SMART_DrawTextEx(False,10,60,'UpChars','Time running: ' + TimeRunning, clBlue);
      SMART_DrawTextEx(False,10,80,'UpChars','Laps run: ' + inttostr(laps), clBlue);
      SMART_DrawTextEx(False,10,100,'UpChars','Experience gained: ' + inttostr( (currentExp-startingExp) ), clBlue);

    end;

    function checkAgility:Integer;
    begin
    currentExp:=GetXP(SKILL_AGILITY);

    if(currentExp=-1) then
      currentExp:=GetXP(SKILL_AGILITY);
      if(currentExp=-1) then
      currentExp:=GetXP(SKILL_AGILITY);
      if(currentExp=-1) then
      currentExp:=GetXP(SKILL_AGILITY);
        if(currentExp=-1) then
      currentExp:=GetXP(SKILL_AGILITY);
        if(currentExp=-1) then
      currentExp:=GetXP(SKILL_AGILITY);
        if(currentExp=-1) then
      currentExp:=GetXP(SKILL_AGILITY);

      result:=currentExp;

    end;



        //Rewrite of FindObjEx to try a max of 12 times before giving up
        //Useful in case we move and script doesn't detect it
    function FindObjEx2(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray;
        Tol, Step, xs, ys, xe, ye: Integer): Boolean;
    var
      CurX, CurY, a, b, c, i, zzz: Integer;
      Start: Boolean;
    begin
      for b := 0 to (GetArrayLength(Color)-1) do
      begin
        if (FindColorSpiralTolerance(cx, cy, color[b], xs, ys, xe, ye, Tol)) then
        begin
        zzz:= zzz+1;
          Start := True;
          Break;
        end;
      end;
      if (Start) then
      begin
        CurX := Round((xs + xe) div 2);
        CurY := Round((ys + ye) div 2) - Step;
        i := 1;
        repeat
          for c := 1 to i do
          begin
            case a of
              0: begin  //To allow for beginning offset and loop
                   a := a + 1;
                   i := 0;
                   CurY := CurY + Step;
                 end;
              1: CurX := CurX + Step;
              2: CurY := CurY - Step;
              3: CurX := CurX - Step;
              4: CurY := CurY + Step;
            end;
            if (CurX >= xs) and (CurX <= xe) and (CurY >= ys) and (CurY <= ye) then
            begin
              try
                for b := 0 to (GetArrayLength(Color)-1) do
                begin
                  if (FindColorTolerance(cx, cy, Color[b], CurX-(Step div 2), CurY-(Step div 2), CurX+(Step div 2), CurY+(Step div 2), Tol)) then
                  begin
                    MMouse(cx, cy, 3, 3);
                    zzz:= zzz+1;
                    writeln('zzz:');
                    writeln(zzz);
                    If (WaitUptextMulti(Text, 300)) then
                    begin
                      GetMousePos(cx, cy);
                      Result := True;
                      Exit;
                    end;
                  end;
                end;
              except
              end;
            end;
          end;
          a := a + 1;
          if a mod 5 = 0 then a := 1;
          if (a = 1) or (a = 3) then i := i + 1;
        until (zzz > 12) or (Result) or ((CurX > xe) and (CurY > ye))
      end;
    end;

    procedure sleepWhileMoving();
      var t:Integer;

        begin
        t:=0;
          while( (IsMoving) and (t < 12)) do
           begin
           sleep(250+random(5))
           writeln('Sleeping while moving');
           t:=t+1;
           end;
        end;

    function getLocation(): integer;
      var myPos, First, Second,Fourth, Fourth2: TPoint;
      var x,y:LongInt;
      begin
         result := 0;
         First := Point(2835, 5670); //Befoer the Stepping stone
         Second := Point(2830, 5670); //On the island, needs to climb tree
         //Third -> On top, needs to click on monkey bars
         Fourth := Point(2805,5670);  //Needs to climb skull wall
         Fourth2 := Point(2805,5675);  //Needs to climb skull wall
         //Firth -> Is player in [] area?
         //Fifth -> Area 2, slide down vine

         Spots[0]:=0;
         Spots[1]:=0;
         Spots[2]:=0;
         Spots[3]:=0;
         Spots[4]:=0;
         Spots[5]:=0;

         myPos := SPS_GetMyPos();


          if(distanceTo(First) < 15) then
            begin
              Spots[0]:=1;
              result:=1;
            end;
          if((myPos = Second) or(myPos.x=2830)) then
          begin
              Spots[1]:=1;
               result:=2;
               end;
               if(passed > 3) then
                 begin
                     Spots[1]:=1;
                     result:=2;
                 end;
          if(( (FindColorTolerance(x,y,393220,604,53,604,53,15)) or FindColorTolerance(x,y,1025,604,53,604,53,25) ) and (FindColorTolerance(x,y,1850450,617,79,635,93,15)) ) then
            begin
            if not(FindColorTolerance(x,y,11377544,572,27,687,145,30)) then
            begin
              Spots[2]:=1;
               result:=3;
               end;
               end;
          if( (myPos.x > 2777) and (myPos.x < 2824) and (myPos.y > 5667) and (myPos.y < 5732) ) then
          begin
              Spots[4]:=1;
               result:=5;
               end;
          if( (myPos = Fourth) or (myPos = Fourth2) ) then
          begin
              Spots[3]:=1;
               result:=4;
               end;
          if( (myPos.x > 2836) and (myPos.x < 2856) and (myPos.y > 5692) and (myPos.y < 5727) ) then
          begin
              Spots[5]:=1;
               result:=6;
               end;

           if(Spots[2] = 1) then
             result:=3;
      end;

    procedure handleObstacle(spot: integer);
    var monkeycolor,treecolor:Integer;
    var waste:T2DExtendedArray;
    var tree5:TPoint;
      begin


        if (spot = 0) then
          begin
            writeln('Walk to beginning Point(2835, 5670)');
            SPS_WalkToPos(Point(2835, 5670));
            sleepWhileMoving();
          end;

      if (spot = 1) then
          begin
             writeln('Click on stepping stone');
             if FindObjEx2(x, y, ['ump', 'tone'], [1783870,2774367], 5, 50, MSX1, MSY1, MSX2, MSY2) then
                begin
                passed:=passed+1;
                  Mouse(x, y, 3, 3, True);
                  sleep(2500+random(175));
                  sleepWhileMoving();
                end;
          end;

      if (spot = 2) then
        begin
           writeln('Climb tree');
           passed:=0;
             if FindObjEx2(x, y, ['Climb'], [5675969, 4684193], 5, 50, MSX1, MSY1, MSX2, MSY2) then
                begin
                  Mouse(x, y, 3, 3, True);
                  sleep(2200+random(150));
                  sleepWhileMoving();
                end;
          end;

      if (spot = 3) then
        begin
           writeln('Click on monkey bars');
           monkeycolor:= 2442074;
             if (FindObjEx2(x, y, ['wing', 'oss'], [monkeycolor], 12, 20, 189,150,296,228)) then
                begin
                  Mouse(x, y, 3, 3, True);
                  sleepWhileMoving();
                  sleepWhileMMBlack();
                end;
      end;

      if (spot = 4) then
        begin
           writeln('Climb skull wall');
             if FindObjEx2(x, y, ['kull', 'ope'], [1519155, 1849921, 2776937], 10, 20, 190,145,240,194) then
                begin
                  Mouse(x, y, 2, 2, True);
                   sleepWhileMoving();
                   sleep(100+random(50));
                end;
        end;

      if (spot = 5) then
        begin
        tree5:= Point(2820, 5710);

           if(distanceTo(tree5) > 13) then
           begin
           writeln('Walk to lower spot (2820, 5705)');

           SPS_WalkToPos(Point(2820, 5710));
           sleepWhileMoving();
           sleep(100+random(50));
            end;
           if(distanceTo(tree5) <14) then
           begin
           writeln('Click tree  (swing rope)');
             if FindObjEx2(x, y, ['ing', 'ope'], [740681, 1860447, 3439209], 5, 50, 275,32,516,290) then
                begin
                  Mouse(x, y, 2, 2, True);
                  sleep(250+random(250));
                   sleepWhileMoving();
                end;
           end;
        end;

      if (spot = 6) then
      begin
          writeln('click climb down tree');

             if FindObjEx2(x, y, ['own'], [4422296,3694463], 5, 20, 224, 3, 403, 104) then
                begin
                  Mouse(x, y, 2, 2, True);
                  laps:=laps+1;
                   sleep(1000+random(350));
                   if(Random(100) > 75) then
                        checkAgility;
                   sleepWhileMoving();
                   sleepWhileMMBlack();
                end;
                end;
      end;


    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name := Username;
      Players[0].Pass := Password;
      Players[0].Nick := 'player';
      Players[0].Active := True;

    end;

    begin

      Smart_Server := SERVER;
      Smart_Members := True;

    //Setup
    SetupSRL;
    DeclarePlayers;
    SPS_Setup(RUNESCAPE_SURFACE, ['6_14','7_14']);
    AddOnTerminate('FreeAll');

    while not(LoggedIn) do
    sleep(1000);

    startingExp:= checkAgility();
    Writeln('Starting exp: ' + inttostr(startingExp));
    while(true) do //Main loop
      begin
      gainedExp:= (currentExp-startingExp);
        FindNormalRandoms();
        ourLoc:= getLocation();
        Writeln(Spots);
        Paint;
        if(ourLoc = 0) then
          begin
            sleep(Random(300)+250);
            ourLoc:= getLocation();
          end;
        handleObstacle(ourLoc);
        sleep(10+random(90));
        sleepWhileMoving();
    end

    end.

    -nathan
    Last edited by [Nathan]; 12-30-2011 at 04:20 AM. Reason: new version

  2. #2
    Join Date
    Mar 2010
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Doesnt work as far as i can tell, but Im probably using it wrong

  3. #3
    Join Date
    Aug 2011
    Location
    Spooner Street
    Posts
    309
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SRL uses Simba these days, not scar.

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

    Default

    ^ and you really need to work on your standards. This tutorial should help.

    Keep it up man, at least you're trying!
    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.


  5. #5
    Join Date
    Nov 2011
    Posts
    255
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Versus The World View Post
    Doesnt work as far as i can tell, but Im probably using it wrong
    In my testing it went 30 laps in a row without messing up and then I stopped using it...

    Quote Originally Posted by Mr. Bottomtooth View Post
    SRL uses Simba these days, not scar.
    My bad, I used the wrong word I guess, I'm used to scar days, its made for simba.

    Quote Originally Posted by Camo Developer View Post
    ^ and you really need to work on your standards. This tutorial should help.

    Keep it up man, at least you're trying!
    I've been spoiled with using eclipse for java and just being able to press a button and having it do it for me

  6. #6
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Don't use code tags, use simba tags, like this

    Simba Code:
    program ApeAtolAgility;
     //author: [Nathan]
    {.Include SRL/SRL.scar}
    {$i sps/sps.simba}
          var x,y,ourLoc:LongInt;

       function FindObjEx2(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray;
        Tol, Step, xs, ys, xe, ye: Integer): Boolean;
    var
      CurX, CurY, a, b, c, i, zzz: Integer;
      Start: Boolean;
    begin
      for b := 0 to (GetArrayLength(Color)-1) do
      begin
        if (FindColorSpiralTolerance(cx, cy, color[b], xs, ys, xe, ye, Tol)) then
        begin
        zzz:= zzz+1;
          Start := True;
          Break;
        end;
      end;
      if (Start) then
      begin
        CurX := Round((xs + xe) div 2);
        CurY := Round((ys + ye) div 2) - Step;
        i := 1;
        repeat
          for c := 1 to i do
          begin
            case a of
              0: begin  //To allow for beginning offset and loop
                   a := a + 1;
                   i := 0;
                   CurY := CurY + Step;
                 end;
              1: CurX := CurX + Step;
              2: CurY := CurY - Step;
              3: CurX := CurX - Step;
              4: CurY := CurY + Step;
            end;
            if (CurX >= xs) and (CurX <= xe) and (CurY >= ys) and (CurY <= ye) then
            begin
              try
                for b := 0 to (GetArrayLength(Color)-1) do
                begin
                  if (FindColorTolerance(cx, cy, Color[b], CurX-(Step div 2), CurY-(Step div 2), CurX+(Step div 2), CurY+(Step div 2), Tol)) then
                  begin
                    MMouse(cx, cy, 3, 3);
                    zzz:= zzz+1;
                    writeln('zzz:');
                    writeln(zzz);
                    If (WaitUptextMulti(Text, 300)) then
                    begin
                      GetMousePos(cx, cy);
                      Result := True;
                      Exit;
                    end;
                  end;
                end;
              except
              end;
            end;
          end;
          a := a + 1;
          if a mod 5 = 0 then a := 1;
          if (a = 1) or (a = 3) then i := i + 1;
        until (zzz > 12) or (Result) or ((CurX > xe) and (CurY > ye))
      end;
    end;
       procedure sleepWhileMoving();
      var a,b,c,d:integer;
      var movez:Boolean;
      begin
      writeln('Sleep while moving');
      movez:= False;
        a:= GetColor(60,70);
        b:= GetColor(280,80);
        c:= GetColor(154,227);
        d:= GetColor(428,268);
        sleep(100+random(10));
        if not(a = GetColor(60,70)) then
          movez:= True;
        if not(b = GetColor(280,80)) then
          movez:= True;
        if not(c = GetColor(154,227)) then
          movez:= True;
        if not(d = GetColor(428,268)) then
          movez:= True;

        if(movez=false) then
            Exit;

        a:= GetColor(60,70);
        b:= GetColor(280,80);
        c:= GetColor(154,227);
        d:= GetColor(428,268);
        while not( ( a = GetColor(60,70)) or ( b = GetColor(280,80)) or ( c = GetColor(154,227)) or ( d = GetColor(428,268)) ) do
          begin
            sleep(100+random(100));
                a:= GetColor(60,70);
        b:= GetColor(280,80);
        c:= GetColor(154,227);
        d:= GetColor(428,268);
          end


      end;

      function getLocation(): integer;
      var myPos, First, Second,Fourth, Fourth2: TPoint;
      var x,y:LongInt;
      begin
      result := 0;
          First := Point(2835, 5670); //Befoer the Stepping stone
          Second := Point(2830, 5670); //On the island, needs to climb tree
          //Third -> On top, needs to click on monkey bars
          Fourth := Point(2805,5670);  //Needs to climb skull wall
          Fourth2 := Point(2805,5675);  //Needs to climb skull wall
          //Firth -> Is player in [] area?
          //Fifth -> Area 2, slide down vine



          myPos := SPS_GetMyPos();

          if(myPos = First) then
              result := 1;
          if(myPos = Second) then
              result := 2;
          if(( (FindColorTolerance(x,y,393220,604,53,604,53,15)) or FindColorTolerance(x,y,1025,604,53,604,53,25) ) and (FindColorTolerance(x,y,1850450,617,79,635,93,15)) ) then
              result := 3;
          if( (myPos.x > 2777) and (myPos.x < 2824) and (myPos.y > 5667) and (myPos.y < 5732) ) then
              result := 5;
          if( (myPos = Fourth) or (myPos = Fourth2) ) then
              result := 4;
          if( (myPos.x > 2836) and (myPos.x < 2856) and (myPos.y > 5692) and (myPos.y < 5727) ) then
              result := 6;

      end;

       function stableLoction(): integer;
       var a,b,c,z:integer;
       begin
          z:= 0;
          a := getLocation();
          b := getLocation();
          c := getLocation();
          if( (a=b) and (b=c) ) then
            result := a;
          while(not( (a=b) or (a=c) )) do
          begin
          z := z+1;
          a := getLocation();
          b := getLocation();
          c := getLocation();
          if( (a=b) and (b=c) ) then
            result := a;

          if(z>10) then
            begin
            writeln('Cannot find a stable location in 10 tries');
            Logout();
            end;

          end
       end;

      procedure handleObstacle(spot: integer);
      var me:TPoint;
      var ran:integer;
      begin

      if (spot = 0) then
        begin
          writeln('Walk to beginning Point(2835, 5670)');
          SPS_WalkToPos(Point(2835, 5670));
        end;

      if (spot = 1) then
          begin
             writeln('Click on stepping stone TODO make area zone not tile');
             if FindObjCustom(x, y, ['ump', 'tone'], [1592406, 1658456], 5) then
                begin
                  Mouse(x, y, 3, 3, True);
                  sleep(1100+random(100));
                   sleepWhileMoving();
                end;
          end;
      if (spot = 2) then
      begin
           writeln('Climb tree');
             if FindObjEx2(x, y, ['imb', 'ical'], [3828367, 4820917, 4224414], 5, 50, MSX1, MSY1, MSX2, MSY2) then
                begin
                  Mouse(x, y, 3, 3, True);
                  sleep(1300+random(150));
                   sleepWhileMoving();
                end;
          end;
      if (spot = 3) then
      begin
           writeln('Click on monkey bars');
             if FindObjEx2(x, y, ['wing', 'oss'], [3759215, 5210009], 5, 50, MSX1, MSY1, MSX2, MSY2) then
                begin
                  Mouse(x, y, 3, 3, True);
                  sleep(2300+random(250));
                   sleepWhileMoving();
                end;
      end;
      if (spot = 4) then
        begin
           writeln('Climb skull wall');
             if FindObjEx2(x, y, ['kull', 'ope'], [2512736, 2776937], 5, 50, MSX1, MSY1, MSX2, MSY2) then
                begin
                  Mouse(x, y, 2, 2, True);
                  sleep(1300+random(250));
                   sleepWhileMoving();
                end;
        end;
      if (spot = 5) then
        begin
           writeln('Walk to lower spot (2820, 5705)');
           writeln('Click tree  (swing rope)');
           SPS_WalkToPos(Point(2820, 5710));
           sleepWhileMoving();
           sleep(1800+random(50));
             if FindObjEx2(x, y, ['ing', 'ope'], [1860447, 3439209], 5, 50, MSX1, MSY1, MSX2, MSY2) then
                begin
                  Mouse(x, y, 2, 2, True);
                  sleep(2700+random(250));
                   sleepWhileMoving();
                end;
        end;
      if (spot = 6) then
          writeln('click climb down tree');
             if FindObjEx2(x, y, ['own'], [3764366, 3764366], 5, 50, 224, 3, 403, 104) then
                begin
                  Mouse(x, y, 2, 2, True);
                  sleep(3300+random(250));
                   sleepWhileMoving();
                end;

      end;




    begin
          SetupSRL;

    SPS_Setup(RUNESCAPE_SURFACE, ['6_14','7_14']);
    while(true) do
    begin
     ourLoc:= getLocation();
     if(ourLoc = 0) then
      begin
      sleep(Random(300)+250);
      ourLoc:= getLocation();
      end;
     handleObstacle(ourLoc);
    sleep(10+random(90));
     sleepWhileMoving();


    end


    end.

    [.Simba] code [./Simba] Without dot
    Hi

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

    Default

    Changed the first post to simba tags.

    Its great to see development, keep it up!
    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
    Mar 2010
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Whats your plans for full release? And its working great atm, great script.

  9. #9
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Yeee! Someone really is using SPS!
    I suggest you don't rely on SPS getting your exact position everytime, it might very well be 1 tile off sometimes. I suggest you do something like this:

    Simba Code:
    function getMyLocation: integer;
    var
      P: TPoint;
      Points: TPointArray;
      i, d, tmp: integer;
    begin
      Result := -1;
      Points := [Point(1234, 1234), Point(4321, 4321), Point(4767, 4576)];
      P := SPS_GetMyPos;
      d := 99999;
      for i := 0 to 2 do
      begin
        tmp := Distance(Points[i].x, Points[i].y, P.x, P.y);
        if tmp < d then
        begin
          d := tmp;
          result := i;
        end;
      end;
    end;

    it would check the nearest tile to you and return that index as your 'current location'

  10. #10
    Join Date
    Oct 2011
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    doesnt work

  11. #11
    Join Date
    Nov 2011
    Posts
    255
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Versus The World View Post
    Whats your plans for full release? And its working great atm, great script.
    Plans for full release are after my micro bio test on friday when I'll actually have some free time again

    Quote Originally Posted by marpis View Post
    Yeee! Someone really is using SPS!
    I suggest you don't rely on SPS getting your exact position everytime, it might very well be 1 tile off sometimes. I suggest you do something like this:

    Simba Code:
    function getMyLocation: integer;
    var
      P: TPoint;
      Points: TPointArray;
      i, d, tmp: integer;
    begin
      Result := -1;
      Points := [Point(1234, 1234), Point(4321, 4321), Point(4767, 4576)];
      P := SPS_GetMyPos;
      d := 99999;
      for i := 0 to 2 do
      begin
        tmp := Distance(Points[i].x, Points[i].y, P.x, P.y);
        if tmp < d then
        begin
          d := tmp;
          result := i;
        end;
      end;
    end;

    it would check the nearest tile to you and return that index as your 'current location'
    Coming back to scar/simba from java scripting, I am incredibly impressed with SPS, actually, before I found out SPS existed, I was planning on writing this script using the different minimap markers as symbols and calculate the distance to each given one and use that to generate a location in the given area, but I found out SPS more or less already does that for me! Thanks for the tip

    Quote Originally Posted by Versus The World View Post
    Whats your plans for full release? And its working great atm, great script.
    would disagree with you
    Quote Originally Posted by PremiumBotter View Post
    doesnt work
    Quote Originally Posted by Nava2 View Post
    Changed the first post to simba tags.

    Its great to see development, keep it up!
    Thanks and thanks

  12. #12
    Join Date
    Mar 2010
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Disagree with what?

  13. #13
    Join Date
    Nov 2011
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Versus The World View Post
    Disagree with what?
    He probably meant to say that to the quote, "doesn't work".

  14. #14
    Join Date
    Feb 2007
    Location
    Colorado, USA
    Posts
    3,716
    Mentioned
    51 Post(s)
    Quoted
    624 Post(s)

    Default

    he was saying that premiumbotter disagrees with you.. although premiumbotter's clearly wrong since it is working, lol.
    The only true authority stems from knowledge, not from position.

    You can contact me via matrix protocol: @grats:grats.win or you can email me at the same domain, any user/email address.

  15. #15
    Join Date
    Mar 2010
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ahh lol i get it now haha, yeh scripts running great, gotten me from 70-78 so far

  16. #16
    Join Date
    Nov 2011
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    When I try to Run/Compile I get this error:

    [Error] (34:17): Unknown type 'T4DIntegerArray' at line 33
    Compiling failed.

    Help?

  17. #17
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by qwerty4ever View Post
    When I try to Run/Compile I get this error:

    [Error] (34:17): Unknown type 'T4DIntegerArray' at line 33
    Compiling failed.

    Help?
    Correct me if I'm wrong but I think you don't have SRL installed correctly (the plugins I think).
    “Ignorance, the root and the stem of every evil.”

  18. #18
    Join Date
    Nov 2011
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Blumblebee View Post
    Correct me if I'm wrong but I think you don't have SRL installed correctly (the plugins I think).
    How do I install SRL correctly? I enabled it in Extensions and updated it.

  19. #19
    Join Date
    Nov 2011
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright, I got it to work. However, it gets stuck immediately before the first obstacle: the stepping-stone. It gets to the right position just before the stepping-stone, but then the mouse just hovers above the Tropical Tree trunk completely ignoring the stone. Maybe the coordinates are different? Maybe I'm doing something wrong? I am in MIN Graphics with a FIXED screen size.
    Last edited by qwerty4ever; 11-09-2011 at 09:37 PM.

  20. #20
    Join Date
    Nov 2011
    Posts
    255
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    New version released experimenting with DTMs to find the monkey bars, still a work in progress, more stable now though.

  21. #21
    Join Date
    Nov 2011
    Posts
    255
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Version 1.0 Beta Released

    The script has been working pretty flawlessly for me for ~ 45 minutes now, made quite a few changes. I would now say the script is actually useable.

    Still won't eat, sorry, not a big priority for me with 90+ HP and 73 agility...

    If you test it let me know of any issues its having.

    This version also uses SMART now

  22. #22
    Join Date
    Jan 2011
    Posts
    335
    Mentioned
    0 Post(s)
    Quoted
    23 Post(s)

    Default

    yeah i keep getting this

    error line 33 on SPS " SPS_Worldmap: T4DIntegerArray; "

    Code:
    [Hint] C:\Users\Alex\Desktop\Simba\Includes\SRL/SRL/core/antirandoms/pinball.scar(37:3): Variable 'MA' never used at line 36
    [Error] C:\Users\Alex\Desktop\Simba\Includes\sps/sps.simba(34:17): Unknown type 'T4DIntegerArray' at line 33
    Compiling failed.
    [Error] (91:29): Unknown type 'T3DIntegerArray' at line 90
    Compiling failed.
    [Hint] C:\Users\Alex\Desktop\Simba\Includes\SRL/SRL/core/antirandoms/pinball.scar(37:3): Variable 'MA' never used at line 36
    [Error] C:\Users\Alex\Desktop\Simba\Includes\sps/sps.simba(34:17): Unknown type 'T4DIntegerArray' at line 33
    Compiling failed.
    If I see you autoing with level 3/default clothes/crap name I WILL report you. Auto Correctly.

  23. #23
    Join Date
    Nov 2011
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The script is working flawlessly so far (10 mins). The only thing I would point out is that it sometimes takes an unusually long time to climb the monkey bars and sometimes, after it hops over the stepping-stone, it tries to click it again (not that big of a problem).

    Also, the rate at which it updates experience is slow (5+ mins per update), but that is not a primary problem and could be dealt with later if needed.

    Overall it is doing very well. Has not stopped yet. But, overall speed could need a boost seeing as it takes around 2+ mins to complete a lap which, if you never fail, is around 16k experience per hour. Still, as this is one of the only agility bots that still works, it is pretty good.

    Keep up the excellent work Nathan!

  24. #24
    Join Date
    Nov 2011
    Posts
    255
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by qwerty4ever View Post
    The script is working flawlessly so far (10 mins). The only thing I would point out is that it sometimes takes an unusually long time to climb the monkey bars and sometimes, after it hops over the stepping-stone, it tries to click it again (not that big of a problem).

    Also, the rate at which it updates experience is slow (5+ mins per update), but that is not a primary problem and could be dealt with later if needed.

    Overall it is doing very well. Has not stopped yet. But, overall speed could need a boost seeing as it takes around 2+ mins to complete a lap which, if you never fail, is around 16k experience per hour. Still, as this is one of the only agility bots that still works, it is pretty good.

    Keep up the excellent work Nathan!
    I've spent countless hours on the monkeybars, everything is the same color up there, its pretty hard to get that aspect to work... Because to get experience you actually have to hover the stat, I wanted to make it realistic, the average person isn't going to check their exp every 10 seconds, so neither can the script :/

    Thanks for testing and commenting!

  25. #25
    Join Date
    Nov 2011
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by [Nathan] View Post
    I've spent countless hours on the monkeybars, everything is the same color up there, its pretty hard to get that aspect to work... Because to get experience you actually have to hover the stat, I wanted to make it realistic, the average person isn't going to check their exp every 10 seconds, so neither can the script :/

    Thanks for testing and commenting!
    Oh, the experience thing makes sense; I didn't think about that. About the monkey bars, yeah, that kind of sucks.

    And, it's a pleasure to test; thank you for creating the script!

    EDIT: When I do the course manually, I often times click an obstacle many times so that that I can finish faster. What if you set the script to click randomly in the general vicinity of the money bars?
    Last edited by qwerty4ever; 11-11-2011 at 05:09 PM.

Page 1 of 5 123 ... 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
  •