Results 1 to 7 of 7

Thread: login function for new rs

  1. #1
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default login function for new rs

    if you can improve repost an improved version post any problems or improvements

    ive just put this together in bout 30 mins it will have bugs and faults
    if any admins wanna make it better and shove it into srl quickly for an emergency release

    im gunna make some more stuff now to patch up damage

    ek left my user and pass in for my main thank god i noticed that quick

    SCAR Code:
    function loginplayer2:boolean;
    var
      PX, PY,trys,clickheretoplay,time:integer;
      click:boolean;
    begin
      activateclient;
      if loggedin then exit;
      if getcolor(402, 204)=0 then
      begin
        mousebox(336, 400,421, 409,1);
        wait(100+random(100));
      end;
      click:=false;
      clickheretoplay := BitmapFromString(3, 41, 'beNq7UX13ETME/X' +
           '40G4L+PFkCRc9WoSO4IEwNXBdC+4OpEPT7bjcU3W6GIG1VyaGCfhy' +
           '1gqCfJ5wh6NdpHwj6eTYEgn5fiIGgX5ezEehaMQq6UY2CAOcHroc=' +
           '');
      mousebox(358,165,403,177,1);
      repeat
        wait(500+random(100));
        click:=getcolor(402, 204)=0;
        inc(trys);
      until (trys>=15) or click=true;
      if click=false then
      begin
        writeln('failed to login');
        exit;
      end;
      click:=false
      mousebox(310, 250, 452, 267,1);
      wait(100+random(100));
      TypeSend(Players[CurrentPlayer].Name);
      Wait(100 + Random(100));
      TypeSend(Players[CurrentPlayer].Pass);
      Wait(100 + Random(100));
      mousebox(336, 400,403, 371,1);
      marktime(time);
      repeat
        wait(10+random(100));
        if findbitmap(clickheretoplay,PX,PY) then
        begin
          mouse(PX, PY, 2,2,true);
          click:=true;
          exit;
        end;
      until click=true or (timefrommark(time)>=180000);
      if click<>true then
      begin
        writeln('failed to login');
        exit;
      end;
      FreeBitmap(ClickHereToPlay);
    end;
    Blank!

  2. #2
    Join Date
    Nov 2007
    Location
    The Netherlands
    Posts
    1,490
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    if click=false and (trys>=15) then
      begin
        writeln('failed to login');
        exit;
      end;
    Could be shortened to:
    SCAR Code:
    if click=false then exit;
    Because there is only a need tto check if click is false, because it will only check when the repeat is done

    SCAR Code:
    mouse(380, 366,5,10,true);
    Maybe a mousebox there?

    SCAR Code:
    if click<>true then
      begin
        writeln('failed to login');
        exit;
      end;
    There is no need to debug there, so, just do this:
    SCAR Code:
    if click<>true then exit;

    Other than that, it looks good
    I didn't test it btw, just looked at the code
    Good job

    PvH

  3. #3
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    pvh the writelns anrnt for debug its so that the user can see what is going on
    Blank!

  4. #4
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Use a GetTextAtEx to find out what happens when you log in badly.

  5. #5
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    erm will that work do we have that font
    Blank!

  6. #6
    Join Date
    Nov 2007
    Location
    The Netherlands
    Posts
    1,490
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Look in the login.scar as it is now for information like that

  7. #7
    Join Date
    Oct 2007
    Location
    The deep web
    Posts
    2,496
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    were does it go? :/
    Did someone say GDK?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 02-27-2008, 05:20 PM
  2. Replies: 2
    Last Post: 02-26-2008, 08:26 PM
  3. [FUNCTION] FindDoorColour: integer; By ZephyrsFury [FUNCTION]
    By ZephyrsFury in forum Research & Development Lounge
    Replies: 10
    Last Post: 07-27-2007, 08:45 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
  •