SRL Archive - RS3 Outdated / Broken Scripts

Teaser of Merchanter ;)


Swatarianess

2011-12-14 09:28:31

No Failsafes. (except 1) yet…
Doesnt buy items properly yet…
Doesnt make mad amount of money yet…

Just taste of what i came up with in few 35mins of works – 3hrs :spot:

//----------------------------------------------------------------------------/|
// -- |
// -- Merchanting Bot v1 beta |
// -- |
// -- by Inf3cti0us |
// -- |
// -- Thanks to WT-Fakawi for this box design i moded slightly |
// -- |
// -- BETA 2 |
// -- |
// -- --- Only uses Colors --- |
//|----------------------------------------------------------------------------|

program MerchantBeta;
{.include SRL\SRL.scar}
var
x, y, ms, GEUP, FoundNPC: integer;
Item2Buy: String;


procedure DeclarePlayers;
begin

HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'Nickname';
Players[0].Pin := 'Pincode';
Players[0].Strings[0]:= 'Rune scimi'; // Item to buy.
Players[0].Integers[0]:= 5; // Amount of Item to buy
Players[0].Integers[1]:= 500; // Buying price (Sell item 1gp or way lower then med to aquire whilest flipping)
Players[0].Integers[2]:= 550; // Selling price (buy higher med price of item)

Players[0].Active := true;

Item2Buy := Players[0].Strings[0];
end;

function FindNPC(var fx, fy: Integer): Boolean;
var
arP: TPointArray;
ararP: T2DPointArray;
tmpCTS, i, arL: Integer;
P: TPoint;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.23, 0.45);

if not(FindColorsTolerance(arP, 3217441, MSX1, MSY1, MSX2, MSY2, 3)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
FoundNPC := 0;
Exit;
end;

SortTPAFrom(arP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arP, 10, 10);
arL := High(ararP);

for i := 0 to arL do
begin
P := MiddleTPA(ararP[i]);
MMouse(P.x,P.y,4,4);
Wait(100 + Random(100));
if (IsUpText('rand_Exchange')) then
begin;
Result := True;
FoundNPC := 1;
Break;
end;
end;

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

if (i = arL + 1) then
begin
Writeln('Apparently nothing was found...');
Exit;
end;

GetMousePos(fx, fy);
end;

function AutoColor2: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(0);

if not (FindColorsTolerance(arP, 6920667, 0, 0, 764, 502, 0)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
GEUP := 1;
Exit;
end;

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

for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);

if (R >= 218) and (R <= 220) and (G >= 152) and (G <= 154) and (B >= 104) and (B <= 106) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
GEUP := 0;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);

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

Procedure FindGEMan;
var
x, y: integer;
begin
FindNPC(x,y)
wait(randomrange(200,500))
//if(FoundNPC = 1) then forward; << dunno why this didn't work
if(FoundNPC = 0) then
begin
writeln('Cannot find NPC...')
exit;
end;
end;

Procedure EnterTheGE;
begin
ClickMouse(x,y,0);
wait(250+random(500))
writeln('On menu up Need to click GrandEchange Menu setting...');
GetMousePos(x,y);
Wait(RandomRange(100,500))
MMouse(x-RandomRange(68,85),y+RandomRange(38,44),1,2);
writeln('Hovering over "Exchange" Clicked ');
wait(500+random(500))
ClickMouse(x,y,1);
end;

Procedure GEinterfaceOpen;
begin
SetupSRL;
ms := MouseSpeed;
MouseSpeed := 25 + RandomRange(-3, 3);
if LoggedIn then
begin
//if ( #Need to make it find the .bmp of the Backpack+ and backpack-
AutoColor2;
wait(randomrange(1500,5000))
if(GEUP = 1) then
begin
FindGEMan;
EnterTheGE;
wait(300+randomrange(400,500))
writeln('We have made it. Thinking of item to choose')
GEUP := 0;
end;
end;
if not LoggedIn then exit;
Writeln('Waiting now whilest GE interface is open...')
end;

