SRL Archive - First Scripts

[First Script] Almost Done, Need Help with a few things please. 07 server


alipotter890

2013-03-28 15:00:25

Its a Hunting Script, Its for using Falcon to get Spotted Kebbit, Burry there bones and drop there fur.

So far I'm having trouble getting the bot to click on them, It just hovers on them, but doesn't click.
Next, I need it to drop the fur and bury the bones. If you can help me with those things, I'll give you credit. I've tried so many times but can do it.

My Hunting Script atm. Its for 07 server



program Falcon;
{$DEFINE SMART8}
{$i srl/srl.simba}
{$I P07Include.Simba}
{$I SRL/srl/misc/SmartGraphics.simba}

const
SRLStats_Username = '';
SRLStats_Password = '';
Version = '1.0';
StartPlayer= 0;
NumbOfPlayers= 0;


procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
for i := 0 to 1-1 do
Players[i].BoxRewards := ['ook', 'amp', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Active := True;
Integers[1] := 4;
Integers[2] := 4;
end;

end;

Procedure Antiban;
Begin
Case Random(20000) Of

0:
Begin
HoverSkill('Hunting', False);
GameTab(Tab_Inv);
End;
1:
Begin
PickUpMouse;
SleepAndMoveMouse(3000 + Random(500));
PickUpMouse;
End;
2: ExamineInv;
3:
Begin
RandomAngle(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);
End;
4:
Begin
GameTab(Tab_Stats);
Wait(3000 + Random(500));
GameTab(Tab_Inv);
End;
5:
Begin
HoverSkill('random', False);
GameTab(Tab_Inv);
End;

End;
End;

Function SpottedKebbit:Boolean;
var
X, Y, PlusOne, SpottedCounter: Integer;
begin
FindNormalRandoms;
PlusOne:= InvCount +2;
If FindObjCustom(X, Y, ['Spotted', 'kebbit', 'D k'], [2111308, 1583159, 2309202, 1979206], 1) Then
begin
Writeln('Found the spotted Kebbit');
GetMousePos( X, Y);
Case Random(2) Of
0: Mouse( X, Y, 5, 5, True);
1: Begin
Mouse( X, Y, 5, 5, False);
WaitOption('Catch', 800);
End;
End;

Repeat
FindNormalRandoms;
MarkTime(SpottedCounter);
Antiban;
Wait(100);
If InvCount=Plusone Then
Writeln('Caught One');
Until (InvCount=Plusone) Or (TimeFromMark(SpottedCounter) > 5000)

End;
end;

Procedure Dropkebbitfur;
var
X, Y, furDTM, I:Integer;
SlotBox:TBox;
furPattern:TIntegerArray;

Begin

furDTM := DTMFromString('mbQAAAHicY2VgYMhlYmBIAeIKIK6GsnUZGRgsgdgKiNWAWB6IHfSlgaoZ0TAmQFcBVwUAQlgDtQ==');
furPattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28];

For I:=0 To 27 Do
Begin
FindNormalRandoms;
SlotBox:=InvBox (furPattern[I]);
If FindDTM(furDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
// MouseItem(furPattern[I],False);
ChooseOption('Dro');
end;
end;


end;

begin
SetupSRL;
SetupP07Include;
DeclarePlayers;
ActivateClient;
Wait(2000);


Repeat;
Antiban;
SpottedKebbit;
If InvFull Then

Dropkebbitfur;
Until(false);


end.




I got an error on this part, // MouseItem(furPattern,False);

Runehack123

2013-03-28 15:02:27

nice good job but you forget to free DTM which is too bad bro
but please this is good script keep it up nice start :)

alipotter890

2013-03-28 15:05:09

From: Runehack123
nice good job but you forget to free DTM which is too bad bro
but please this is good script keep it up nice start :)
how do i do that?

Edit: Like this?


procedure freeDTMs;
begin
freeDTM(furDTM);
end;

Runehack123

2013-03-28 15:08:46

look here themost useful post ever made he is a God legend and you know it
http://villavu.com/forum/showthread.php?t=78418
learn it live it love it

the way things work in programming languages is that you call on memory but it also has to be freed otherwise there memory leaks and that means that memory is just used up and can never be used again.
Memory leak is partly responsible for PC aging geting slower with age so right now I wouldn't run your script it might break down you are calling on DTM a lot in that repeat loop and never freeing.
I would change fast but I don't think it will take you long if you read the link :)

sahibjs

2013-03-28 15:10:14

From: alipotter890
how do i do that?

Edit: Like this?


procedure freeDTMs;
begin
freeDTM(furDTM);
end;


Then in your main loop put Addonterminate (freeDTMS);

alipotter890

2013-03-28 15:11:10

Thanks a lot lol, I tryed watching his videos, I figured out some.

Le Jingle

2013-03-28 15:15:01

When using MouseItem, the second parameter doesn't accept a boolean or a variant. Instead, it asks for the Integer type, thus you'd want to use the Mouse_Right constant (which represents an Integer) to get a right click action.

alipotter890

2013-03-28 15:21:34

I'm thinking of quiting, I'm tryed for 3 days..

sahibjs

2013-03-28 15:25:20

From: alipotter890
I'm thinking of quiting, I'm tryed for 3 days..


