SRL Archive - SRL Archives

Clan Chat


Awkwardsaw

2009-05-26 05:41:03

program ClanChat;
{.include SRL/SRL.scar}

{*******************************************************************************
function InClanChat: boolean;
By: akwardsaw, senrath shortened it.
Description: It checks if you are currently in a clan chat
*******************************************************************************}
function InClanChat: boolean;
begin
gametab(10);
result := (getcolor(571, 447) = 39935);
end;

{*******************************************************************************
Function FindCCTab: Boolean;
By: Akwardsaw, NaumanAkhlaQ made it better
Description: Just incase findtab(10) doesnt work,
this will open the clan chat tab.
*******************************************************************************}
Function FindCCTab: boolean;
begin
result := gametab(10); //gametab() has an inbuilt result
If result then exit;
begin
mousebox(953, 603, 981, 636, 1);
result:= (getuptext = 'Clan Chat');
end;
end;

{*******************************************************************************
procedure GetInChat(channel: string);
By: Akwardsaw
Description: It will get you into a Clan Chat channel, if it exists.
If no Specific Channel, leave as GetInChannel('');
*******************************************************************************}

procedure GetInChat(channel: string);
var channelarray: tstringarray;
begin
if not FindCCTab then exit;
if not inclanchat then
begin
begin
Mousebox(571, 438, 625, 453, 1);
wait(100);
end;
if channel = '' then
begin
channelarray:= ['dewll dragon', 'spaderdabomb', 'Strings Mas',
'Zeth317', '0wn3d xx', 'Miljaker', 'Trawler Fish', 'Sir Nrop',
'Diy Chat', 'Seraphyna', 'zach5433', 'Cake753', 'World65edge',
'Mr Sniper1', 'Jsen', 'Quirk_X', 'Sworddude247', 'munyacct5',
'ashcon4', 'Gastrophete', 'Ot Chatroom', 'Meimaskiller',
'Xhuntahx'];
Typesend(channelarray[Random(Length(channelarray))]);
end else typesend(channel);
while inclanchat = false do wait(100);
end;
end;

{*******************************************************************************
procedure TalkinCC(text: string; true: boolean; mistake: integer;);
By: Akwardsaw, Home fixed
Description: text = text you want it to say
true = say random sentences, false if
you just want it to say that one sentence.
mistake = chance of it making a mistake. 1 = 100%, 2= 50%, 0 = 0%
*******************************************************************************}
Procedure TalkInCC(Text :String; TalkRandom: Boolean; Mistake: Integer);
var
YourMessage: TStringArray;
begin
{if InClanchat then }
begin
if TalkRandom then
begin
YourMessage:= ['heya', 'heya whats up', 'whats up', 'hola', 'hi',
'im bored', Text, 'hiya', 'im sooo bored', 'whats new',
'whats new guys'];
Typesend('/' + AddMistakes(YourMessage[Random(Length(YourMessage))],Mistake))
end else
Typesend(Text);
end;
end;

{*******************************************************************************
procedure LeaveCC(text: string; true: boolean);
By: Akwardsaw, NaumanAkhlaQ suggesting to add mistakes and tstringarray
Description: text = Text you want to say before you leave(leave blank if you
don't want it to say anything.
true = If you want to say a random sentence before leaving, if false
it says what you want it to say.
It says nothing if text is blank.
mistake = the chance of it making a mistake. 1= 100%, 2 = 50%, 0= 0%
*******************************************************************************}

procedure LeaveCC(text: string; true: boolean; mistake: integer);
var leavemessage: tstringarray;
begin
if inclanchat then
begin
if true then
begin
leavemessage:= ['cya guys', 'alright, im gonna go',
'adios', 'im gonna take a nap :P cya',
'yawn, imma go to bed', 'ffs lag', 'need to take a break',
'bleh, gonna restart my computer', 'moms calling -.-', 'brb',
'phone call, bbl', 'bbl', 'gonna go get something to eat'];
Typesend('/' + AddMistakes(leavemessage[Random(Length(leavemessage))],Mistake))
end else typesend('/' + addmistakes(text, mistake));
wait(600+random(400));
Mousebox(571, 438, 625, 453, 1);
end;
end;

its mostly used for antiban i guess, you never know what possibilities you can come up with =p

and yes, i know. its pretty basic i guess, but it works, and is random

Naum

2009-05-26 12:30:39

Nice to see you stuck to your initial Idea :). May I add, that using a TStringArray is faster and shorter for typing messages :).

Richard

2009-05-26 12:47:03

{*******************************************************************************
function InClanChat: boolean;
By: akwardsaw, senrath shortened it.
Description: It checks if you are currently in a clan chat
*******************************************************************************}
function InClanChat: boolean;
begin
gametab(10);
result := (getcolor(571, 447) = 39935);
end;

