SRL Archive - OSR Help

help please !


tombow

2012-04-15 17:15:08

ok on a script im making i need it to right click the man and right click the item to buy,so i thought this would be code,but its not any advice? also i need it to walk to bank after full inv,as he only has 10 i need it to buy 10 hop world buy 10 hop buy 10? if u understand me then once inv full bank and repeat any help beacuse yohojos guide is for powerchopper so doesnt show about going to bank or hoping


Function findman:boolean;
var
x, y, Plusone, barcounter: integer;
begin
plusone:= Invcount + 1;
If FindObjCustom(x, y, ['name', 'h R'], [5726875, 2836576], 20) Then
begin
StatsGuise('hooray we found him');
getmousepos(x, y);

case random(1) of
0: begin
mouse (x, y, 10, 10, false);
WaitOption ('Trade', 3000);
end;
case random(1) of
0: begin
mouse (x, y, 10, 10, false);
WaitOption ('item', 3000);
end;
end;

Abu

2012-04-15 17:24:51

You posted two threads.
You didn't post your code in
 tags

Also, there are built in functions for banking, you can find them here: [url]http://docs.villavu.com/srl-5/bank.html[/url]

tombow

2012-04-15 20:06:33

ok im following yohojo tut and it says to put this in the droping thing

MouseItem(orePattern,False);

when i do it says
[Error] (200:37): Type mismatch at line 199
Compiling failed.

any help please???????????

Caotom

2012-04-15 20:24:22

From: tombow
ok im following yohojo tut and it says to put this in the droping thing

MouseItem(orePattern,False);

when i do it says
[Error] (200:37): Type mismatch at line 199
Compiling failed.

any help please???????????


Can you please post the whole script so we can have a look for the error?
If it is an error with that line, is it possibly because you are using a TPointArray in MouseItem, which requires an Integer?

~Caotom

tombow

2012-04-15 21:51:41

sorryy guys got another problem iv made the script working flawless atm, how to i add it so that when i click play it loads rs to bot ?

Le Jingle

2012-04-15 21:56:08

From: tombow
sorryy guys got another problem iv made the script working flawless atm, how to i add it so that when i click play it loads rs to bot ?


If you are trying to get your character loaded with the smart client try this;


program New;
{$DEFINE SMART}
{$DEFINE SRL5}
{$i srl/srl.simba}

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

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Active := True; //use this player?
end;

Procedure MainLoop;
begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end;

begin
MainLoop;
end.

tombow

2012-04-15 22:05:00

dont understand it :( iv wrotethe script but idk how to get it to add smart etc so client loads up?

SMART Initialized.
Loaded: Server 13, Members: False, Signed: True, Super Detail: False.
Error: Exception: Access violation at line 142
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

Jakkle

2012-04-15 22:37:27

If you would of listened to Caotom, your problem might have be sorted out by now.
From: Caotom
Can you please post the whole script so we can have a look for the error?
If it is an error with that line, is it possibly because you are using a TPointArray in MouseItem, which requires an Integer?

~Caotom

You see this,
From: tombow
SMART Initialized.
Loaded: Server 13, Members: False, Signed: True, Super Detail: False.

That means SMART is loading

This,
Error: Exception: Access violation at line 142

Means there is a problem at line 142. Which could be in your script or it might of opened up a new window in Simba and shown you a problem its having with a function or procedure your trying to use from the SRL library.

These don't worry about.
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]


So if you can post the function or procedure that line is in you will be helped a lot quicker, even better the whole script ;).

tombow

2012-04-15 22:48:00

program copperminer;
{$DEFINE SMART}
{.include SRL\SRL.simba}
{.Include SRL\SRL\Misc\Debug.simba}
//{$i SRL\SRL\Misc\paintsmart.simba}


Const

SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)
LoadsTotal= 999999; //How Many Total Lods To Do Per Character!
Version= '1.0'; //NO TOUCHY! program new;


