Results 1 to 8 of 8

Thread: First script help

  1. #1
    Join Date
    Dec 2011
    Posts
    237
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default First script help

    This is my first attempt at a script and i am having some trouble so i would really apreciate help. It pickpockets just fine right now, the eating part doesnt seem to work please help!

    Simba Code:
    program BlooopasGaurdThief;
    //{$DEFINE SMART}
    {$i srl/srl.simba}
    Procedure DeclarePlayers;
    begin
    HowManyPlayers := 1;
    NumberOfPlayers(HowManyPlayers);
    CurrentPlayer := 0;
    Players[0].Name :='';
    Players[0].Pass :='';
    Players[0].Nick :='';
    Players[0].Active:=True;
    end;
    Procedure Antiban;
    begin
    if(not(LoggedIn))then
    Exit;
    FindNormalRandoms;
    case Random(30) of
      0:
       begin
       HoverSkill('Woodcutting', false);
       wait(2453+Random(432));
       end;
      13:
       begin
       HoverSkill('Thieving', False);
       wait(2000+Random(400));
       end;
      17:
       PickUpMouse;
      23:
       begin
       MakeCompass('N');
       wait(100+random(133));
       end;
      end;
     end;
     procedure Stealing;
     var x, y: integer;
     begin
     repeat
      FindNormalRandoms;
      Antiban;
      if FindObj(x, y, 'uard', 13161169, 20) then
      begin
       Mouse(x,y,5,5,false);
       ChooseOption('ickpocket');
       wait(1000+random(500));
       WriteLn('Found guard!');
      end;
     Until(false)
    end;
    Procedure Eat;
     var
      x, y: Integer;
    Begin
      Repeat
       FindNormalRandoms;
       Antiban;
       if (HPPercent<50) then
       FindObj(x, y, 'rout', 7830154, 35);
        Begin
         Mouse(x,y,5,5,false);
         ChooseOption('at');
         wait(200+random(100));
        end;
      Until(HPPercent>70)
    End;
    begin
    SetUpSRL;
    //ActivateClient;
    //DeclarePlayers;
    //LoginPlayer;
    Stealing;
    Eat;
    end.


    Thank you for ur time!!
    Last edited by bloopa1; 06-13-2012 at 08:44 PM.
    "The holy grail is to spend less time making the picture then it takes poeple to look at it"- Banksy

  2. #2
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    If you put [SIMBA] at the start of the script and [ /SIMBA] at the end it sets it out better for people to read


    I've changed your eating procedure a bit, make sure you look at the comments
    Simba Code:
    Procedure Eat;
    var
      i, : Integer;
    Begin
      Repeat
       FindNormalRandoms;
       Antiban;
       if (HPPercent<50) then
         for i := 1 to 28 do    //This goes through all of the inventory slots one at a time
           begin
             if(ExistsItem(i))then    //For each slot it checks if there is an item there
               begin
                 MMouseItem(i);       //if there is then it moves the mouse to it
                 if(WaitUptext('rout', 100+Random(500)))then //if then checks if the uptext matches
                   begin
                     ClickMouse2(mouse_Left);     //if it does then it clicks
                     Wait(1000+Random(1000));     //Then waits while it eats
                   end;
                 if(HPPercent > 70)then           //if the HPPercent is greater than 70 then it exits the procedure
                   exit;
               end;
           end;
      Until(HPPercent>70)
    end;
    Last edited by putonajonny; 06-13-2012 at 08:46 PM.

  3. #3
    Join Date
    Dec 2011
    Posts
    237
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by putonajonny View Post
    If you put [SIMBA] at the start of the script and [ /SIMBA] at the end it sets it out better for people to read
    thank you i had no idea how to do that!!
    "The holy grail is to spend less time making the picture then it takes poeple to look at it"- Banksy

  4. #4
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by bloopa1 View Post
    thank you i had no idea how to do that!!
    See my edit

  5. #5
    Join Date
    Dec 2011
    Posts
    237
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by putonajonny View Post
    See my edit
    thank u very much! Now could i add a type of failsafe of
    Simba Code:
    if InvEmpty then
    exit;
    would that end it when the player runs out of food?
    "The holy grail is to spend less time making the picture then it takes poeple to look at it"- Banksy

  6. #6
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by bloopa1 View Post
    thank u very much! Now could i add a type of failsafe of
    Simba Code:
    if InvEmpty then
    exit;
    would that end it when the player runs out of food?
    That would exit the procedure, if you put:
    Simba Code:
    if(InvEmpty and (HPPercent < 50))then
      TerminateScript;

    It would end the script, you could also add:
    Simba Code:
    if(InvEmpty and (HPPercent < 50))then
      begin
        ExitToLobby;
        TerminateScript;
      end;

  7. #7
    Join Date
    Dec 2011
    Posts
    237
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by putonajonny View Post
    That would exit the procedure, if you put:
    Simba Code:
    if(InvEmpty and (HPPercent < 50))then
      TerminateScript;

    It would end the script, you could also add:
    Simba Code:
    if(InvEmpty and (HPPercent < 50))then
      begin
        ExitToLobby;
        TerminateScript;
      end;
    Thank u very much for all the help!! Just so i can know what was keeping mine from working properly, it was obviously greatly worse then ur fix but i just want to know so i can learn!
    "The holy grail is to spend less time making the picture then it takes poeple to look at it"- Banksy

  8. #8
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    FindObj searches the MainScreen of runescape for items, you could have used FindObjEx

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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