Results 1 to 15 of 15

Thread: Type mismatch (TradeScreen)

  1. #1
    Join Date
    Mar 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Type mismatch (TradeScreen)

    Code:
      if TradeScreen then
       begin
        repeat
        Wait(1000);
        until(not TradeScreen);
       end;
      end;
    Line 56: [Error] (16690:18): Type mismatch in script,

    What should i do to fix it?

  2. #2
    Join Date
    Dec 2007
    Location
    Wizzup?'s boat
    Posts
    1,013
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    if(TradeScreen)then
    is better standards, but post the whole script

    which line is 56?
    Project: Welcome To Rainbow

  3. #3
    Join Date
    Mar 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Line 56 is the first line, 'if TradeScreen then'

  4. #4
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    benjaa, that's worse standards.

    It should be if TradeScreen then.

    Let me check to see if there's any syntax.

    Try this:
    SCAR Code:
    if not TradeScreen = 0 then
    begin
      repeat
        Wait(1000);
      until(not TradeScreen = 0);
    end;

  5. #5
    Join Date
    Mar 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program PC;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/misc/trade.scar}

    var
    tradename: string;

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name := 'aaa';
      Players[0].Pass := 'aaa;
      Players[0].Nick := '
    aaa;
      Players[0].Active := True;
    end;

    procedure SetUp;
     begin
     SetupSRL;
     writeln('Barts Trade helper!');
     Wait(500);
     ActivateClient;
     if not LoggedIn then LogInPlayer;
     end;

    procedure SayText;
     begin
     SendKeys('glow2:shake:trade me for your price checks!');
     Wait(300+random(300));
     SendKeys(chr(13));
     Wait(2000);
     end;

    procedure AntiRandom;
     begin
     FindNormalRandoms;
     FindTalk;
     if FindFight then RunAway('s', true, 1, 7000+random(3000));
     end;

    procedure CheckTrades;
     begin
      SayText;
      AntiRandom;
      if SomeoneTrades then
       begin
       tradename := GetTradersName;
       SendKeys('Now trading '+ tradename);
       Wait(300);
       SendKeys(chr(13));
       AcceptTrade;
       end;
      if (TradeScreen) then
       begin
        repeat
        Wait(1000);
        until(not TradeScreen);
       end;
      end;

    begin
    DeclarePlayers;
     repeat
     CheckTrades;
     until(false);
    end.

    this is the whole script

  6. #6
    Join Date
    Jan 2008
    Location
    Stanford, CA
    Posts
    329
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    You have syntax error in your declareplayers btw. That part you were talking about should be fine (other than poor standards), considering that all your function were written correctly. Don't know why you are getting error there.

    However, there is a lot to improve on this script though. Good luck with it.

  7. #7
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Freakymonkey: It's because TradeScreen returns an Integer, not a Boolean.

    The integers are: 1 and 2 for trade screen, 0 for neither.

  8. #8
    Join Date
    Jan 2008
    Location
    Stanford, CA
    Posts
    329
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Oh, I stand corrected thanks Tv didn't know that.

  9. #9
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    {*******************************************************************************
    function TradeScreen: Integer;
    By: ZephyrsFury and EvilChicken!
    Description: Returns 1 or 2 for the respective tradescreens, 0 if neither is open.
    *******************************************************************************}


    function TradeScreen: Integer;
    begin
      Result := 0;
      if GetColor(90, 61) = 2070783 then
        Result := 1
      else
      if GetColor(142, 55) = 0 then
        Result := 2;
    end;


  10. #10
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Shorter:
    SCAR Code:
    While TradeScreen = 0 Do
      Wait(1000);


  11. #11
    Join Date
    Dec 2007
    Location
    Wizzup?'s boat
    Posts
    1,013
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    asif, if(TradeScreen)then is much better standards

    that's the way it should be written in C++ and HAS to be in GML
    Project: Welcome To Rainbow

  12. #12
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    C++/GML != Pascal.

  13. #13
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by TViYH View Post
    C++/GML != Pascal.
    fro correct scar scripting:

    C++/GML <> Pascal



    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  14. #14
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Well I don't know if you fixed this but here is an error.
    SCAR Code:
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
     
      Players[0].Name := 'aaa';
      Players[0].Pass := 'aaa;
      Players[0].Nick := '
    aaa;
      Players[0].Active := True;
    end;

    Should be:
    SCAR Code:
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
     
      Players[0].Name := 'aaa';
      Players[0].Pass := 'aaa';
      Players[0].Nick := 'aaa';
      Players[0].Active := True;
    end;

    Hope this helps

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  15. #15
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    TradeScreen IS NOT a boolean!

    It returns an integer!

    Look in Amount.scar for the answer to your question.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Type mismatch
    By batnas in forum OSR Help
    Replies: 3
    Last Post: 04-24-2008, 06:48 PM
  2. Type Mismatch..
    By Nava2 in forum OSR Help
    Replies: 1
    Last Post: 04-23-2008, 07:44 PM
  3. type mismatch
    By Maxcore in forum OSR Help
    Replies: 12
    Last Post: 11-10-2007, 12:54 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
  •