SRL Archive - OSR Help

Starting my first script


juunhoad

2013-02-27 20:46:52

Hello guys,

I just started writing my first script for 07scape by reading tutorials and mainly by watching the scripting video from YoHoJoSRL.

Right now my script is only chopping the maple trees at seers village. I want to add bank later. First I need to know if the script is correct right now, I have no compile issues but still want to know if it functions right :)

program MapleChopper;
{$i SRL\SRL.simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I P07Include.Simba}
const
Version = '1,0';

Procedure P07_DeclarePlayer;
Begin
P07_PlayerName:='';
P07_PlayerPass:='';
end;


Function AntiBan: Boolean;

begin
case Random(250) of
0: P07_HoverSkill ('woodcutting', RandomRange(2500, 4000));
1: P07_MakeCompassSouth;
2: MMouse(random(700), random(400), 0, 0);
3: P07_MakeCompassEast;
4: P07_MakeCompassWest;
5: P07_MakeCameraAngleHigh;
end;
end;

Function ChopDownMaple: boolean;
var
x, y, TreeCounter: Integer;
begin
if P07_FindObjCustom(x, y, ['Cho', 'own','p d'], [20860, 21377, 19325], 10) then
begin
case Random(2) of
0: begin
ClickMouse2(mouse_left);
Wait(RandomRange(9000, 11000))
end;
1:
begin
ClickMouse2(mouse_right);
P07_WaitOptionMulti(['hop', 'own'],RandomRange(200,300))
Wait(RandomRange(9000, 11000));
end;
end;

repeat
MarkTime(TreeCounter);
Antiban;
Wait(100);
Until (TimeFromMark(TreeCounter) > 7000)

end;
end;


begin
ActivateClient;
SetupP07Include;
P07_DeclarePlayer;
repeat
ChopDownMaple;
until(false);
TerminateScript;
end.

I want to know if my antiban in the function 'ChopDownMaple' works correct this way for 07scape? because I saw it in a scripting video that was 2 years old.
And what do you think I can improve more?

I already saw in issue with chopping. There are 4 tree's at seers village. 3 tree's pretty close to eachother and 1 tree not. If the script comes to close at the 1 tree side it can't see the other tree's anymore. How can I fix this?
If you don't know what I mean, go to seers village.

Ian

2013-02-27 20:50:05

Antiban Procedure should work fine. The best was to see if it works is to test it, then come back and tell us how it goes :)

Sjoe

2013-02-27 20:52:17

Looks great to me!
Nice work, good standards and it's logical.
Keep it up ;)

juunhoad

2013-02-28 07:20:23

I changed
2: MMouse(random(700), random(400), 0, 0);
from the antiban to
MMouse(RandomRange(X - 5, X + 5), RandomRange(y - 5, y + 5), 0, 0);


Or could I keep?
 MMouse(random(700), random(400), 0, 0);?

Sjoe

2013-02-28 07:22:59

euh make it MMouse(RandomRange(1, 500), RandomRange(1,500), 0, 0));
or use HoverMouse

check antiban include for more :)

juunhoad

2013-02-28 07:29:48

Ok thx changed it.
I already encoutered a problem with the antiban.
Right now I have
repeat
MarkTime(TreeCounter);
Antiban;
Wait(100);
Until (TimeFromMark(TreeCounter) > 7000)

But then it will Repeat the antiban the whole time after 7 seconds, so it can't chop again. How can I changed this in to the code that it will randomly do antiban within 7-9 seconds?

juunhoad

2013-02-28 07:31:49

Could this work?
repeat
MarkTime(TreeCounter);
Antiban;
Wait(100);
Until (TimeFromMark(TreeCounter) = RandomRange(7000, 9000))

EDIT: The script still keeps doing the repeat…until proces.
It will first click on the tree, then after several seconds it will only do the antiban function because of the repeat..until and can't chop again.

Mark

2013-02-28 07:57:00

You have your MarkTime. In the wrong place its should be before the repeat loop.

Right now you are marking the time inside your loop which is making it repeat forever.

Edit:
Could do

If TimeFromMark(timer) > 7000 then
Begin
Antiban;
MarkTime(timer);
End;

Add your random interval time to make it more human like

juunhoad

2013-02-28 08:16:56

Thankyou, this is working. What would be the best TimeFromMark with the randomrange click:
Wait(RandomRange(9000, 11000));  
because now the antiban will sometimes be right before the ClickMouse2 which looks weird. Seeing the mousemove(for antiban) and then instantly to the tree(for cutting).

Now I have another question. How can I only make it click the tree when it's NOT cutting?
Because now the script will randomly click the tree within 9-11 seconds.

Mark

2013-02-28 08:27:55

it looks weird because your not controlling the mouse :P
there is nothing wrong with that you could have your antiban with longer intervals alot of people afk while doing certain skills there is no perfect amount everybody is random while playing legit i do so much antiban i dont even realise it try record your self playing runescape legit and see what you do without knowing

you could also look into Animation.Simba

Le_don

2013-02-28 08:49:56

From: juunhoad
Hello guys,

I just started writing my first script for 07scape by reading tutorials and mainly by watching the scripting video from YoHoJoSRL.

