SRL Archive - First Scripts

KrumpyySummoning!


cool4 ltr

2012-12-13 22:42:19


First time scripting it out (lol)

Took me a few hours to learn the basics, still trying to learn a lot more to advance with me scripter buddies =D

KrumpyySummoning:

Basic script as of now:


Set up: Attached a Photo

Basic mode - lowest detail - camera zoomed all the way out - TRAVELY - MAKE SURE YOUR SUPPLIES FOR THE POUCHES ARE IN THE FIRST INVENTORY SLOT

Stand in front of Magestix faceing North

Have the following at the bottom of your inventory

Supplies; charms, pouches, shards, scrolls.



Edit: Small adjustments to script

Chris Reborn

2012-12-13 23:25:17

Looks congratz on the first release ill check it out tomorow after school!

cool4 ltr

2012-12-13 23:30:08

From: idodew
Looks congratz on the first release ill check it out tomorow after school!


Thanks! looking forward to it, as well as your feedback for improvements

Soulipsism

2012-12-14 00:36:28

Hows it going, I've looked over your script and I have a lot of advice for you. I'm new here but I know quite a bit already.

I recommend you familiarize yourself with random numbers because with this script you are clicking on the exact pixel every time you need to accomplish something.

A decent example:

MoveMouse(260 + Random(5), 150 + Random(5));

I also suggest you use the following procedure when you're clicking with the mouse. Instead of using the outdated mouse movement.
Mouse(260, 150, 5, 5, true);

This Mouse procedure also clicks along with moving the mouse so you can condense your code even more. The third and fourth numbers are also built in random numbers so you wouldn't even have to use + random(x) while using this command.

You used ChooseOption well in this script.

The last and maybe most important thing is that you failed to use any loops in your entire script and it happens to be 6000 lines long. You could have easily accomplished line 111 to line 6158 by using a simple loop.

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
repeat
Trade;
Trade1;
until false;

For more information about loops I highly recommend you read a guide like this one:
http://villavu.com/forum/showthread.php?t=54339

That tutorial lists several types of loops.

There's a lot more that can be done but for now I don't want to overload you.

Google

2012-12-14 00:40:50

what is up with your main loop..

Edit: I will post back later with some suggestions.

cool4 ltr

2012-12-14 01:15:57

From: Soulipsism
Hows it going, I've looked over your script and I have a lot of advice for you. I'm new here but I know quite a bit already.

I recommend you familiarize yourself with random numbers because with this script you are clicking on the exact pixel every time you need to accomplish something.

A decent example:

MoveMouse(260 + Random(5), 150 + Random(5));

I also suggest you use the following procedure when you're clicking with the mouse. Instead of using the outdated mouse movement.
Mouse(260, 150, 5, 5, true);

This Mouse procedure also clicks along with moving the mouse so you can condense your code even more. The third and fourth numbers are also built in random numbers so you wouldn't even have to use + random(x) while using this command.

You used ChooseOption well in this script.

The last and maybe most important thing is that you failed to use any loops in your entire script and it happens to be 6000 lines long. You could have easily accomplished line 111 to line 6158 by using a simple loop.

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
repeat
Trade;
Trade1;
until false;

For more information about loops I highly recommend you read a guide like this one:
http://villavu.com/forum/showthread.php?t=54339

That tutorial lists several types of loops.

There's a lot more that can be done but for now I don't want to overload you.



Thanks for the feedback! very helpful going to push a ton of improvements within the next 24 hours =]

Slashed

2012-12-16 20:54:12

So, it's good you have initiative to learn, very good in fact so here's my advice on this script. Put it simply, you CAN'T use these mouse procedures like this, as in, with no randomization, it's so easily detected. With this script like this it can't run for more than 10 minutes I assure you.

Also, try to name your procedures something meaningful to you when you're scripting, I speak for myself here but what the hell does trade, trade1, trade2…etc do? Wouldn't it be much more easy to name it something more….intuitive?

This is basically a move the mouse and click predetermined pixels which I don't recommend at all. But what I recommend is this:

http://www.youtube.com/watch?v=qfumZWrm_DE

It's YoHoJo's first scripting tutorial. Look through it, learn at your pace, don't rush and try to learn the maximum you can and also remember to practice a lot!

I hope I have helped you. :biggrin:

