SRL Archive - First Scripts

BooIvy


Bobby Boo

2012-04-14 01:16:38


Current features:
-Falador only currently*
-Antiban
-uses all hatchets (will not equip sc hatchets)
-currently does not get bird nests

*MUST use falador unless you want to add camera angle changing yourself
(script doesn't know to turn camera to face ivy)


Setup:
1)Put user and pass in the script
2)Go to falador ivy
3)Make sure your camera is facing north

Upcoming features:
-birds nests
-proggy


Very special thanks to m34tcode and Sockz for teaching me about pixelshift and adding it to the script <3


Please leave feedback and PLEASE help me improve this script.
This is my very first script and all help will be greatly appreciated!

Note: v1.1 and 1.2 are the same except for the fact that 1.2 is… more stable

m34tcode

2012-04-14 01:23:42

A script. I will read this and post some feed back =]

great first script. does it work? im not in the area to test lol.


A good feature to add, is detection on whether you are cutting or not. In the future, my PixelShiftOT function will be in the srl include, which will be perfect. For now, call isanimating =]

to use it, make a box around your char, and wait while is animating returns true ;]

Bobby Boo

2012-04-14 01:51:20

It does work…

the procedure to chop the ivy cuts until the uptext is not chop ivy, but…. the antiban occurs too frequently which moves the mouse off of the ivy and causes a constant looping of right click > chop ivy > antiban > repeat

So, how do I reduce the frequency that my antiban occurs?

m34tcode

2012-04-14 01:52:58

add a wait. Wait while cutting would be best

Got to use pixelshift for that, since you get xp too slowly
pixelshift tut ;]
http://villavu.com/vb/showthread.php?t=74090

Bobby Boo

2012-04-14 01:54:08

you're gonna have to go more in depth with this pixelshift stuff <3

m34tcode

2012-04-14 01:54:59

Added the tut. Im too tired to explain fully lol. 1:55 am here:p

Bobby Boo

2012-04-14 01:59:36

Late here too…
I'll check into it thanks a bunch
Will credit if I end up using pixelshift

m34tcode

2012-04-14 02:11:57

Dont worry about credits. I didnt write any code ;]. Just learn all you can =]

Sockz

2012-04-14 02:15:53

you can try this instead

repeat
wait(400+random(250));
AntiBan;
Until not IsMoving
FindNormalRandoms;

It is still the pixelshift thing, just somebody has made the box around the player for you :D

also for your antiban to occur less often try changing the integer in this line of code

case Random(8) of  

Putting in a number higher than 8 will make it occur less frequently.

Basically atm it generates a number from 0 to 8, if it generates 0 your hoverskill event thing will occur, if it generates 1 your pickupmouse event will occur and for 2 it changes the compass in your script. If it generates 3, 4 , 5, 6, 7 or 8 nothing will occur. So increasing the max number it can generate, in your case 8 atm, it will be less likely to pick 0, 1 or 2 and therefor less antiban.

Hope you understand :D

m34tcode

2012-04-14 02:34:33

You didnt include the rest of the func so he wont understand;]

What he is saying is this:

case random(8) of
0: DoSomthing;
1: DoSomethingElse;
2: DoAnotherThing
3: DoThingsUnseen
4: PerformSomeAntibanz

etc. if random 8 in that case statement returns 3, then dothingsunseen will execute. if random reutrns 0 then do something will execute. It will executes whatever random returns. ;]

also that has nothing to do with pixelshift so idk what you meant about that sockz o.O

Sockz

2012-04-14 02:51:03

From: m34tcode
You didnt include the rest of the func so he wont understand;]

What he is saying is this:

case random(8) of
0: DoSomthing;
1: DoSomethingElse;
2: DoAnotherThing
3: DoThingsUnseen
4: PerformSomeAntibanz

etc. if random 8 in that case statement returns 3, then dothingsunseen will execute. if random reutrns 0 then do something will execute. It will executes whatever random returns. ;]

also that has nothing to do with pixelshift so idk what you meant about that sockz o.O



I'm bad at explaining stuff. Long story short, increase 8 :P

And i dont know what your talking about ;)

function IsMoving: Boolean;
begin
Result := PixelShift(IntToBox(MMCX-30, MMCY-30, MMCX+30, MMCY+30), 500) > 200;
end;