{*******************************************************************************
Function FindCCTab: Boolean;
By: Akwardsaw, NaumanAkhlaQ made it better
Description: Just incase findtab(10) doesnt work,
this will open the clan chat tab.
*******************************************************************************}
Function FindCCTab: boolean;
begin
result := gametab(10); //gametab() has an inbuilt result
If result then exit;
begin
mousebox(953, 603, 981, 636, 1);
result:= (getuptext = 'Clan Chat');
end;
end;

{*******************************************************************************
procedure GetInChat(channel: string);
By: Akwardsaw
Description: It will get you into a Clan Chat channel, if it exists.
If no Specific Channel, leave as GetInChannel('');
*******************************************************************************}

procedure GetInChat(channel: string);
begin
if not FindCCTab then exit;
if not inclanchat then
begin
begin
Mousebox(571, 438, 625, 453, 1);
wait(100);
end;
if channel = '' then
begin
case random(24) of
0: typesend('dewll dragon');
1: typesend('spaderdabomb');
2: typesend('w60 penguins');
3: typesend('Strings Mas');
4: typesend('Zeth317');
5: typesend('0wn3d xx');
6: typesend('Miljaker');
7: typesend('Trawler Fish');
8: typesend('Sir Nrop');
9: typesend('Diy Chat');
10: typesend('Seraphyna');
11: typesend('zach5433');
12: typesend('Cake753');
13: typesend('World65edge');
14: typesend('Mr Sniper1');
15: typesend('Jsen');
16: typesend('Quirk_X');
17: typesend('Sworddude247');
18: typesend('munyacct5');
19: typesend('ashcon4');
20: typesend('Gastrophete');
21: typesend('Ot Chatroom');
22: typesend('Meimaskiller');
23: typesend('Xhuntahx');
end;
end else typesend(channel);
while inclanchat = false do wait(100);
end;
end;

{*******************************************************************************
procedure TalkinCC(text: string; true: boolean);
By: Akwardsaw
Description: text = text you want it to say
true = say random sentences, false if
you just want it to say that one sentence.
*******************************************************************************}
Procedure TalkInCC(text :string; true: boolean);
begin
if inclanchat then
begin
if true then
begin
case random(5) of
0: typesend('/heya guys');
1: typesend('/whats up');
2: typesend('/hola');
3: typesend('/hi');
4: typesend('/im bored.');
5: typesend(text);
end;
end else
typesend(text);
end;
end;

{*******************************************************************************
procedure LeaveCC(text: string; true: boolean);
By: Akwardsaw
Description: text = Text you want to say before you leave(leave black if you
don't want it to say anything.
true = If you want to say a random sentence before leaving, if false
it says what you want it to say.
It says nothing if text is blank.
*******************************************************************************}

procedure LeaveCC(text: string; true: boolean);
begin
if inclanchat then
begin
if true then
begin
case random(4) of
0: typesend('/cya guys');
1: typesend('/alright, im gonna go');
2: typesend('/adios');
3: typesend('/im gonna take a nap :P cya');
end;
end else typesend(text);
wait(600+random(400));//randomness
Mousebox(571, 438, 625, 453, 1);
end;
end;

Could be quite useful.

Naum

2009-05-26 16:38:26

You might want to AddMistakes to it :). It makes it seem more human :p

Dynamite

2009-05-26 17:52:20

LOL I made this like last week :)
Nice
T~M

Awkwardsaw

2009-05-26 18:43:01

/me is smiling irl

From: The Man
LOL I made this like last week :)
Nice
T~M


i ALSO made this last week :p

thanks for the good input guys, i was expecting something like "wow, thats stupid, you should have done this (insert advanced code here)" :)

also, yeah i wanted to update it more, been busy lately learning reflection and auto color stuff for a lumby flax spinner

From: NaumanAkhlaQ
May I add, that using a TStringArray is faster and shorter for typing messages

do you mean use a stringarray instead of the case like so?:
Procedure TalkInCC(text :string; true: boolean; mistake: integer);
var
yourmessage: array [0..11] of string;
i: integer;
begin
if inclanchat then
begin
if true then
begin
yourmessage:= ['heya', 'heya whats up', 'whats up', 'hola', 'hi',
'im bored', text, 'hiya', 'im sooo bored', 'whats new',
'whats new guys'];
for i:= 0 to 11 do
typesend('/' + addmistakes(yourmessage[random(i)], mistake));
end else
typesend(text);
end;
end;

Dynamite

2009-05-26 20:07:03

i made mine before you :p

T~M

Awkwardsaw

2009-05-26 22:16:10

i didnt see it then :P

so, any suggestions on how to make it better then, the man? :)

Naum

2009-05-26 23:27:29

Exactly Akward :)

Awkwardsaw

2009-05-26 23:40:04

theres a problem then, it doesnt type any thing :P

do i have to call tstringarray in the procedure?

Procedure TalkInCC(text :tstringarray; true: boolean; mistake: integer);

Nava2

2009-05-27 04:02:25

Harry made this before any of you..

Nice job awkward, nice to see you committing. But this is an awful lot like an autoresponder. Not sure it will get in. Keep going though, you never know! :)

Awkwardsaw

2009-05-27 04:05:36