procedure GettingItem;
begin
if(GEUP = 0) then
begin
writeln('We have GE Opened')
wait(500+RandomRange(300,500))
MMouse(71,156,4,4);
//writeln('On GE interface GEUP = '+ IntToStr(GEUP) + ' << Meaning...' )
ClickMouse(x,y,1);
wait(1000+RandomRange(500,1000))
//writeln('Buying: ' + + ' @' + IntToStr(Players[CurrentPlayer].Integers[1]))
MMouse(62,459,50,7)
wait(500+RandomRange(100,600))
ClickMouse(62,459,1);
wait(randomRange(100,200))
ClickMouse(62,459,1);
wait(500+randomRange(100,600))
//TypeSendEx(Item2Buy,True)
TypeSendEx(Players[CurrentPlayer].Strings[0],True)
wait(500+RandomRange(500,1000))
MMouse(67,355,80,5)
wait(300+RandomRange(200,700))
ClickMouse(x,y,1)
end;

end;

procedure BuyItem;
begin
end;


begin
DeclarePlayers;
GEinterfaceOpen;
GettingItem;
BuyItem;
end.


Its Teaser all it does is get GEman and buys whatever item. :/ Any way i can improve it?

HyperSecret

2011-12-14 09:39:09

Dont use clickmouse, if you want to click the mouse use Mouse, MMouse moves the mouse without clicking while Mouse moves the mouse and clicks.

marpis

2011-12-14 11:35:29

Also, try to make your nesting standards match the code you got from ACA.

procedure dothistuff;
var x,y: integer;
begin
if findnpc(x,y)then begin
mouse(x,y,0,0,true);
writeln('yohoo');
end;
end;


procedure DoThisStuff;
var
x, y: integer;
begin
if FindNPC(x, y) then
begin
Mouse(x, y, 0, 0, True);
WriteLn('yohoo');
end;
end;

Swatarianess

2011-12-14 11:42:11

From: HyperSecret
Dont use clickmouse, if you want to click the mouse use Mouse, MMouse moves the mouse without clicking while Mouse moves the mouse and clicks.


ahh ok. so to use Mouse and/or MMouse i use it like this?

mouse(x,y,0,0,true);

so Mouse(
x = x-Cord
y = y-Cord
0 = random pixels from x?
0 = random pixels from y?
true = Click left after?
)

is that right? just got this off Simba be4 Pc broke again -.-

From: marpis
Also, try to make your nesting standards match the code you got from ACA.

procedure dothistuff;
var x,y: integer;
begin
if findnpc(x,y)then begin
mouse(x,y,0,0,true);
writeln('yohoo');
end;
end;


procedure DoThisStuff;
var
x, y: integer;
begin
if FindNPC(x, y) then
begin
Mouse(x, y, 0, 0, True);
WriteLn('yohoo');
end;
end;


Ok i'll try make it similar :P
so from what i see from the snippit of code..

procedure dothistuff;
var x,y: integer;
begin
if findnpc(x,y)then begin
mouse(x,y,0,0,true);
writeln('yohoo');
end;
end;

if findnpc(x,y) returns a pair of co-ordinates then it'd left[or right?] click it then say yohoo :D

ahh i understand the second one looks more structuced and similar to the ACA kk coolio i get it

kyocera

2011-12-14 16:05:16

mind if i try to work on this a bit ? I was lookin for one earlier today :)
better cash then a essence script, I know you can do like 5-10 rune essence flips an hour which is 125-250k and all you need is 25k to start no skills either…

lord onon

2011-12-14 18:23:40

how i work this where the download link or just copy and paste?

Silent

2011-12-14 18:59:09

From: lord onon
how i work this where the download link or just copy and paste?


This particular script would be copy and paste.

lord onon

2011-12-14 19:16:55

thanks bro

Swatarianess

2011-12-15 11:04:22

From: kyocera
mind if i try to work on this a bit ? I was lookin for one earlier today :)
better cash then a essence script, I know you can do like 5-10 rune essence flips an hour which is 125-250k and all you need is 25k to start no skills either…


Yeh no problem it isnt done it just Opens it and types in the item. Theres only one failsafe :( . All that needs to be done is the Selling method and buying method.

also yeh its base i guess if u make it work that'd be great ^^ Goodluck

mostly it'd need alottt of Booleans and anti-ban(eg. Misclicks here and there) :D

kyocera

2011-12-16 08:10:28

From: bro433
Yeh no problem it isnt done it just Opens it and types in the item. Theres only one failsafe :( . All that needs to be done is the Selling method and buying method.

also yeh its base i guess if u make it work that'd be great ^^ Goodluck

mostly it'd need alottt of Booleans and anti-ban(eg. Misclicks here and there) :D


Yeah this would be my first script I've been working on it little by little at school (I'm taking a programming class that is 3 hours long everyday).

Tried doing some stuff yesterday, no luck at the moment. I will get it though!:)

