SRL Archive - Research & Development Lounge

First code I wrote in three years.


Dub

2009-12-16 10:42:25

I thought to myself; hey let's write a (hopefully) useful procedure that could possibly be implemented in the list of AntiBan stuff. I don't know anything yet about the new functions and stuff there are these days, and this code is (yes I know!) kinda slow. I was hoping for suggestions and/or improvements to make this faster. It's compact, but I need more chat options. Can you guys reply with some FAQS(ingame ones) and possible answers to them? Your contribution is appreciated :).

Redid the whole thing, using Arrays now. Okay so version 2 of it. This is basically just the template, because there's loads of HiChats ( which is just chatter ) to be added. The Level procedure just answers with your own skill level in a particular skill filled in the (); e.g. SkillResponder('Mining');


program responders;
{.include SRL\SRL\Misc\Quickchat.scar}
var
HiChats, HiAnswers: TStringArray
LevelChats: TStringArray;
i: integer;

procedure SkillResponder(ART_Skill:String);
begin
LevelChats:=['What is your Mining level?','Your level?','your level?','Ur level?','ur lvl?',
'your levels?','Your Levels',(ART_Skill + 'level'),(ART_Skill + 'lvl?')];

for I:= 0 to High(LevelChats) do
begin
if (InChat(LevelChats[i]))then
begin
//QCSayLevel(ART_Skill);
wait(1000+random(200));
writeln('Responded to the question!');
Exit;
end;
end;
wait(500+random(20));
end;


procedure BlaResponder;

begin
HiChats:=['hi','hello','sup','yo','bored'];
HiAnswers:=['yo','hi','mornin!','yo!','Yah im bored too..'];
for I:= 0 to High(HiChats) do
begin
if InChat(HiChats[i]) then
TypeSend(HiAnswers[i]);
wait(100+random(200));
end;
end;


Dervish

2009-12-16 12:17:11

Fix your standards ;).

Dub

2009-12-16 12:21:23

Yah I know I know, I was told that so many times. Guess I should've applied them when I first started :P. No turning back now.

Look past the standards, and comment?

Coh3n

2009-12-16 13:07:21

You need to break out of the repeat..until loop if it replies, otherwise it will reply three times. You can also use TypeSend to add multiple answers. Correct me if I'm wrong, but can't you use the numbers on the keyboard to type using quick chat faster? Like you type '1' for answer one, '2' for answer two, etc.

Dub

2009-12-16 13:09:45

From: Coh3n
You need to break out of the repeat..until loop if it replies, otherwise it will reply three times. You can also use TypeSend to add multiple answers. Correct me if I'm wrong, but can't you use the numbers on the keyboard to type using quick chat faster?


Good comment, i'll just add a little Break there. Can you type in the responses with keyboard presses? That'd be great cause then making a little random(#reply) could humanize thing up a bit :D. Is there anything like this or have I actually found a little problem that hasn't been solved yet :garfield:?

mixster

2009-12-16 13:12:53

Couple of things. You only increment tries when it finds the colour and as the repeat until loop only breaks when tries goes passed 3, it will infinite loop until it finds the colour 3 times. Another point is that you don't free your bitmaps at the end of the procedure. Edit: This is added onto Cohen's suggestion.

I would suggest you changed the 0's for y randomness for the Mouse calls as it would mean that it always clicked on the same place on the bitmaps. Probably also a good idea to remove the writeln's - while useful for debugging, they may get annoying for anyone who uses it :)

In terms of speeding it up, I would say the main slow down is because of the several large waits. Instead of using those, possibly making repeated smaller checks until it confirms or times out. Bitmaps aren't really that slow, especially when small and small-ish areas are being searched, so lag wouldn't be because of that.

Floor66

2009-12-16 13:16:28

You can use TypeSend(Text); for typing stuff.

Coh3n

2009-12-16 13:17:47

From: Dub
Good comment, i'll just add a little Break there. Can you type in the responses with keyboard presses? That'd be great cause then making a little random(#reply) could humanize thing up a bit :D. Is there anything like this or have I actually found a little problem that hasn't been solved yet :garfield:?

Check misc/QuickChat.scar. ;)

Dub

2009-12-16 13:17:56

Hahahaha okay so my whole procedure was fail. I could've just used commands from that SRL include. Thanks for the pointer Coh3n.. I'll probably start writing my first real script somewhere next week.. Thanks for your time and effort pointing out some mistakes :D!

