SRL Archive - Help and Support

Help with Store Seller Script Please.


RAM

2010-01-13 16:15:21

I could use a little help Please….

Trying to make a Store Seller for Varrock….

The Actual Procedure for selling notes to the store works fine….:)

Finding the Shop Keepers does not…:duh:

I would like it to be able to sell EVERYTHING in the inventory, but adding an option to sell Summoning Scrolls is next….

Thanks In Advance to anyone that offers help !!!


program StoreSeller;
{.include SRL/SRL/Misc/SMART.scar}
{.include SRL/SRL.scar}

var
NoteDTM: Integer;

procedure LoadStuff;

begin
NoteDTM := DTMFromString('78DA633CC8C4C010C8C8800A9818FE034990E' +//Zephyr's Fury
'87F20603C0254138BA98601AA064C6F02F28309A83983DD2E1435' +
'9B817C2F026ACE02F9BEF8D50000C8880B92');
end;



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

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
end;

procedure TalkToShopKeeper;
var
x, y: Integer;
TPA: TPointArray;
begin
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1063283, MSX1, MSY1, MSX2, MSY2, 20);
if IsUpText('hop') then
Mouse(x, y, 1, 1, false);
wait(25+random(25));
ChooseOption('rade');
end;

procedure SellInventoryNotes;
var
x, y: Integer;

begin
if FindDTM(NoteDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Mouse(x, y, 8, 8, false);
wait(25+random(25));
ChooseOption('ell 50');
end;


procedure Setup;

begin
Smart_Members:= True;
Smart_Server := 160;
Smart_Signed := True;
SetupSRL;
ActivateClient;
DeclarePlayers;
MouseSpeed := 40;
LoginPlayer;
LoadStuff;
end;

begin
Setup;
TalkToShopKeeper;
repeat
SellInventoryNotes;
Until (InvEmpty);
logout;
end.

Naum

2010-01-13 16:48:32

I commented the script, you basically needed begin's and end's, you always need a loop for object finding TPA's. I've tried to point out where:

program StoreSeller;
{.include SRL/SRL/Misc/SMART.scar}
{.include SRL/SRL.scar}

var
NoteDTM: Integer;

procedure LoadStuff;

begin
NoteDTM := DTMFromString('78DA633CC8C4C010C8C8800A9818FE034990E' +//Zephyr's Fury
'87F20603C0254138BA98601AA064C6F02F28309A83983DD2E1435' +
'9B817C2F026ACE02F9BEF8D50000C8880B92');
end;



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

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
end;

procedure TalkToShopKeeper;
var
x, y, i: Integer;
TPA: TPointArray;
ATPA : T2DPointArray; //this holds the 'boxes' made by TPAToATPAEx
begin //findcolorsspiraltolerance stores all points in a tpa
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1063283, MSX1, MSY1, MSX2, MSY2, 20);
ATPA := TPAToATPAEx(TPA, 5, 5); //this splits the tpa into boxes of 5*5 (so less time spent searching)
For I := 0 To High(ATPA) Do //loops through the boxes
If MiddleTPAEx(ATPA[I], X, Y) Then //finds the middle
Begin
MMouse(x, y, 0, 0); //moves mouse over so we can check for uptext
if WaitUpText('hop', 400) then //waits for it
Begin
Mouse(x, y, 1, 1, false); //side clicks
WaitOption('rade', 400); //clicks trade
Exit; //exits procedure :)
End;
End;
end;

procedure SellInventoryNotes;
var
x, y: Integer;

begin
if FindDTM(NoteDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin //you need a begin and end after an
Mouse(x, y, 8, 8, false); //if statement with more than one line proceeding it.
wait(25+random(25));
ChooseOption('ell 50');
End;
end;


procedure Setup;

begin
Smart_Members:= True;
Smart_Server := 160;
Smart_Signed := True;
SetupSRL;
ActivateClient;
DeclarePlayers;
MouseSpeed := 20; //40's a bit too high
LoginPlayer;
LoadStuff;
end;

begin
Setup;
TalkToShopKeeper;
repeat
SellInventoryNotes;
Until (InvEmpty);
logout;
end.

If you want any more help hit me up on msn (naumanakhlaq@hotmail.com), or PM me :).