mkay nava =D

sorry but i dont really see how it would be an auto responder =p

i still need to work on it, even if it doesnt get in i'll still use it for personal use :)

Dynamite

2009-05-27 04:07:33

Nava2 are we (Non devs) allowed to commit stuff?
Sorry to be offtopic and mine is probs worse than yours so…
Well done :)

T~M

senrath

2009-05-27 04:17:02

From: The Man
Nava2 are we (Non devs) allowed to commit stuff?
Sorry to be offtopic and mine is probs worse than yours so…
Well done :)

T~M


Nope. Only dev's have the ability to commit to the repository.

Awkwardsaw

2009-05-27 04:56:27

From: The Man
Nava2 are we (Non devs) allowed to commit stuff?
Sorry to be offtopic and mine is probs worse than yours so…
Well done :)

T~M


do you mind if i take a look at it? :)

ps: your always welcome to use it if it doesn't get it in, make sure to credit and all that jazz, and that's for every one :p

Dynamite

2009-05-27 04:58:44

sure:
http://www.villavu.com/forum/showthread.php?t=45377
There ya go ;)

T~M

Awkwardsaw

2009-05-27 05:05:50

oo. i like the fact of using a bitmap/ dtm instead of mousebox.. it looks more profesional imo

Dynamite

2009-05-27 05:09:32

Yeh, I guess so :p
but yours has many more hmm 'features'?

T~M

Harry

2009-05-27 05:10:58

Slowpokes.jpg

This has been in my fight caver for months now. :|

Awkwardsaw

2009-05-27 05:22:55

haha, i'm probably the only one here at srl who hasn't used your fight caver harry :P

Nava2

2009-05-27 07:34:45

Mouse boxes are probably more efficient in this case as the coords are static. So, if they don't move, why treat them like they do? :)

Awkwardsaw

2009-05-27 09:15:35

idk, i use mousebox a LOT now, sometimes i think im over using it :P

its just me i guess haha

Awkwardsaw

2009-07-04 01:44:26

bump, sorry for double post, but i changed the procedures, with the help of Home :D

they all work now, with good randomness and the like. im going to try to figure out how many people are in the clan chat now

Floor66

2009-07-04 10:40:21

I made this a loooong time ago (but it sucked :p). This is prolly better.
My old one: http://www.villavu.com/forum/showthread.php?t=39189&highlight=clan+chat

Awkwardsaw

2009-07-04 10:47:46

what i wanna figure out is how to find out how many people are in the cc.. :P its a pain right now

Rich

2009-07-04 21:48:48

{*******************************************************************************
procedure GetInChat(channel: string);
By: Akwardsaw
Description: It will get you into a Clan Chat channel, if it exists.
If no Specific Channel, leave as GetInChannel('');
*******************************************************************************}

procedure GetInChat(channel: string);
var channelarray: tstringarray;
begin
if not FindCCTab then exit;
if not inclanchat then
begin
begin
Mousebox(571, 438, 625, 453, 1);
wait(100);
end;
if channel = '' then
begin
channelarray:= ['dewll dragon', 'spaderdabomb', 'Strings Mas',
'Zeth317', '0wn3d xx', 'Miljaker', 'Trawler Fish', 'Sir Nrop',
'Diy Chat', 'Seraphyna', 'zach5433', 'Cake753', 'World65edge',
'Mr Sniper1', 'Jsen', 'Quirk_X', 'Sworddude247', 'munyacct5',
'ashcon4', 'Gastrophete', 'Ot Chatroom', 'Meimaskiller',
'Xhuntahx'];
Typesend(channelarray[Random(Length(channelarray))]);
end else typesend(channel);
while inclanchat = false do wait(100);
end;
end;

Could be

{*******************************************************************************
procedure GetInChat(channel: string);
By: Akwardsaw
Description: It will get you into a Clan Chat channel, if it exists.
If no Specific Channel, leave as GetInChannel('');
*******************************************************************************}

procedure GetInChat(channel: string);
var channelarray: tstringarray;
begin
if not FindCCTab then exit;
if not inclanchat then
begin
Mousebox(571, 438, 625, 453, 1);
wait(100);
if channel = '' then
begin
channelarray:= ['dewll dragon', 'spaderdabomb', 'Strings Mas',
'Zeth317', '0wn3d xx', 'Miljaker', 'Trawler Fish', 'Sir Nrop',
'Diy Chat', 'Seraphyna', 'zach5433', 'Cake753', 'World65edge',
'Mr Sniper1', 'Jsen', 'Quirk_X', 'Sworddude247', 'munyacct5',
'ashcon4', 'Gastrophete', 'Ot Chatroom', 'Meimaskiller',
'Xhuntahx'];
Typesend(channelarray[Random(Length(channelarray))]);
end else typesend(channel);
while inclanchat = false do wait(100);
end;
end;

Meh, it's two lines shorter.

Awkwardsaw

2009-07-04 22:28:34

well, the less lines the faster it is right? although its very very very small difference

besides, i like it when people look through stuff and change things around