{*******************************************************************************
procedure DeclarePlayers;
By: SRL
Description: SRL's Player Setup
*******************************************************************************}
procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players.BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Active := True;
Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
end;

end;


{*******************************************************************************
Procedure StatsGuise(wat:String);
By: YoHoJo
Description: Combination of Status & Diguise
*******************************************************************************}
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;


{*******************************************************************************
Function CheckAndClick(X,Y:Integer):Boolean;
By: YoHoJo
Description: Moves mouse to x,y, checks for uptext, and clikcs if found
*******************************************************************************}
Function CheckAndClick(UpText:String; X,Y:Integer; RClick:String):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 5000) Then
Begin
Result:=True;
GetMousePos(x, y);

Case RClick Of

'R':
Begin
Mouse(x, y, 0, 0, False);
WaitOption('ine', 2000);
FFlag(0);
End;

'L':
Begin
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
FFlag(0);
End;

End;
End;

End;


Procedure Antiban;
Begin
Case Random(2000) Of

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

End;
End;

Procedure Failsafe (reason:string);
begin
players[currentplayer].Loc:=reason;
logout;
stats_commit;
terminatescript;
end;



Function mineore:boolean;
var
x, y, Plusone, treecounter: integer;
begin
FindNormalRandoms;
plusone:= Invcount + 1;
If FindObjcustom(x, y, ['Mine', 'copper', 'e c'], [4884973, 5214973], 10) Then
begin
StatsGuise('hooray we found the bastard');
getmousepos(x, y);

case random(1) of
0: mouse (x, y, 5, 5, true);
1: begin
mouse (x, y, 5, 5, false);
WaitOption ('mine', 1000);
end;
end;

flag;
marktime(treecounter);

Repeat
FindNormalRandoms;
statsGuise('Antiban and waiting');
Antiban;
wait(100);
if invcount=plusone then
writeln('we got one');
until (invcount=plusone) or (timefrommark(treecounter) > 7000)

End;
end;

Procedure dropore;
var
x, y, oreDTM, I:integer;
Slotbox:Tbox;
orePattern:TintegerArray;



begin


oreDTM := DTMFromString('mbQAAAHicY2VgYHBhYmCwAmJ7IPYHYm8gfgIUvwvEn4D4BRDfAuJdOVZAkgmMDRQUwBgd/AdiRiwYDACBqAkk');
orePattern:=[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;
statsGuise('Dropping ore:' + InttoStr(I));
slotbox:=invbox(orePattern);
If FindDTM(oreDTM,x,y,slotbox.x1,slotbox.y1, slotbox.x2, slotbox.y2) Then
begin
MouseItem(orePattern,Mouse_Right);
chooseoption('rop');
end;
end;

end;

begin
Smart_Server := 54;
Smart_Members := true;
Smart_Signed := false;
Smart_SuperDetail := false;
SetupSRL;
DeclarePlayers;
repeat
mineore;
if InvFull Then
dropore;
Until(false);
End.

tehq

2012-04-15 22:48:37

^ Put simba tags around the script :)

Caotom

2012-04-15 22:52:36

From: tombow
program copperminer;
{$DEFINE SMART}
{.include SRL\SRL.simba}
{.Include SRL\SRL\Misc\Debug.simba}
//{$i SRL\SRL\Misc\paintsmart.simba}


Const

SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)
LoadsTotal= 999999; //How Many Total Lods To Do Per Character!
Version= '1.0'; //NO TOUCHY! program new;


{*******************************************************************************
procedure DeclarePlayers;
By: SRL
Description: SRL's Player Setup
*******************************************************************************}
procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Active := True;
Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
end;

end;


{*******************************************************************************
Procedure StatsGuise(wat:String);
By: YoHoJo
Description: Combination of Status & Diguise
*******************************************************************************}
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;


