Results 1 to 20 of 20

Thread: All new functions by MasterKill

  1. #1
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default All new functions by MasterKill

    Heey guys,

    some stuff i made that should be in srl i'll update it evry time i made an new srl include

    Stuffs:

    * Function AutoResponder(FindText, SayText: TStringArray; LookInLastIntegerLines: integer): Boolean;
    * Function NumberOfActive(UseWriteLn: boolean): Integer;
    * Function FindEnemyOutAttack(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; AnemyHight, Tolerance: Integer): Boolean;
    * Function PickItem(UpTexts: TStringArray; Colors: TIntegerArray; RChooseOption: String; Tolerance: Integer): Boolean;

    Future stuffs:

    * you i'll see that when i'm done, i don't want my idee get stolen

    <----------------------------------------------------->

    AutoResponder(...): boolean;

    SCAR Code:
    {*******************************************************************************
    Function AutoResponder(FindText, SayText: TStringArray; LookInLastIntegerLines: integer):Boolean;
    By: MasterKill.
    Description: If Found the FindText then random say one of the SeyTexts
    Use: AutoResponder(['bot','auto','macro'], ['im not an bot!','im not ' +PlayerName,'whats that?'], 2);
    Error: Use 'PlayerName' on own risk! scars GetTextAt is a lil buggy
    *******************************************************************************}

    var
      PlayerName: String;
    Function AutoResponder(FindText, SayText: TStringArray; LookInLastIntegerLines: integer):Boolean;
    var
      textx, texty, Ymod, GetNameTrys, Coordspace, SRT, R: Integer;
      TextSayd, TextFound: String;
    begin
      If (LookInLastIntegerLines > 8) then
      begin
        WriteLn('  auto respond [ERROR] Wrong >LookInLastIntegerLines< not setted up correct:');
        WriteLn('  error in Respond: ' + FindText[0]);
        exit;
      end;
      case LookInLastIntegerLines of
        1: Ymod := 441;
        2: Ymod := 428;
        3: Ymod := 414;
        4: Ymod := 400;
        5: Ymod := 386;
        6: Ymod := 372;
        7: Ymod := 358;
        8: Ymod := 344;
      end;
      For R := 0 To (GetArrayLength(findtext)-1) Do
      begin
        if IsTextInAreaEx(8, Ymod, 291, 461, textx, texty, FindText[R], 12, smallchars, False, True, 0, 1, 16711680) then
        begin
          Coordspace := Texty;
          //writeLn(IntToStr(Coordspace));
          PlayerName := '';
          Repeat
            PlayerName := GetTextAtEx(12, (Coordspace), 0, SmallChars, False, False, 0, 5, 0, 40, False, tr_AllChars)
            If Not (playerName = '') then Break;
            GetNameTrys := GetNameTrys + 1;
          Until not (PlayerName = '') or (GetNameTrys > 5)
          Wait(2000);
          if (Pos(Players[CurrentPlayer].Nick, PlayerName) > 0) then exit;
          Result := True;
          SRT := Random(GetArrayLength(SayText));
          TypeSend(SayText[SRT]);
          TextSayd := SayText[SRT];
          TextFound := FindText[R];
          responds := responds + 1;
          WriteLn('  -Auto Respond');
          If (Trim(PlayerName) = '') then
          begin
            PlayerName := 'Anonymous:';
            WriteLn('    not found player name');
          end;
          WriteLn('    ' + Trim(PlayerName) +' ' + TextFound);
          WriteLn('    ' + Players[CurrentPlayer].Name + ': '+ TextSayd);
          WriteLn('  -Auto Respond');
          If (PlayerName = 'Anonymous:') then
          begin
            Case Random(3) Of
              0: PlayerName := 'dude'
              1: PlayerName := 'sir'
              2: PlayerName := 'noob'
            end;
          end;
        end;
        If (Result = True) then exit;
      end;
    end;

    GetNameAtAx; idk, but i can't do it, it never finds the first/second char.

    <----------------------------------------------------->

    NumberOfActive(...): Integer;

    SCAR Code:
    {*******************************************************************************
    Function NumberOfActive(UseWriteLn: boolean): Integer;
    By: MasterKill
    Description: Result := number of players active.
    *******************************************************************************}

    Function NumberOfActive(UseWriteLn: boolean): Integer;
    var
      PActive, R: integer;
    begin
      for R := 0 To HowManyPlayers - 1 do
      begin
        if (Players[i].active = True) then PActive := PActive + 1;
      end;
      If UseWriteLn then WriteLn('we still got ' + IntToStr(PActive) + ' player[s] active.');
      Result := PActive;
    end;

    simple one but usefull

    SCAR Code:
    Until(NumberOfActive = 0)
    If (NumberOfActive = 0) then exit;

    <----------------------------------------------------->

    FindEnemyOutAttack(...): Boolean;

    SCAR Code:
    {*******************************************************************************
    function FindEnemyOutAttack(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; AnemyHight, Tolerance: Integer): Boolean;
    By: Stupid3ooo and Starblaster100 and MasterKill
    Description: Finds enemy with custom amount of colors and custom amount of Uptext
      If the beast is in attack then look again for other.
    Use: FindEnemyOutAttack(x, y, ['att', 'ack'], [123456, 345678], 40, 5)
    AnemyHight: the size of the anemy in coörds! find the red/green hp balk in a aria of ... coörds
    *******************************************************************************}

    Function FindEnemyOutAttack(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; AnemyHight, Tolerance: Integer): Boolean;
    var
      a, b, c, i, x1, y1, x2, y2, x3, y3: Integer;
      Start: Boolean;
    begin
      For b := 0 to (GetArrayLength(Color)-1) do
      Begin
        if (FindColorSpiralTolerance(cx, cy, color[b], MSX1, MSY1, MSX2, MSY2, Tolerance)) then
        Begin
          Start := True;
          Break;
        end;
      end;
      If(Start)then
      Begin
        x1 := 245;
        y1 := 165;
        x2 := 277;
        y2 := 185;
        repeat
          If not(LoggedIn)then
            break;
          a := a + 1;
          If (a = 1) then
            c := c + 1
          else If (a = 3) then
            c := c + 1;
          For i := 1 to c do
          Begin
            If (a = 1) then
            Begin
              x1 := x1 + 30;
              x2 := x2 + 30;
            end else
            If (a = 2) then
            Begin
              y1 := y1 - 20;
              y2 := y2 - 20;
            end else
            If (a = 3) then
            Begin
              x1 := x1 - 30;
              x2 := x2 - 30;
            end else
            If (a = 4) then
            Begin
              y1 := y1 + 20;
              y2 := y2 + 20;
            end;
            If (x1 = 485) and (x2 = 517) then
              x2 := x2 - 2;
            If (y1 = 325) and (y2 = 345) then
              y2 := y2 - 7;
            If (x2 > 515) then
              Break;
            For b := 0 to (GetArrayLength(Color)-1) do
            Begin
              If (FindColorTolerance(cx, cy, Color[b], x1, y1, x2, y2, tolerance)) then
              Begin
                if (not FindColor(x3, y3, 65280, (cx - AnemyHight), (cy - AnemyHight), (cx + AnemyHight), (cy + AnemyHight))) or
                (not FindColor(x3, y3, 255, (cx - AnemyHight), (cy - AnemyHight), (cx + AnemyHight), (cy + AnemyHight))) then
                begin
                  MMouse(cx, cy, 0, 0)
                  Wait(random(50));
                  if (IsUpTextMultiCustom(Text)) then
                  Begin
                    Result := True;
                    Exit;
                  end;
                end;
              end;
            end;
          end;
          if (a = 4) then
            a := 0;
        until (x2 > 515) or (Result = True);
      end;
    end;

    <----------------------------------------------------->

    PickItem(...): Boolean;

    SCAR Code:
    {*******************************************************************************
    Function PickItem(UpTexts: TStringArray; Colors: TIntegerArray; RChooseOption: String; Tolerance: Integer): Boolean;
    By: MasterKill
    Description: Pick's an item of the ground by rightclicking on it. then choose the selected option.
    Use: PickItem(['Dragon','egs'], [23234, 2345432], 'pick', 5)
    Result: true if one or more items are picked.
    *******************************************************************************}

    Function PickItem(UpTexts: TStringArray; Colors: TIntegerArray; RChooseOption: String; Tolerance: Integer): Boolean;
    var
      AllPicked: boolean;
    begin
      repeat
        If FindObjCustom(x, y, UpTexts, Colors, Tolerance) then
        begin
          Mouse(x, y, 0, 0, False);
          Wait(50);
          if ChooseOption(RChooseOption) then
          begin
            Result := True;
            Wait(100);
            Flag;
            Wait(500 + random(500));
            AllPicked := False;
          end;
        end else AllPicked := True;
      until AllPicked
    end;

    <----------------------------------------------------->


    more might come later

  2. #2
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Looks nice The "Autoresponder" looks fine. There is a spelling mistake, though. It's called "Anonymous"

    -Knives

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

    Default

    Bwuahaha, I made a thread for my functions too

    Meh, saves me posting everytime I create something.


    Yes, the autoresponder indeed looks nice.

    I wonder whats the idea of Tolerance in GetTextAtEx...

  4. #4
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by King of Knives View Post
    Looks nice The "Autoresponder" looks fine. There is a spelling mistake, though. It's called "Anonymous"

    -Knives
    thanks

    Anonymous: i'm a dysslect huh rofl

    Quote Originally Posted by n3ss3s View Post
    Bwuahaha, I made a thread for my functions too

    Meh, saves me posting everytime I create something.


    Yes, the autoresponder indeed looks nice.

    I wonder whats the idea of Tolerance in GetTextAtEx...
    lawl thanks

    does the Tolerance matter?

  5. #5
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I usually just use 150. Doesn't find anything wrong, so it can only be good to have.

    -Knives

  6. #6
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    oki, but i just want to find the color wich is needed

    added 2 Functions

  7. #7
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    I wonder whats the idea of Tolerance in GetTextAtEx...
    I think its for if the text is different colours, on different parts of it..like if you have the letter B, which is yellow at the top and red at the bottom. This sort of thing never happens in RS though, that I know of. Can someone confirm?

  8. #8
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I just added for in case of.

    i guess the colors are not chane'ing.

    If this will/won't be in srl you guys let me know?

  9. #9
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    i doubt it will. People should just use add it them self, People wouldnt use it anyways (no offence)

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  10. #10
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    All the average functions will not be in SRL. Only functions that are either, hard to make or are used a lot.
    Verrekte Koekwous

  11. #11
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default

    Yea, it is very rare for a non-dev to get a function into SRL. Mainly because all of the stuff that is either really good or really used is in SRL already, sorry. The only names i've seen in SRL that arent devs are Town and Iloveit8, i think

  12. #12
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Dark_Sniper too

    Good job MasterKill...although the PickItem could be...a bit better...
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  13. #13
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Santa_Clause View Post
    Good job MasterKill...although the PickItem could be...a bit better...
    thanks. i know about the pickitem. i just made it and thought why shouldn't i post it

    the claw: the auto responder map is empty. maybe place mine there?

  14. #14
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The Claw View Post
    Yea, it is very rare for a non-dev to get a function into SRL. Mainly because all of the stuff that is either really good or really used is in SRL already, sorry. The only names i've seen in SRL that arent devs are Town and Iloveit8, i think
    IM IN IT TO! ^^
    Verrekte Koekwous

  15. #15
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    SCAR Code:
    SRT := Random(GetArrayLength(SayText)-1);

    Now it'll never choose the last from the SayText array. Remove the -1 to let it work properly
    Hup Holland Hup!

  16. #16
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by nielsie95 View Post
    SCAR Code:
    SRT := Random(GetArrayLength(SayText)-1);

    Now it'll never choose the last from the SayText array. Remove the -1 to let it work properly
    oh rofl nice found.

    i thought it should be the same line players - 1 ect ect.

    eddited now

    but do you like it? or not?

  17. #17
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by MasterKill View Post
    I just added for in case of.

    i guess the colors are not chane'ing.

    If this will/won't be in srl you guys let me know?
    Nope it won't be in SRL.
    There's aren't functions that fit in SRL.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    There's aren't functions that fit in SRL.
    Grammar

    You ment 'These aren't functions that fit in SRL. ' ?

    Anyways, yeah, I think SRL is for the general stuff which of you create functions for other things in your script.

  19. #19
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    Grammar

    You ment 'These aren't functions that fit in SRL. ' ?
    Grammar

    I think you meant "You meant "These aren't functions that fit in SRL."?"?

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

    Default

    Okay okay Claw pwns lol...

    Is it really meant? =/ Im used to ment xD no-one has noted anything before.. thx anyways.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. AutoRespondZor(...); by masterkill
    By MasterKill in forum RS3 Outdated / Broken Scripts
    Replies: 20
    Last Post: 11-20-2007, 06:19 PM
  2. Happy B-day Masterkill!
    By Dumpin in forum News and General
    Replies: 1
    Last Post: 11-08-2007, 09:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •