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