{*******************************************************************************
Function CheckAndClick(X,Y:Integer):Boolean;
By: YoHoJo
Description: Moves mouse to x,y, checks for uptext, and clikcs if found
*******************************************************************************}
Function CheckAndClick(UpText:String; X,Y:Integer; RClick:String):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 5000) Then
Begin
Result:=True;
GetMousePos(x, y);

Case RClick Of

'R':
Begin
Mouse(x, y, 0, 0, False);
WaitOption('ine', 2000);
FFlag(0);
End;

'L':
Begin
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
FFlag(0);
End;

End;
End;

End;


Procedure Antiban;
Begin
Case Random(2000) Of

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

End;
End;

Procedure Failsafe (reason:string);
begin
players[currentplayer].Loc:=reason;
logout;
stats_commit;
terminatescript;
end;



Function mineore:boolean;
var
x, y, Plusone, treecounter: integer;
begin
FindNormalRandoms;
plusone:= Invcount + 1;
If FindObjcustom(x, y, ['Mine', 'copper', 'e c'], [4884973, 5214973], 10) Then
begin
StatsGuise('hooray we found the bastard');
getmousepos(x, y);

case random(1) of
0: mouse (x, y, 5, 5, true);
1: begin
mouse (x, y, 5, 5, false);
WaitOption ('mine', 1000);
end;
end;

flag;
marktime(treecounter);

Repeat
FindNormalRandoms;
statsGuise('Antiban and waiting');
Antiban;
wait(100);
if invcount=plusone then
writeln('we got one');
until (invcount=plusone) or (timefrommark(treecounter) > 7000)

End;
end;

Procedure dropore;
var
x, y, oreDTM, I:integer;
Slotbox:Tbox;
orePattern:TintegerArray;



begin


oreDTM := DTMFromString('mbQAAAHicY2VgYHBhYmCwAmJ7IPYHYm8gfgIUvwvEn4D4BRDfAuJdOVZAkgmMDRQUwBgd/AdiRiwYDACBqAkk');
orePattern:=[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;
statsGuise('Dropping ore:' + InttoStr(I));
slotbox:=invbox(orePattern[I]);
If FindDTM(oreDTM,x,y,slotbox.x1,slotbox.y1, slotbox.x2, slotbox.y2) Then
begin
MouseItem(orePattern[I],Mouse_Right);
chooseoption('rop');
end;
end;

end;

begin
Smart_Server := 54;
Smart_Members := true;
Smart_Signed := false;
Smart_SuperDetail := false;
SetupSRL;
DeclarePlayers;
repeat
mineore;
if InvFull Then
dropore;
Until(false);
End.


In future could you please use simba and /simba wrappings around any code you post.
There does not seem to be an issue with the script, it compiles fine on my machine. When you get the error, does it open an include and highlight line 142 from that?

~Caotom

tombow

2012-04-15 22:53:07

what do you mean?

tombow

2012-04-15 22:54:46

yea this is what it opens 'smart tab'
if(prefix = '')then
thats line 142were it says error

Jakkle

2012-04-15 23:52:34

1 thing I have seen is that you have announced this
Function mineore:boolean;
var
x, y, Plusone, treecounter: integer;
begin
FindNormalRandoms;
plusone:= Invcount + 1;
If FindObjcustom(x, y, ['Mine', 'copper', 'e c'], [4884973, 5214973], 10) Then
begin
StatsGuise('hooray we found the bastard');
getmousepos(x, y);

case random(1) of
0: mouse (x, y, 5, 5, true);
1: begin
mouse (x, y, 5, 5, false);
WaitOption ('mine', 1000);
end;
end;

flag;
marktime(treecounter);

Repeat
FindNormalRandoms;
statsGuise('Antiban and waiting');
Antiban;
wait(100);
if invcount=plusone then
writeln('we got one');
until (invcount=plusone) or (timefrommark(treecounter) > 7000)

End;
end;
As a Boolean but yet you have not set any results.
So you either make a click rock function, which is advisable as you can then know if it is clicking the rock.
Or you can just make it a procedure, which I did.
So I changed a few things and here it is.
program copperminer;
{$DEFINE SMART}
{.include SRL\SRL.simba}
{.Include SRL\SRL\Misc\Debug.simba}
//{$i SRL\SRL\Misc\paintsmart.simba}


Const

SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
LoadsTotal = 999999; //How Many Total Lods To Do Per Character!
Version = '1.0'; //NO TOUCHY! program new;


{*******************************************************************************
procedure DeclarePlayers;
By: SRL
Description: SRL's Player Setup
*******************************************************************************}
procedure DeclarePlayers;
begin
HowManyPlayers := 1; // How many players are you using ?
NumberOfPlayers(HowManyPlayers); // Don't touch !!!
CurrentPlayer := 0; // Which player do you want to start with ?

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Pin := '';
Active := True;
BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];
Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
end;