RAM

2010-01-13 17:31:19

Thank You very much, the comments help SOOOO much,I actually get it now…..

I think I have you on Messenger, but I never go on…but I WILL hit you up later !

RAM

2010-01-13 20:28:42

What would be the best way to sell all items in inventory, regardless of amout or if noted, except inv slot 1 (coins) ?



{*******************************************************************************
Function Sell(i, Amount: Integer): Boolean;
By: RSN small edit by N1ke!
Description: Sells Items at specified Inv Slot
*******************************************************************************}
Function Sell(i, Amount: Integer): Boolean;
var
ItemPoint: TPoint;
begin
Result := False;
if Not (ExistsItem(i)) then
Exit;
ItemPoint := ItemCoords(i);
Result := SellCoords(ItemPoint.x, ItemPoint.y, Amount);
end;

Wanted

2010-01-13 20:46:08

{.Include SRL\SRL.SCAR}

procedure SellItems;
var
P: TPoint;
I: Byte;
begin
for I := 2 to 28 do
begin
if (not (ExistsItem(I))) then
Continue;
P := ItemCoords(I);
Mouse(P.X, P.Y, 0, 0, False);
Wait(250 + Random(250));
ChooseOption('All');
Wait(250 + Random(250));
end;
end;

begin
SetUpSRL;
Wait(1000);
SellItems;
end.

RAM

2010-01-13 20:54:58

ok,this is what I have so far, working on fail safes….

//----------------------------------------------------------------------------//
// *
// * NAME : Varrock Store Seller
// * WRITER : RAM ,Credits to Naum,Zephyr's Fury,YOHOJO,IceFire908
// * CATEGORY : Misc.
// * DESCRIPTION : Sells ALL Items in Inventory to Store.
// * USAGE : Start @ Varrock General Store
// * AUTOCOLOR : Yes.
// * NOTES : SRL 4
//----------------------------------------------------------------------------//
// 1. BANK ALL ITEMS YOU DO NOT WISH TO SELL !!!!!!
// 2. Uses S.M.A.R.T. and Automaticly optimizes settings.
// 3. Find yourself a quiet World.
// 4. Position your character at Varrock Store. This script is multiplayer!
// 5. Sells ALL items in inventory, regarless if item or note !!!
//----------------------------------------------------------------------------//
program StoreSeller;
{.include SRL/SRL/Misc/SMART.scar}
{.include SRL/SRL.scar}

var
NoteDTM: Integer;

procedure LoadDTM;
begin
NoteDTM := DTMFromString('78DA633CC8C4C010C8C8800A9818FE034990E' +//Zephyr's Fury
'87F20603C0254138BA98601AA064C6F02F28309A83983DD2E1435' +
'9B817C2F026ACE02F9BEF8D50000C8880B92');
end;

procedure DeclarePlayers;
begin
HowManyPlayers:= 3;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;

Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;
end;

function AreWeInStore: boolean;
var
x, y: Integer;
Begin
If FindColor(x, y, 2070783, 175, 5, 275, 50) then //color of orange-letters
Result := true;
Exit;
end;

procedure TalkToShopKeeper;
var
x, y, i: Integer;
TPA: TPointArray;
ATPA : T2DPointArray;
begin
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1063283, MSX1, MSY1, MSX2, MSY2, 20);
ATPA := TPAToATPAEx(TPA, 5, 5);
For I := 0 To High(ATPA) Do
If MiddleTPAEx(ATPA[I], X, Y) Then
Begin
MMouse(x, y, 0, 0);
if WaitUpText('hop', 400) then
Begin
Mouse(x, y, 1, 1, false);
WaitOption('rade', 400);
Exit;
End;
End;
end;