Bobby Boo

2012-04-14 08:52:23

From: Sockz
you can try this instead

repeat
wait(400+random(250));
AntiBan;
Until not IsMoving
FindNormalRandoms;

It is still the pixelshift thing, just somebody has made the box around the player for you :D

also for your antiban to occur less often try changing the integer in this line of code

case Random(8) of  

Putting in a number higher than 8 will make it occur less frequently.

Basically atm it generates a number from 0 to 8, if it generates 0 your hoverskill event thing will occur, if it generates 1 your pickupmouse event will occur and for 2 it changes the compass in your script. If it generates 3, 4 , 5, 6, 7 or 8 nothing will occur. So increasing the max number it can generate, in your case 8 atm, it will be less likely to pick 0, 1 or 2 and therefor less antiban.

Hope you understand :D


You actually explained it perfectly the first time <3

And that first bit you gave me… I can use IsMoving rather than setting up some pixelshift crap?

Sockz

2012-04-14 08:59:00

From: Bobby Boo
You actually explained it perfectly the first time <3

And that first bit you gave me… I can use IsMoving rather than setting up some pixelshift crap?


Haha pixelshift is a very useful function but yeah, I reckon isMoving would do. It creates a box around the player and detects if its moving for you. I think it will detect woodcutting movements but your gonna have to test it :D

Bobby Boo

2012-04-14 09:10:24


function IsMoving: Boolean;
begin
Result := PixelShift(IntToBox(MMCX-30, MMCY-30, MMCX+30, MMCY+30), 500) > 200;
end;

I guess I have to add this in.. but can it go anywhere or do I need to plug it into what I have

And also.. what do I put in the main loop for this?

xtrapsp

2012-04-14 09:13:30

Goodluck with this :) If you need any help hit me up

Sockz

2012-04-14 09:14:49

From: Bobby Boo

function IsMoving: Boolean;
begin
Result := PixelShift(IntToBox(MMCX-30, MMCY-30, MMCX+30, MMCY+30), 500) > 200;
end;

I guess I have to add this in.. but can it go anywhere or do I need to plug it into what I have

And also.. what do I put in the main loop for this?


Thats straight out of the simba include, I was just showing that it does use pixelshift.

If you use IsMoving how i said in my first post it should be right :D

Bobby Boo

2012-04-14 09:35:56

From: m34tcode




also that has nothing to do with pixelshift so idk what you meant about that sockz o.O


From: Sockz


And i dont know what your talking about ;)



Makes me weary about using the first way ;)

Sockz

2012-04-14 09:39:10

From: Bobby Boo
Makes me weary about using the first way ;)


I posted the function to show it does use pixelshift :P

Anyway, their is nothing better than testing yourself, hows the script going?

Bobby Boo

2012-04-14 09:49:02

I put in the IsMoving thing and it still checks for the uptext…?

E: but antiban works much better now

E2: definitely looks suspicious the way it moves around all the time… idk what to do <3

Sockz

2012-04-14 09:55:25

Post the new code, I'll take a look

Bobby Boo

2012-04-14 10:07:17

I'll post the new and if you fix it i'll credit <3

       /////////////////////////////////////
/////////////~~~~Boo~~~~/////////////
////////////~~~~Ivy~~~~//////////////
/////////////////////////////////////
program BooIvy;
{$DEFINE SMART}
{$i srl/srl.simba}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=''; //username here
Players[0].Pass :=''; //password here
Players[0].Active:=True;
end;

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(50) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2001+Random(999));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(150));
FindNormalRandoms;
end;
end;
end;

procedure ChopIvy;
var x, y: integer;
begin
if FindObj(x, y, 'hop Iv', 3629644, 20) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('hop Iv');
end;
repeat
wait(400+random(250));
AntiBan;
Until not IsMoving;
FindNormalRandoms;
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
Repeat
ChopIvy;
Until (False);
end.

m34tcode

2012-04-14 10:32:58

From: Sockz
you can try this instead

Simba Code:
[LEFT]repeat
wait(400+random(250));
AntiBan;
Until not IsMoving
FindNormalRandoms;
[/LEFT]


It is still the pixelshift thing, just somebody has made the box around the player for you :D

also for your antiban to occur less often try changing the integer in this line of code

