SRL Archive - RS3 Script Requests

Small/Medium Request Please?


7x7x

2012-09-28 02:16:57

Ok So i made a simple auto typer, ive been trying for days to improve it but i cant do it lol. so now i need help.


I Want To Add:

Does Random Emote (Clicking Emotes Randomly From 1 through 20)

Does Random Speeds (Messages will appear 5-15 seconds Randomly)

Does Random Text Colors (Red, White, Purple, Cyan, Glow1,2,3 and Flash 1,2,3)

this is all i want, if you can help me put this in my script id appreciate it =)

Script I Made:

{$DEFINE SMART}
{$i srl/srl.simba}
Const
Message0=('Message Here');
Message0=('Message Here');
Message0=('Message Here');
Message0=('Message Here');
Message0=('Message Here');

begin
ClearDebug();
SetupSRL();
Repeat
wait(3000+Random(50)); <—- // I dont want to keep changing speeds, i want the bot to change randomly
TypeSend(Message0);
wait(4000+Random(50)); <—-
TypeSend(Message1);
wait(5000+Random(50)); <—-
TypeSend(Message2);
wait(3000+Random(50)); <—-
TypeSend(Message3);
wait(4000+Random(50)); <—-
TypeSend(Message4);
Until(false)
end.

P1ng

2012-09-28 03:42:52

Why don't you just make the wait times
Wait(RandomRange(1500, 5500));
?

riwu

2012-09-28 07:06:37

Use a loop and store all the messages as a TStringArray:

Message:=['msg1','msg2',....];
for i:=0 to High(Message) do
begin
TypeSend(Message[i]);
wait(RandomRange(blabla));
end;
Could be better if you randomly sort the TSA after every cycle.

7x7x

2012-09-28 08:29:49

From: P1ng
Why don't you just make the wait times
Wait(RandomRange(1500, 5500));
?


because i want the wait times to randomly change speeds instead of what it is now.

riwu

2012-09-28 08:33:04

From: 7x7x
because i want the wait times to randomly change speeds instead of what it is now.

