Results 1 to 9 of 9

Thread: Type mismatch with TeditBox thing in forms

  1. #1
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default Type mismatch with TeditBox thing in forms

    Line 35: [Error] (16350:33): Type mismatch in script C:\Program Files\SCAR 3.20\Scripts\akward alcher.scar

    what Alchs is suposed to do, is you type in the number of alchs you would like to do on the form, and it does that many

    here is the procedure:

    SCAR Code:
    procedure StartClick(sender: TObject);
    begin
      Writeln('Get Ready To Alch!');
      frmDesign.ModalResult:= mrOk; // Closes the form
      Username := UserEdit.Text;//no problem
      Password := PassEdit.Text;//no problem
      Alchs := IntToStr(AlchEdit.Text);//problem line
      WriteLn('Username = ' + Username);
      Writeln('Password = ' + Password);
    end;

    my variables:

    SCAR Code:
    UserEdit : TEdit;
      PassEdit : TEdit;
      NickEdit : TEdit;
      STEdit : TEdit;
      SFEdit : TEdit;
      AlchEdit : TEdit;
      Username, Password: String;
      alchs : integer

    and where i use it:
    SCAR Code:
    repeat
        alch;
        cleardebug;
        prog;
      until Alchs = Counter;


    and, when i change the variables to:
    SCAR Code:
    Username, Password, Alchs : String;
      SRL_Time, Counter, exp : integer;

    and the procedure to:
    SCAR Code:
    procedure StartClick(sender: TObject);
    begin
      Writeln('Get Ready To Alch!');
      frmDesign.ModalResult:= mrOk; // Closes the form
      Username := UserEdit.Text;
      Password := PassEdit.Text;
      Alchs := AlchEdit.Text;
      WriteLn('Username = ' + Username);
      Writeln('Password = ' + Password);
    end;

    i get this:
    SCAR Code:
    repeat
        alch;
        cleardebug;
        prog;
      until Alchs = Counter;//Line 269: [Error] (16584:22): Type mismatch in script C:\Program Files\SCAR
    Last edited by Awkwardsaw; 03-28-2009 at 08:09 PM.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  2. #2
    Join Date
    Jan 2009
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Change this:

    SCAR Code:
    procedure StartClick(sender: TObject);
    begin  
    Writeln('Get Ready To Alch!');  
    frmDesign.ModalResult:= mrOk; // Closes the form  
    Username := UserEdit.Text;//no problem  
    Password := PassEdit.Text;//no problem
     Alchs := IntToStr(AlchEdit.Text);//problem line  
    WriteLn('Username = ' + Username);  
    Writeln('Password = ' + Password);
    end;

    To this:

    SCAR Code:
    procedure StartClick(sender: TObject);
    begin  
    Writeln('Get Ready To Alch!');  
    frmDesign.ModalResult:= mrOk; // Closes the form  
    Username := UserEdit.Text;//no problem  
    Password := PassEdit.Text;//no problem
     Alchs := StrToInt(AlchEdit.Text);//problem line  
    WriteLn('Username = ' + Username);  
    Writeln('Password = ' + Password);
    end;

    CAuse AlchEdit.Text is a string, and Alchs is an int. You had InttoStr instead of StrToInt.

  3. #3
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    thats what iv had before i as playing around with it, i must have forgotten to change it, thanks though. its still the same error
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  4. #4
    Join Date
    Jan 2009
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    And in the second one, where it was something like

    until alchs=counter

    alchs is declared as string and counter is declared as int
    so it would be

    until strtoint(alchs)=counter

  5. #5
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    wew, thanks, that did it.

    +rep, because i was to dumb to test that out in the first place, thinking that it wouldnt work =p
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  6. #6
    Join Date
    Jan 2009
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No problem glad to help <(^_^)>

  7. #7
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    ok, heres an other little bug =p syntax error with the antiban i just made

    SCAR Code:
    procedure AkwardAntiBan;
    begin
      if (not(LoggedIn))then
      LoginPlayer;
      for R := 300 to 500 do
      for RG := 0 to 8 do
      case Random(10) of
        0:begin
            HoverSkill('Magic', False);
            wait(100+ random(R));
            HoverSkill('Random', False);
            SleepAndMoveMouse(600000+random(400000));
          end;
        1:Begin
            case Random(3) of
            0: begin
                 Gametab(RG);
                 wait(R + random (R));
                 Gametab(RG);
                 wait(R + random (R));
                 Gametab(RG);
                 wait(R + random (R));
                 Gametab(RG);
                 wait(R + random (R));
               end;
            1: begin
                 Gametab(RG);
                 wait(R + random (R));
                 Gametab(RG);
                 wait(R + random (R));
               end;
            2: begin
                 Gametab(RG);
                 wait(R + random (R));
                 Gametab(RG);
                 wait(R + random (R));
                 GameTab(RG);
               end;
            end;
            end;
        2:begin
            case Random(2) of
            0: begin
                 PickUpMouse;
                 wait(R + random (r));
                 PickUpMouse;
                 wait(R + random (r));
               end;
            1: begin
                 PickUpMouse;
                 wait(R + random (r));
               end;
          end;
          end;
        3: SayCurrentLevels('Magic');
        4: begin
             case Random(2) of
             0: begin
                  MakeCompass('N');
                  Wait(R + random(R));
                  MakeCompass('S');
                  Wait(R + random(R));
                  MakeCompass('N');
                  Wait(R + random(R));
                end;
             1: begin
                  MakeCompass('E');
                  Wait(R + random(R));
                  MakeCompass('S');
                  Wait(R + random(R));
                  MakeCompass('E');
                  Wait(R + random(R));
                  MakeCompass('W');
                  Wait(R + random(R));
                  MakeCompass('S');
                  Wait(R + random(R));
                  MakeCompass('N');
                  Wait(R + random(R));
                end;
             end;
    end;

    have fun trying to figure it out.. im gonna keep playing with it though
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  8. #8
    Join Date
    Jan 2009
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    point out the line it returs a syntax error plz!

  9. #9
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    the first line of the next procedure, where it says "procedure procedurename;"

    but, if i but the antiban in brackets, i dont get the error, so its somewhere in the antiban procedure
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

Thread Information

Users Browsing this Thread

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

Posting Permissions

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