Page 9 of 9 FirstFirst ... 789
Results 201 to 209 of 209

Thread: YoHoJo Video Tutorial #2: Making your VERY FIRST script for RUNESCAPE

  1. #201
    Join Date
    Mar 2012
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    I am using rs07 dunno if this changes anything

    Hopefully I can get some help!

    Code:
    program PowerChopper;
    //{$DEFINE SMART8}
    {$i SRL\SRL.simba}
    
     Const
      SRLStats_Username = '';// Your SRL Stats Username
      SRLSTats_Password = '';// Your SRL Stats Password
      BreakEvery        = 120; //How many minutes to break after
      Breakfor          = 5; //How long to break for
      Version           = '1.0';
      NumbOfPlayers  = 1; //How many players you are using
      StartPlayer       = 0; //Player to start auting with (0 means first char)
    
    Procedure DeclarePlayers;
    var i:integer;
    begin
      NumberOfPLayers(NumbOfPlayers);
      CurrentPLayer := StartPlayer;
      for i := 0 to NumbOfPlayers-1 do
        Players[i].BoxRewards   := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];
    
      with Players[0] do
      begin
        Name         := ''; //Player username.
        Pass         := ''; //Player Password.
        Active       := True;
        Integers[1]  := 4;   //1=BrightCopper, 2=DarkCopper, 3=Tin, 4=Iron.
        Integers[2]  := 4;   //Seconds to try mining rock before clicking another.
      end;
    end;
    
    Procedure StatsGuise(wat:String);
    Begin
      Status(wat);
      Disguise(wat);
    end;
    
    Function CheckAndClick(UpText, Option:String; X,Y:Integer; RClick:Boolean) :Boolean;
    Begin
      MMouse (x, y, 5, 5);
      If WaitUptext (UpText, 1500+Random(500)) Then
      Begin
        Result:=True;
        GetMousePos (x, y);
        If RClick Then
        Begin
        Mouse (x, y, 0, 0, False);
        Result := WaitOption (Option, 2000);
        If Result then FFlag (0);
        End Else
        Begin
          Mouse (x, y, 0, 0, True);
          Wait (100+Random(50));
          FFlag(0);
        End;
      End;
    End;
    
    Procedure Antiban;
    Begin
      Case Random(250) of
        0: Begin StatsGuise ('AntiBan') Gametab(tab_Stats) Hoverskill('Woodcut', False) GameTab(28) End;
        1: Begin StatsGuise ('AntiBan') SleepAndMoveMouse(7000 + Random(500)); End;
        2: Begin StatsGuise ('AntiBan') GameTab (tab_Inv) ExamineInv; GameTab(28) End;
        3: Begin StatsGuise ('Antiban') RandomAngle (1); End;
        4: Begin StatsGuise ('Antiban') GameTab (Tab_Stats); Wait(3000 + Random(500)); GameTab (28); End;
        5: Begin StatsGuise ('Antiban') GameTab(Tab_Stats); HoverSkill ('Random', False); GameTab (28); End;
       End;
    End;
    
    Procedure Failsafe(Reason:String);
    Begin
      Players[CurrentPlayer].Loc:=Reason;
      Logout;
      Stats_Commit;
      //ProgressReport;
      TerminateScript;
    End;
    
    Function Chopdown:Boolean;
    Var
     X, Y, PlusOne, Treecounter: Integer;
    Begin
      PlusOne:= InvCount + 1;
      If FindObjCustom(X, Y, ['Chop', 'Down', 'p' ,'d'], [3627896, 3166827, 3627896, 1454376, 269596, 2044719 ], 10) Then
     Begin
      StatsGuise('This is the start of something Great!');
      GetMousePos(X, Y);
      Case Random(1) of
        0: Mouse(x, y, 5, 5, True);
        1: Begin
              Mouse(x, y, 5, 5, False);
              WaitOption('Chop', 500);
           End;
        End;
    
        Repeat
         MarkTime(TreeCounter);
         Antiban;
         Wait(100);
         If InvCount=Plusone Then
          WriteLn('We got one');
         Until (InvCount=Plusone) or (TimeFromMark(TreeCounter) > 7000)
     End;
    end;
    
    
    begin
     SetupSRL;
     DeclarePlayers;
     SetAngle(SRL_ANGLE_LOW);
     //Repeat
      ChopDown
     //Until(False);
    end.

    My first problem is the

    SetAngle(SRL_ANGLE_LOW); It does not put the angle all the way down when I execute the script. I orignally tried using SetAngle(False); But then I get this compiling error

    [Error] C:\Simba\Scripts\powerchopper.simba(112:17): Type mismatch at line 111
    Compiling failed.

    Also when I try to get it to write "We got one" using the WriteLn command nothing gets written.

    Another problem is that when

    Case Random(1) of
    0: Mouse(x, y, 5, 5, True);
    1: Begin
    Mouse(x, y, 5, 5, False);
    WaitOption('Chop', 500);
    End;
    End;

    If It choses the 1 instead of 0 it does not click Chop Down it just opens up the drop down menu (From when you rightclick in runescape) but dosnt do anything

    Code:
    Function Chopdown:Boolean;
    Var
     X, Y, PlusOne, Treecounter: Integer;
    Begin
      PlusOne:= InvCount + 1;
      If FindObjCustom(X, Y, ['Chop', 'Down', 'p' ,'d'], [3627896, 3166827, 3627896, 1454376, 269596, 2044719 ], 10) Then
     Begin
      StatsGuise('This is the start of something Great!');
      GetMousePos(X, Y);
      Case Random(1) of
        0: Mouse(x, y, 5, 5, True);
        1: Begin
              Mouse(x, y, 5, 5, False);
              WaitOption('Chop', 500);
           End;
        End;
    
        Repeat
         MarkTime(TreeCounter);
         Antiban;
         Wait(100);
         If InvCount=Plusone Then
          WriteLn('We got one');
         Until (InvCount=Plusone) or (TimeFromMark(TreeCounter) > 7000)
     End;
    end;
    Last edited by melkoo; 03-09-2013 at 11:13 PM.

  2. #202
    Join Date
    Oct 2012
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Can you use this scripting tutorial to script in Old School RS?

    Thanks

  3. #203
    Join Date
    Jan 2013
    Location
    Ohio
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    77 Post(s)

    Default

    Hey Yohojo, you make some great videos! You seem very composed during them.

    I'm getting this error:
    [Error] C:\Simba\Scripts\Powerchopper.simba(34:1): 'BEGIN' expected at line 33
    Compiling failed.

    Simba Code:
    program Powerchopper;
    {$DEFINE SMART8} // Change to {$DEFINE SMART} if not using SMART8.
    {$i SRL/srl.simba}
    {$i SRL/SRL/Misc/SmartGraphics.simba}
    //{$i SRL/SRL/Misc/Stats.simba}


    Const
      SRLStats_Username = ''; //Your SRL Stats Username
      SRLStats_Password = ''; // Your SRL Stats Password
      BreakEvery        = 120; //How Many Minutes to Break After
      BreakFor          = 5; //How Long to Break For
      Version           = '1.0';


    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      with Players[0] do
      begin
        Name        :='';         // Username
        Pass        :='';         // Password
        Pin         :='';         // Bank PIN
        Member      := true;
        Active      := true;
      end;

    end;

    proceudre StatsGuise(wat:String);
    Begin
      Status(wat);
      Disguise(wat);
    End;

    Function CheckAndClick(UpText, Option:String; X,Y:Integer; RClick:Boolean):Boolean;
    Begin
      MMouse(x, y, 5, 5);
      If WaitUptext(UpText, 1500+Random(500)) Then
      Begin
        Result:=True;
        GetMousePos(x, y,);
        If RClick Then
        Begin
          Mouse(x, y, 0, 0, False);
          Result:= WaitOption(Option, 2000);
          If Result Then FFlag(0);
        End Else
        Begin
          Mouse(x, y, 0, 0, True);
          Wait(100+Random(50));
          FFlag(0);
        End;
      End;
    End;

    Procedure Antiban;
    Begin
      Case Random(250) Of
        0: Begin StatsGuise('Antiban') GameTab(tab_Stats) Hoverskill('Woodcutting', False) GameTab(28) End;
        1: Begin StatsGuise('Antiban') SleepAndMoveMouse(7000 + Random(500)); End;
        2: Begin StatsGuise('Antiban') RandomAngle(1); End;
        3: Begin StatsGuise('Antiban') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); End;
        4: Begin StatsGuise('Antiban') GameTab(tab_inv) ExamineInv; GameTab(28); End;
      End;
    End;

    Procedure FailSafe(Reason:String);
    Begin
      Players[CurrentPlayer].Loc:=Reason;
      Logout;
      Stats_Commit;
      //ProgressReport;
      TerminateScript;
    End;

    Function ChopDown:Boolean;
    Var
      X, Y: Integer;
    Begin
      //FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
      If FindObjCustom(X, Y, ['Chop', 'Dead'], [1979453, 2173748], 23) Then
      WriteLn('Woot, we found a tree!');
    End;




    Begin
      SetupSRL;
      DeclarePlayers;
      Repeat
        ChopDown;
      Until(false);


    End.

    What am I doing wrong here? Anyone?

    edit: Also I'm chopping dead trees, that's why the uptext option is different.
    Last edited by count to potato; 06-16-2013 at 08:20 PM.

  4. #204
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by count to potato View Post
    Hey Yohojo, you make some great videos! You seem very composed during them.

    I'm getting this error:
    [Error] C:\Simba\Scripts\Powerchopper.simba(34:1): 'BEGIN' expected at line 33
    Compiling failed.

    Simba Code:
    program Powerchopper;
    {$DEFINE SMART8} // Change to {$DEFINE SMART} if not using SMART8.
    {$i SRL/srl.simba}
    {$i SRL/SRL/Misc/SmartGraphics.simba}
    //{$i SRL/SRL/Misc/Stats.simba}


    Const
      SRLStats_Username = ''; //Your SRL Stats Username
      SRLStats_Password = ''; // Your SRL Stats Password
      BreakEvery        = 120; //How Many Minutes to Break After
      BreakFor          = 5; //How Long to Break For
      Version           = '1.0';


    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      with Players[0] do
      begin
        Name        :='';         // Username
        Pass        :='';         // Password
        Pin         :='';         // Bank PIN
        Member      := true;
        Active      := true;
      end;

    end;

    proceudre StatsGuise(wat:String);
    Begin
      Status(wat);
      Disguise(wat);
    End;

    Function CheckAndClick(UpText, Option:String; X,Y:Integer; RClick:Boolean):Boolean;
    Begin
      MMouse(x, y, 5, 5);
      If WaitUptext(UpText, 1500+Random(500)) Then
      Begin
        Result:=True;
        GetMousePos(x, y,);
        If RClick Then
        Begin
          Mouse(x, y, 0, 0, False);
          Result:= WaitOption(Option, 2000);
          If Result Then FFlag(0);
        End Else
        Begin
          Mouse(x, y, 0, 0, True);
          Wait(100+Random(50));
          FFlag(0);
        End;
      End;
    End;

    Procedure Antiban;
    Begin
      Case Random(250) Of
        0: Begin StatsGuise('Antiban') GameTab(tab_Stats) Hoverskill('Woodcutting', False) GameTab(28) End;
        1: Begin StatsGuise('Antiban') SleepAndMoveMouse(7000 + Random(500)); End;
        2: Begin StatsGuise('Antiban') RandomAngle(1); End;
        3: Begin StatsGuise('Antiban') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); End;
        4: Begin StatsGuise('Antiban') GameTab(tab_inv) ExamineInv; GameTab(28); End;
      End;
    End;

    Procedure FailSafe(Reason:String);
    Begin
      Players[CurrentPlayer].Loc:=Reason;
      Logout;
      Stats_Commit;
      //ProgressReport;
      TerminateScript;
    End;

    Function ChopDown:Boolean;
    Var
      X, Y: Integer;
    Begin
      //FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
      If FindObjCustom(X, Y, ['Chop', 'Dead'], [1979453, 2173748], 23) Then
      WriteLn('Woot, we found a tree!');
    End;




    Begin
      SetupSRL;
      DeclarePlayers;
      Repeat
        ChopDown;
      Until(false);


    End.

    What am I doing wrong here? Anyone?

    edit: Also I'm chopping dead trees, that's why the uptext option is different.
    On line 33 change
    Simba Code:
    proceudre
    to
    Simba Code:
    procedure

    Also you'll need to remove the comma after the y on line 45. So change
    Simba Code:
    GetMousePos(x, y,);
    to
    Simba Code:
    GetMousePos(x, y);

  5. #205
    Join Date
    Jan 2013
    Location
    Ohio
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    77 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    On line 33 change
    Simba Code:
    proceudre
    to
    Simba Code:
    procedure

    Also you'll need to remove the comma after the y on line 45. So change
    Simba Code:
    GetMousePos(x, y,);
    to
    Simba Code:
    GetMousePos(x, y);
    Thanks - I'll implement these changes when I get home tonight!

    And I know I sent you this in a PM but.. Thank you so much for telling me I left my details in the script.
    Much love and respect!

  6. #206
    Join Date
    Apr 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Even more helpful than your beginner's guide, again, thank you very much for the guide

  7. #207
    Join Date
    Aug 2013
    Posts
    82
    Mentioned
    0 Post(s)
    Quoted
    35 Post(s)

    Default

    Can this be used for RS07 as well?

  8. #208
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    Quote Originally Posted by Athylus View Post
    Can this be used for RS07 as well?
    Yes, but you need another include (srl-osr) and at least smart 8 (smart8.2 for oldschool reflection! Still in development)

    Goodluck scripting!

    Edit: smart is only needed if you minimise your bot.

  9. #209
    Join Date
    Aug 2013
    Posts
    82
    Mentioned
    0 Post(s)
    Quoted
    35 Post(s)

    Default

    Thanks for the info. I got that SRL-OSR, followed the 4 videos by Yohojo. Awesome.

    Using this to pick potatoes, but the only thing it does is keep moving the mouse over potatoes very fast. Using the exact same code as you provided in the tutorial but of course changed to the potatoes. What's wrong? I've been trying to find a solution the past 2 hours. I'm going to sleep now.

    Edit: Only need to be able to walk now! I'm getting better at this by the minute.
    Last edited by Athylus; 08-14-2013 at 02:30 PM.

Page 9 of 9 FirstFirst ... 789

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
  •