Results 1 to 11 of 11

Thread: Help Please, Type Miscmatch error from: While... Do

  1. #1
    Join Date
    Jul 2007
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help Please, Type Miscmatch error from: While... Do

    Hi guys, I get this error: Type mismatch in script

    The only thing I try to do is:

    begin
    sendkeyswait('Druk Ctrl+Alt+A en Alt+Tab dan naar scar',50,25)
    while sendkeyswait('Druk Ctrl+Alt+A en Alt+Tab dan naar scar',50,25) Do
    writeln('Loop naar bank en typ pin als je die hebt')
    writeln('Het script staat nu op pause.')
    writeln('Als je klaar bent, druk weer op Play.')
    writeln('Dan gaat het echte script beginnen.')
    writeln('AUB! Dan niet meer de muis bewegen.')
    writeln('Einde Bericht.')
    wait(3000)
    end.
    (SORRY IT'S DUTCH!!)
    but when I try this, it says:
    Line 4: [Error] (4:70): Type mismatch in script



    Can Anyone help me please?


    EDIT: It's my first script thing, so sorry if I made dumb mistakes.

  2. #2
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    The while do Command needs a boolean in the middle of it.

    PHP Code:
    While Boolean_is_true do
      
    //code 
    You have put a simple procedure in the middle of it: a procedure is not a boolean, and so it will nto work! Its a simple mistake to make so don't worry.

    If you are just starting out, i would recommend you look at some tutorials. My own personal one is in my sig below this post
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  3. #3
    Join Date
    Jul 2007
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks alot for the quick response, i'm going to test it right away

    (I don't really know what i should type in the place of Boolean is true,
    what i'm trying to do is when Scar SendKeyWait's, I want to make it type the Writeln's at the same time, is that possible with while Boolean_is_true do ?

    EDIT!

    Nevermined, i fixed it =) I just placed all text a bit different way and deleted the while... do

    Is it ok if I got another question or should I make a new thread for that?

    (It's: Can you let SCAR read your XP from a skill in RuneScape
    because I couldn't figure out how GetTextAtEx works...)

  4. #4
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    {*******************************************************************************
    function GetXP(Skill: String): Integer;
    By: Nielsie95
    Description: Returns current xp for a skill. Returns -1 if failed.
    *******************************************************************************}

    It's in Scar folder/includes/srl/srl/core/GameTab.scar
    For skill, just put in something like 'attack' for attack (case doesn't matter) and it should work if you spelt it right - will return -1 if you mispelt it.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  5. #5
    Join Date
    Jul 2007
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    EDIT Nevermind I copied the GetXp thing from the script so I'm putting this in:

    function GetXp(skill: string): Integer;
    var
    p: TPoint;
    i, tx, ty, x, y: Integer;
    begin
    Result := -1;
    if (not LoggedIn) or (not TabExists(2)) then Exit;
    GameTab(2);
    if (GetCurrentTab <> 2) then Exit;
    p := SkillToCoords(True,Skill);
    if (p.x < 1) then Exit;
    MMouse(p.x, p.y +5, 12, 4);
    while (not FindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2)) and (i < 50) do
    begin
    Wait(100);
    Inc(i);
    end;
    Wait(200 + Random(150));
    if (not FindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2)) then Exit;
    if IsTextInAreaEx(x, y, x + 60, y + 60, tx, ty, 'urrent', 0, SmallChars, False, False, 0, 1, 0) then
    Result := StrToIntDef(GetNumbers(GetTextAtEx(tx, ty, 0, SmallChars, False, True, 0, 1, 0, 50, False, tr_AllChars)), -1);
    end.
    and it gives another error =(

    this one:
    Line 7: [Error] (7:9): Unknown identifier 'LoggedIn' in script

  6. #6
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    You have to include SRL at the top of your script.
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  7. #7
    Join Date
    Jul 2007
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok I did include SRL.SCAR but now i get Another error ='(
    {.include SRL/SRL.scar}

    function GetXp(skill: string): Integer;
    var
    p: TPoint;
    i, tx, ty, x, y: Integer;
    begin
    Result := -1;
    if (not LoggedIn) or (not TabExists(2)) then Exit;
    GameTab(2);
    if (GetCurrentTab <> 2) then Exit;
    p := SkillToCoords(True,Skill);
    if (p.x < 1) then Exit;
    MMouse(p.x, p.y +5, 12, 4);
    while (not FindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2)) and (i < 50) do
    begin
    Wait(100);
    Inc(i);
    end;
    Wait(200 + Random(150));
    if (not FindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2)) then Exit;
    if IsTextInAreaEx(x, y, x + 60, y + 60, tx, ty, 'urrent', 0, SmallChars, False, False, 0, 1, 0) then
    Result := StrToIntDef(GetNumbers(GetTextAtEx(tx, ty, 0, SmallChars, False, True, 0, 1, 0, 50, False, tr_AllChars)), -1);
    end.
    and it says:
    Line 2: [Error] (12645:10): Duplicate identifier 'GETXP' in script C:\...\...\...\GetXp.scar

    I DON'T UNDERSTAND =(

    (sorry for being anoying with my errors )

  8. #8
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    SRL already has the function GetXP in it, so delete your GetXp function from your main script, save it, and it should compile.
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  9. #9
    Join Date
    Jul 2007
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm very sorry to tell you but.... I don't understand that =(
    How do I delete the GetXp function? when i have like this:

    {.include SRL/SRL.scar}

    begin
    WriteLn('Hi')


    function GetXp(skill: string): Integer;
    var
    p: TPoint;
    i, tx, ty, x, y: Integer;
    begin
    Result := -1;
    if (not LoggedIn) or (not TabExists(2)) then Exit;
    GameTab(2);
    if (GetCurrentTab <> 2) then Exit;
    p := SkillToCoords(True,Skill);
    if (p.x < 1) then Exit;
    MMouse(p.x, p.y +5, 12, 4);
    while (not FindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2)) and (i < 50) do
    begin
    Wait(100);
    Inc(i);
    end;
    Wait(200 + Random(150));
    if (not FindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2)) then Exit;
    if IsTextInAreaEx(x, y, x + 60, y + 60, tx, ty, 'urrent', 0, SmallChars, False, False, 0, 1, 0) then
    Result := StrToIntDef(GetNumbers(GetTextAtEx(tx, ty, 0, SmallChars, False, True, 0, 1, 0, 50, False, tr_AllChars)), -1);
    end;
    end.
    should i just delete:
    function GetXp(skill: string): Integer;
    that sentence?

    If you're getting tired of this, It's ok tell me (it isn't necesarry for the script)

  10. #10
    Join Date
    Dec 2007
    Location
    Canada
    Posts
    187
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    EDIT: ok try this

    SCAR Code:
    program GetPrayerXp;
    {.include SRL/SRL.scar}

    Procedure GetTheXp;
    begin
      GetXp('Prayer'); //Im pretty sure it stores the xp in memory and it might possibly write it on the debug box I cant currently test
    end;

    begin
      writeln('hi')
      GetTheXp;
    end.
    I'm baaaack

  11. #11
    Join Date
    Jul 2007
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks. I'm going to try it. But will it write down the XP somewhere?

    when i have like this:

    {.include SRL/SRL.scar}

    begin
    GetXp(prayer);
    end;

    begin
    writeln('hi')
    end.
    what will it do?


    EDIT

    It says unknown identifier 'Prayer' in script ..

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Type Mismatch Error, Help!
    By Ultra in forum OSR Help
    Replies: 4
    Last Post: 01-21-2009, 10:24 PM
  2. type mismatch error?
    By RudeBoiAlex in forum OSR Help
    Replies: 2
    Last Post: 10-28-2007, 10:17 PM
  3. Type Mismatch error
    By !bezo! in forum OSR Help
    Replies: 3
    Last Post: 08-26-2007, 03:00 PM
  4. Type Mismatch Error
    By hbryan1991 in forum OSR Help
    Replies: 2
    Last Post: 07-20-2007, 07:17 PM

Posting Permissions

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