Results 1 to 11 of 11

Thread: Checklogin;

  1. #1
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default Checklogin;

    Begin
    Startscript;
    if(not(findbitmap(Logincheck,x,y)))then
    begin
    LoginToGame;
    end.

    just doesent work.. started typing my password into chat

    or is there a SRL commands to check this? im a bit new to srl :O

  2. #2
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    I'm not sure what you are trying to do, please explain again.

    There are SRL commands for checking whether you are logged in, for logging in, for logging out, for switching players etc in SRL>SRL>core>login.scar.

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

    Default

    Code:
    If not(Loggedin)then
      LoginPlayer
    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!


  4. #4
    Join Date
    Aug 2006
    Location
    London
    Posts
    2,021
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    since you're new to SRL, i think this extra information could be useful

    call a procedure called NumberOfPlayers(
    SCAR Code:
    NumberOfPlayers(1)
    this is to get the array length, without it, you would get RunTime errors

    next you have to set the username and password
    SCAR Code:
    players[0].name:='usernamehere';
    players[0].pass:='passwordhere';

    so the end script would be something like this
    Code:
    {.include SRL\SRL.scar}
    
    begin
      NumberOfPlayers(1);
      Players[0].name := 'UsernameHere';
      Players[0].pass := 'PasswordHere';
    
      if(not loggedin)then
       loginplayer
    Join the Official SRL IRC channel. Learn how to Here.

  5. #5
    Join Date
    Jul 2006
    Location
    NY
    Posts
    371
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yak I have a quick question about a runtime error I keep getting. Im asking you this because you said something about a runtime error in your previous post. Im using Mouse procedures, but instead of numbers like this:
    Mouse(x,y,0,0,true)
    Im doing this:
    Mouse(MA[random(3)],MB[random(3)],5,5,true)
    If you dont know what that is, instead of using numbers Im using arrays. The thing is that sometimes I will get a runtime error right before a procedure like that, but sometimes I dont get a error at all.
    What do you think the problem is?

  6. #6
    Join Date
    Sep 2006
    Location
    Scripter's Heaven
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    the problem is that your arrays dont include an index for every number from 0 to 2, those are the numbers that random(3) will return. make sure the randomness will always be withing the bounds of your array.

    And check out my pascal interpreter!
    <R0b0t1> No, really, I went to a bar and picked up a transvestite.

  7. #7
    Join Date
    Jul 2006
    Location
    NY
    Posts
    371
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by lardmaster View Post
    the problem is that your arrays dont include an index for every number from 0 to 2, those are the numbers that random(3) will return. make sure the randomness will always be withing the bounds of your array.
    I fixed it. I made up variables like a,b,c,d etc...
    and made them integers.
    And then my mouse procedure changed from this:
    SCAR Code:
    Mouse(A1[random(3)],B1[random(2)],0,0,true)
    To this:
    SCAR Code:
    a:= random(3)+1
    b:= random(2)+1
    Mouse(A[a],B1[b],0,0,true)

    I read your post and I looked at my "[random(3)]" and thought of a way to change it.
    And it worked, no more runtime error
    Thanks.
    ~jR

  8. #8
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    -Lol now when im looking at my first post i must have been drunk or something

    -i'we looked through srl/srl/core/inventory.scar. but i dunno which one i should use for checking if inventory is full heres the code:
    Code:
    Procedure Cutyew;
    begin
    repeat
    until(inv = InventoryFull: Boolean;)
    end;
    -not sure if its like that fix me pls if im wrong :O

  9. #9
    Join Date
    Oct 2006
    Posts
    412
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It would be like this

    Procedure Cutyew;
    begin
    repeat
    until(InvFull);
    end;

  10. #10
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Yes InvFull is a boolean function that will check if the inventory is full. Function meaning that it returns a value, boolean meaning that value is true or false. So when you use InvFull in the until, it represents true or false, so you don't have to do InvFull=true or anything like that.

  11. #11
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    thank you all helped me alot if ur wondering im making a auto yew cutter... hopefully i get it finished.. lol

    - typing this from school.. im way ahead of everyone IT lol...

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
  •