Lock Thread please! ;)

WT-Fakawi

2009-12-17 03:59:34

Don't do Wait(1000), but do something usefull while waiting, such as FindNormalRandoms a couple of times. Idling for one second or more could get you in a lot of trouble :)

Dub

2009-12-17 10:56:18

Yah thanks for that comment but it was only a shell really :P. It was more my intention of pointing out a possible extra anti-ban and I made a simple (crappy, lol) example :P. Is there something like this in the sense of Anti-Ban or should I still dev this further?

EDIT: I modified it, removed the writeln debug messages and replaced the increment. Also added in some findnormalrandoms (thanks Fakawi). Should I make this a boolean function or are we all fine with procedures?

The Claw

2009-12-17 11:23:03

Autoresponders are very good antiban. Without them I'm sure I would of lost alot more accounts in high risk, talkative places…the crafting guild for example. You just have to make sure your not always repeating the same things to the same questions, change it up a bit.

Dervish

2009-12-17 12:34:17

From: WT-Fakawi
Don't do Wait(1000), but do something usefull while waiting, such as FindNormalRandoms a couple of times. Idling for one second or more could get you in a lot of trouble :)


Then you got to find something / create something to do for ~1 second.

From: The Claw
Autoresponders are very good antiban. Without them I'm sure I would of lost alot more accounts in high risk, talkative places…the crafting guild for example. You just have to make sure your not always repeating the same things to the same questions, change it up a bit.


Autoresponders which fail example :

Player 1 : "Hi there !"
Botter : "Lol !"

Or 2 bots :

Player 1 : "Hi there !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
…

Are horrible antiban ;).

WT-Fakawi

2009-12-17 12:42:44

From: Dr D. Dervish
Then you got to find something / create something to do for ~1 second.



RS cheating consists of waiting, waiting and waitng. Might as well do something useful with it.


procedure FTWait(myLen:Integer);
var
mywait: Integer;
begin
for mywait := 1 to myLen do
begin
Wait(100 + Random(100));
FindNormalRandoms;
end
end;

Tim0suprem0

2009-12-17 13:31:52

From: Dr D. Dervish
Then you got to find something / create something to do for ~1 second.



Autoresponders which fail example :

Player 1 : "Hi there !"
Botter : "Lol !"

Or 2 bots :

Player 1 : "Hi there !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
…

Are horrible antiban ;).

/offtopic but I once saw a legit player start off an autoresponding war between two crappy autoresponders… All he said was "Hi" and it started a chain reaction of "Lol's" and "I'm level __" as they just kept responding to one another.

Dub it's nice to see oldschoolers coming back and starting to script! Kind of inspiring :)

Dub

2009-12-17 16:18:15

From: Dr D. Dervish

Autoresponders which fail example :

Player 1 : "Hi there !"
Botter : "Lol !"

Or 2 bots :

Player 1 : "Hi there !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
…

Are horrible antiban ;).


That's a good comment. I was thinking of making it find a bitmap with the right part of the white bubble AND a part of the text it says behind it. so for instance I could take a bitmap showing a little part of the white bubble and a part of the "what is your level in randomskill" so it would only respond if THAT question was asked.. Then again, that bitmap would become a bit bigger. I'll check to see how many ms that takes extra..

EDIT: Okay so I did that. Made it slightly faster and look for part of the bubble + a part of the W. Can someone test this for me as my comp has problems compiling ( takes me 3-9 seconds random to load up just running this function & setupsrl…. lol )

mixster

2009-12-17 19:13:42

From: WT-Fakawi
RS cheating consists of waiting, waiting and waitng. Might as well do something useful with it.


procedure FTWait(myLen:Integer);
var
mywait: Integer;
begin
for mywait := 1 to myLen do
begin
Wait(100 + Random(100));
FindNormalRandoms;
end
end;


