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

Thread: PowerGoblins 6.2

  1. #1
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default PowerGoblins 6.2

    Well I made this goblin killer script mainly for leveling my Pure Autoed Pure, since chickens are a bit crowded and not so good XP after 20 str and attack.

    This script has got an auto-eater for the few most popular f2p foods for eating while autofighting, which I think are: Meat, Chicken, Trout, Cod and Salmon.

    No point in eating lobster or swordfish while fighting goblins.

    Caution: Goblin hut is not a good place to use this script, even there are failsafes, it's pretty stupid when you get a "false flag", that there is a flag but your char wont walk.

    I suggest to use it in the Stronghold of Security underneath Barbarian Village, where are 5-13 levels in one room and about 20 lvl ones in another room, so there is plenty of choice for varying levels.

    It is very rare, but sometimes it might attack two goblins at the sametime, so

    a) Make sure the timeout you have set in Const is high enough.
    b) Your char isn't supposed to be like lvl 10 while using this script, defence should be atleast 5 or more.


    It's still in quite a beta stage, the 6.2 in the name just looks cool, so report possible bugs/ flaws and post improvements.

    No bone burying, it's for noobs, and asking for item pickup is useless.


    Place your players near goblins and hit run.

    I had a test run yesterday, worked as supposed to, Good Luck & Have Fun.



    SCAR Code:
    Program PowerGoblins;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/Skill/Fighting.scar}


    Const MonsterTime = 35000;
    Const AmountGoblins = 40;
    Const MultiCombatArea = False;


    Type
      FightStyle = (Accurate, Agressive, Shared, Defence);


    Var
      Styles: Array of FightStyle;

    Var
      Meat, Chicken, Trout, Cod, Salmon, Hit, Killed: Integer;

    Var
      gHP: Extended;


    Procedure DeclarePlayers;
    Begin

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

      SetArrayLength(Styles, HowManyPlayers);

      Players[0].Name := 'Username';
      Players[0].Pass := 'Password';
      Players[0].Nick := 'ser';
      Players[0].Booleans[0] := True;   // Eat?
      Players[0].Strings[0] := '';      // Food name, if any, valid listed below.

      // Valid foods: Meat, Chicken, Trout, Cod, Salmon.

      Players[0].Active := True;

      Styles[0] := Agressive; // Accurate, Agressive, Controlled, Defence

    End;


    Procedure LoadDTMs;
    Begin

      Meat := DTMFromString('78DA6374616060486340017DE18E0CCA409A1' +
           '188FF0301A3399091CE8006189148206D05241209A87104127104' +
           'D478008930026A7C814408013541402286801A7F209142408D379' +
           '0C826A0C61D48141050E340841A6B2091875F0D005CFC0D51');

      Chicken := DTMFromString('78DA6374626060B8C58002DA8304189481342' +
           '310FF0702460B20E31E031A60442281B41D907840408D0790B84F' +
           '408D1FA67B30D4F80289CB04D4F803897344987392801A7722D4D' +
           '80389F304D45803894B04D4580289AB04D498110E1F00B0FF136A' +
           '');

      Trout := DTMFromString('78DA6374666060D8C280027A4AF2199481342' +
           '310FF0702467320630F031A60442281B435116A4076ED22A0C60D' +
           '486C23A0C60B486C22A0C60F48AC23A0260848AC26A0C607482C2' +
           '7A0C61F482C2142CD4A026A5C80C40A026AEC81C47A026AAC80C4' +
           '66026ACC80C44EFC6A005BFA141E');

      Cod := DTMFromString('78DA6374626060E86440010DCB0A189481342' +
           '310FF0702460B206322031A60442281B42B90E825A0C61D487411' +
           '50E30524DA09A8090012F504D404813C42408D3F90A824A0C6930' +
           '8735C89708F0B90A825A0C60A48741050630624FAF1AB0100FDCB' +
           '1022');

      Salmon := DTMFromString('78DA6374666060E060644006373CA51994813' +
           '448F43F10309A0319BCA86A20B2301248DB020941026A5C81041F' +
           '0135EE40828B801A3F20C14C404D10320F871A7F20F18F01BF9A0' +
           '020F19B81B0393F09A8F122C22E50F8301270B30B90F8CB40382E' +
           'D80898638519EFE86A00E1A40EEA');

    End;


    Procedure ProgressReport;

    Var
       H, M, S, I: Integer;
       GpM: Extended;
    Begin
      ConvertTime(GetTimeRunning, H, M, S);
      Writeln('||---------------------------------------------------||');
      Writeln('||------------------Progress Report------------------||');
      Writeln(Padr('|| Ran for '+IntToStr(H)+' hours, '+IntToStr(M)+' mins, '+IntToStr(S)+' sec.', 52) + ' ||');
      Killed := Killed + Hit;
      Hit := 0;
      Writeln(Padr('|| Goblins killed: '+IntToStr(Killed), 52) +' ||');
      GpM := H * 3600000 + M * 60000 + S * 1000;
      GpM := GpM / 60000;
      GpM := Killed / GpM;
      Writeln(Padr('|| Goblins per minute: '+FloatToStr(GpM), 52) +' ||');
      Writeln('||---------------------------------------------------||');
      Writeln('|| Thank you for using n3s'' PowerGobliner.          ||');
      Writeln('||---------------------------------------------------||');
    End;


    Function FindGoblin(Var X, Y: Integer): Boolean;

    Var
       CTS, I, C: Integer;
    Begin
      X := MSCX;
      Y := MSCY;
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      For I := 0 To 2 Do
      Begin
        Case I of
          0: C := 4040609;
          1: C := 4483121;
          2: C := 2715756;
        End;
        If FindColorSpiralTolerance(X, Y, C, MSX1, MSY1, MSX2, MSY2, 12) Then
          If CountColorTolerance(C, X - 5, Y - 5, X + 5, Y + 5, 10) >= 6 Then
          Begin
            Result := True;
            Break;
          End;
      End;
      ColorToleranceSpeed(CTS);
    End;


    Function Check(X, Y, Rx, Ry: Integer): Boolean;

    Begin
      Mouse(X, Y, Rx, Ry, False);
      Result := ChooseOption('ttac');
    End;


    Function ClickGoblin: Boolean;

    Var
       X, Y: Integer;

    Begin
      If Not FindGoblin(X, Y) Then
        Exit;
      If ((Not MultiCombatArea) Xor IsFightAt(X, Y)) Then
        If Check(X, Y, 2, 2) Then
        Begin
          Result := true;
          FFlag(0);
        End;
    End;


    Function FindAllHPBars: Array of TPointArray;

    Var
       g, r: TPointArray;

    Begin

      FindColorsTolerance(g, 65280, MSCX - 60, MSCY - 60, MSCX + 60, MSCY + 60, 0);
      FindColorsTolerance(r, 255, MSCX - 60, MSCY - 60, MSCX + 60, MSCY + 60, 0);

      Result := TPAToATPAEx(CombineTPA(g, r), 31, 5);

    End;


    Function GetHits: TIntegerArray;

    Var
       TPAA: T2DPointArray;
       E: Extended;
       I: Integer;
       TB: TBox;

    Begin

      TPAA := FindAllHPBars;
      SetArrayLength(Result, GetArrayLength(TPAA));

      For I := 0 To High(TPAA) Do
      Begin
        TB := GetTPABounds(TPAA[i]);
        E := CountColor(65280, TB.x1, TB.y1, TB.x2, TB.y2) / 150;
        Result[i] := Round(100 * E);
      End;

    End;


    Function ChatsBlueText: TStringArray;

    Var
       TPA: TPointArray;
       I: Byte;

    Begin
      SetArrayLength(TPA, 9);
      For I := 1 To 8 Do
        TPA[i] := TextCoords(i);

      SetArrayLength(Result, 9);
      For I := 1 To 8 Do
        Result[I] := Trim(GetTextAtEx(TPA[i].x - 2, TPA[i].y - 2, 0, SmallChars, False,
          False, 0, 1, 16711680, 80, False, tr_AllChars));
    End;


    Procedure ChitChat;

    Var
       TSA, Q: TStringArray;
       I, II, Z, X: Integer;
    Begin
      TSA := ChatsBlueText;
      TSA := [TSA[6], TSA[7]];
      Q := ['hp', 'hitpoint', 'str', 'strength', 'atk', 'attack', 'def', 'defence'];
      For I := 0 To 1 Do
        For II := 0 To High(Q) Do
        Begin
          z := Pos(Q[ii], TSA[i]);
          x := Pos('lvl', TSA[i]);
          If x = 0 Then
            x := Pos('lev', TSA[i]);
          If X > Z Then
          Begin
            Case II Of
              0, 1: x := GetSkillInfo('hitpoints', False);
              2, 3: x := GetSkillInfo('strength', False);
              4, 5: x := GetSkillInfo('attack', False);
              6, 7: x := GetSkillInfo('defence', False);
            End;
            TypeSend(IntToStr(X));
            Exit;
          End;
        End;
    End;


    Function FightGoblin: Boolean;

    Var
       Hits: TIntegerArray;
       FS, I: Integer;
    Begin
      If Not ClickGoblin Then Exit;
      Result := True;
      FS := GetSystemTime;
      Wait(250 + Random(50));
      If FindNormalRandoms Then
        If Not LoggedIn Then
          Exit;
      Wait(100 + Random(25));
      If FindBlackChatMessage('reach') Then Exit;
      Wait(25);
      If FindBlackChatMessage('someone') Then Exit;
      Repeat
        Wait(25);
        If GetSystemTime - FS > 4000 Then Break;
        Hits := GetHits;
      Until(GetArrayLength(Hits) >= 0);
      If GetArrayLength(Hits) > 0 Then
        Result := True
      Else
        Exit;
      FS := GetSystemTime;
      Repeat
        Hits := GetHits;
        If GetArrayLength(Hits) < 1 Then
          Exit
        Else
          For I := 0 To High(Hits) Do
            If Hits[i] = 0 Then
              Exit;
        Wait(100 + Random(50));
        If FindNormalRandoms Then
          If Not LoggedIn Then
            Exit;
        Wait(100 + Random(50));
        ChitChat;
        If GetSystemTime - FS >= MonsterTime Then
        Begin
          Writeln('Timeout!');
          Exit;
        End;
      Until(Not(LoggedIn));
    End;


    Function FindNPCs: TPointArray;

    Var
       CTS: Integer;

    Begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      FindColorsTolerance(Result, 195836, MMCX - 40, MMCY - 40, MMCX + 40, MMCY + 40, 12);
      ColorToleranceSpeed(CTS);
      RAaSTPA(Result, 4);
    End;


    Function doCallibrate: Boolean;

    Var
       Points: T2DPointArray;
       X, Y: Integer;
    Begin
      Points := SplitTPA(FindNPCs, 35);
      SortATPASize(Points, True);
      Try
        MiddleTPAEx(Points[0], X, Y);
        MFNF(X, Y, 2, 2);
        FFlag(0);
        Result := True;
      Except
        Result := False;
      End;
    End;


    Function NeedHealth: Extended;

    Var
       CS: String;
    Begin
      Result := (GetMMLevels('hitpoints', CS) / gHP);
    End;


    Function Eat: Boolean;

    Var
       DTM, X, Y: Integer;
       CS: String;

    Begin

      If Players[CurrentPlayer].Strings[0] = '' Then
      Begin
        Result := True;
        Exit;
      End;

      Case LowerCase(Players[CurrentPlayer].Strings[0]) Of
        'meat': DTM := Meat;
        'chicken': DTM := Chicken;
        'trout': DTM := Trout;
        'cod': DTM := Cod;
        'salmon': DTM := Salmon;
      End;

      Repeat
        If FindDTM(DTM, X, Y, MIX1, MIY1, MIX2, MIY2) Then
        Begin
          Mouse(X, Y, 2, 2, True);
          Result := True;
        End;
        Wait(650 + Random(250));
      Until(GetMMLevels('hitpoints', CS) >= Round(gHP)) or (Not(Result));

    End;


    Procedure KillGoblins;

    Var
       Miss, Callibrate, Count: Integer;
    Begin
      Callibrate := 0;
      Count := 0;
      Repeat
        If Not FightGoblin Then
          Miss := Miss + 1
        Else
        Begin
          Miss := 0;
          Callibrate := 0;
          Hit := Hit + 1;
          Count := Count + 1;
        End;
        If (Miss >= 10) And (Callibrate = 1) Then
        Begin
          Writeln('No goblins');
          Callibrate := 0;
          Logout;
          Exit;
        End;
        If Miss > 10 Then
          If Not doCallibrate Then
          Begin
            Writeln('Failed to callibrate');
            Logout;
            Exit;
          End Else
          Begin
            Callibrate := 1;
            Miss := 0;
          End;
        If NeedHealth < 0.65 Then
          If Not Eat Then
          Begin
            Writeln('Out of food');
            Logout;
            Exit;
          End;
        If FindNormalRandoms Then
          If Not LoggedIn Then
            Exit;
        If Not LoggedIn Then Exit;
        Wait(450 + Random(250));
      Until(Count >= 10 + Random(20));
    End;


    Procedure DoStyles;
    Begin
      Case Styles[CurrentPlayer] Of
        Accurate: SetFightMode(1);
        Agressive: SetFightMode(2);
        Defence: SetFightMode(3);
        Shared: SetFightMode(4);
      End;
    End;


    Procedure ScriptTerminate;
    Begin
      FreeDTM(Meat);
      FreeDTM(Chicken);
      FreeDTM(Trout);
      FreeDTM(Cod);
      FreeDTM(Salmon);
    End;


    Var
       I: Integer;


    begin
      SetupSRL;
      LoadDTMs;
      DeclarePlayers;
      Repeat
        LoginPlayer;
        For I := 2 To 5 Do
          SetChat('off', i);
        DoStyles;
        gHP := GetSkillInfo('hitpoints', False);
        SetAngle(True);
        SetRun(True);
        SetRetaliate(True);
        Repeat
          KillGoblins;
          ProgressReport;
          If Not LoggedIn Then Break;
        Until(Hit >= AmountGoblins + Random(20));
        NextPlayer(LoggedIn);
        ProgressReport;
      Until(False);
    end.

  2. #2
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great Mate i will check the code now

    Edit: Sweet code , Nice read
    ~Hermen

  3. #3
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Sigh N3ss3s sometime's you know too much TPA knowledge for your own good .

    Very nice script for begginers, Registared users.

    Rep++ to you

  4. #4
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Hehe, thanks


    @Hermpie:

    If ((Not MultiCombatArea) Xor IsFightAt(X, Y)) Then


    If the character is not in Multicombat Area and there isn't fight at the monster, it can attack it without getting Somebody else is already fighting this monster etc, or if the character is in multi and there is a fight, it also can attack it

  5. #5
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Argh why must you shove random lines everywhere. Its hurting me eyes.... ... so much that I can't roll them properly... Other than that its looks good.

  6. #6
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    What does shoving random lines mean?

  7. #7
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    What does shoving random lines mean?
    Sorry... Its late here :

    SCAR Code:
    Function FindAllHPBars: Array of TPointArray;
                                                                    //Why do you put a line here
    Var
       g, r: TPointArray;
                                                                       //and here
    Begin
                                                                       //and here
      FindColorsTolerance(g, 65280, MSCX - 60, MSCY - 60, MSCX + 60, MSCY + 60, 0);
      FindColorsTolerance(r, 255, MSCX - 60, MSCY - 60, MSCX + 60, MSCY + 60, 0);
                                                                        //and here
      Result := TPAToATPAEx(CombineTPA(g, r), 31, 5);
                                                                        //and here too?
    End;

  8. #8
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It is easy to read duh...
    ~Hermen

  9. #9
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    I put them because they look uber awesome.

  10. #10
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Hermpie View Post
    It is easy to read duh...
    It makes it harder for me to see where one function/procedure ends and where one begins.

    Quote Originally Posted by n3ss3s View Post
    I put them because they look uber awesome.
    You just keep thinking that..

  11. #11
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Yeah it makes it more readable then it all stuffed together..
    I'm gonna use this on my pure =p

    -

    Ive tried this in security stronghold, but id didnt find gobs, neither any good in Lumby..
    Ce ne sont que des gueux


  12. #12
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Are you sure you have

    a) Moved the crosshair
    b) Have your screen on 32bit true color?

  13. #13
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    I'll use this on my pure.

    Add lobster as food if you want longer progress reports, and add the script as an attachment to your first post on this thread. But overall it looks REALLY nice, I wish I had your scripting skillZ. Now go write some tuts?
    And, how long did this take to write?

  14. #14
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Yeah, anyway i changed the case, added a few colors now works like a charm thx!

    And yeah, add lobsters, that'd be good.
    Ce ne sont que des gueux


  15. #15
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    If you know how to make a bitmap, make a bitmap of the lobster, replace some other food with that and use the old foods name. I'm too lazy to go and add =p

  16. #16
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by EvilChicken! View Post
    I'll use this on my pure.

    Add lobster as food if you want longer progress reports, and add the script as an attachment to your first post on this thread. But overall it looks REALLY nice, I wish I had your scripting skillZ. Now go write some tuts?
    And, how long did this take to write?
    Lobster on goblins LOL
    ~Hermen

  17. #17
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ||------------------Progress Report------------------||
    || Ran for 0 hours, 18 mins, 2 sec. ||
    || Goblins killed: 116 ||
    || Goblins per minute: 6,43253234750462 ||
    ||---------------------------------------------------||
    || Thank you for using n3s' PowerGobliner. ||
    ||---------------------------------------------------||
    ******** FOUND TALKING RANDOM TEXT********: Talk-to Molly
    [Runtime Error] : Exception: Access violation at address 006CF23E in module 'scar.exe'. Read of address FFFFFFFC in line 1246 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar


  18. #18
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Cazax View Post
    ||------------------Progress Report------------------||
    || Ran for 0 hours, 18 mins, 2 sec. ||
    || Goblins killed: 116 ||
    || Goblins per minute: 6,43253234750462 ||
    ||---------------------------------------------------||
    || Thank you for using n3s' PowerGobliner. ||
    ||---------------------------------------------------||
    ******** FOUND TALKING RANDOM TEXT********: Talk-to Molly
    [Runtime Error] : Exception: Access violation at address 006CF23E in module 'scar.exe'. Read of address FFFFFFFC in line 1246 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar
    You got smashed down by molly xD
    ~Hermen

  19. #19
    Join Date
    Oct 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hmm im downloading now, i am going to try on my pure i made

  20. #20
    Join Date
    Mar 2008
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Line 87: [Hint] (12828:1): Variable 'I' never used in script
    Line 460: [Error] (13201:1): Unknown identifier 'SetRetaliate' in script

  21. #21
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Line 87: [Hint] (12828:1): Variable 'I' never used in script
    Line 460: [Error] (13201:1): Unknown identifier 'SetRetaliate' in script
    Oops, my bad, I put that after the test run. Change the SetRetaliate to Retaliate.

  22. #22
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    Quote Originally Posted by eugenius1 View Post
    this script is jacking up for me
    whats wrong with it ...

    post the problem lol

  23. #23
    Join Date
    Apr 2008
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Works fine for me.

  24. #24
    Join Date
    Mar 2008
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Works perfect now. Thanks!

  25. #25
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Is there gonna be any updates? The script is kinda good as it is =p
    Ce ne sont que des gueux


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
  •