HT BaaFly

2011-12-16 14:25:24

doesn't work a bit, lol

Swatarianess

2011-12-19 13:08:59

From: HT BaaFly
doesn't work a bit, lol


I'm guessing you failed to read the first post? I said it's a teaser I might be able to complete it eventually. All it's suppose to do is get the GE (wo)man and click buy then type "rune scimi" (default). If it did that's it working great also u need only to be able to see 1 GE (wo)man npc or else id mess up abit…

HT BaaFly

2011-12-20 16:24:17

tried what you said, didn't work
try this:

function OpenBankNPCEx: Boolean;
var
NPCBox :TBox;
Colors, NPCArray :TPointArray;
ATPA: T2DPointArray;
MSNPC, NPCPoint :TPoint;
TempCTS, C, HiNPC, II, I :Integer;
begin
Result := False;
Result := (InGE) or (PinScreen);
If Result then Exit;

NPCArray := GetMinimapDots('NPC');
HiNPC := High(NPCArray);

If Length(NPCArray) = 0 then Exit;
SortTPAFrom(NPCArray, Point(MMCX, MMCY));
for I := 0 to HiNPC do
begin
NPCPoint := MMToMS(NPCArray[I])
If NPCPoint = Point(-1, -1) then Continue;
NPCBox := IntToBox(NPCPoint.X - 40, NPCPoint.Y - 40, NPCPoint.X + 40, NPCPoint.Y + 40)
If PixelShift(NPCBox, 200) > 500 then Continue;

TempCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.13, 1.52);
FindColorsTolerance(Colors, 6852026, NPCBox.X1, NPCBox.Y1, NPCBox.X2, NPCBox.Y2, 13);
ATPA := TPAToATPAEx(Colors, 15, 20);
SortATPASize(ATPA, True);

for II := 0 to High(ATPA) do
begin
MSNPC := MiddleTPA(ATPA[II]);
MMouse(MSNPC.X, MSNPC.Y, 3, 3);
If WaitUpTextMulti(['rand Exchange clerk'], 200) then
begin
Mouse(MSNPC.X, MSNPC.Y, 1, 1, False);
If WaitOptionMulti(['xchange G'], 300) then
MarkTime(c);
Repeat
Wait(RandomRange(50, 100));
Until (InGE) or (PinScreen) or (TimeFromMark(C) > 4500);
if (Players[CurrentPlayer].Pin <> '') then
InPin(Players[CurrentPlayer].Pin);
Result := (InGE) or (PinScreen);
If Result then
begin
ColorToleranceSpeed(TempCTS);
Exit;
end
else
ColorToleranceSpeed(TempCTS);
end;
end;
end;
end;

credits to homer i think

HT BaaFly

2011-12-20 16:26:01

good attempt, nonetheless

Swatarianess

2011-12-21 09:53:21

Just read the beginners to Advanced Simba tuts found on Tut island (on SRL fourm) and think i know what i am doing now lol >.< this was be4 knowing much about it but hopefully if i retry i'd do wayyy better :D

From: HT BaaFly
good attempt, nonetheless


thanks i'll try what you said ^^ Thanks to homer :D might close thread/let it die :P

hogan

2011-12-21 17:05:33

You should add a buy sell price checker

Swatarianess

2011-12-22 07:29:13

From: hogan
You should add a buy sell price checker


Yeh probably a simple Text reading function could return the amount but i cannot find a Font of the Ge font >.< its similar to UpcharEx with the Numbers but the ' , ' is different i think :P

FPS Russia

2011-12-22 10:28:54

Yo tnx for the tip it now runs but when it comes to the sawmill it just randomly walks to anything that has a brown colour om the minimap any thing that would fix it?

Swatarianess

2011-12-23 06:01:46

From: FPS Russia
Yo tnx for the tip it now runs but when it comes to the sawmill it just randomly walks to anything that has a brown colour om the minimap any thing that would fix it?


not sure what you are talking about… Are you in the GE? doesnt reli do much and its pretty old i got lots more knowledge then when i had made this so.. which tip are you talking about too?

creedgaming

2012-03-22 03:19:08

How bout adding Member support and 2 items for F2P?

Kajutsky

2012-03-22 04:35:15

what is a recommended item? :D

brit ftw

2012-03-28 01:45:07

is there any screenshots previews ;o?