Page 1 of 3 123 LastLast
Results 1 to 25 of 75

Thread: Simple Goblin Killer

  1. #1
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default Simple Goblin Killer

    Simple Goblin Killer


    This script can be started anywhere in the whole of Runescape, it kills Goblins and even Walks back if you die, perfect for low levels.

    Please let me know any ways that it could be improved or if you think it would be good enough for SRL membership?


    To download see the bottom of this post
    Simba Code:
    //This script kills goblins in lumbridge, It will even walk back if you die. Give me feedback in the forms.

    program GoblinKiller;

      {.include SRL/SRL/Misc/Smart.scar}
      {.include SRL/SRL.scar}
      {$i sps/sps.simba}
      {$i SRL/SRL/Misc/stats.simba}
      {$i SRL/SRL/misc/paintsmart.scar}
      {.include SRL/SRL/Skill/Fighting.scar}

    Var
    ChangePlayerEveryR, BreakEveryR, BreakForR, LastBreaked, LastSwapped, Location, x, y, TimeLast, Time, bones, i, attackedsinceburried, bonesburried, timespentb, TimeLastPainted, z : Integer;
    Lumbridge, Goblins1, Goblins2, Goblins3: TPoint;
    WalkGoblins: TPointArray;
    Colours, BoneColours, PlayersToUse : TIntegerArray;
    Ver, CurStatus : String;
    DoneAntiban, PermissionToLocate, NoMoreBones, PtoLB, LootBones, JustLootBones : Boolean;

    Const
    Version = 4;
    NCPColour1 = 4363920;  //If the script won't fight the goblins then change these
    NCPColour2 = 8029837;
    NCPColour3 = 5994344;
    NCPColour4 = 6516083;
    WaitTime = 2000;       //Wait Time before attacking another NCP
    Tolerance = 3;         //Colour Tolerence
    HowOften = 0;         //How often in seconds should it check the location?   If it gets lost a lot lower this, if it is slow and is always checking location increase this
    INeedHelp = False;     //Do you need help setting this script up?
    SRLStats_User = 'IDoNotHaveAnAccount'; // Your SRL Stats ID (If you dont have one then just leave it as it is)
    SRLStats_Password = '12345abc'; // Your SRL Stats Password (If you dont have one then just leave it as it is)
    TimeSpentBurrying = 10;    //How much of the time should be spent burrying bones? Scale 1 to 10
    ChangePlayerEvery = 60;    //How often should it swap players     +/-5
    BreakEvery = 30;   //Minutes       +/-5
    BreakFor = 10;     //Minutes       +/-5
    ReusePlayers = True;      //Once all the players have been used should it start again or end?
    BoneCol1 = 9343124;
    BoneCol2 = 11777723;


    procedure DeclarePlayers;
    begin

      LootBones := True;              //Loot and bury bones?
      JustLootBones := True;          //Just loot and bury bones? (no combat)                For an explanation of why these aren't constants look here: [url]http://villavu.com/forum/showthread.php?p=863322[/url]

      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name :='';   //use " if you are getting ~
      Players[0].Pass :='';
      Players[0].Nick :='';//3-4 phrase from your name Ex. "ownage" = "nag"
      Players[0].Active := True;


    end;             //no editing required below here...
    Procedure SetBitmaps;
    begin
      bones := BitmapFromString(21, 18, 'meJx9k1lLQmEQhqVf4g8oiCKIbo' +
            'wguu0i2mihbF9tQyRsEdO0PbHEss0WWwxLDGm/if5WDwwMH+dUMBy' +
            'G+Wbe953lVLoaKlz1la6G8po6sbLq2hKHIx4/HBubwtGgmaBGodSa' +
            'CFQdHV96vX4cp7NcIgr1j0kadnGRDQRWpZzv5dV9LJbUV4ESSYjXw' +
            'qenj9u7/MlJBvF+f6DXPSjxQuHt7Ox6fSMWDEZ9vsWJiRmC0qYY+A' +
            'eH6c3NOKQLi8H5+WW+pgAwpRDM5pZ2iYMJUTi8wZPHM4eZCrU2my1' +
            'EIlsqRuIYdAQHBkdlzjc3j5YesWLxEwpBlioxWgZzaGhcM9/fv0HY' +
            '208hFSeff3l9+0Ihc7BgijEKxcTJ5Yqp1Dm9JJOnmUzu4fFZZPf1D' +
            '5PJ6IizFOIQ4Wst88eHiHaYA5msXmRPT3sxBKyE1nlNJI7T57cQ0S' +
            'b6pQvZHbymNlpg/jgjI5Mzsz58EnZ2E/BChG8/G20E2dG1Hab6a9c' +
            'YCs1jFtMrZYAwWqatJtrk8u1Hi7alpVBHZ4+Um2n6v8jhmbVsiplw' +
            'twijX6WWqtIql/0HNMvZCNe7vb3HqBsbm/SPU1K7bwKKcnYEdWtbp' +
            '1n+F6kFTdYHe1e328JuB/kBYKY/7Q==');
    end;

    Procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colour: integer);               //Thanks to BobboHobbo
      var
        mx, my, Pic, I, B, H, Numb: Integer;
        TTP: TPointArray;
        Canvas: TCanvas;
      begin
        SmartSetDebug(True);
        GetClientDimensions(mx, my);
        Pic := BitmapFromString(mx, my, '');
        for I := 0 to High(TP) do
        begin
          TTP := LoadTextTPA(TP[i], SmallChars, H);
          for B := 0 to High(TTP) do
          begin
            Numb := ((I + 1) * 13);
            FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1,8388736);
            FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
          end;
        end;
        Canvas := TCANVAS.Create;
        Canvas.Handle := SmartGetDebugDC;
        DrawBitmap(Pic, Canvas, Placement.x, Placement.y);
        FreeBitmap(Pic);
      end;

    Procedure Paint;
    begin
      If((GetTimeRunning-TimeLastPainted)>5000) then
      begin
        PrintOnSmart(['Status:', CurStatus ], Point(42, 45), 16695040);
        PrintOnSmart(['this script was written by putonajonny'], Point(270,359),16695040);
        PrintOnSmart(['Time Running (Perodically Updated)',TimeRunning],Point(563,424),16695040);

        TimeLastPainted := GetTimeRunning
      end;
    end;

    function FindHPBars(Sx, Sy, x1, y1, x2, y2: Integer): TBoxArray;               //this function is an exact copy of FindAllHPBars except the colours needed changing
    var
      a, b : TPointArray;
      ATPA : T2DPointArray;
      H, I : Integer;
    begin
      FindColorsSpiralTolerance(Sx, Sy, a, 524473, x1, y1, x2, y2, 0);
      FindColorsSpiralTolerance(Sx, Sy, b, 51867, x1, y1, x2, y2, 0);
      ATPA := TPAToATPAEx(CombineTPA(a, b), 55, 7);
      H := High(ATPA);
      SetLength(Result, Length(ATPA));
      for I := 0 to H do
        Result[i] := GetTPABounds(ATPA[i]);
    end;
    function GetHits(Sx, Sy, x1, y1, x2, y2: Integer): TIntegerArray;              //this function is an exact copy of GetHitsIn but i needed to make it call FindHPBars not FindAllHPBars

    var
       E: Extended;
       I, H: Integer;
       TBA : TBoxArray;
    begin
      TBA := FindHPBars(Sx, Sy, x1, y1, x2, y2);
      SetArrayLength(Result, GetArrayLength(TBA));
      H := High(TBA);
      for I := 0 To H Do
      begin
        E := CountColorTolerance(56488, TBA[i].x1, TBA[i].y1, TBA[i].x2, TBA[i].y2, 43) / 60;
        Result[i] := Round(100 * E);
      end;
    end;

    function IsFighting(Tolerance : Integer) : Boolean;                            //My function
    var
      Hits : TIntegerArray;
      HP : Integer;
    begin
      Result := False
      Hits := GetHits(253, 99, 0, 0, 764, 502);

      if GetArrayLength(Hits) = 0 then
        Exit;

      HP := HPPercent
      Result := ((HP-Tolerance) < Hits[0]) and ((HP+Tolerance) > Hits[0]);

      if (GetArrayLength(Hits) > 1) and (not Result) then
        Result := ((HP-Tolerance) < Hits[1]) and ((HP+Tolerance) > Hits[1]);
    end;

    Procedure CheckVersion;
    Begin
      CurStatus := 'Checking that you are running the most recent version'
      Ver := GetPage('http://goblinkiller.webuda.com/Ver');
      If Version = StrToInt(Ver) then
        begin
          WriteLn('You are using the most up to date version -Thank you');
        end else
          begin
            If Version > StrToInt(Ver) then
            begin
              WriteLn('**You seem to be useing some sort of beta version, be careful')
            end else
            begin
              ClearDebug;
              WriteLn('Please Update This Script, opening web page...');
              OpenWebPage('http://goblinkiller.webuda.com/Redirect');
              TerminateScript;    //Comment out this to use this version anyway
            end;
          end;
    End;
    Procedure CheckRandoms;
    begin
    CurStatus := 'Checking for Randoms'
    Paint;
    FindNormalRandoms;
    If Not(LoggedIn) Then
      begin
        WriteLn('I think we failed a random - I will just Check');
        LoginPlayer;
        FindNormalRandoms;
        If Not(LoggedIn) Then
          begin
            WriteLn('Client has Logged Out So Probably Failed a Random - Terminating Script');
            TerminateScript;
          end
      end;
    end;
    Procedure CheckLocation;
    begin
      If((GetTimeRunning<60000) or ((GetTimeRunning-TimeLast)>HowOften*1000) or (PermissionToLocate)) then
      begin
        CurStatus := 'Checking Location'
        Paint;
        Wait(4000+Random(2000))
        Location := 2;
        if (SPS_PosOnMM(Lumbridge)) then
        Location := 0; //lumbridge
        if (SPS_PosOnMM(Goblins1)) or (SPS_PosOnMM(Goblins2)) or (SPS_PosOnMM(Goblins3)) then
        Location := 1; //Goblins
        TimeLast := GetTimeRunning
      end;
    end;
    Procedure WalkToGoblins;
    begin
      CurStatus := 'Walking to Goblins'
      Paint;

      WalkGoblins := [Point(4708, 3767), Point(4733, 3767), Point(4753, 3761), Point(4759, 3743), Point(4748, 3723),
                      Point(4731, 3707), Point(4717, 3693), Point(4710, 3676), Point(4698, 3677), Point(4675, 3674),
                      Point(4648, 3678), Point(4625, 3675), Point(4598, 3677), Point(4580, 3676), Point(4565, 3676), Point(4565, 3650)]

      If(SPS_WalkPath(WalkGoblins)) then
      WriteLn('At Goblins');
    end;
    Procedure RectifyLocation;
    begin
      CurStatus := 'Rectifying Location'
      Paint;
      Mouse(254, 309, 10, 5, true);
      Wait(250+Random(250));
      Mouse(544, 24,5,5,true);

      If (FindSymbol( x, y, 'fishing shop')) then    //attempt 1
      begin
        WriteLn('using fishing shop to fix location')
        CurStatus := 'using fishing shop to fix location'
        Paint;
        Wait(500+Random(200));
        x := x-43
        y := y-5
        Mouse(x, y,5,5,true);
        Wait(2000+Random(2000));
      end;

      If (FindSymbol( x, y, 'dungeon')) then         //attempt 2
      begin
        WriteLn('using dungeon to fix location')
        CurStatus := 'using dungeon to fix location'
        Paint;
        Wait(500+Random(200));
        x := x+66
        y := y+7
        Mouse(x, y,2,2,true);
        Wait(2000+Random(2000));
      end;

      If (FindSymbol( x, y, 'fish')) then           //attempt 3
      begin
        WriteLn('using fishing spot to fix location')
        CurStatus := 'using fishing spot to fix location'
        Paint;
        Wait(500+Random(200));
        x := x+59
        y := y+68
        Mouse(x, y,2,2,true);
        Wait(2000+Random(2000));
      end;

      If (FindSymbol( x, y, 'water')) then           //attempt 4
      begin
        WriteLn('using water to fix location')
        CurStatus := 'using water to fix location'
        Paint;
        Wait(500+Random(200));
        x := x-45
        y := y+87
        Mouse(x, y,2,2,true);
        Wait(2000+Random(2000));
      end;

      If (FindSymbol( x, y, 'churn')) then           //attempt 5
      begin
        WriteLn('using churn to fix location')
        CurStatus := 'using churn to fix location'
        Paint;
        Wait(500+Random(200));
        x := x-52
        y := y+108
        Mouse(x, y,2,2,true);
        Wait(2000+Random(2000));
      end;

      PermissionToLocate := True
      CheckLocation;

      case location of                  //final attempt
        2: begin
             Mouse(626,152,2,2,True)
             Wait(2000+Random(1000));
           end;
      end;

      PermissionToLocate := True
      CheckLocation;

      case location of
          2:
            begin
               Writeln('Location Not Recognised - Lets Teleport Home')
               GameTab(tab_Magic)
               Wait(1000+Random(500))
               Mouse(575, 230, 5, 5, true)
               Time := GetTimeRunning;
             Repeat
               Wait(2000+Random(500));
               If((GetTimeRunning - Time) > 15000) and (Not SPS_PosOnMM(Lumbridge)) then
                 begin
                   GameTab(tab_Magic)
                   Wait(1000+Random(500))
                   Mouse(575, 230, 5, 5, true)
                   Time := GetTimeRunning;
                 end;
             Until(SPS_PosOnMM(Lumbridge));
             PermissionToLocate := True;
             Wait(2000+Random(1000))
            end;
      end;

    end;
    Procedure Attack;
    begin
      CurStatus  := 'Attacking'
      Paint;
      If (FightNPC(Colours, Tolerance, WaitTime)) then
      stats_IncVariable('Monsters Killed', 1)
      else
      SetAngle(True);
      DoneAntiban := False;
      attackedsinceburried := attackedsinceburried + 1
      If (attackedsinceburried>(10-TimeSpentBurrying)) then
      begin
        PtoLB := True;
        attackedsinceburried := 0
      end;
    end;
    Procedure AntiBan;
    begin
        CurStatus := 'Antiban'
        Paint;
        If Not(DoneAntiban) then
        begin
          x := Random(51)
          case x of
            0: HoverSkill('Attack', False);                   //Beautiful Antiban
            1: HoverSkill('Strength', False);
            2: HoverSkill('Defence', False);
            3: HoverSkill('hitpoints', False);
            4: HoverSkill('smithing', False);
            5: HoverSkill('woodcutting', False);
            6: HoverSkill('firemaking', False);
            7: HoverSkill('magic', False);
            8: HoverSkill('woodcutting', False);
            9: HoverSkill('fishing', False);
            10: HoverSkill('prayer', False);
            11: HoverSkill('runecrafting', False);
            12..15: PickUpMouse;
            16..25: RandomMovement;
            26..27: RandomRClick;
            28..32: BoredHuman;
            33: ExamineInv;
            34: RandomAngle(True);
            35..48: Wait(1000+random(1000));
            49..50: Wait(1000+Random(20000));
          end;
        DoneAntiban := True;
        Wait(2000+Random(500));
        end;
    end;
    Procedure Rest;
    begin
      If(TimeFromMark(LastBreaked) > (BreakEveryR*60000)) then
      begin
        WriteLn('Breaking For '+IntToStr(BreakForR)+' Minutes')
        If(LoggedIn) then
          Logout;
        Wait(BreakForR*60000);
        BreakEveryR := BreakEvery - 5 + Random(10);
        BreakForR := BreakFor - 5 +Random(10);
        WriteLn('Break Done!')
        WriteLn('We will break in '+IntToStr(BreakEveryR)+' minutes, for '+IntToStr(BreakForR)+' minutes.')
        LogInPlayer;
        MarkTime(LastBreaked)
      end;
    end;
    Procedure BuryBones;
    begin
      CurStatus  := 'Burying Bones'
      Paint;
      TimeSpentB := TimeSpentBurrying;
      GameTab(25);
      for i := 1 to 28 do
      begin
        If (ExistsItem(i)) then
        begin
          Repeat
            InvMouse(i, 3);
            If(WaitUptextMulti(['ury','one'],1000)) then
              begin
                ClickMouse2(True);
                bonesburried := bonesburried + 1;
                stats_IncVariable('Bones (Burried)',1);
              end;
            Wait(500+Random(800));
          Until(not ExistsItem(i) or not(WaitUptextMulti(['ury','one'],1000)))
        end;
      end;
    end;
    Procedure Loot;
    begin
      CurStatus  := 'Looting'
      Paint;
      BuryBones;
      If((LootBones and PtoLB) or (JustLootBones)) then
        begin
          for i := 0 to High(BoneColours) do
          begin
            IF(FindColorTolerance(x, y, BoneColours[i], 0, 0, 516, 338, 10)) then
            begin
              Wait(400+Random(200))
              Mouse( x, y, 2, 2, False);
              If (WaitOption('one', 2000)) then
                stats_IncVariable('Bones (Collected)',1);
              BuryBones;
            end;
          end;
          Wait(3000+Random(500));
        end;
    end;
    Procedure BonesProgress;
    begin
      CurStatus := 'Progress Report'
      Paint;
      If((((GetTimeRunning-Time)>15000) and (JustLootBones)) or ((GetTimeRunning-Time)>60000)) then
      begin
      WriteLn('')
      WriteLn('')
      WriteLn('[-------------------------------------------------------------------------------]');
      WriteLn('[' + padr(padl('Bone Burrier by Putonjonny', 38 + Length('Bone Burrier by Putonjonny') / 2), 79) + ']');
      WriteLn('[-------------------------------------------------------------------------------]');
      WriteLn(PadR('[  Time Running: ' + TimeRunning, 80) + ']');
      WriteLn(PadR('[  Bones Burried: ' + IntToStr(bonesburried), 80) + ']');
      Writeln('[-------------------------------------------------------------------------------]');
      WriteLn('')
      Time := GetTimeRunning;
      end;

    end;
    Procedure ChangePlayer;
    begin
      MarkTime(LastSwapped)
      z := z+1
      If(LoggedIn) then
        Logout;
      if(z = GetArrayLength(PlayersToUse)) then
      begin
      case ReusePlayers of
      True: z := 0;
      False: begin
               WriteLn('****All players Used and ReusePlayers is False so Ending Script****')
               TerminateScript;
             end;
      end;
      end;
      SwitchToPlayer(PlayersToUse[z],ReusePlayers)
      Repeat
        LoginPlayer;
        Wait(2000);
      Until(LoggedIn)

      ChangePlayerEveryR := ChangePlayerEvery - 5 + Random(10)
      WriteLn('We will change players again in '+IntToStr(ChangePlayerEveryR)+' minutes.')

    end;
    Procedure OpenHelpPage;
    begin
      ClearDebug;
      WriteLn('You have not uncommented lines 11 and 44 or you have not setup the script correctly')
      Wait(1000+Random(100));   //why have I put a random on this :S
      WriteLn('You obvoiusly need some help...')
      Wait(1000+Random(100));
      WriteLn('Reaching out for help...')
      Wait(1000+Random(100));
      WriteLn('I cant find any...')
      Wait(1000+Random(100));
      WriteLn('It seems that nobody can help you now...')
      Wait(1000+Random(100));
      WriteLn('Oh wait...')
      Wait(1000+Random(100));
      WriteLn('Here we go... :)')
      Wait(1000+Random(100));
      OpenWebPage('http://putonajonnyscripts.hostoi.com/Help.htm')
      WriteLn('')
      WriteLn('')
      WriteLn('')
      Wait(250)
      WriteLn('To Clarify: You have not uncommented lines 11 and 44 or you have not setup the script correctly.')
      WriteLn('Please set up script again then restart.')
      WriteLn('The Webpage that Just Opened should help.')
      TerminateScript;
    end;

    Procedure EndScript;
    begin
      BonesProgress;
      Status('Goodbye... I will miss you :(')
      WriteLn('Goodbye...')
      WriteLn('Script Ran For: '+TimeRunning)
      FreeBitmap(3)
    end;

    begin
      ClearDebug;
      If (IneedHelp) then
        begin
          WriteLn('Opening Help Page');
          OpenWebPage('http://goblinkiller.webuda.com/Help');
          TerminateScript;
        end;

      CheckVersion;

      AddOnTerminate('EndScript');

      CurStatus := 'Setting Up'
      Lumbridge := Point(4706, 3767);
      Goblins1 := Point(4570, 3650);
      Goblins2 := Point(4570, 3650);
      Goblins3 := Point(4570, 3650);
      Colours := [NCPColour1,NCPColour2,NCPColour3,NCPColour4];
      BoneColours := [BoneCol1, BoneCol2, 9737883, 12962254,13159633,13948382,11974847,9803164,9671578,8421510,14211810];
      bonesburried := 0;
      z := 0
      ChangePlayerEveryR := ChangePlayerEvery - 5 + Random(10)
      BreakEveryR := BreakEvery - 5 + Random(10)
      BreakForR := BreakFor - 5 + Random(10)

      Smart_Server := 11;
      Smart_Members := False;
      Smart_Signed := False;
      Smart_SuperDetail := False;
      SetupSRL;
      SetupSRLStats(305, SRLStats_User, SRLStats_Password);
      cleardebug;
      Paint;
      WriteLn('***************Goblin Killer by Putonajonny Version '+IntToStr(Version)+'***************');
      CheckVersion;
      SetBitmaps;


      DeclarePlayers;

      LoginPlayer;
      WriteLn('We will break in '+IntToStr(BreakEveryR)+' minutes, for '+IntToStr(BreakForR)+' minutes.');
      WriteLn('We will change players in '+IntToStr(ChangePlayerEveryR)+' minutes.')

      SPS_Areas := ['11_9'];
      SPS_Setup(RUNESCAPE_SURFACE, SPS_Areas);

      MarkTime(LastSwapped);
      MarkTime(LastBreaked);

      If (JustLootBones) then
      begin
        SetAngle(True)
        Repeat
          If(TimeFromMark(LastSwapped)>(60000*ChangePlayerEveryR)) then
            ChangePlayer;
          Loot;
          BonesProgress;
          CheckRandoms;
          Stats_Commit;
        Until(false)
      end;

      Repeat
        If(TimeFromMark(LastSwapped)>60000*ChangePlayerEveryR) then
          ChangePlayer;
        Rest;
        Paint;
        SetAngle(True);
        CheckRandoms;
        Rest;
        Stats_Commit;
        CheckLocation;
        case location of
          0: WalkToGoblins;
          1:begin
              Loot;
              If(bonesburried>0) then
                BonesProgress;
              If(isfighting(10)) then
                AntiBan
              else
                Attack;
            end;
          2: RectifyLocation;
          else
            RectifyLocation;
        end;
      until(false)
    end.
    Last edited by putonajonny; 12-31-2011 at 01:14 PM.

  2. #2
    Join Date
    Oct 2011
    Location
    Chicago
    Posts
    3,352
    Mentioned
    21 Post(s)
    Quoted
    437 Post(s)

    Default

    I think its a good script, much better than what I could put out at this stage

    Try to get some professional options though perhaps IRC.
    Then apply! :P




    Anti-Leech Movement Prevent Leeching Spread the word
    Insanity 60 Days (Killer workout)
    XoL Blog (Workouts/RS/Misc)

  3. #3
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by R4nd0m View Post
    I think its a good script, much better than what I could put out at this stage

    Try to get some professional options though perhaps IRC.
    Then apply! :P
    Thanks very much

  4. #4
    Join Date
    Oct 2011
    Location
    Chicago
    Posts
    3,352
    Mentioned
    21 Post(s)
    Quoted
    437 Post(s)

    Default

    Could you actually explain how you put in the home teleport function, looks like a great failsafe.

    Like what is this

    Simba Code:
    Mouse(254, 309, 10, 5, true);
      Wait(500+Random(500));
      Mouse(544, 24,5,5,true);
      Wait(1000+Random(200))

    I remember reading something about large numbers near mouse something about a map?
    If so how did you create it?




    Anti-Leech Movement Prevent Leeching Spread the word
    Insanity 60 Days (Killer workout)
    XoL Blog (Workouts/RS/Misc)

  5. #5
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Mouse is a procedure that moves the mouse cursor to the coordinate specified. Great first script, very creative.
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

  6. #6
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by R4nd0m View Post
    Could you actually explain how you put in the home teleport function, looks like a great failsafe.

    Like what is this

    Simba Code:
    Mouse(254, 309, 10, 5, true);
      Wait(500+Random(500));
      Mouse(544, 24,5,5,true);
      Wait(1000+Random(200))

    I remember reading something about large numbers near mouse something about a map?
    If so how did you create it?
    If you look at this procedure :
    Simba Code:
    Procedure CheckLocation;
    begin
      Wait(4000+Random(2000))
      Location := 2;
      if (SPS_PosOnMM(Lumbridge)) then
      Location := 0; //lumbridge
      if (SPS_PosOnMM(Goblins1)) or (SPS_PosOnMM(Goblins2)) or (SPS_PosOnMM(Goblins3)) then
      Location := 1; //Goblins
    end;

    What that does is tries to find the current location, if it is at lumbridge castle it returns 0 if it is at the goblins it returns 1 and if it is at neither/can't detect the location it returns 2, then in my main loop you will see:




    Simba Code:
    case location of
          0: WalkToGoblins;
          1: Attack;
          2: RectifyLocation;
          else
            RectifyLocation;
        end;
    What this does is checks for that number, if it is 0 (i.e. at lumbridge castle) then it walks to the goblins, if it is 1 (i.e. at the goblins) then it starts attacking, if it is 2 or any other number then it attempts to 'rectify location'.



    Simba Code:
    Procedure RectifyLocation;
    begin
      Mouse(254, 309, 10, 5, true);
      Wait(500+Random(500));
      Mouse(544, 24,5,5,true);
      Wait(1000+Random(200));
      If (FindSymbol( x, y, 'fishing shop')) then
      begin
        x := x-43
        y := y-5
        Mouse(x, y,5,5,true);
        Wait(2000+Random(2000));
      end;

      CheckLocation;

      case location of
          2:
            begin
              Writeln('Location Not Recognised - Lets Teleport Home')
              Mouse(748, 187,5,5,true)
              Wait(1000+Random(500))
              Mouse(575, 230, 5, 5, true)
              Wait(16000+Random(2000))
            end;
      end;

    This is the attempt to rectify the location:



    Simba Code:
    Mouse(254, 309, 10, 5, true);
    this clicks continue just incase you have died,


    Simba Code:
    Mouse(544, 24,5,5,true);
    This aligns the map to north,


    Simba Code:
    If (FindSymbol( x, y, 'fishing shop')) then
      begin
        x := x-43
        y := y-5
        Mouse(x, y,5,5,true);
        Wait(2000+Random(2000));
      end;
    This looks for the symbol of the fishing shop, if it finds it it performs some calculations to work out the co-ordinates of the goblin hill and then clicks on it, it then checks the location again, if it still doesn't know where it is then it teleports home. Once there it will walk to the goblins again.

  7. #7
    Join Date
    Oct 2011
    Location
    Chicago
    Posts
    3,352
    Mentioned
    21 Post(s)
    Quoted
    437 Post(s)

    Default

    Ah I see! Thank you
    +Rep




    Anti-Leech Movement Prevent Leeching Spread the word
    Insanity 60 Days (Killer workout)
    XoL Blog (Workouts/RS/Misc)

  8. #8
    Join Date
    Nov 2011
    Location
    ireland
    Posts
    71
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    dose your script work in lumby?

  9. #9
    Join Date
    Oct 2011
    Location
    Chicago
    Posts
    3,352
    Mentioned
    21 Post(s)
    Quoted
    437 Post(s)

    Default

    Quote Originally Posted by i hate fagex View Post
    dose your script work in lumby?
    Yes...
    All of the code is based for Lumbridge.




    Anti-Leech Movement Prevent Leeching Spread the word
    Insanity 60 Days (Killer workout)
    XoL Blog (Workouts/RS/Misc)

  10. #10
    Join Date
    Nov 2011
    Location
    ireland
    Posts
    71
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by R4nd0m View Post
    Yes...
    All of the code is based for Lumbridge.
    Sweet Dude!

  11. #11
    Join Date
    Nov 2011
    Location
    ireland
    Posts
    71
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Error: Out Of Range at line 142. what is this ?
    Last edited by TrLoLoLoL; 11-29-2011 at 11:21 PM.

  12. #12
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Make sure your SRL is updated to the latest revision, please.

    Quote Originally Posted by i hate fagex View Post
    [Error] (204:9): Unknown identifier 'Mouse' at line 203 i got this error when i went to go and get something to eat what is this ??

  13. #13
    Join Date
    Nov 2011
    Location
    ireland
    Posts
    71
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Error: Out Of Range at line 142

  14. #14
    Join Date
    Oct 2011
    Location
    Chicago
    Posts
    3,352
    Mentioned
    21 Post(s)
    Quoted
    437 Post(s)

    Default

    I wish I knew what that was as well I get it in my script too




    Anti-Leech Movement Prevent Leeching Spread the word
    Insanity 60 Days (Killer workout)
    XoL Blog (Workouts/RS/Misc)

  15. #15
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by R4nd0m View Post
    I wish I knew what that was as well I get it in my script too
    Please use the debug version and then post the full error box

  16. #16
    Join Date
    Oct 2010
    Posts
    44
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    can you maby make also a fighting script for cows?


    sorry for my bad english im dutch:P

  17. #17
    Join Date
    Dec 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is a great script, I'm new here and so far it's the best one I found to train fighting in low level chars. It could be improved a lot though. Please keep working on it !

  18. #18
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by sander70 View Post
    can you maby make also a fighting script for cows?


    sorry for my bad english im dutch:P
    Yes I could, would you want it looting though? that would make it a bit harder, PM me about this

    Quote Originally Posted by sickboy84 View Post
    This is a great script, I'm new here and so far it's the best one I found to train fighting in low level chars. It could be improved a lot though. Please keep working on it !
    Thanks, what improvements do you think would be good?

  19. #19
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

    nice first script

    Simba Code:
    4: HoverSkill('smithing', False);
          5: HoverSkill('woodcutting', False);
          6: HoverSkill('firemaking', False);
          7: HoverSkill('magic', False);
          8: HoverSkill('woodcutting', False);
          9: HoverSkill('fishing', False);
          10: HoverSkill('prayer', False);
          11: HoverSkill('runecrafting', False);
    dont realy see the point would just slow the script down as your not even training these skills

  20. #20
    Join Date
    Dec 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by putonajonny View Post
    Thanks, what improvements do you think would be good?
    • Fixing this error:

      Code:
      Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
      Although is isn't a big problem, it could affect performance.
    • Detecting the goblins even faster.
    • And of course, you could always reuse your script to match things other than goblins, like cow, rats, etc.

  21. #21
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Version 2 Submitted, added a few more features.

  22. #22
    Join Date
    Dec 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Really really great script. And lessing the random waits a bit makes much more efficient (although more prone to a ban).

    Can you remake it for other stuff like cows, giant rats, minotaurs, etc.?

  23. #23
    Join Date
    Aug 2007
    Location
    Marijuanaville USA
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I agree with sickboy, this is a wonderful script coded beautifully for a beginner. +1 for a first script. I also agree that a cow killer would be useful, and seeing your comment about looting, would be a nice update if you were to initially release the cow killer itsself, then later an option to bank hides or even hides bones and raw beef.

  24. #24
    Join Date
    Dec 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    IT wont attack the goblins or anything

  25. #25
    Join Date
    Dec 2011
    Posts
    58
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    How exactly do you uncomment 11 and 44?

Page 1 of 3 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
  •