Results 1 to 4 of 4

Thread: Script won't do anything. Help ;/ (Iron Powerminer, first script)

  1. #1
    Join Date
    Mar 2013
    Location
    Norway
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Unhappy Script won't do anything. Help ;/ (Iron Powerminer, first script)

    So I have been looking at Yohojo's video tuts to make a script. I made one powerminer for iron in Al Kharid. in other words, i did my best so far. Now I'm stuck as the script won't sign in the player, or search for colors. The only thing the script does is fixing camera angle and camera degrees. I'm very new to this, so I would like some advice and tips on how to improve this and how to make the script do something. xD
    Simba Code:
    program PremixPowerminer;
    {$i srl/srl.simba}
    {$i P07Include.simba}

    Procedure P07_DeclarePlayer;
    Begin
      P07_PlayerName:='';
      P07_PlayerPass:='';
    end;

    Procedure AntiBan;
    begin
    if P07_LoggedIn then
    begin;
      case random(250) of
      0: P07_HoverSkill('Mining', random(5000));
      2: P07_MakeCameraAngleHigh;
      3: P07_MakeCompassSouth;
      5: P07_MakeCompassWest;
      6: P07_DropInventorySlot(14);
      7: P07_DropInventorySlot(22);
      8: sleepandmovemouse(3000);
      end;
    end;
    end;


    function RockColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.10, 0.74);

      if not (FindColorsTolerance(arP, 1713730, MSX1, MSY1, MSX2, MSY2, 11)) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        Result := arC[i];
        //Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        //Writeln('AutoColor failed in finding the color.');
    end;

    function Mining;
    var
      x, y, PlusOne: integer;
    begin
      PlusOne:= InvCount + 1;
      x:=MSCX;
      y:=MSCY;
      if FindObjTPA(x, y, RockColor, 5, 1, 50, 50, 250, ['Min']) then
      begin
        WriteLN('Found iron!');
        GetMousePos(x, y);

        case Random(2) Of
          0: Mouse(x, y, 6, 6, True);
          1: begin
               Mouse(x, y, 6, 6, False);
               WaitOption('Mine', 500);
             end;
        end;
        if not FindObjTPA(x, y, RockColor, 5, 1, 50, 50, 250, ['Min']) then
              WriteLn('Check colors.');

        repeat
          Antiban;
          Wait(2000);
          If InvCount=PlusOne then
            WriteLn('Got one iron.');
        until (InvCount=PlusOne);

      end;
    end;




    begin;
      ActivateClient;
      SetupSRL;
      SetupP07Include;
      P07_DeclarePlayer;
      P07_MakeCompassDegree(270);
      P07_MakeCameraAnglehigh;
      repeat
        Mining;
      until(not P07_LoggedIn);
      TerminateScript;
    end.

  2. #2
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    All I can say is check the colors -.- are you using a ACA generated function?

  3. #3
    Join Date
    Dec 2011
    Posts
    164
    Mentioned
    4 Post(s)
    Quoted
    23 Post(s)

    Default

    Hi there!

    Simba Code:
    program PremixPowerminer;
    {$Define SMART8}
    {$i srl/srl.simba}
    {$i P07Include.simba}

    procedure P07_DeclarePlayer;
    begin
      P07_PlayerName := '';
      P07_PlayerPass := '';
    end;

    procedure AntiBan;
    begin
      if P07_LoggedIn then
      begin
        case random(250) of
          0: P07_HoverSkill('Mining', random(5000));
          2: P07_MakeCameraAngleHigh;
          3: P07_MakeCompassSouth;
          5: P07_MakeCompassWest;
          6: P07_DropInventorySlot(14);
          7: P07_DropInventorySlot(22);
          8: sleepandmovemouse(3000);
        end;
      end;
    end;

    function RockColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.10, 0.74);
      if not (FindColorsTolerance(arP, 1713730, MSX1, MSY1, MSX2, MSY2, 11)) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;
      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);
      for i := 0 to arL do
      begin
        Result := arC[i];
        Break;
      end;
      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
      if (i = arL + 1) then
      end;

    procedure Mining;
    var
      x, y, PlusOne: integer;
    begin
      PlusOne := InvCount + 1;
      x := MSCX;
      y := MSCY;
      if FindObjTPA(x, y, RockColor, 5, 1, 50, 50, 250, ['Min']) then
      begin
        WriteLN('Found iron!');
        GetMousePos(x, y);
        case Random(2) of
          0: Mouse(x, y, 6, 6, True);
          1:
            begin
              Mouse(x, y, 6, 6, False);
              WaitOption('Mine', 500);
            end;
        end;
        if not FindObjTPA(x, y, RockColor, 5, 1, 50, 50, 250, ['Min']) then
          WriteLn('Check colors.');
        repeat
          Antiban;
          Wait(2000);
          if InvCount = PlusOne then
            WriteLn('Got one iron.');
        until (InvCount = PlusOne);
      end;
    end;
    begin
      P07_DeclarePlayer;
      ActivateClient;
      SetupSRL;
      SetupP07Include;
      P07_LogInPlayer;
      P07_MakeCompassDegree(270);
      P07_MakeCameraAnglehigh;
      repeat
        Mining;
      until (not P07_LoggedIn);
      TerminateScript;
    end.

    Alright, let me quickly explain what I did.

    First off, to solve your problem, I added P07_LogInPlayer; to your main loop to log in the users.

    Second off, I changed your Function Mining; to Procedure Mining; as Mining; is being used to complete in game tasks.

    Thirdly, I added SMART to your script, this simply acts as a client, and makes it so you can do things on your computer other than stare out a mouse clicking away on a Runescape client.
    SMART for RS07 can be read about here:
    http://villavu.com/forum/showthread.php?t=97599 (Simply the SMART portion at the Bottom)

    I'm using Smart 8, you can simply take out the 8 to run tradition smart, but you must still make the modifications as stated on the link above to run the RS07 client.

    Hope I helped! You appear to be off to a good start!

  4. #4
    Join Date
    Mar 2013
    Location
    Norway
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    RJJ95: I used ACA generated color. i followed Yohojo's ACA tutorial to try to not make any mistakes. The rocks were fully red, so it would be kind of weird if the colors were wrong :/

    Iambubbleman: I was a bit confused if it was a function or a procedure, since Yohojo used a function to do almost the same code for a powerchopper. Still won't do the mining part, but you helped me make the script login the player I tried to add P07_LoginPlayer in the main loop before I posted. All it did was clicking the login button (didn't write anything at all).

    Thanks for the quick replies <3
    Last edited by Premix; 03-14-2013 at 11:36 PM.

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
  •