Well I tried starting a merchanter, but my parents have been limiting me to an hour of internet a day so I'll just post what I started and see if you can do nifty things with it ;)
It uses my custom autotalker in it (more undetectable than srl… still…) and the functions for finding trades don't work yet but that's what I was able to do without runescape to test on.
program WidgetMerchanter; // // // // // // // //
{.include SRL/SRL.scar}
const
Selling = 'ess'; // What are you selling?
// Script will try to sell as 'Selling [that] [price]ea - [name]'
Selling2 = 'essence'; // another name
WaitTime = 10000; // Time to wait between talking
WaitTimeRand = 5000; // +/- time for WaitTime
BuyPrice = 20; // Price to buy your object for
SellPrice = 30; // Price to sell your object for
Plural = False; // Does it get an 's' after the name? Like nats or laws.
UseEffect = True; // Using an effect? Helps a lot =)
EffectToUse = 'glow3:'; // Don't need to bother if UseEffect is False
UName = 'Widget'; // Name to put after typing, like 'selling something 30ea -- Widget'
var wx,wy:integer;
item,item2,effect,price:string;
price2:string;
Procedure Init;
begin
Price := IntToStr(SellPrice)
Price2 := IntToStr(BuyPrice)
Item := Selling
Item2 := Selling2
if Plural then begin
Item := Selling + 's'
Item2 := Selling2 + 's'
end;
If UseEffect then
Effect := EffectToUse
end;
function number(letter:char):boolean;
var t:integer;
begin
t := getkeycode(letter)
result := true
if (t < 122) and (t > 97) then result := false;
if (t < 90) and (t > 65) then result := false;
end;
function Capital(letter:char):boolean;
var t:integer;
s:string;
begin
result := false;
t := getkeycode(letter);
s := letter;
if (Chr(t) = letter) then result := true;
if number(letter) then result := false;
if (s='<') or (s='>') or (s='?') or (s=':') or (s='"')
or (s='{') or (s='}') or (s='|') or (s='+') or (s='_')
or (s='~') or (s='!') or (s='@') or (s='#') or (s='$')
or (s='%') or (s='^') or (s='&') or (s='*') or (s='(')
or (s=')') then result := true;
end;
function CheckPrevious(text:string;pos:integer):boolean;
begin
try
if pos > 1 then
Result := Capital(text[pos-1])
except
Result := False;
end;
end;
function CheckAfter(text:string;pos:integer):boolean;
begin
try
if pos < (length(text)-1) then
Result := Capital(text[pos+1])
except
Result := False;
end;
end;
function Mistake(letter:char):string;
begin
if number(letter) then result := letter else result := humantext(letter,40)
if result=letter then begin end else writeln('mistake made')
end;
function MakeMistakes(text:string):string;
var t:integer;
begin
for t := 1 to length(text) do begin
result := result + mistake(text[t])
end;
end;
procedure Talk(text:string);
var t:integer;
s:string;
begin
s := MakeMistakes(text) + Chr(13);
for t := 1 to length(s) do begin
if capital(s[t]) and not CheckPrevious(s,t) then
begin keydown(16); sleep(20+random(20)) end;
keydown(getkeycode(s[t]))
sleep(10+random(20))
keyup(getkeycode(s[t]))
sleep(20+random(20))
if capital(s[t]) and not CheckAfter(text,t) then
begin keyup(16); sleep(20+random(20)) end;
end;
end;
Procedure AddFriend(friend:string);
begin
GameTab(8);
Mouse(601,444,7,3,True);
sleep(100+random(500));
Talk(friend);
end;
Procedure DeleteFriend(friend:string);
begin
GameTab(9);
Mouse(681,444,7,3,True);
sleep(100+random(500));
Talk(friend);
end;
Function FindTradeOffer:Boolean; // doesn't work
begin
if InChat('would like to trade')
then result := True;
end;
Function GetTrader:string;// doesn't work
begin
GetLastChatText(result)
result := Chr(0)+result;
result := Between(Chr(0),' would like',result)
end;
Procedure AcceptTrade;
var t:integer;
begin
t := getcolor(290,189)
Mouse(260,195,7,3,True);
repeat
sleep(100)
until not (GetColor(290,189)=t)
Mouse(225,310,7,2,True)
WriteLn('Accepted Trade')
end;
Procedure DeclineTrade;
begin
Mouse(260,267,7,3,True);
sleep(100+random(500));
end;
Procedure ShakeOffRClick; // doesn't work
var t,tx,ty:integer;
begin
t := MouseSpeed
MouseSpeed := 1
getmousepos(tx,ty)
MMouse(tx+500,ty,300,300)
MMouse(tx,ty,50,50)
MouseSpeed := t
end;
Function SellingThis:String;
var t:integer;
sstring:string;
begin
t := random(30)
if (t > -1) and (t < 16) then // 0-15
sstring := Effect+'Selling '+Item+' '+Price+'ea';
if (t > 15) and (t < 21) then // 15-20
sstring := Effect+'Selling '+Item+' '+Price+'ea'+' -- '+UName;
if (t > 20) and (t < 24) then // 21-23
sstring := Effect+'Selling '+Item2+' '+Price+'ea';
if (t > 23) and (t < 27) then // 24-26
sstring := Effect+'Selling '+Item2+' '+Price+'ea'+' -- '+UName;
if (t > 26) and (t < 29) then // 27-28
sstring := 'Selling '+Item2+' '+Price+'ea'
if (t > 28) and (t < 31) then // 29-30
sstring := 'Selling '+Item2+' '+Price+'ea'+' -- '+UName;
result := sstring;
end;
Procedure SellUntilTrade;
begin
repeat
Talk(SellingThis);
Sleep(WaitTime-WaitTimeRand+(WaitTimeRand*2))
until FindTradeOffer;
AddFriend(GetTrader);
end;
begin
SetUpSRL;
Init;
activateclient;
end.