joj0r

2012-12-19 09:37:30

i also have a nicely mouse feature for you, there's a human mouse procedure made by benland100 and flight, you should give them credit in your script when you use it :)

Procedure HumanMMouse(eX, eY, ranX, ranY: Integer); 
var
randSpeed: extended;
X,Y,X2,Y2,A,Dist,MP: integer;
begin

A := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
if MP < 0 then
MP := 1;

randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
X2 := RandomRange(eX-(A*MP), eX+(A*MP));
Y2 := RandomRange(eY-(A*MP), eY+(A*MP));
WindMouse(X, Y, X2, Y2, 9.0, 3.0, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
MouseSpeed := A;

end;

add this as an extra procedure, then change your
 Movemouse(260, 150);  

to

 HumanMMouse(260, 150,5,5);

the 5,5 at the end is the same as

(260 + Random(5), 150 + Random(5));
like Soulipsism said, just use the HumanMMouse :)

Fascinate

2012-12-25 01:01:31

Is this updated for the EoC? There is a window you have to click to choose what you want to infuse now!

DannyRS

2012-12-25 01:06:42

From: Fascinate
Is this updated for the EoC? There is a window you have to click to choose what you want to infuse now!


If its not, and your talking about the production window, goto any of my scripts that make something, and steal my ClickCraftAll and WaitCrafting functions, and add them to the script where you need them, obviously dont distribute it without OP's permission though

Fascinate

2012-12-25 01:09:55

From: DannyRS
If its not, and your talking about the production window, goto any of my scripts that make something, and steal my ClickCraftAll and WaitCrafting functions, and add them to the script where you need them, obviously dont distribute it without OP's permission though


Thanks! Love you! Lol I won't distribute but thanks for posting!

Gucci

2012-12-25 01:34:13

You should replace:

MoveMouse(x, y);
ClickMouse(x, y);

with

MMouse(x, y, rx, ry);
ClickMouse2(action);

Valid actions for ClickMouse2 are mouse_right (False), mouse_left(True) or move_mouse.

For example this is the original:

procedure Trade;
begin
Wait(2000);
Movemouse(260, 150);
Wait(1000);
Clickmouse(260, 150, mouse_right);
Wait(1000);
ChooseOption('rade');
Wait(1000);
Movemouse(570, 220);
Wait(1000);
Clickmouse(570, 220, mouse_right);
Wait(1000);
ChooseOption('ell 50');
Wait(1000);
Movemouse(200, 200);
Wait(1000);
Clickmouse(200, 200, mouse_right);
Wait(1000);
ChooseOption('uy All');
Wait(1000);
Movemouse(500, 25);
Wait(1000);
Clickmouse(500, 25, mouse_left);
Wait(1000);
Movemouse(320, 183);
Wait(1000);
Clickmouse(320, 183, mouse_left);
Wait(1000);
Movemouse(320, 315);
Wait(1500);
Clickmouse(320, 315, mouse_left);
Wait(1000);
Movemouse(650, 225);
Wait(2000);
Clickmouse(650, 225, mouse_left);
Wait(1000);
Movemouse(320, 183);
Wait(1000);
Clickmouse(320, 183, mouse_left);
Wait(1000);
Movemouse(320, 315);
Wait(1000);
Clickmouse(320, 315, mouse_left);
Wait(1000);
end;

Since you don't do any checking after the Movemouse you can just use Mouse, look:

procedure Trade;
begin
Wait(2000);
Mouse(260, 150, 2, 2, mouse_right);
WaitOption('rade', 1000);
Wait(1000);
Mouse(570, 220, 2, 2, mouse_right);
WaitOption('ell 50', 1000);
Wait(1000);
Mouse(200, 200, 2, 2, mouse_right);
WaitOption('uy All', 1000);
Wait(1000);
Mouse(500, 25, 2, 2, mouse_left);
Wait(1000);
Mouse(320, 183, 2, 2, mouse_left);
Wait(1000);
Mouse(320, 315, 2, 2, mouse_left);
Wait(1500);
Mouse(650, 225, 2, 2, mouse_left);
Wait(2000);
Mouse(320, 183, 2, 2, mouse_left);
Wait(1000);
Mouse(320, 315, 2, 2, mouse_left);
Wait(1000);
end;

