Page 1 of 2 12 LastLast
Results 1 to 25 of 37

Thread: Logging Out and In.

  1. #1
    Join Date
    Apr 2012
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Logging Out and In.

    Currently making my first script although its not for RuneScape but one of the many Private Servers i play. Really enjoying it so far, scripting im talking about. Script is working perfectly, so far its thieves and Alchs not a lot but its a start.

    Right now im looking to add some code that will log out and back in as a random on the server is it asks you a question which you need to answer, simply logging in and out gets rid of it.


    Any suggestions?
    << Newbie Scripter >>
    Release First Script [ ]
    100 Posts [ ]
    250 Posts [ ]


  2. #2
    Join Date
    Apr 2012
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Anyone? Im guessing the logging and out will be quite simple but the eating im not sure about
    << Newbie Scripter >>
    Release First Script [ ]
    100 Posts [ ]
    250 Posts [ ]


  3. #3
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    idk about eating

    Simba Code:
    function LoggedIn: boolean;
    procedure LoginPlayer;
    procedure Logout;

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  4. #4
    Join Date
    Apr 2012
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Dgby714 View Post
    idk about eating

    Simba Code:
    function LoggedIn: boolean;
    procedure LoginPlayer;
    procedure Logout;
    Think i did the eating, be quite pleased if it does work as i worked it out on my own

    this is what i got for eating but for some reason im getting an Error. Right at the end of my script the "end;" is where the error is showing but i cant figure it out.

    Code:
    //Eating
    
    procedure Eat;
    begin
    if(FindColor(x,y,Hit,8,5,516,333)) then
     begin
    if(FindColor(x,y,Sword,564,214,726,451)) then
    begin
    wait(300);
    ClickMouse(x,y,mouse_Left);
    wait(randomrange(500,700));
    
    end;
    end;
    
    
    //Main Loop
    
    
       Begin
    repeat
    
    Steal;
    Alch;
    Eat;
    
    until(false);
    end; //Error is showing here.
    Last edited by Example; 04-09-2012 at 03:27 PM.
    << Newbie Scripter >>
    Release First Script [ ]
    100 Posts [ ]
    250 Posts [ ]


  5. #5
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    The main begin end has a period (.) after end not a semi-colon (;)

    Simba Code:
    program _;
    begin
    end.

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  6. #6
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Example View Post
    Think i did the eating, be quite pleased if it does work as i worked it out on my own

    this is what i got for eating but for some reason im getting an Error. Right at the end of my script the "end;" is where the error is showing but i cant figure it out.

    Code:
    //Eating
    
    procedure Eat;
    begin
    if(FindColor(x,y,Hit,8,5,516,333)) then
     begin
    if(FindColor(x,y,Sword,564,214,726,451)) then
    begin
    wait(300);
    ClickMouse(x,y,mouse_Left);
    wait(randomrange(500,700));
    
    end;
    end;
    
    
    //Main Loop
    
    
       Begin
    repeat
    
    Steal;
    Alch;
    Eat;
    
    until(false);
    end; //Error is showing here.
    Simba Code:
    //Eating

    procedure Eat;
    begin // 1 Begin
    if(FindColor(x,y,Hit,8,5,516,333)) then
     begin // 2 Begin
    if(FindColor(x,y,Sword,564,214,726,451)) then
    begin // 3 Begin
    wait(300);
    ClickMouse(x,y,mouse_Left);
    wait(randomrange(500,700));

      End;
     End; // Two ends?
    End; //Added third end.


    //Main Loop


     Begin
    repeat

    Steal;
    Alch;
    Eat;

    until(false);
    end. //Error is showing here.
          //Mainloop ends with end. with a dot, nor a semicolom.
    Last edited by Failure; 04-09-2012 at 03:35 PM.

  7. #7
    Join Date
    Apr 2012
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Failure View Post
    Simba Code:
    //Eating

    procedure Eat;
    begin // 1 Begin
    if(FindColor(x,y,Hit,8,5,516,333)) then
     begin // 2 Begin
    if(FindColor(x,y,Sword,564,214,726,451)) then
    begin // 3 Begin
    wait(300);
    ClickMouse(x,y,mouse_Left);
    wait(randomrange(500,700));

      End;
     End; // Two ends?
    End; //Added third end.


    //Main Loop


       Begin
    repeat

    Steal;
    Alch;
    Eat;

    until(false);
    end; //Error is showing here.
    Yeah just found out the problem, like you say was missing one more "end;" Almost had it
    << Newbie Scripter >>
    Release First Script [ ]
    100 Posts [ ]
    250 Posts [ ]


  8. #8
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Example View Post
    Yeah just found out the problem, like you say was missing one more "end;" Almost had it
    Also the dot at the last line of end, since it has to end your mainloop.

  9. #9
    Join Date
    Apr 2012
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    //Eating

    procedure Eat;
    begin
    if(FindColor(x,y,Hit,8,5,516,333)) then //Finds the colour red when your Attacked
    begin
    if(FindColor(x,y,Sword,564,214,726,451)) then //Finds Swordfish in Inv
    begin
    wait(300);
    ClickMouse(x,y,mouse_Left); //Eat
    wait(randomrange(500,700));

    end;
    end;
    end;

    But its not eating for some reason.
    << Newbie Scripter >>
    Release First Script [ ]
    100 Posts [ ]
    250 Posts [ ]


  10. #10
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Use better colors or maybe even make a DTM for the food you want to eat.

    What is is that you want to eat exactly?

  11. #11
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Example View Post
    Simba Code:
    //Eating

    procedure Eat;
    begin
    if(FindColor(x,y,Hit,8,5,516,333)) then //Finds the colour red when your Attacked
    begin
    if(FindColor(x,y,Sword,564,214,726,451)) then //Finds Swordfish in Inv
    begin
    wait(300);
    ClickMouse(x,y,mouse_Left); //Eat
    wait(randomrange(500,700));

    end;
    end;
    end;

    But its not eating for some reason.
    Simba Code:
    Procedure Eat;
    Begin
    If FindColor(x, y, Hit, 8, 5, 516 ,333 ) then
     Begin
      FindColor(x, y, Sword, 564, 214, 726, 451);
      Wait(300); //Showing an Error Here.
      Mouse(x, y, 5, 5, True);
      Wait(RandomRange(500, 700));
     End;
    End;

    That should do it.
    Last edited by Failure; 04-09-2012 at 03:59 PM.

  12. #12
    Join Date
    Apr 2012
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    Use better colors or maybe even make a DTM for the food you want to eat.

    What is is that you want to eat exactly?
    Trying to End sword fish which are inside my Inventory every time the guard that im pickpocketing catches me.
    << Newbie Scripter >>
    Release First Script [ ]
    100 Posts [ ]
    250 Posts [ ]


  13. #13
    Join Date
    Apr 2012
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Failure View Post
    Simba Code:
    Procedure Eat;
    Begin
    If FindColor(x, y, Hit, 8, 5, 516 ,333 ) then
     Begin
      FindColor(x, y, Sword, 564, 214, 726, 451) //Can use MIX1, MIY1, MIX2, MIY2 instead I guess (Main Inventory)
      Wait(300);
      Mouse(x, y, 5, 5, True);
      Wait(RandomRange(500, 700));
     End;
    End;

    That should do it.
    Started Scripting yesterday so im not sure how the MIX1, MIX2 Etc.. Are used, that will be the next thing i look into.

    Just tried you modification of my script but im now getting an error somewhere else, on the "wait(300);

    Simba Code:
    Procedure Eat;
    Begin
    If FindColor(x, y, Hit, 8, 5, 516 ,333 ) then
     Begin
      FindColor(x, y, Sword, 564, 214, 726, 451)
      Wait(300); //Showing an Error Here.
      Mouse(x, y, 5, 5, True);
      Wait(RandomRange(500, 700));
     End;
    End;
    << Newbie Scripter >>
    Release First Script [ ]
    100 Posts [ ]
    250 Posts [ ]


  14. #14
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Example View Post
    Started Scripting yesterday so im not sure how the MIX1, MIX2 Etc.. Are used, that will be the next thing i look into.

    Just tried you modification of my script but im now getting an error somewhere else, on the "wait(300);

    Simba Code:
    Procedure Eat;
    Begin
    If FindColor(x, y, Hit, 8, 5, 516 ,333 ) then
     Begin
      FindColor(x, y, Sword, 564, 214, 726, 451)
      Wait(300); //Showing an Error Here.
      Mouse(x, y, 5, 5, True);
      Wait(RandomRange(500, 700));
     End;
    End;
    It's oke you'll get used to it, I ran the Procedure myself I'm not getting errors, you sure you copied it properly?

  15. #15
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    You didn't put a semicolon after your FindColor function.


    EDIT: The one above Wait(30);


    EDIT2: to use MIX1 etc... just replace it with your co-ordinates, like this:
    Simba Code:
    FindColor(x, y, Sword, MIX1, MIY1, MIX2, MIY2)
    Last edited by Abu; 04-09-2012 at 03:59 PM.

  16. #16
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    You didn't put a semicolon after your FindColor function.


    EDIT: The one above Wait(30);


    EDIT2: to use MIX1 etc... just replace it with your co-ordinates, like this:
    Simba Code:
    FindColor(x, y, Sword, MIX1, MIY1, MIX2, MIY2)


    When I run it myself without semicolon it still works. Though you are right, I forgot it I added it myself when I was testing I forgot only after a if statement there's no semicolon.
    Last edited by Failure; 04-09-2012 at 04:05 PM.

  17. #17
    Join Date
    Apr 2012
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What exactly does the MIX1, MIX2 etc.. Do? Ill read into more just don't like using things that i don't really understand, just means more confusion if i need to change anything.
    << Newbie Scripter >>
    Release First Script [ ]
    100 Posts [ ]
    250 Posts [ ]


  18. #18
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Example View Post
    What exactly does the MIX1, MIX2 etc.. Do? Ill read into more just don't like using things that i don't really understand, just means more confusion if i need to change anything.
    It's basically just the coordinates of your inventory but in a shortcut instead of getting the coords yourself. MI = Main Inventory.

  19. #19
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by Example View Post
    What exactly does the MIX1, MIX2 etc.. Do? Ill read into more just don't like using things that i don't really understand, just means more confusion if i need to change anything.
    Searches the main inventory.

    MI - stands for Main Inventory.
    X1 co-ordinate - searches from the top left corner
    Y2 co-ordinate - searches till the bottom right hand corner.

    The co-ordinates in between are just the other two corners (bottom left, top right)

    EDIT:
    You can also replace MI with:
    - MS: Main Screen
    - MM: Mini Map
    Last edited by Abu; 04-09-2012 at 04:13 PM.

  20. #20
    Join Date
    Apr 2012
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Failure View Post
    It's basically just the coordinates of your inventory but in a shortcut instead of getting the coords yourself. MI = Main Inventory.
    ahh ok. Im now having another problem..

    Simba Code:
    //Eating

    procedure Eat;
    begin
    if(FindColor(x,y,Hit,8,5,516,333)) then
    begin
    if(FindColor(x,y,Sword,564,214,726,451)); //Error showing here
    wait(300);
    Mouse(x, y, 5, 5, True); //Error shows here also
    wait(randomrange(500,700));

    end;
    end;

    Seems like im just getting more problems.
    << Newbie Scripter >>
    Release First Script [ ]
    100 Posts [ ]
    250 Posts [ ]


  21. #21
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Example View Post
    ahh ok. Im now having another problem..

    Simba Code:
    //Eating

    procedure Eat;
    begin
    if(FindColor(x,y,Hit,8,5,516,333)) then
    begin
    if(FindColor(x,y,Sword,564,214,726,451)); //Error showing here
    wait(300);
    Mouse(x, y, 5, 5, True); //Error shows here also
    wait(randomrange(500,700));

    end;
    end;

    Seems like im just getting more problems.
    Simba Code:
    Procedure Eat;
    Begin
    If FindColor(x, y, Hit, 8, 5, 516 ,333 ) then
     Begin
      FindColor(x, y, Sword, 564, 214, 726, 451); // As Abu said, I forgot the Semi-Colon here.
      Wait(300);
      Mouse(x, y, 5, 5, True);
      Wait(RandomRange(500, 700));
     End;
    End;

    Didn't that work?

  22. #22
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    The first error - you need a then after the FindColor function

    Second error - you need a begin before wait(300) and then another end after Wait(randomrange(500,700)); - this is because you are doing more than one thing if you find that color

  23. #23
    Join Date
    Apr 2012
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok so i found the problem, added what Abu said but found that i had a wrong line.

    Simba Code:
    //Eating

    procedure Eat;
    begin
    if(FindColor(x,y,Hit,8,5,516,333)) then
    begin
    if(FindColor(x,y,Sword,564,214,726,451)) then
    begin
    wait(300);
    MoveMouse(x,y,Sword,564,214,726,451)); //If was Finding the Food twice.. This needed to be ClickMouse(x,y,mouse_Left);
    wait(randomrange(500,700));

    end;
    end;
    end;

    Ill run and see if it works. Ill let you know the results.

    Example
    << Newbie Scripter >>
    Release First Script [ ]
    100 Posts [ ]
    250 Posts [ ]


  24. #24
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Woah!! That will not work! MoveMouse only has two parameters - x and y. Everything else you have added is unnecessary.


    EDIT: Also, MoveMouse doesn't click anything - it simply moves the mouse

  25. #25
    Join Date
    Apr 2012
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I was attacked and it still didn't eat, Both the colour codes are correct as i checked them. Its like it just bypasses the "Eat;" procedure all together.

    Can the way the procedures are listed in the main loop affect how they work?

    Simba Code:
    //Main Loop


       Begin
    repeat

    Steal;
    Alch;
    Eat;

    until(false);
    end.

    Right now i have it eating after Its pickpocketed the guard and alched the item, should i swap it around to have it Steal, then if its been attacked it should heal and then alch the item.

    Edit: Didn't make any difference, still not eating.
    << Newbie Scripter >>
    Release First Script [ ]
    100 Posts [ ]
    250 Posts [ ]


Page 1 of 2 12 LastLast

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
  •