Results 1 to 8 of 8

Thread: Take a look please?

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

    Default Take a look please?

    Since my Range Guilder script has been put on hold, thanks to Joker , I'm making another script for the time being. It runs fine for what I have, but I want to see what yall think. Here it is so far.
    SCAR Code:
    Program VarrockAnythingSmither;
    {.include SRL\SRL.scar}

    Function CheckForFight: Boolean;
    Begin
      if CheckHpFirst then
      begin
        Wait(500 + Random(100));
        if (HpPercent < 100) then
          FleeFromFight;
      end;
    End;

    Procedure FleeFromFight;
    Begin
      RunAway('N', True, 1, 10000 + Random(2000));
    End;

    Procedure AntiRandoms;
    Begin
      if not(LoggedIn) then Exit;
      LampSkill := 'Smithing';
      FindTalk;
      FindNormalRandoms;
      if (CheckForFight = True) then
      begin
        FleeFromFight;
      end;
    End;

    Procedure AntiBan;
    Begin
        case random(50) of
         1 : MMouse(0, 0, 700, 500);
         2 : Hoverskill('Range', false);
         4 : BoredHuman;
         5 : RandomMovement;
        end;
    End;

    Var x,y,i : Integer;

    Procedure WalkToAnvil;
    begin
      If not (LoggedIn) then Exit;
      if FindSymbol(x, y, 'anvil') then
        begin
          Mouse(x, y, 1, 1, true);
          AntiRandoms;
          WriteLn('Found Symbol');
          FFlag(4);
        end;
    end;

    Function FindAnvil: Boolean;
    Var
      Counter : Integer;
    begin
      If not (LoggedIn) then Exit;
      if FindObjTPA(x,y,3947585,11,-1,7,7,20,['options','1 mor','more opt']) then
      begin
      Repeat
        MMouse(x,y,2,2);
        Wait(100+random(200));
        begin
          GetMousePos(x,y);
          Mouse(x,y,2,2,false);
          AntiRandoms;
          Result := True;
          ChooseOption('amine');
        end;
          Inc(Counter);
      until ((Result = True) or (Counter = 20));
        if (Counter=20) then
        begin
          WriteLn('Couldn''t find Anvil');
          Logout;
          TerminateScript;
        end;
      end;
    end;



    Begin
      ClearDebug;
      SetupSRL;
      SymbolAccuracy := 0.45;
      ActivateClient;
      Wait(1000);
      MakeCompass('N');
      Setangle(True);
      AntiRandoms;
      WalkToAnvil;
      FindAnvil;
    End.
    Should I make it store the anvils location so that way it doesn't have too keep looking for it everytime it comes back? My next step is to have it check to see if the anvil is there, then if bars are in the inventory use them. Any input would be appreciated

    ~Camo
    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.


  2. #2
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    it's a good start
    ~ Metagen

  3. #3
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    The script won't even compile because you've called FleeFromFight before you've declared it as a procedure, so that's one thing that should be fixed. Also, if WalkToAnvil somehow fails (doesn't find the symbol, perhaps), then you'll be looking for the anvil for no reason. I'd suggest adding some failsafes to make sure you only run a function or procedure when you're supposed to.
    :-)

  4. #4
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Why not just say if infight then runaway(blaaaah);
    ~ Metagen

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

    Default

    Ok, oops. stupid mistake. So hows this?
    SCAR Code:
    Procedure FleeFromFight;
    Begin
      RunAway('N', True, 1, 10000 + Random(2000));
    End;

    Function CheckForFight: Boolean;
    Begin
      if CheckHpFirst then
      begin
        Wait(500 + Random(100));
        if (HpPercent < 100) then
          FleeFromFight;
      end;
    End;

    as for the failsafes...
    SCAR Code:
    Function WalkToAnvil: Boolean;
    Var
      MarkedTime : Integer;
    begin
      If not (LoggedIn) then Exit;
        MarkTime(MarkedTime);
      Repeat
      if FindSymbol(x, y, 'anvil') then
        begin
          Mouse(x, y, 1, 1, true);
          AntiRandoms;
          Result := True;
          WriteLn('Found Symbol');
          FFlag(4);
        end;
        if (not Result) then
          Wait(1000 + Random(1000));
      until ((Result = True) or (TimeFromMark(MarkedTime) >=400000));
      if (TimeFromMark(MarkedTime) >=400000)then
      begin
        WriteLn('Couldn''t Find Symbol');
        Logout;
        TerminateScript;
      end;
    end;
    Is this good?

    @Metagen. I want some practice at making my own procedures/functions and what not.

    EDIT: I get this error
    SCAR Code:
    [Runtime Error] : Out Of Range in line 1087 in script
    Then it opens up the AntiRandoms.scar which is this
    SCAR Code:
    if FindTPAinTPA(Players[CurrentPlayer].NickTPA,TPA,Matches) then  //Length check inside the function ;)

    ~Camo
    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.


  6. #6
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    You need to create a DeclarePlayers procedure and use LoginPlayer for antirandoms to function properly.
    :-)

  7. #7
    Join Date
    Jul 2008
    Posts
    907
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    as method says it needs the nickname


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

    Default

    Ok, will do. Thanks. How's this?
    SCAR Code:
    Program VarrockAnythingSmither;
    {.include SRL\SRL.scar}

    Const
    //LoadsWanted     = 10;   // Change this for how many loads you want

      YourSRLID = '';
      YourSRLPass = '';
     
    Var x,y,i : Integer;

    Procedure DeclarePlayers;
    Begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

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

      Writeln( IntToStr ( HowManyPlayers ) + ' Players' );
      SetPlayerNameTPAs;
    End;


    Procedure FleeFromFight;
    Begin
      RunAway('N', True, 1, 10000 + Random(2000));
    End;

    Function CheckForFight: Boolean;
    Begin
      if CheckHpFirst then
      begin
        Wait(500 + Random(100));
        if (HpPercent < 100) then
          FleeFromFight;
      end;
    End;

    Procedure AntiRandoms;
    Begin
      if not(LoggedIn) then Exit;
      LampSkill := 'Smithing';
      FindTalk;
      FindNormalRandoms;
      if (CheckForFight = True) then
      begin
        FleeFromFight;
      end;
    End;

    Procedure AntiBan;
    Begin
        case random(50) of
         1 : MMouse(0, 0, 700, 500);
         2 : Hoverskill('Smithing', false);
         4 : BoredHuman;
         5 : RandomMovement;
         6 : GameTab(1);
        end;
    End;

    Function WalkToAnvil: Boolean;
    Var
      MarkedTime : Integer;
    begin
      If not (LoggedIn) then Exit;
        MarkTime(MarkedTime);
      Repeat
      if FindSymbol(x, y, 'anvil') then
        begin
          Mouse(x, y, 1, 1, true);
          AntiRandoms;
          Result := True;
          WriteLn('Found Symbol');
          FFlag(4);
          AntiBan;
        end;
        if (not Result) then
          Wait(1000 + Random(1000));
      until ((Result = True) or (TimeFromMark(MarkedTime) >=400000));
      if (TimeFromMark(MarkedTime) >=400000)then
      begin
        WriteLn('Couldn''t Find Symbol');
        Logout;
        TerminateScript;
      end;
    end;

    Function FindAnvil: Boolean;
    Var
      Counter : Integer;
    begin
      If not (LoggedIn) then Exit;
      if FindObjTPA(x,y,3947585,11,-1,7,7,20,['options','1 mor','more opt']) then
      begin
      Repeat
        MMouse(x,y,2,2);
        Wait(100+random(200));
        begin
          GetMousePos(x,y);
          Mouse(x,y,2,2,false);
          AntiRandoms;
          Result := True;
          ChooseOption('amine');
          AntiBan;
        end;
          Inc(Counter);
      until ((Result = True) or (Counter = 20));
        if (Counter=20) then
        begin
          WriteLn('Couldn''t find Anvil');
          Logout;
          TerminateScript;
        end;
      end;
    end;

    Begin
    //  LoadsDone := 0
      ClearDebug;
      SetupSRL;
      DeclarePlayers;
      ActivateClient;
      LoginPlayer;
      SymbolAccuracy := 0.45;
      if(YourSRLId = '')or(YourSRLPass = '')then
      begin
        SRLId := '6394';
        SRLPassword := 'GwepfLrGMa';
      end;
      Wait(1000);
      MakeCompass('N');
      Setangle(True);
      AntiRandoms;
      Repeat
        SetRun(True);
        WalkToAnvil;
        FindAnvil;
      Until (not (LoggedIn));
      //(LoadsDone=LoadsWanted);
    End.

    I keep getting this error: [Runtime Error] : Exception: in line 46 in script. Here is the line. I really don't understand it.
    SCAR Code:
    Result := CreateTPAFromBMP( GetBitmapDC(TempBMP));

    ~Camo
    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
  •