procedure SellInventoryNotes;
var
x, y: Integer;
begin
if FindDTM(NoteDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
Mouse(x, y, 8, 8, false);
wait(25+random(25));
ChooseOption('ell 50');
End;
end;

procedure SellInventoryScrolls;
var
x, y: Integer;
begin
If FindColor(x, y, 12539733, MIX1, MIY1, MIX2, MIY2) then //blue color on scrolls
Begin
Mouse(x, y, 8, 8, false);
wait(25+random(25));
ChooseOption('ell 50');
End;
end;

procedure SellInventoryPouches;
var
x, y: Integer;
begin
If FindColor(x, y, 8272440, MIX1, MIY1, MIX2, MIY2) then //cream color of pouch
Begin
Mouse(x, y, 8, 8, false);
wait(25+random(25));
ChooseOption('ell 50');
End;
end;

procedure Setup;
begin
Smart_Members:= True;
Smart_Server := 160;
Smart_Signed := True;
SetupSRL;
ActivateClient;
DeclarePlayers;
MouseSpeed := 20;
LoginPlayer;
LoadDTM;
SetAngle (true);
end;

begin
repeat
Setup;
repeat
Wait(25+random(25));
TalkToShopKeeper;
Until AreWeInStore;
repeat
SellInventoryScrolls;
SellInventoryNotes;
SellInventoryPouches;
Until (InvEmpty);
LogOut;
NextPlayer(True);
LoginPlayer;
until false;
end.

RAM

2010-01-13 21:04:32

From: IceFire908
Code:
[LEFT]{.Include SRL\SRL.SCAR}

procedure SellItems;
var
P: TPoint;
I: Byte;
begin
for I := 2 to 28 do
begin
if (not (ExistsItem(I))) then
Continue;
P := ItemCoords(I);
Mouse(P.X, P.Y, 0, 0, False);
Wait(250 + Random(250));
ChooseOption('All');
Wait(250 + Random(250));
end;
end;

begin
SetUpSRL;
Wait(1000);
SellItems;
end.
[/LEFT]



Ok,there there is obviously not a "Sell All" option in the shop screen,is this automatically handled in SRL ?

Wanted

2010-01-13 21:13:16

My bad

{.Include SRL\SRL.SCAR}

procedure SellItems;
var
P: TPoint;
I: Byte;
begin
for I := 2 to 28 do
begin
if (not (ExistsItem(I))) then
Continue;
P := ItemCoords(I);
while ((GetAmount(P.X, P.Y) > 0) and (LoggedIn)) do
begin
Mouse(P.X, P.Y, 0, 0, False);
Wait(250 + Random(250));
ChooseOption('50');
Wait(250 + Random(250));
if (FindNormalRandoms) then
begin
Wait(RandomRange(1000, 2000));
//Talk to NPC
Wait(RandomRange(1000,2000));
end;
end;
end;
end;

begin
SetUpSRL;
Wait(1000);
SellItems;
end.


Add a "ShopScreen" Boolean in there somewhere…

RAM

2010-01-13 21:20:33

Ok, TY, that makes sense…I had made my own "Shop Screen" proc before I saw BuySell.scar

Wanted

2010-01-13 21:23:17

From: RAM
Ok, TY, that makes sense…I had made my own "Shop Screen" proc before I saw BuySell.scar


A simple

function SScreen: Boolean;
begin
Result := (GetColor(100, 100) = 1234567); //like the shop orange text color or somethin
end;

Should work.

RAM

2010-01-13 22:04:53

IceFire, your procedure didn't switch to the next inventory spot?…I used YoHoJo's….

Still need to add a few things,but it's getting closer…


//----------------------------------------------------------------------------//
// *
// * NAME : Varrock Store Seller
// * WRITER : RAM ,Credits to Naum,YOHOJO,IceFire908,Zephyr's Fury,WT-Fakawi for leading the way!!
// * CATEGORY : Misc.
// * DESCRIPTION : Sells ALL Items in Inventory to Store.
// * USAGE : Start @ Varrock General Store
// * AUTOCOLOR : Yes.
// * NOTES : SRL 4
//----------------------------------------------------------------------------//
// 1. BANK ALL ITEMS YOU DO NOT WISH TO SELL !!!!!!
// 2. Uses S.M.A.R.T. and Automaticly optimizes settings.
// 3. Leave 1st Inventory spot open for coins..
// 4. Position your characters at Varrock Store. This script is multiplayer!
// 5. Sells ALL items in inventory, regarless if item or note !!!
//----------------------------------------------------------------------------//
program StoreSeller;
{.include SRL/SRL/Misc/SMART.scar}
{.include SRL/SRL.scar}

var
NoteDTM: Integer;

procedure LoadDTM;
begin
NoteDTM := DTMFromString('78DA633CC8C4C010C8C8800A9818FE034990E' +//Zephyr's Fury
'87F20603C0254138BA98601AA064C6F02F28309A83983DD2E1435' +
'9B817C2F026ACE02F9BEF8D50000C8880B92');
end;

procedure DeclarePlayers;
begin
HowManyPlayers:= 3;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;

Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;
end;

function AreWeInStore: boolean;
var
x, y: Integer;
Begin
If FindColor(x, y, 2070783, 175, 5, 275, 50) then //color of orange-letters
Result := true;
Exit;
end;

procedure TalkToShopKeeper;
var
x, y, i: Integer;
TPA: TPointArray;
ATPA : T2DPointArray;
begin
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1063283, MSX1, MSY1, MSX2, MSY2, 20);
ATPA := TPAToATPAEx(TPA, 5, 5);
For I := 0 To High(ATPA) Do
If MiddleTPAEx(ATPA[I], X, Y) Then
Begin
MMouse(x, y, 0, 0);
if WaitUpText('hop', 400) then
Begin
Mouse(x, y, 1, 1, false);
WaitOption('rade', 400);
Exit;
End;
End;
end;

