Firstly make sure to have SetUpSRL; in you main loop. I'm looking at your script now and making changes.
Ok heres what I have so far go through and see what I wrote to the side
SCAR Code:
program MerchantMaster;
{.Include SRL/SRL.scar}
{.include srl\srl\extended\xtext.scar}
{.include srl/srl/misc/amount.scar}
const //fill these out, or it won't work!!!!!
howmany = 15; //how many of the item you want.
whatyouwannabuy='willows'; //what IS the item you want?
eaprice=25; //Just wondering, how much would you want to buy each?
Var
Message1:String;
Fx, Fy : integer;//sets up the buying message
{------------------------------------------------------------------------------------------}
procedure BuyTrade; //This starts the procedure of a Buying Trade
begin
MoveMouse(470,292);
Wait(10000);
if Option2('Willow')then // I'm not sure what this is but if you want it to work you need a begin
end;
{------------------------------------------------------------------------------------------}
procedure StartTrade; //This moves the mouse to start the trade
var cx, cy, Fx, Fy : integer;
begin
If (FindColor(Fx, Fy, 8388736, 21, 416, 29, 425))then //if it finds rade in the chat box...
begin
Wait(500);
Mouse(cx+10,cy+3,0,0,True); //it will move the mouse towards it.
Wait(500);
BuyTrade; // added semicolon
end;
end;
procedure Buyingstatement; //This starts talking using your buying statement.
var Fx, Fy : integer;
begin
wait(1000); //Waits a few seconds before typing again.
Message1:= 'buying up to '+ IntToStr(howmany) + ' ' + whatyouwannabuy +'! for ' + IntToStr(eaprice) + 'ea!'; //this SHOULD make the typing message work....
typesend(Message1); //this will make it look like the line above is being typed by a human.
if (FindColor(Fx, Fy, 8388736, 21, 416, 29, 425)) then
begin
StartTrade;
end;
end;
{------------------------------------------------------------------------------------------}
begin ///////////////////////////////////
repeat //////{ Rinse, Lather, Repeat. }//
buyingstatement; ///////////////////////////////////
until(FindColor(Fx, Fy, 8388736, 21, 416, 29, 425)); //until the trade color is found in the last chat line.
////////////////////////////////////
end.
What you need : Tidey it up, just because you understand your notes doesn't mean every one else will. Try compacting your procedures into one procedure that loops. Make your final until (which is the trade screen) into a Boolean function. SRL may already have this try looking and seeing if they do.
I.E.
SCAR Code:
Function TradeScreen:Boolean;
begin
if (FindColor(Fx, Fy, 8388736, 21, 416, 29, 425)) then
begin
Result := True;
end else
Result := False;
end;
Then your final loop would be
SCAR Code:
begin ///////////////////////////////////
repeat //////{ Rinse, Lather, Repeat. }//
buyingstatement; ///////////////////////////////////
until(TradeScreen)
end.
These are tidbits but theres more to do keep reading tuts and you will have it in no time! Good luck