Simba Code:
[LEFT]case Random(8) of
[/LEFT]


Putting in a number higher than 8 will make it occur less frequently.

Basically atm it generates a number from 0 to 8, if it generates 0 your hoverskill event thing will occur, if it generates 1 your pickupmouse event will occur and for 2 it changes the compass in your script. If it generates 3, 4 , 5, 6, 7 or 8 nothing will occur. So increasing the max number it can generate, in your case 8 atm, it will be less likely to pick 0, 1 or 2 and therefor less antiban.

Hope you understand :D


I didnt realize you were referring to ismoving. Ismoving does not detect player movement. It detects if you are walking or not. It uses pixelshift on the minimap, not the main screen. You must create a box around your char, and calc the pixelshift in that ;]

Sockz

2012-04-14 10:49:02

From: m34tcode
I didnt realize you were referring to ismoving. Ismoving does not detect player movement. It detects if you are walking or not. It uses pixelshift on the minimap, not the main screen. You must create a box around your char, and calc the pixelshift in that ;]



Ohh :P that clears so much up. Thats why it didn't work, I guess i learnt something out of this too :D

here is an example of what m34tcode suggested

procedure ChopIvy;
var x, y: integer;
begin
if FindObj(x, y, 'hop Iv', 3629644, 20) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('hop Iv');
end;
repeat
wait(400+random(250));
AntiBan;
Until (PixelShift(IntToBox(237, 150, 293, 208), 1000) < 600) ;
FindNormalRandoms;
end;

This is my understanding of this pixelshift function anyways -
you declare a box i.e. (237, 150, 293, 208) 237,150 being the top left x and y co-ords and 293, 208 being the bottom right. Use the colour picking tool to make this box.

Basically it checks how much the pixels change in the box you made over a period of time, in this case i set it to 1000(ms).

You can play around with that line until it works for you.

m34tcode

2012-04-14 11:22:38

600 may be right. Sockz function is exactly what i meant.unindent the repeat and until, and place find normal randoms in that loop ;]

Bobby Boo

2012-04-14 11:49:39

600 works great… i'll give credits to both of you
Thank you very very much for your help

Sockz

2012-04-14 12:12:51

From: Bobby Boo
600 works great… i'll give credits to both of you
Thank you very very much for your help


Anytime buddy, feel free to pm me any questions :D

m34tcode

2012-04-14 12:15:27

Or just post a thread. The community is more than happy to help you out. Make sure you search first ;]

Bobby Boo

2012-04-14 17:02:25

Been reading up on how to make a proggy.. I might have that included by tomorrow

Imanoobbot

2012-04-14 17:28:22

You could use my Autocolor function for Nest detection. Read that you haven´t added it yet. Working on an IvyCutter too at the moment ;)

Good Luck with yours. PM me if you got questions.


function NestAutoColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.29, 1.80);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 3359302, MSX1, MSY1, MSX2, MSY2, 2);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the NestColor.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 4.20) and (X <= 5.67) and (Y >= 4.49) and (Y <= 6.10) and (Z >= 3.30) and (Z <= 4.64) then
begin
Result := arC[i];
Writeln('NestColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('We failed in finding the NestColor.');
end;

Bobby Boo

2012-04-15 00:41:50

From: Imanoobbot
You could use my Autocolor function for Nest detection. Read that you haven´t added it yet. Working on an IvyCutter too at the moment ;)

Good Luck with yours. PM me if you got questions.


function NestAutoColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.29, 1.80);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 3359302, MSX1, MSY1, MSX2, MSY2, 2);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the NestColor.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 4.20) and (X <= 5.67) and (Y >= 4.49) and (Y <= 6.10) and (Z >= 3.30) and (Z <= 4.64) then
begin
Result := arC[i];
Writeln('NestColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('We failed in finding the NestColor.');
end;


wow thanks a lot.. this was my problem with adding it. I didn't know how to detect the nest

E: how silly of me to not GL you back.. though you probably won't need it ;)


I'm trying to think of how to pick the nest up after it is recognized…:

 If (NestAutoColor) := True then
FindObj(x, y, 'ird's Nest', 3359302, 0);
begin
Mouse(x, y, 2, 2, false);
ChooseOption('ake Bird');
end;

I think the first line is wrong.. idk if you can do that or not ;)