Procedure SellAllItems; //YoHoJo
var
I: Byte;
Begin
For I:=2 to 28 Do
Begin
If ExistsItem(I) Then
Begin
MouseItem(I, False);
If ChooseOption('ll 50') Then Exit;
If ChooseOption('ll 10') Then Exit;
If ChooseOption('ll 5') Then Exit;
If ChooseOption('ll 1') Then Exit;
End;
FindNormalRandoms;
Wait(25+random(25));
End;
End;

procedure Setup;
begin
Smart_Members:= True;
Smart_Server := 160;
Smart_Signed := True;
SetupSRL;
ActivateClient;
DeclarePlayers;
MouseSpeed := 20;
LoginPlayer;
LoadDTM;
SetAngle (true);
end;

begin
repeat
Setup;
repeat
Wait(25+random(25));
TalkToShopKeeper;
Until AreWeInStore;
repeat
SellAllItems;
Until (InvEmpty);
LogOut;
NextPlayer(True);
LoginPlayer;
until false;
end.

The Claw

2010-01-13 22:32:31

{.Include SRL\SRL.SCAR}

procedure SellItems;
var
P: TPoint;
I: Byte;
begin
for I := 2 to 28 do
begin
if (not (ExistsItem(I))) then
Continue;
P := ItemCoords(I);
while ((GetAmount(P.X, P.Y) > 0) and (LoggedIn)) do
begin
Mouse(P.X, P.Y, 0, 0, False);
Wait(250 + Random(250));
ChooseOption('50');
Wait(250 + Random(250));
if (FindNormalRandoms) then
begin
Wait(RandomRange(1000, 2000));
//Talk to NPC
Wait(RandomRange(1000,2000));
end;
end;
Continue;
end;
end;

begin
SetUpSRL;
Wait(1000);
SellItems;
end.

Try this RAM

YoHoJo

2010-01-13 22:39:45

http://pastebin.com/m24941aab

RAM

2010-01-13 23:18:05

OK, Latest Update…..everything is GREAT, until it get's to the end…….I tried it a few different ways, but no luck….

Need Help with "InvEmpty—>SwitchPlayers"……



