okay so, i'm trying to make this autobuyer for chaos, and i'm getting there, but i'm having serious trouble, i'm doing the function "runeamount" that returns how many runes the person has offered, but i dunno how to take that amount and use it in anything, here's the script so far
SCAR Code:
program New;
{.include srl/srl.scar}
{.include srl/srl/skill/buysell.scar}
{.include srl/srl/misc/trade.scar}
var
x,y,z,a,AmountToGive,NumOfChaos,Chaos: integer;
const
Message = ('buying chaos 110 ea and deaths 270 ea - drizzt');
begin
setupsrl;
activateclient;
LoadRune('chaos');
FreeBitmap(chaos);
repeat;
Typesend(message);
if (someonetrades = true) then
begin
accepttrade;
wait(500);
if (tradescreen) then
begin
wait(3000);
begin
Runeamount('tradescreen','Chaos'); //this is where my current problem is
AmountToGive := (NumOfChaos * 110);
end
findobj(z,a,'oins',1680070,549,205,736,460);
mouse(z,a,2,2,false);
choosoption('er-X');
typesend(inttostr(AmountToGive));
end
if PlayerAccepted = true then
Accept;
CheckItem(true,'Chaos Rune x ' + inttostr(numofchaos););
end
until not(loggedin);
end.
k i figured out a way to do it, is this the proper way?
SCAR Code:
program New;
{.include srl/srl.scar}
{.include srl/srl/skill/buysell.scar}
{.include srl/srl/misc/trade.scar}
var
x,y,z,a,AmountToGive,NumOfChaos,Chaos: integer;
const
Message = ('buying chaos 110 ea and deaths 270 ea - drizzt');
ItemToBuy = ('aos');
PricePerItem = (110);
function FindIt: boolean;
begin
if Findcolor(x,y,1680070,549,205,736,460) then
begin
MMouse(z,a,0,0)
Wait(50+Random(50));
if (IsUpText(ItemToBuy)) then
begin
Result := True;
end
end
end;
begin
setupsrl;
activateclient;
LoadRune('chaos');
repeat;
Typesend(message);
if (someonetrades = true) then
begin
accepttrade;
wait(500);
if (tradescreen) then
begin
wait(3000);
if FindIt = true then
begin
NumOfChaos := Runeamount('tradescreen','Chaos');
AmountToGive := (NumOfChaos * PricePerItem);
end
mouse(z,a,2,2,false);
chooseoption('er-X');
typesend(inttostr(AmountToGive));
end
if PlayerAccepted = true then
Accept;
CheckItem(true,'Chaos Rune x ' + inttostr(numofchaos));
end
until (isfunctionkeydown(1) = true);
FreeBitmap(chaos);
end.