SRL Archive - SRL Archives

ClanChat Function


Dynamite

2009-05-15 13:43:46

Hi this is the first function i have ever made


//function ClanChat : Boolean;
//By The Man
//Goes onto a ClanChat
//Instructions: Const ClanChat := True/False
//Example ClanChat(True);

function ClanChat : Boolean;
var
x, y, H, i: integer;
Chats: TStringArray;

begin
if ClanChat(True) then
begin
GameTab(10)
if FindBitmap(srl_GetBitmap(bmp_Join_Chat), x, y) then
begin
Result := True;
Mouse(x, y, 0, 0, True);
wait(500)
begin
H := High(Chats);
for i := 0 to H do
begin
TypeSend(Chats[i]);
end;
begin
Chats := ['Zezima', 'Merchkingz', 'Adamsdumbo5'];
end;
end;
end;
end;

I haven't tested but i think it should work
Please give feedback, if its absolutely crap then say its absolutely crap and why :)

T~M

P.S. I have my operation now will check later on tonight or tomorrow :)

BobboHobbo

2009-05-15 14:43:53


function ClanChat(Chats: TStringArray) : Boolean;
var
x, y, H, i: integer;
Chat: TStringArray;
begin
GameTab(10)
Result :=FindBitmap(srl_GetBitmap(bmp_Join_Chat), x, y);
If (Result) then
begin
Mouse(x, y, 0, 0, True);
wait(RandomRange(100,500));
H := High(Chats);
for i := 0 to H do
begin
TypeSend(Chats[i]);
end;
Chat := Chats;
end;
end;

Shortened and made for better use xD. I dont get how it would work though xD.

Rich

2009-05-15 18:56:33

I guess it could be used for anti-ban. A few minutes after you joined, it could leave, and also register if you are allowed into that chat.

Dynamite

2009-05-16 14:58:15

yeh ant-ban is what i meant this for :)

T~M

Floor66

2009-05-16 15:07:21

I once made something like it. Look in the Pub Test corner, it must roam around there somewhere.

Nava2

2009-05-18 01:31:01

Standards, and some other fixes.. good idea though.

Harry made this for his caver as well. :)

Dynamite

2009-05-19 23:00:28

Can i commit to OpenDev? or can only Devs do that?

OH Crap im gna have to redo my bitmap.
Just reformatted pc

T~M

Naum

2009-05-19 23:06:33

Shortened it a bit more,


function ClanChat(Chats: TStringArray) : Boolean;
var
x, y, i: integer;
Chat: TStringArray;
begin
GameTab(10)
Result := FindBitmap(srl_GetBitmap(bmp_Join_Chat), x, y);
If (Result) then
begin
Mouse(x, y, 0, 0, True);
wait(RandomRange(100,500));
for i := 0 to High(Chats) do
TypeSend(Chats[i]);
Chat := Chats;
end;
end;

Dynamite

2009-05-19 23:07:40

OK cheers Nauman. Do you know if i'm allowed to commit?

T~M

Naum

2009-05-19 23:09:28

I dunno… I think Dev's have their own passwords for commiting :)

Dynamite

2009-05-20 15:22:31

From: NaumanAkhlaQ
Shortened it a bit more,


function ClanChat(Chats: TStringArray) : Boolean;
var
x, y, i: integer;
Chat: TStringArray;
begin
GameTab(10)
Result := FindBitmap(srl_GetBitmap(bmp_Join_Chat), x, y);
If (Result) then
begin
Mouse(x, y, 0, 0, True);
wait(RandomRange(100,500));
for i := 0 to High(Chats) do
TypeSend(Chats[i]);
Chat := Chats;
end;
end;


Do i need to put in the chats then?

T~M

Dynamite

2009-05-22 17:30:13

Guys sorry to bump but do I need to put in the chats then?
function ClanChat(Chats: TStringArray) : Boolean;
var
x, y, i: integer;
Chat: TStringArray;
begin
GameTab(10)
Result := FindBitmap(srl_GetBitmap(bmp_Join_Chat), x, y);
If (Result) then
begin
Mouse(x, y, 0, 0, True);
wait(RandomRange(100,500));
for i := 0 to High(Chats) do
TypeSend(Chats[i]);
Chat := Chats;
end;
end;

What do I add to that?

T~M

Naum

2009-05-22 17:37:56

You need to add a FreeBitmap thingy.

So:

function ClanChat(Chats: TStringArray) : Boolean;
var
xx, yy: integer;
begin
GameTab(10)
Result := FindBitmap(srl_GetBitmap(bmp_Join_Chat), xx, yy);
If (Result) Xor (GetArrayLength(Chats) > 0) Then
begin
Mouse(xx, yy, 4, 4, True);
wait(RandomRange(100, 500));
for xx := 0 to High(Chats) do //no need for a new var re-write the old 'xx'
begin
TypeSend(Chats[xx]);
wait(RandomRange(100, 500));
end;
end;
srl_FreeBitmaps;
end;

That should do it :). Add a failsafe added a wait and put some randomness on it. Got rid of that useless variable modified x, y to xx,yy in case of any errors :). Also whats the need for the Chat variable?

Torrent of Flame

2009-05-22 17:39:03

Just add it in your script, before the Anti-Ban, then call it in your Anti-Ban proc.

Dynamite

2009-05-22 17:39:33

Cheers Nauman but where do I write in which chats I want it to do?

T~M

Naum

2009-05-22 18:02:56

Umm isn't that easy? Should be in the parameter ;)

ClanChat(Chats: TStringArray);

If ClanChat(['hey', 'i macro!']) Then


Edit: Check the first post got rid of the useless 'i' variable :)