You want it to randomly change the random range? (i.e. 'double random')
Then just do 1 more RandomRange: RandomRange(RandomRange(blabla

7x7x

2012-09-28 08:40:13

From: riwu
You want it to randomly change the random range? (i.e. 'double random')
Then just do 1 more RandomRange: RandomRange(RandomRange(blabla



so doing x2 random range will randomize my text speeds without me manually changing the speeds?

riwu

2012-09-28 09:07:27

From: 7x7x
so doing x2 random range will randomize my text speeds without me manually changing the speeds?

If you are referring to the speed in which you type the message, TypeSend is a SRL function that already has randomness incorporated in it.

7x7x

2012-09-28 09:40:08

From: riwu
If you are referring to the speed in which you type the message, TypeSend is a SRL function that already has randomness incorporated in it.


So your saying i dont even need to put in: wait(3000+Random(50));?

riwu

2012-09-28 09:46:04

From: 7x7x
So your saying i dont even need to put in: wait(3000+Random(50));?

That wait would be for in between sending each message so it's best to still have it.

7x7x

2012-09-28 09:53:17

From: riwu
That wait would be for in between sending each message so it's best to still have it.


thats the thing i dont want to keep having to put wait times in between each line, i want the script to randomize it.

riwu

2012-09-28 09:59:32

From: 7x7x
thats the thing i dont want to keep having to put wait times in between each line, i want the script to randomize it.

Oh, why you didn't complain about having to put TypeSend(Message); so many times too? :rolleyes:
The best solution would be to use TStringArray and a for loop which can simplify them into 2 lines as i've demonstrated above. Read up tutorials on them if you dont understand how to use them.

7x7x

2012-09-28 10:14:56

From: riwu
Use a loop and store all the messages as a TStringArray:

Message:=['msg1','msg2',....];
for i:=0 to High(Message) do
begin
TypeSend(Message[i]);
wait(RandomRange(blabla));
end;
Could be better if you randomly sort the TSA after every cycle.


Can you tell me what each line is used for and where to put this in my script? if its not to much of a hassle.

Runaway

2012-09-28 11:40:59

Hey there,

Was bored this morning so I made the RandomEmote function for you. It only does emotes 1-16 cause it's not worth coding scroll bar coords :p Also, I left the difference pattern in there in case you wanted to take a look at it:


program new;
{$i SRL/SRL.simba}

function FixEmotes: Boolean;
var
Arrow, Slider: TBox;
x, y, t: Integer;
begin
Result := False;
Arrow := IntToBox(722, 208, 735, 221);
Slider := IntToBox(722, 223, 735, 227);
GameTab(tab_Emotes);
MarkTime(t);
while not Result and (TimeFromMark(t) < 2000) do
begin
Result := CountColorTolerance(4807781, Slider.x1, Slider.y1, Slider.x2, Slider.y2, 3) > 6;
if Result then
Exit;
GetMousePos(x, y);
if not PointInBox(Point(x, y), Arrow) then
MouseTBox(Arrow, mouse_Move);
ClickMouse2(mouse_Left);
Wait(Random(100));
end;
Wait(250 + Random(250));
end;

{
Row 1, x: 571, 614, 657, 700 (x Dif = 43)
Row 1, y: 279
Row 2, y: 339
Row 3, y: 399 (y Dif = 60)
}

procedure RandomEmote(EmoteFrom, EmoteTo: Integer);
var
Range: TIntegerArray;
Emote, x, y, i: Integer;
begin
GameTab(tab_Emotes);
if not FixEmotes then
Exit;
Range := [EmoteFrom, EmoteTo];
for i := 0 to High(Range) do
begin
if not InRange(Range[i], 1, 16) then
begin
Writeln('Specified emote is out of range!');
Exit;
end;
end;
Emote := RandomRange(Range[0] - 1, Range[1]);
x := 570 + (Emote mod 4 * 43) - 6;
y := 229 + (Floor(Emote / 4.0) * 60) - 15;
Mouse(x, y, 12, 30, mouse_Left);
Wait(500 + Random(500));
end;

begin
SetupSRL;
ActivateClient;
RandomEmote(1, 16);
end.

Have fun with that ;)

Pavement

2012-09-28 11:47:33


Message:=['msg1','msg2',....]; // String array each "msg" being a different message
for i:=0 to High(Message) do //For length of string times. So it does this for each message
begin
TypeSend(Message[i]); //sends the message i of the string array which will firstly be 0 (First message)
wait(RandomRange(blabla)); //this is the delay between messages. Afterwards it will change i to 2 and send the second message and so on...
end;

7x7x

2012-09-28 15:14:54

From: Runaway
Hey there,

Was bored this morning so I made the RandomEmote function for you. It only does emotes 1-16 cause it's not worth coding scroll bar coords :p Also, I left the difference pattern in there in case you wanted to take a look at it:


program new;
{$i SRL/SRL.simba}

function FixEmotes: Boolean;
var
Arrow, Slider: TBox;
x, y, t: Integer;
begin
Result := False;
Arrow := IntToBox(722, 208, 735, 221);
Slider := IntToBox(722, 223, 735, 227);
GameTab(tab_Emotes);
MarkTime(t);
while not Result and (TimeFromMark(t) < 2000) do
begin
Result := CountColorTolerance(4807781, Slider.x1, Slider.y1, Slider.x2, Slider.y2, 3) > 6;
if Result then
Exit;
GetMousePos(x, y);
if not PointInBox(Point(x, y), Arrow) then
MouseTBox(Arrow, mouse_Move);
ClickMouse2(mouse_Left);
Wait(Random(100));
end;
Wait(250 + Random(250));
end;

{
Row 1, x: 571, 614, 657, 700 (x Dif = 43)
Row 1, y: 279
Row 2, y: 339
Row 3, y: 399 (y Dif = 60)
}

procedure RandomEmote(EmoteFrom, EmoteTo: Integer);
var
Range: TIntegerArray;
Emote, x, y, i: Integer;
begin
GameTab(tab_Emotes);
if not FixEmotes then
Exit;
Range := [EmoteFrom, EmoteTo];
for i := 0 to High(Range) do
begin
if not InRange(Range[i], 1, 16) then
begin
Writeln('Specified emote is out of range!');
Exit;
end;
end;
Emote := RandomRange(Range[0] - 1, Range[1]);
x := 570 + (Emote mod 4 * 43) - 6;
y := 229 + (Floor(Emote / 4.0) * 60) - 15;
Mouse(x, y, 12, 30, mouse_Left);
Wait(500 + Random(500));
end;

begin
SetupSRL;
ActivateClient;
RandomEmote(1, 16);
end.

Have fun with that ;)


omg! thanks sooooo much! where in my script above would i add this function inn?

7x7x

2012-09-28 15:15:55

From: Pavement

Message:=['msg1','msg2',....]; // String array each "msg" being a different message
for i:=0 to High(Message) do //For length of string times. So it does this for each message
begin
TypeSend(Message[i]); //sends the message i of the string array which will firstly be 0 (First message)
wait(RandomRange(blabla)); //this is the delay between messages. Afterwards it will change i to 2 and send the second message and so on...
end;


thanks so much fro explaining lol. i appreciate it!

7x7x

2012-09-28 15:41:35

From: Runaway
Hey there,

Was bored this morning so I made the RandomEmote function for you. It only does emotes 1-16 cause it's not worth coding scroll bar coords :p Also, I left the difference pattern in there in case you wanted to take a look at it:


program new;
{$i SRL/SRL.simba}

function FixEmotes: Boolean;
var
Arrow, Slider: TBox;
x, y, t: Integer;
begin
Result := False;
Arrow := IntToBox(722, 208, 735, 221);
Slider := IntToBox(722, 223, 735, 227);
GameTab(tab_Emotes);
MarkTime(t);
while not Result and (TimeFromMark(t) < 2000) do
begin
Result := CountColorTolerance(4807781, Slider.x1, Slider.y1, Slider.x2, Slider.y2, 3) > 6;
if Result then
Exit;
GetMousePos(x, y);
if not PointInBox(Point(x, y), Arrow) then
MouseTBox(Arrow, mouse_Move);
ClickMouse2(mouse_Left);
Wait(Random(100));
end;
Wait(250 + Random(250));
end;

{
Row 1, x: 571, 614, 657, 700 (x Dif = 43)
Row 1, y: 279
Row 2, y: 339
Row 3, y: 399 (y Dif = 60)
}

procedure RandomEmote(EmoteFrom, EmoteTo: Integer);
var
Range: TIntegerArray;
Emote, x, y, i: Integer;
begin
GameTab(tab_Emotes);
if not FixEmotes then
Exit;
Range := [EmoteFrom, EmoteTo];
for i := 0 to High(Range) do
begin
if not InRange(Range[i], 1, 16) then
begin
Writeln('Specified emote is out of range!');
Exit;
end;
end;
Emote := RandomRange(Range[0] - 1, Range[1]);
x := 570 + (Emote mod 4 * 43) - 6;
y := 229 + (Floor(Emote / 4.0) * 60) - 15;
Mouse(x, y, 12, 30, mouse_Left);
Wait(500 + Random(500));
end;

begin
SetupSRL;
ActivateClient;
RandomEmote(1, 16);
end.

Have fun with that ;)


ok so i added smart to this and i ran the bot, it does 2 emotes then executes it self, how can i stop the execution?

Pavement

2012-09-28 15:49:05


begin
SetupSRL;
ActivateClient;
RandomEmote(1, 16);
end.

This is the main loop in this part of the script. What it does is call the function"RandomEmote(1,16);" that runaway made. It looks like this function will have to be added into a loop to repeat.

I don't really know much myself but it may help to read a few guides about general scripting to understand it better, goodluck.

7x7x

2012-09-28 16:13:02

From: Pavement

begin
SetupSRL;
ActivateClient;
RandomEmote(1, 16);
end.

This is the main loop in this part of the script. What it does is call the function"RandomEmote(1,16);" that runaway made. It looks like this function will have to be added into a loop to repeat.

I don't really know much myself but it may help to read a few guides about general scripting to understand it better, goodluck.


ok so i added it to repeat, so not it works with out execution =)

now i need to know how to speed up and down the switching of emotes, have a clue where that might be?