//----------------------------------------------------------------------------//
// *
// * NAME : Varrock Store Seller
// * WRITER : RAM ,Credits to Naum,YOHOJO,IceFire908Zephyr's Fury,WT-Fakawi for leading the way!!
// * CATEGORY : Misc.
// * DESCRIPTION : Sells ALL Items in Inventory to Store.
// * USAGE : Start @ Varrock General Store
// * AUTOCOLOR : Yes.
// * NOTES : SRL 4
//----------------------------------------------------------------------------//
// 1. BANK ALL ITEMS YOU DO NOT WISH TO SELL !!!!!!
// 2. Uses S.M.A.R.T. and Automaticly optimizes settings.
// 3. Leave 1st Inventory spot open for coins..
// 4. Position your characters at Varrock Store. This script is multiplayer!
// 5. Sells ALL items in inventory, regarless if item or note !!!
//----------------------------------------------------------------------------//
program StoreSeller; //ver.1.5 1/13/2010
{.include SRL/SRL/Misc/SMART.scar}
{.include SRL/SRL.scar}

Var NoteDTM: Integer;

Procedure LoadDTM;
Begin
NoteDTM := DTMFromString('78DA633CC8C4C010C8C8800A9818FE034990E' +//Zephyr's Fury
'87F20603C0254138BA98601AA064C6F02F28309A83983DD2E1435' +
'9B817C2F026ACE02F9BEF8D50000C8880B92');
End;

Procedure DeclarePlayers;
Begin
HowManyPlayers:= 3;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;

Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;
End;

Function AreWeInShop: boolean;
Var
x, y: Integer;
Begin
If FindColor(x, y, 2070783, 175, 5, 275, 50) Then //color of orange letters
Result := true;
Exit;
End;

Procedure TalkToShopKeeper; //Naum
Var
x, y, i: Integer;
TPA: TPointArray;
ATPA : T2DPointArray;
Begin
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1063283, MSX1, MSY1, MSX2, MSY2, 20);
ATPA := TPAToATPAEx(TPA, 5, 5);
For I := 0 To High(ATPA) Do
If MiddleTPAEx(ATPA[I], X, Y) Then
Begin
MMouse(x, y, 0, 0);
if WaitUpText('hop', 400) Then
Begin
Mouse(x, y, 1, 1, False);
WaitOption('rade', 400);
Exit;
End;
End;
end;

Procedure SellAllItems; //YoHoJo
Var
I: Byte;
Begin
For I:=2 to 28 Do
Begin
If ExistsItem(I) Then
Begin
MouseItem(I, False);
If ChooseOption('ll 50') Then Exit;
If ChooseOption('ll 10') Then Exit;
If ChooseOption('ll 5') Then Exit;
If ChooseOption('ll 1') Then Exit;
End;
FindNormalRandoms;
Wait(25+random(25));
End;
End;

Procedure CloseShopScreen;
Begin
Mouse(504, 62, 1, 1, True);
LogOut;
End;

Procedure Setup;
Begin
Smart_Members:= True;
Smart_Server := 160;
Smart_Signed := True;
SetupSRL;
ActivateClient;
DeclarePlayers;
MouseSpeed := 30;
LoginPlayer;
LoadDTM;
SetAngle (True);
End;

Begin
Repeat
Setup;
Repeat
Wait(125+random(125));
TalkToShopKeeper;
Until AreWeInShop;
Repeat
SellAllItems;
Until (InvEmpty);
If (InvEmpty) Then
Begin
CloseShopScreen;
NextPlayer(True);
LoginPlayer;
End;
Until False;
End.

Wanted

2010-01-13 23:19:11

From: The Claw
{.Include SRL\SRL.SCAR}

procedure SellItems;
var
P: TPoint;
I: Byte;
begin
for I := 2 to 28 do
begin
if (not (ExistsItem(I))) then
Continue;
P := ItemCoords(I);
while ((GetAmount(P.X, P.Y) > 0) and (LoggedIn)) do
begin
Mouse(P.X, P.Y, 0, 0, False);
Wait(250 + Random(250));
ChooseOption('50');
Wait(250 + Random(250));
if (FindNormalRandoms) then
begin
Wait(RandomRange(1000, 2000));
//Talk to NPC
Wait(RandomRange(1000,2000));
end;
end;
Continue;
end;
end;

begin
SetUpSRL;
Wait(1000);
SellItems;
end.

Try this RAM


How does that Continue; help any?

YoHoJo

2010-01-13 23:34:30

If InvEmpty Then NextPlayer(False) ?

The Claw

