Results 1 to 4 of 4

Thread: My check isn't working :o

  1. #1
    Join Date
    Sep 2006
    Posts
    322
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Question My check isn't working :o

    SCAR Code:
    // BEGIN CHECK FOR USERNAME TAKEN
      if (GetColor(381, 145) = 1251528) then
      ClearDebug;
      Writeln('Sorry, this username was taken');
      TerminateScript;//if name is taken, script will stop
      if (GetColor(382, 146) = 6398542) then
      ClearDebug;
      Writeln('>>>>>>>> Recovery Info <<<<<<<');
      WriteLn('Username = ' + Username);
      Writeln('Password = ' + Password);
      Writeln('01/01/1996');
      Writeln('Email: Null');
    // END CHECK FOR USERNAME TAKEN

    YoHoJo suggested I should use colorspiral maybe..? I also remember something about a if, then, else. If someone could explain why I need to use that, thanks.

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You're missing some begin/ends after the if/thens.

    SCAR Code:
    // BEGIN CHECK FOR USERNAME TAKEN
      if (GetColor(381, 145) = 1251528) then
      begin //HERE
        ClearDebug;
        Writeln('Sorry, this username was taken');
        TerminateScript;//if name is taken, script will stop
      end; //HERE
      if (GetColor(382, 146) = 6398542) then
      begin //HERE
        ClearDebug;
        Writeln('>>>>>>>> Recovery Info <<<<<<<');
        WriteLn('Username = ' + Username);
        Writeln('Password = ' + Password);
        Writeln('01/01/1996');
        Writeln('Email: Null');
      end; //HERE
    // END CHECK FOR USERNAME TAKEN

    A begin/end is needed after an if/then if you want to execute more than 1 statement of code.

  3. #3
    Join Date
    Jul 2008
    Location
    US
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    // BEGIN CHECK FOR USERNAME TAKEN
      if (GetColor(381, 145) = 1251528) then
      Begin
        ClearDebug;
        Writeln('Sorry, this username was taken');
        TerminateScript;//if name is taken, script will stop
      End Else
      Begin
        ClearDebug;
        Writeln('>>>>>>>> Recovery Info <<<<<<<');
        WriteLn('Username = ' + Username);
        Writeln('Password = ' + Password);
        Writeln('01/01/1996');
        Writeln('Email: Null');
      End;
    // END CHECK FOR USERNAME TAKEN

    This way you only have to worry about one color. if you wanted to make it legit, make a bitmapmask of the text that ur trying to find. That's what I do when i Auto on Private Servers with different fonts then Regular RS.

    heres example:

    SCAR Code:
    If (FindBitmapMaskTolerance(Mask_name, x, y, 0, 0, 50, 50, 5) then
    Begin

    These work very well with text, and are faster to make and find then DTM's.

  4. #4
    Join Date
    Sep 2006
    Posts
    322
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Thanks again Jad

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
  •