Results 1 to 9 of 9

Thread: i can't find the error..

  1. #1
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default i can't find the error..

    on my new autotrader i kind of got stuck, here is my script

    SCAR Code:
    program AutoTrader;
    {.include srl/srl.scar}
    {.include srl/srl/skill/buysell.scar}
    {.include srl/srl/misc/trade.scar}

    var
    x,y,z,a,AmountToGive,NumOfChaos,RunesBought: integer;

    const
      Message = ('buying chaos 110 ea - drizzt');
      ItemToBuy = ('aos');   //letters to make the isuptext work
      PricePerItem = (110);
      RuneToBuy = ('chaos');
      amounttobuy = (10000);
     
    function Findit(color,x1,y1,x2,y2: Integer; Nick: string): boolean;
      begin
        if Findcolor(z,a,color,x1,y1,x2,y2) then
        begin
          MMouse(z,a,0,0)
          Wait(50+Random(50));
          if (IsUpText(nick)) then
          begin
            Result := True;
          end
        end
      end;
     
      Function TradetheFool: Boolean;
      begin
        if Findcolor(x,y,8388736,10,442,201,456) then
        begin
        mouse(x,y,0,10,true);
        end
        wait(1000);
        if checkarea('tradescreen') = true then
        begin
        Result := true;
        writeln('ooh we gots a seller');
        end
        else result := false;
      end;
     

    begin
      setupsrl;
      activateclient;
      RunesBought := 0
      repeat
        Typesend(message);
        if Tradethefool = true then
        begin
          wait(5000);
          if Findit(1681119,301,75,345,111,itemtobuy) = true then
          begin
            amount('tradescreen',1) :=  numofchaos;
            AmountToGive := (NumOfChaos * PricePerItem);
            mouse(z,a,2,2,false);
            chooseoption('er-X');
            wait(750);
            typesend(inttostr(AmountToGive));
            wait(4000+random(500));
          end
          if PlayerAccepted = true then
          begin
            Accept;
            CheckItem(true,ItemToBuy + inttostr(numofchaos));
            Accept;
            RunesBought := (RunesBought + NumOfChaos);
          end
          else Decline;
        end
      until (not(loggedin)) or (runesbought >= amounttobuy);
    end.

    it says "Line 56: [Error] (15791:25): Identifier expected in script"

    and i can't find what i'm missing, so someone help me out?
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  2. #2
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    'tradescreen' is not a var in your script.

    make it an var or do something else. (i think you need to fill in something else there)

  3. #3
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ahh, i thought that error meant that i didnt have correct beginnings and endings though?

    and isn't 'tradescreen' an area in Core/Amount of SRL? which is what the function calls for if i am correct
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  4. #4
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thats not it because in a procedure out of srl above it he's using tradescreen to its a hard Question i looked in the include and nope your thingy is right :s

  5. #5
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program AutoTrader;
    {.include srl/srl.scar}
    {.include srl/srl/skill/buysell.scar}
    {.include srl/srl/misc/trade.scar}

    var
    x,y,z,a,AmountToGive,NumOfChaos,RunesBought: integer;

    const
      Message = ('buying chaos 110 ea - drizzt');
      ItemToBuy = ('aos');   //letters to make the isuptext work
      PricePerItem = (110);
      RuneToBuy = ('chaos');
      amounttobuy = (10000);

    function Findit(color,x1,y1,x2,y2: Integer; Nick: string): boolean;
      begin
        if Findcolor(z,a,color,x1,y1,x2,y2) then
        begin
          MMouse(z,a,0,0)
          Wait(50+Random(50));
          if (IsUpText(nick)) then
          begin
            Result := True;
          end
        end
      end;

      Function TradetheFool: Boolean;
      begin
        if Findcolor(x,y,8388736,10,442,201,456) then
        begin
        mouse(x,y,0,10,true);
        end
        wait(1000);
        if checkarea('tradescreen') = true then
        begin
        Result := true;
        writeln('ooh we gots a seller');
        end
        else result := false;
      end;


    begin
      setupsrl;
      activateclient;
      RunesBought := 0
      repeat
        Typesend(message);
        if Tradethefool = true then
        begin
          wait(5000);
          if Findit(1681119,301,75,345,111,itemtobuy) = true then
          begin
            numofchaos := amount('tradescreen',1);
            AmountToGive := (NumOfChaos * PricePerItem);
            mouse(z,a,2,2,false);
            chooseoption('er-X');
            wait(750);
            typesend(inttostr(AmountToGive));
            wait(4000+random(500));
          end
          if PlayerAccepted = true then
          begin
            Accept;
            CheckItem(true,ItemToBuy + inttostr(numofchaos));
            Accept;
            RunesBought := (RunesBought + NumOfChaos);
          end
          else Decline;
        end
      until (not(loggedin)) or (runesbought >= amounttobuy);
    end.

    you had:
    amount('tradescreen',1) := numofchaos;
    is shoud be
    numofchaos := amount('tradescreen',1);


  6. #6
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ow! stupid i thought the code was okay but i first thought it looked weird after that i thought... okay but it wasn't :S

  7. #7
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    and the winner is...rikjess! ty much

    i had that to begin with, but changed it after the script just stopped while finding the amount, i did some more tweaking and forgot i had changed that, and i didn't think it would do much, but i guess it does
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  8. #8
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    rofl rikjess nice one!

    never used amoult >.<

  9. #9
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hey can someone help me test it? idk how i can by myself, and no friends are on rs to help me since i'm home from school sick, if so, pm me on here or something
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can't Find DTM
    By Macho Man67 in forum OSR Help
    Replies: 5
    Last Post: 09-04-2008, 07:19 PM
  2. Cant find a bmp
    By Diabloizzle in forum OSR Help
    Replies: 5
    Last Post: 07-06-2007, 01:55 AM
  3. how do you find out if a key is down
    By del_signo in forum OSR Help
    Replies: 6
    Last Post: 05-12-2007, 04:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •