Results 1 to 8 of 8

Thread: (FirstScript)Goblin Decimator!

  1. #1
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default (FirstScript)Goblin Decimator!

    My first script

    Please test and review version 0.1!






    Code:
    program GoblinDecimator;
    
    {$DEFINE SMART}
    {$i SRL/srl.simba}
    
    
      Const
    
    //SRL Stats
      SRLStats_Username = '';
      SRLStats_Password = '';
    
    //Break settings
      BreakIn      = 180;          //How long before we take a break? (minutes)
      BreakFor     = 13;           //How long will we break for? (minutes)
      Bir          = 7;           //Random minutes to add/subtract from how long until we break
      Bfr          = 3;            //Random minutes to add/subtract from break duration
    
      Procedure DeclarePlayers;
      begin
        HowManyPlayers := 1;
        NumberOfPlayers(HowManyPlayers);
        CurrentPlayer := 0;
        with Players[0] do
        begin
          Name        := '';
          Pass        := '';
          Pin         := '';
          BoxRewards  := ['XP','xp','lamp'];
          LampSkill   := Skill_Runecrafting;
          Active      := True;
        end;
      end;
    
     procedure StatsGuise(wat:String);
    Begin
      Status(wat);
      Disguise(wat);
    End;
    
    
    Procedure Antiban;
    Begin
      Case Random(192) Of
        0: HoverSkill('Attack', False);
        1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
        2: RandomAngle(1);
        3: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
        4: HoverSkill('random', False);
        5: HoverSkill('Defense', False);
        6: HoverSkill('Constitution', False);
        7: HoverSkill('Strength', False);
      End;
    End;
    
    Procedure FailSafe(Reason:String);
    begin
      Players[CurrentPlayer].Loc:=Reason;
      Logout;
      TerminateScript;
    end;
    
    
    function InFight: Boolean;
    begin
      Result := srl_InFight;
    end;
    
    Function AttackGoblins:Boolean;
    Var
      x,y:Integer;
    begin
      SetAngle(SRL_ANGLE_HIGH);
      if InFight then
      begin
        repeat
          FindNormalRandoms;
        until ((not LoggedIn) or (not InFight))
        end;
    If FindObjEx(x,y, ['Attack'], [4430477, 4033671, 1858905, 3253129], 10, 50, 1, 5, 690, 400) then
      Begin
      StatsGuise('Attacking Goblin');
      GetMousePos(x,y);
    
        Case Random(1) of
         1:begin
             Mouse(x,y,5,5,True);
             ChooseOption('Attack')
         end;
     End;
    End;
    end;
    
    
    
    begin
    SetupSRL;
      DeclarePlayers;
      SetAngle(SRL_ANGLE_HIGH)
      if not (LoggedIn) then
      LoginPlayer;
      Wait(4000+random(400))
    
      repeat
        Antiban;
        AttackGoblins;
      until(false);
    
    end.


    Credit to Gucci for goblin finding method.
    Last edited by Joepetey; 04-22-2012 at 11:37 PM. Reason: Credit

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

    Default

    Nice script, you considered adding banking for the low levels, it could be a great way to train new leveled accounts?

  3. #3
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you for testing, were there any bugs?
    Im gonna add banking as soon as I learn how to, but its harder than it looks.

  4. #4
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    Banking isn't really needed and here they do the same thing:

    Simba Code:
    Case Random(2) of
         0:Mouse(x,y,5,5,True); // This left clicks
         1:begin
             Mouse(x,y,5,5,True); // This left clicks
             ChooseOption('Attack')

    Also this is straight out of my script

    Simba Code:
    If FindObjEx(x,y, ['Attack'], [4430477, 4033671, 1858905, 3253129], 10, 50, 1, 5, 690, 400) then

    You only changed the tolerance.... same colors and other parameters etc, some credits maybe?
    Current Project: Retired

  5. #5
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry forgot to credit you just have been really busy. Will do right now and thanks for the tip.

  6. #6
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by Joepetey View Post
    Sorry forgot to credit you just have been really busy. Will do right now and thanks for the tip.
    Yeah no problem and thanks for the credit also you have breaking constants at the top of your script that aren't used might as well delete those
    Current Project: Retired

  7. #7
    Join Date
    Nov 2011
    Location
    MA
    Posts
    545
    Mentioned
    3 Post(s)
    Quoted
    10 Post(s)

    Default

    Here's a version with fixed up standards to make it easier to read. Also, the result is not used from your AttackGoblins: boolean;
    Simba Code:
    program GoblinDecimator;

    {$DEFINE SMART}
    {$i SRL/srl.simba}


    Const

      //SRL Stats
      SRLStats_Username = '';
      SRLStats_Password = '';

    {Break settings
      BreakIn      = 180;          //How long before we take a break? (minutes)
      BreakFor     = 13;           //How long will we break for? (minutes)                                //not used
      Bir          = 7;           //Random minutes to add/subtract from how long until we break
      Bfr          = 3;            //Random minutes to add/subtract from break duration    }


    Procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      with Players[0] do
      begin
        Name        := '';
        Pass        := '';
        Pin         := '';
        BoxRewards  := ['XP','xp','lamp'];
        LampSkill   := Skill_RUNECRAFTING;
        Active      := True;
      end;
    end;

    Procedure StatsGuise(wat:String);
    Begin
      Status(wat);
      Disguise(wat);
    End;

    Procedure Antiban;
    Begin
      Case Random(192) Of
        0: HoverSkill('Attack', False);
        1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
        2: RandomAngle(1);
        3: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
        4: HoverSkill('random', False);
        5: HoverSkill('Defense', False);
        6: HoverSkill('Constitution', False);
        7: HoverSkill('Strength', False);
      End;
    End;

    Procedure FailSafe(Reason:String);
    begin
      Players[CurrentPlayer].Loc := Reason;
      Logout;
      TerminateScript;
    end;

    Function InFight: Boolean;
    begin
      Result := srl_InFight;
    end;

    Function AttackGoblins:Boolean;
    Var
      x, y:Integer;
    begin
      SetAngle(SRL_ANGLE_HIGH);
      if InFight then
      begin
        repeat
          FindNormalRandoms;
        until (not LoggedIn) or (not InFight);
      end;
      If FindObjEx(x,y, ['Attack'], [4430477, 4033671, 1858905, 3253129], 10, 50, 1, 5, 690, 400) then
      Begin
        StatsGuise('Attacking Goblin');
        GetMousePos(x,y);
        Case Random(1) of
          1 :
          begin
            Mouse(x, y, 5, 5, mouse_right);
            ChooseOption('Attack');
          end;
        End;
      End;
    end;


    begin
      SetupSRL;
      DeclarePlayers;
      SetAngle(SRL_ANGLE_HIGH)
      if not (LoggedIn) then
        LoginPlayer;
      Wait(4000 + Random(400));
      repeat
        Antiban;
        AttackGoblins;
      until(false);
    end.

    P.S. Great job on your first script!

  8. #8
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you for testing, and thanks for fixing it up for me

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
  •