Don't quit! The more questions you ask, the more answers you'll get, and the more progresss you'll make! Just be patient with the questions

Also, you're using the Mouse function which (I think) has been advised against. Why don't you try using MMouse, and then ClickMouse2(Mouse_Left) (once again, I think)

Runehack123

2013-03-28 15:27:35

From: alipotter890
I'm thinking of quiting, I'm tryed for 3 days..


relax take a short break and then get back to it
it just takes practice but it gets to natural after a while so don't worry

alipotter890

2013-03-28 15:42:53

All I want is to make it bot for me till level 63. If someone can help write the script for this community then It would be awesome, I might not be able to finish. If someone wants to work on it for me and finish it that would be cool. And he can get all the credit.

sahibjs

2013-03-28 15:44:40

From: alipotter890
All I want is to make it bot for me till level 63. If someone can help write the script for this community then It would be awesome, I might not be able to finish. If someone wants to work on it for me and finish it that would be cool. And he can get all the credit.


You've already made tremendous progress mate. You'll be able to finish it with no problem. I'm not forcing you or anything, but it would be a shame if you stopped right now

alipotter890

2013-03-28 17:37:13

From: sahibjs
You've already made tremendous progress mate. You'll be able to finish it with no problem. I'm not forcing you or anything, but it would be a shame if you stopped right now


I know mate, Idk how to work some of them.

alipotter890

2013-03-29 02:13:27

Can someone help fix it for me?

djm995

2013-04-26 21:11:27

i'll put this in the script directory, you might get more feedback/help that way :)

TheeMason

2013-04-26 21:55:56

I would love to help you out, but I'm not a member, and I have little experience with members, and scripting… I have been there before man, just go into the tutorials and research. If your patient with the community they will be patient with you also. Hang in there dude!

t4q

2013-04-27 03:29:07

From: alipotter890
I'm thinking of quiting, I'm tryed for 3 days..

i don't have 07 includes so i can't test it :(
Also I don't understand that pattern part :redface: maybe someone could explain this to me
But try this:

program Falcon;
{$DEFINE SMART8}
{$i srl/srl.simba}
{$I P07Include.Simba}
{$I SRL/srl/misc/SmartGraphics.simba}

const
SRLStats_Username = '';
SRLStats_Password = '';
Version = '1.0';
StartPlayer= 0;
NumbOfPlayers= 0;


procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
for i := 0 to 0 do
Players[i].BoxRewards := ['ook', 'amp', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Active := True;
Integers[1] := 4;
Integers[2] := 4;
end;

end;

Procedure Antiban;
Begin
Case Random(6) Of

0:
Begin
HoverSkill('Hunting', False);
GameTab(Tab_Inv);
End;
1:
Begin
PickUpMouse;
SleepAndMoveMouse(3000 + Random(500));
PickUpMouse;
End;
2: ExamineInv;
3:
Begin
RandomAngle(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);
End;
4:
Begin
GameTab(Tab_Stats);
Wait(3000 + Random(500));
GameTab(Tab_Inv);
End;
5:
Begin
HoverSkill('random', False);
GameTab(Tab_Inv);
End;

End;
End;

Function SpottedKebbit:Boolean;
var
X, Y, PlusOne, SpottedCounter: Integer;
begin
FindNormalRandoms;
PlusOne:= InvCount +2;
If FindObjCustom(X, Y, ['Spotted', 'kebbit', 'D k'], [2111308, 1583159, 2309202, 1979206], 1) Then
begin
Writeln('Found the spotted Kebbit');
Case Random(2) Of
0: Mouse( X, Y, 5, 5, mouse_left);
1: Begin
Mouse( X, Y, 5, 5, mouse_right);
WaitOption('Catch', 800);
End;
End;

Repeat
FindNormalRandoms;
MarkTime(SpottedCounter);
Antiban;
Wait(100);
If InvCount=Plusone Then
Writeln('Caught One');
Until (InvCount=Plusone) Or (TimeFromMark(SpottedCounter) > 5000)

End;
end;

Procedure Dropkebbitfur;
var
X, Y, furDTM, I:Integer;
SlotBox:TBox;
furPattern:TIntegerArray;

Begin

furDTM := DTMFromString('mbQAAAHicY2VgYMhlYmBIAeIKIK6GsnUZGRgsgdgKiNWAWB6IHfSlgaoZ0TAmQFcBVwUAQlgDtQ==');
// furPattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28];

// For I:=0 To 27 Do
// Begin
FindNormalRandoms;
SlotBox:=InvBox (furPattern[I]);
If FindDTM(furDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
// MouseItem(furPattern[I],False);
mouse(x, y, 3, 3, mouse_right);
WaitOption('Dro',500);
end;
// end;
freeDTM(furDTM);

end;

begin
SetupSRL;
SetupP07Include;
DeclarePlayers;
ActivateClient;
Wait(2000);


Repeat;
Antiban;
SpottedKebbit;
If InvFull Then

Dropkebbitfur;
Until(false);


end.

Falixus

2013-05-18 15:36:40

So far it looks good.

aaron126

2013-05-22 10:42:00

From: alipotter890
Can someone help fix it for me?


lol didn't realize someone else had a falconry script in the making xD
ali if you're still active, you can take a look at my falconry script, which would probably answer your questions.