2010-01-13 23:49:20

From: IceFire908
How does that Continue; help any?


Upon closer inspection it appears it wouldn't
Whats with the 0 randomness in Mouse though?

Wanted

2010-01-13 23:51:43

From: The Claw
Upon closer inspection it appears it wouldn't
Whats with the 0 randomness in Mouse though?


Doesn't ItemCoords already have randomness?

RAM

2010-01-14 00:14:38

Still no luck with your procedure IceFire :redface:, but YoHoJo's is stable….

I tried adding "If InvEmpty Then NextPlayer(False)", a couple of different ways and places, but still no luck….

Please see latest version, and post suggestions ?

//----------------------------------------------------------------------------//
// *
// * NAME : Varrock Store Seller
// * WRITER : RAM ,Credits to Naum,YOHOJO,IceFire908,Zephyr's Fury,WT-Fakawi for leading the way!!
// * CATEGORY : Misc.
// * DESCRIPTION : Sells ALL Items in Inventory to Store.
// * USAGE : Start @ Varrock General Store
// * AUTOCOLOR : Yes.
// * NOTES : SRL 4
//----------------------------------------------------------------------------//
// 1. BANK ALL ITEMS YOU DO NOT WISH TO SELL !!!!!!
// 2. Uses S.M.A.R.T. and Automaticly optimizes settings.
// 3. Leave 1st Inventory spot open for coins..
// 4. Position your characters at Varrock Store. This script is multiplayer!
// 5. Sells ALL items in inventory, regarless if item or note !!!
//----------------------------------------------------------------------------//
program StoreSeller; //ver.1.6 1/13/2010
{.include SRL/SRL/Misc/SMART.scar}
{.include SRL/SRL.scar}

Var NoteDTM: Integer;

Procedure LoadDTM;
Begin
NoteDTM := DTMFromString('78DA633CC8C4C010C8C8800A9818FE034990E' +//Zephyr's Fury
'87F20603C0254138BA98601AA064C6F02F28309A83983DD2E1435' +
'9B817C2F026ACE02F9BEF8D50000C8880B92');
End;

Procedure DeclarePlayers;
Begin
HowManyPlayers:= 3;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;

Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := False;

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := False;
End;

Procedure CloseShopScreen;
Begin
Mouse(504, 62, 1, 1, True);
LogOut;
Exit;
End;

Function AreWeInShop: boolean;
Var
x, y: Integer;
Begin
If FindColor(x, y, 2070783, 175, 5, 275, 50) Then //color of orange letters
Result := true;
Exit;
End;

Procedure TalkToShopKeeper; //Naum
Var
x, y, i: Integer;
TPA: TPointArray;
ATPA : T2DPointArray;
Begin
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1063283, MSX1, MSY1, MSX2, MSY2, 20);
ATPA := TPAToATPAEx(TPA, 5, 5);
For I := 0 To High(ATPA) Do
If MiddleTPAEx(ATPA[I], X, Y) Then
Begin
MMouse(x, y, 0, 0);
if WaitUpText('hop', 400) Then
Begin
Mouse(x, y, 1, 1, False);
WaitOption('rade', 400);
Exit;
End;
End;
end;

Procedure SellAllItems; //YoHoJo
Var
I: Byte;
Begin
For I:=2 to 28 Do
Begin
If (InvEmpty) Then CloseShopScreen; //<-------@@@@@@@@RAM
If ExistsItem(I) Then
Begin
MouseItem(I, False);
If ChooseOption('ll 50') Then Exit;
If ChooseOption('ll 10') Then Exit;
If ChooseOption('ll 5') Then Exit;
If ChooseOption('ll 1') Then Exit;
End;
FindNormalRandoms;
Wait(25+random(25));
End;
End;

Procedure Setup;
Begin
Smart_Members:= True;
Smart_Server := 160;
Smart_Signed := True;
SetupSRL;
ActivateClient;
DeclarePlayers;
MouseSpeed := 30;
LoginPlayer;
LoadDTM;
SetAngle (True);
End;