end;


{*******************************************************************************
Procedure StatsGuise(wat:String);
By: YoHoJo
Description: Combination of Status & Diguise
*******************************************************************************}
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;


{*******************************************************************************
Function CheckAndClick(X,Y:Integer):Boolean;
By: YoHoJo
Description: Moves mouse to x,y, checks for uptext, and clikcs if found
*******************************************************************************}
Function CheckAndClick(UpText:String; X,Y:Integer; RClick:String):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 5000) Then
Begin
Result:=True;
GetMousePos(x, y);

Case RClick Of

'R':
Begin
Mouse(x, y, 0, 0, False);
WaitOption('ine', 2000);
FFlag(0);
End;

'L':
Begin
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
FFlag(0);
End;

End;
End;

End;


Procedure Antiban;
Begin
Case Random(2000) Of

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

End;
End;

Procedure Failsafe (reason:string);
begin
players[currentplayer].Loc:=reason;
logout;
stats_commit;
terminatescript;
end;



procedure mineore;
var
x, y, Plusone, treecounter: integer;
begin
FindNormalRandoms;
plusone:= Invcount + 1;
If FindObjcustom(x, y, ['Mine', 'copper', 'e c'], [4884973, 5214973], 10) Then
begin
StatsGuise('hooray we found the bastard');
getmousepos(x, y);

case random(1) of
0: mouse (x, y, 5, 5, true);
1: begin
mouse (x, y, 5, 5, false);
WaitOption ('mine', 1000);
end;
end;

flag;
marktime(treecounter);

Repeat
FindNormalRandoms;
statsGuise('Antiban and waiting');
Antiban;
wait(100);
if invcount=plusone then
writeln('we got one');
until (invcount=plusone) or (timefrommark(treecounter) > 7000)

end;
end;

Procedure dropore;
var
x, y, oreDTM, I:integer;
Slotbox:Tbox;
orePattern:TintegerArray;



begin


oreDTM := DTMFromString('mbQAAAHicY2VgYHBhYmCwAmJ7IPYHYm8gfgIUvwvEn4D4BRDfAuJdOVZAkgmMDRQUwBgd/AdiRiwYDACBqAkk');
orePattern:=[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;
statsGuise('Dropping ore:' + InttoStr(I));
slotbox:=invbox(orePattern[I]);
If FindDTM(oreDTM,x,y,slotbox.x1,slotbox.y1, slotbox.x2, slotbox.y2) Then
begin
MouseItem(orePattern[I],Mouse_Right);
chooseoption('rop');
end;
end;

end;

begin
Smart_Server := 54;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
LoginPlayer;
repeat
mineore;
if InvFull Then
dropore;
Until(false);
End.

You didn't have LoginPlayer; for a start.
You put smart signed to false, you can not use unsigned any more (unless they have changed it ?)
Also I cleaned up your declare players procedure. Change it back if you want.
Hope I helped :)

~Jakkle