procedure FTWait(len, rand: Integer);
var
t: Integer;
begin
t := GetSystemTime + (len * 100) + Random(rand);
repeat
FindNormalRandoms;
Wait(100 + Random(100);
until (GetSystemTime > t);
end;

I feel it's a bit safer to assume lag than to assume no lag :)

Simtoon

2009-12-17 21:26:20

ive seen auto responders it really noobish i remember i was using one a while ago.. someone knew the responder and pridected what it was going to say.. like it would go are you a bot.. and they go watch its going to say lmfao or lol and it did …

The Claw

2009-12-18 00:12:59

There are functions which get the actual text from the chatbox, so no need to mess around with bitmaps. If you want to make this a quick-chat responder, you could get all the possible questions and put them in a 2d array, get the relevant answers and put them in another 2d array, then when one of the questions is asked, select randomly from a certain part in the response array.

someone asks mining level
this matches up with ResponseArray[0][i] for example
make i a random number from 0 to high(responsearray[0]), which corresponds to "my mining level is...", or another mining answer for example
then say that response

You could also make it respond with quick chat even if the legit asks questions not using quickchat, but has key words so you know what they mean.

Dub

2009-12-18 04:39:46

From: The Claw
There are functions which get the actual text from the chatbox, so no need to mess around with bitmaps. If you want to make this a quick-chat responder, you could get all the possible questions and put them in a 2d array, get the relevant answers and put them in another 2d array, then when one of the questions is asked, select randomly from a certain part in the response array.

someone asks mining level
this matches up with ResponseArray[0][i] for example
make i a random number from 0 to high(responsearray[0]), which corresponds to "my mining level is...", or another mining answer for example
then say that response

You could also make it respond with quick chat even if the legit asks questions not using quickchat, but has key words so you know what they mean.


That's a really good comment. Now, the only problem left is I have to learn how to use arrays. They were introduced like a week before I quit, so I never got the time to use em. I'll dig up some tuts and start working on this! :D

EDIT: Yay, read some tuts and with the help of N1ke and Wizzup I rewrote the entire thing.
Feed me feedback :D:D.

Freddy1990

2009-12-19 09:05:52

From: Dr D. Dervish
Then you got to find something / create something to do for ~1 second.



Autoresponders which fail example :

Player 1 : "Hi there !"
Botter : "Lol !"

Or 2 bots :

Player 1 : "Hi there !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
…

Are horrible antiban ;).


Lol !

I love it when that happens :)

swisspking

2009-12-20 16:04:31

Were there any Bots with good Autoresponders yet?
Hmm I think Quickchat Answers would be easy to answer and you could write like "I can only use Quickchat" if someone asks you something unanswerable on Quickchat (Take this as a suggestion).

Oh well, problem there would be the

From: Dr D. Dervish

2 bots :

Player 1 : "Hi there !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
Botter 1 : "Lol !"
Botter 2 : "Lol !"
…

Are horrible antiban ;).


Would be just like:

Player 1 : "What is your level in Mining?"
Botter 1 : "My mining level is: 43."
Botter 2 : "My mining level is: 32."
Botter 1 : "My mining level is: 43."
Botter 2 : "My mining level is: 32."
Botter 1 : "My mining level is: 43."
Botter 2 : "My mining level is: 32."
Botter 1 : "My mining level is: 43."
Botter 2 : "My mining level is: 32."
Botter 1 : "My mining level is: 43."
Botter 2 : "My mining level is: 32."
…

Dub

2009-12-21 04:17:46

From: swisspking
Were there any Bots with good Autoresponders yet?
Hmm I think Quickchat Answers would be easy to answer and you could write like "I can only use Quickchat" if someone asks you something unanswerable on Quickchat (Take this as a suggestion).

Oh well, problem there would be the



Would be just like:

Player 1 : "What is your level in Mining?"
Botter 1 : "My mining level is: 43."
Botter 2 : "My mining level is: 32."
Botter 1 : "My mining level is: 43."
Botter 2 : "My mining level is: 32."
Botter 1 : "My mining level is: 43."
Botter 2 : "My mining level is: 32."
Botter 1 : "My mining level is: 43."
Botter 2 : "My mining level is: 32."
Botter 1 : "My mining level is: 43."
Botter 2 : "My mining level is: 32."
…


Nope that wouldn't happen. It checks for the yellow text above peoples heads, so it only answers if people actually asked anything in your area.. This works pretty well, and it doesn't just answer quickchat questions with quickchat answers..
I made it so it doesnt answer sentences, just questions.

And for the "i can use quickchat" suggestion, that would be like saying "look I can't really type I'm just a bot! :D Report meeee (:" Lol.

Cigue

2009-12-22 00:15:08

Actually, saying I can only use quickchat means that you are muted because you spouted offensive stuff at people.