Begin
Repeat
Setup;
Repeat
Wait(125+random(125));
TalkToShopKeeper;
Until AreWeInShop;
Repeat
SellAllItems;
Until (InvEmpty);//<-------@@@@@@@@RAM
Begin
NextPlayer(True);
LoginPlayer;
End;
Until False;
End.

YoHoJo

2010-01-14 00:34:20

Instead of InvEmpty try something like

If Not(FindColor(x,y,131072,MIX1,MIY1,MIX2,MIY2)) Then //the black outline color of items
NextPlayer(False);

Not sure if I did the parameters right, but yeah, that.

RAM

2010-01-14 03:51:09

OK, VERY STABLE so far :), switches players after inventory is empty, but trying to correctly use a specified marked time to switch…..any hints ?


//----------------------------------------------------------------------------//
// *
// * NAME : Varrock Store Seller
// * WRITER : RAM ,Credits to Naum,YOHOJO,IceFire908,Zephyr's Fury,WT-Fakawi for leading the way!!
// * CATEGORY : Misc.
// * DESCRIPTION : Sells ALL Items in Inventory to Store.
// * USAGE : Start @ Varrock General Store
// * AUTOCOLOR : Yes.
// * NOTES : SRL 4
//----------------------------------------------------------------------------//
// 1. Uses S.M.A.R.T. and Automaticly optimizes settings.
// 2. BANK ALL ITEMS YOU DO NOT WISH TO SELL !!!!!!
// 3. Leave 1st Inventory spot open for coins.
// 4. Make sure you have 1 item in the LAST Inventory Spot(28)!!!!
// 5. Position your characters at Varrock Store. This script is multiplayer!
//----------------------------------------------------------------------------//
program StoreSeller; //ver.1.82 1/13/2010
{.include SRL/SRL/Misc/SMART.scar}
{.include SRL/SRL.scar}

Const
DisplayDetails = True;
Debugmode = True;
procedure debug(s : string); begin if debugmode then writeln(s) else Status(s); end;

Var NoteDTM: Integer;

Procedure LoadDTM;
Begin
Debug('LoadDTM');
Disguise('LoadDTM');
NoteDTM := DTMFromString('78DA633CC8C4C010C8C8800A9818FE034990E' +//Zephyr's Fury
'87F20603C0254138BA98601AA064C6F02F28309A83983DD2E1435' +
'9B817C2F026ACE02F9BEF8D50000C8880B92');
End;

Procedure DeclarePlayers;
Begin
Debug('DeclarePlayers');
Disguise('DeclarePlayers');
HowManyPlayers:= 3;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;

Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;
End;

Function AreWeInShop: Boolean;
Var
x, y: Integer;
Begin
Debug('AreWeInShop');
Disguise('AreWeInShop');
If FindColor(x, y, 2070783, 175, 5, 275, 50) Then //color of orange letters
Result := True;
Exit;
End;

Procedure TalkToShopKeeper; //Naum
Var
x, y, i: Integer;
TPA: TPointArray;
ATPA : T2DPointArray;
Begin
Debug('TalkToShopKeeper');
Disguise('TalkToShopKeeper');
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1063283, MSX1, MSY1, MSX2, MSY2, 20);
ATPA := TPAToATPAEx(TPA, 5, 5);
For I := 0 To High(ATPA) Do
If MiddleTPAEx(ATPA[I], X, Y) Then
Begin
MMouse(x, y, 0, 0);
if WaitUpText('hop', 400) Then
Begin
Mouse(x, y, 1, 1, False);
WaitOption('rade', 400);
Exit;
End;
End;
End;

Function AnyItemsLeftInv28: boolean;//Thanks for the help YoHoJo:)
Var
x, y: Integer;
Begin
Debug('AnyItemsLeftInv28');
Disguise('AnyItemsLeftInv28');
If Not (FindColor(x, y, 131072, 175, 5, 275, 50)) Then //black color outline
Result := True;
Exit;
End;