Right now my script is only chopping the maple trees at seers village. I want to add bank later. First I need to know if the script is correct right now, I have no compile issues but still want to know if it functions right :)

program MapleChopper;
{$i SRL\SRL.simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I P07Include.Simba}
const
Version = '1,0';

Procedure P07_DeclarePlayer;
Begin
P07_PlayerName:='';
P07_PlayerPass:='';
end;


Function AntiBan: Boolean;

begin
case Random(250) of
0: P07_HoverSkill ('woodcutting', RandomRange(2500, 4000));
1: P07_MakeCompassSouth;
2: MMouse(random(700), random(400), 0, 0);
3: P07_MakeCompassEast;
4: P07_MakeCompassWest;
5: P07_MakeCameraAngleHigh;
end;
end;

Function ChopDownMaple: boolean;
var
x, y, TreeCounter: Integer;
begin
if P07_FindObjCustom(x, y, ['Cho', 'own','p d'], [20860, 21377, 19325], 10) then
begin
case Random(2) of
0: begin
ClickMouse2(mouse_left);
Wait(RandomRange(9000, 11000))
end;
1:
begin
ClickMouse2(mouse_right);
P07_WaitOptionMulti(['hop', 'own'],RandomRange(200,300))
Wait(RandomRange(9000, 11000));
end;
end;

repeat
MarkTime(TreeCounter);
Antiban;
Wait(100);
Until (TimeFromMark(TreeCounter) > 7000)

end;
end;


begin
ActivateClient;
SetupP07Include;
P07_DeclarePlayer;
repeat
ChopDownMaple;
until(false);
TerminateScript;
end.

I want to know if my antiban in the function 'ChopDownMaple' works correct this way for 07scape? because I saw it in a scripting video that was 2 years old.
And what do you think I can improve more?

I already saw in issue with chopping. There are 4 tree's at seers village. 3 tree's pretty close to eachother and 1 tree not. If the script comes to close at the 1 tree side it can't see the other tree's anymore. How can I fix this?
If you don't know what I mean, go to seers village.


Hey man.

Make it so it has more chance of single clicking trees, and a lower chance of right clicking. A 50/50 chance is too obvious.
Le_Don

juunhoad

2013-02-28 08:52:40

Ya that's true :P right now I have this function for Chopping:
Function ChopDownMaple: boolean;
var
x, y, TreeCounter, PlusThree: Integer;
begin
if P07_FindObjCustom(x, y, ['Cho', 'own','p d'], [20860, 21377, 19325], 10) then
begin
case Random(20) of
0..15: begin
Wait(RandomRange(100,250));
ClickMouse2(mouse_left);
Wait(RandomRange(9000, 11000));
end;
15..20:
begin
Wait(RandomRange(100,250));
ClickMouse2(mouse_right);
P07_WaitOptionMulti(['hop', 'own'],RandomRange(200,300))
Wait(RandomRange(9000, 11000));
end;
end;

if TimeFromMark(TreeCounter) > 5000 then
begin
AntiBan;
Wait(RandomRange(1500,3000))
Marktime(TreeCounter);
end;

end;
end;

Will this look random enough for you?
Ok thx, I will have a look at that.
But, I got another question again :p. Does this procedure look good for Birds nest?
procedure BirdsNest;
var
x ,y: Integer;
begin
if P07_FindObjCustom(x, y, ['ake'], [2569530, 2569530], 5) then
begin
Wait(RandomRange(1000,1500));
ClickMouse2(mouse_left);
end;
end;

juunhoad

2013-02-28 08:55:10

From: Le_don
Hey man.

Make it so it has more chance of single clicking trees, and a lower chance of right clicking. A 50/50 chance is too obviouse.

Le_Don


Already had done that :P look above this post

Le_don

2013-02-28 13:09:57

From: juunhoad
Already had done that :P look above this post


Good work, using your TreeCounter in a private script for mining - hope you don't mind!

Can't seem to get it to click, though it hovers over the ore.. Hopefully I don't have bugged uptext.. Here's my code, It's the old ore I'm trying to mine.


program LeDonsKhazardIronDepositor2;
{$i SRL\SRL.simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I P07Include.Simba}
const
Version = '0.0';

procedure Iron;
var
x, y, TreeCounter: Integer;
begin
if P07_FindObjCustom(x, y, ['ine', 'Mine', 'Min'], [1646647, 1646647, 1646647], 10) then
begin
case Random(20) of
15:
begin
ClickMouse2 (mouse_left);
Wait (RandomRange(200,500))
end;
5:
begin
ClickMouse2 (mouse_right);
P07_WaitOptionMulti(['Mine', 'ine'], RandomRange (200,300))
Wait (RandomRange(400,700))
end;
end;
repeat
MarkTime(TreeCounter);
Wait(100);
Until (TimeFromMark(TreeCounter) > 5000)

end;
end;

begin
ActivateClient;
SetupSRL;
SetupP07Include;
repeat
Iron;
until(false);
TerminateScript;
end.

Hoping you could help me out, lol sorry if I missed something I'm new too!

juunhoad

2013-02-28 14:15:17

try 1..15: not only 15