Procedure DeclarePlayers;
begin

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
ClickNorth(SRL_ANGLE_HIGH); // I believe this won't do anything here
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
Wait(1000 + Random(2000)); // Add a wait for after logging in
ClickNorth(SRL_ANGLE_HIGH); // Now it will do this after your logged in and ready
repeat
Trade;
Trade1;
Trade2;
Trade3;
Trade4;
Trade5;
Trade6;
until false;

end.

Also your script is all static clicks and waits I would recommend checking out the tutorials for much better finding options like colors, DTM's and bitmaps. Also your standards need some work but it's nothing that makes the script difficult to read.

Fascinate

2012-12-25 01:35:15

From: Gucci
You should replace:

MoveMouse(x, y);
ClickMouse(x, y);

with

MMouse(x, y, rx, ry);
ClickMouse2(action);

Valid actions for ClickMouse2 are mouse_right (False), mouse_left(True) or move_mouse.

For example this is the original:

procedure Trade;
begin
Wait(2000);
Movemouse(260, 150);
Wait(1000);
Clickmouse(260, 150, mouse_right);
Wait(1000);
ChooseOption('rade');
Wait(1000);
Movemouse(570, 220);
Wait(1000);
Clickmouse(570, 220, mouse_right);
Wait(1000);
ChooseOption('ell 50');
Wait(1000);
Movemouse(200, 200);
Wait(1000);
Clickmouse(200, 200, mouse_right);
Wait(1000);
ChooseOption('uy All');
Wait(1000);
Movemouse(500, 25);
Wait(1000);
Clickmouse(500, 25, mouse_left);
Wait(1000);
Movemouse(320, 183);
Wait(1000);
Clickmouse(320, 183, mouse_left);
Wait(1000);
Movemouse(320, 315);
Wait(1500);
Clickmouse(320, 315, mouse_left);
Wait(1000);
Movemouse(650, 225);
Wait(2000);
Clickmouse(650, 225, mouse_left);
Wait(1000);
Movemouse(320, 183);
Wait(1000);
Clickmouse(320, 183, mouse_left);
Wait(1000);
Movemouse(320, 315);
Wait(1000);
Clickmouse(320, 315, mouse_left);
Wait(1000);
end;

Since you don't do any checking after the Movemouse you can just use Mouse, look:

procedure Trade;
begin
Wait(2000);
Mouse(260, 150, 2, 2, mouse_right);
WaitOption('rade', 1000);
Wait(1000);
Mouse(570, 220, 2, 2, mouse_right);
WaitOption('ell 50', 1000);
Wait(1000);
Mouse(200, 200, 2, 2, mouse_right);
WaitOption('uy All', 1000);
Wait(1000);
Mouse(500, 25, 2, 2, mouse_left);
Wait(1000);
Mouse(320, 183, 2, 2, mouse_left);
Wait(1000);
Mouse(320, 315, 2, 2, mouse_left);
Wait(1500);
Mouse(650, 225, 2, 2, mouse_left);
Wait(2000);
Mouse(320, 183, 2, 2, mouse_left);
Wait(1000);
Mouse(320, 315, 2, 2, mouse_left);
Wait(1000);
end;

Procedure DeclarePlayers;
begin

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
ClickNorth(SRL_ANGLE_HIGH); // I believe this won't do anything here
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
Wait(1000 + Random(2000)); // Add a wait for after logging in
ClickNorth(SRL_ANGLE_HIGH); // Now it will do this after your logged in and ready
repeat
Trade;
Trade1;
Trade2;
Trade3;
Trade4;
Trade5;
Trade6;
until false;

end.

Also your script is all static clicks and waits I would recommend checking out the tutorials for much better finding options like colors, DTM's and bitmaps. Also your standards need some work but it's nothing that makes the script difficult to read.


I'm not sure he is going to update this… I'm going to do it myself

rj

2012-12-26 00:21:53

Yea using static coords is BAD get you banned fast

neeger

2012-12-29 13:30:32

Static coords + wait time is alway the same "Wait(1000); " Try using like: Wait(900 + Random(500));

Btw make it so it check if option is available before clicking? And add failsafes?

Thehatered

2012-12-30 12:14:42

works but very bannable

Firestarmc

2012-12-30 21:21:47

OMG does this script work?