Procedure SellAllItems; //YoHoJo
Var
I: Byte;
Begin
For I:=2 to 28 Do
Begin
If ExistsItem(I) Then
Begin
Debug('SellAllItems');
Disguise('SellAllItems');
MouseItem(I, False);
If ChooseOption('ll 50') Then Exit;
If ChooseOption('ll 10') Then Exit;
If ChooseOption('ll 5') Then Exit;
If ChooseOption('ll 1') Then Exit;
End;
FindNormalRandoms;
Wait(25+random(25));
End;
End;

{var
SwitchTime: Integer;}

Procedure Setup;
Begin
Debug('Setup');
Disguise('Setup');
Smart_Members:= True;
Smart_Server := 160;
Smart_Signed := True;
SetupSRL;
ActivateClient;
DeclarePlayers;
MouseSpeed := 30;
LoginPlayer;
//MarkTime(SwitchTime);
LoadDTM;
SetAngle (True);
End;

Begin
Debug('Main Loop');
Disguise('Main Loop');
Repeat
Setup;
Repeat
Wait(125+random(125));
TalkToShopKeeper;
Until AreWeInShop;
Repeat
SellAllItems;
Until AnyItemsLeftInv28;
CloseWindow;
//if TimeFromMark(SwitchTime) > 30 * 60000 then
//Disguise('Switching Character for ' + IntToSTr(Round(SwitchTime / 60000)) + ' mins.');
LogOut;
NextPlayer(True);
LoginPlayer;
Until False;
End.

YoHoJo

2010-01-14 03:55:36

Marktime(PlayTime)   //Place after login I guess
Shit
If (TimeFromMakr(PlayTime) > Players[CurrentPlayer].Integers[0]*60000) Then
NextPlayer(True)

And just make Players[X].Integers[0]:=5 // Minutes to sell before switching.

Something of that sort

marpis

2010-01-15 05:42:15

There is a function InvEmpty:Boolean; btw :)

RAM

2010-01-15 11:06:33

From: marpis
There is a function InvEmpty:Boolean; btw :)


Well, the inventory isn't really empty,Will it return true even if there is coins in inventory?

Sabzi

2010-01-15 11:19:03

From: RAM
Well, the inventory isn't really empty,Will it return true even if there is coins in inventory?


I don't think so. But if you are sure that there will be just coins when finished use InvCount. That returns the amount of inventory space filled.
So until InvCount = 1; or something like that. However you want to use it.

EDIT: First time I ninja'd an admin :)

Boreas

2010-01-15 11:19:48

Nope. You need IncCount=27 or more accurately if ExistsItem true for 1 and false for 2-28

E: ninja'd

RAM

2010-01-15 18:22:47

Thank You all,I'm going to work on this a bit more later this weekend,just rounding up more junk to test with :d

Main

2010-01-16 14:39:03

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

YoHoJo

2010-01-16 15:18:30

From: Main_Ftw
http://www.youtube.com/watch?v=x4Ap7soZiPQ


Haha, RAM, what that basically means is that you can GREATLY reduce your waits, and mouse movement when selling items! And if they ban you, say you were using mousekeys! :p

Main

2010-01-16 20:27:46

Lots people who doesn't macro do this, and no you don't get banned. I sold over 3400k long (U)s in store , (maximum was 100k+ at once) and you don't get banned because you can just spam your left key if your on laptop, or mousekey.

YoHoJo

2010-01-16 20:34:00

Yeah ram.
Make you script go to settings, make it so its 1 mouse key. And spam click, (just check how much the wait after the click in mouse is, and make that wait only that much).
Ill explain better if needed. Also for extra speed, there is a wait 100+random(something) in the actual mouse.scar, remove that crap too :D

mastaraymond

2010-01-16 20:41:37

From: YoHoJo
Yeah ram.
Make you script go to settings, make it so its 1 mouse key. And spam click, (just check how much the wait after the click in mouse is, and make that wait only that much).
Ill explain better if needed. Also for extra speed, there is a wait 100+random(something) in the actual mouse.scar, remove that crap too :D

Don't use the edit mouse.scar for this;

Just MMouse to a position and then

repeat
mousedown(true);
wait(10+random(30));
mouseup(true);
until NoMoreStuff;

YoHoJo

2010-01-16 20:43:57

Meh, I edit out the wait anyways, makes stuff faster! But true, you do have a point there.