Page 7 of 9 FirstFirst ... 56789 LastLast
Results 151 to 175 of 209

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

  1. #151
    Join Date
    Jan 2012
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Amazing script. Thanks to u, I made my first script with minimal scripting knowledge. I hope to make more advanced scripts, but I couldn't have done it without u..

    Thank you for taking up time to make this splendid script

  2. #152
    Join Date
    Mar 2012
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    First of all nice tutorial, working with simba since i ve watched it (about 1-2 weeks ago) thanks for it!

    i ve got a question, is there a function which checks if there is a interface opened in the chat box? like when talking to a npc where you can select different answers?

  3. #153
    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 sipfer2 View Post
    i ve got a question, is there a function which checks if there is a interface opened in the chat box? like when talking to a npc where you can select different answers?
    You can look here: http://docs.villavu.com/srl-5/chat.html

  4. #154
    Join Date
    May 2012
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hi :P

    i gots another question / problem lmao

    HTML Code:
     Begin
        FindNormalRandoms;
        SlotBox   := InvBox(LogPattern[I]);
        If FindDTM(LogDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
      End;
        Begin
          MouseItem(LogPattern[I],False);
          ChooseOption('Dro');
        End;
    End;
    .
    this part of the script is stopping compiling for some reason .....

    heres what the debug at boottom says

    [Error] (101:37): Type mismatch at line 100
    Compiling failed.

    any help would be appreciated

  5. #155
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    been watching this video and this is my first day at scripting and i feel that my woodcutter pro with multiple locations and trees will be up soon and flawless thanks a lot man this video helped epically
    Goals:

    Learn to script(doing)
    Write Basic Yew and magic log cutter(DONE!NEEDS WALKING AND BANKING 1ST)
    Create Universal Fighter

  6. #156
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    MouseItem(LogPattern[I],False);

    This is Wrong! idk what to do!

  7. #157
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    It would help if you told what the error was.
    I think you just change the false to a 2, or maybe a 1 and it's fixed.

  8. #158
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    LogPattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,23, 27,4,8,14,24,28];
    StatsGuise('Dropping Logs:' + IntToStr(I));
    For I:=0 To 27 Do
    Begin
    SlotBox:=InvBox(LogPattern[I]);
    If FindDTM(LogDtm, seX, seY,SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
    Begin
    MouseItem(LogPattern[I],False);
    //MouseItem(LogPattern[I],False);
    ChooseOption('Dro');
    End;
    End;
    End;

    [Error] (142:39): Type mismatch at line 141
    Compiling failed.

    probably a 2 cuz we want it to right click!

  9. #159
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Use simba tags when posting code too.
    Okay so, replace with 2, does it fix?

  10. #160
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    418
    Mentioned
    2 Post(s)
    Quoted
    86 Post(s)

    Default

    Helped me out a lot, thanks Yohojo.

  11. #161
    Join Date
    May 2012
    Location
    England
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Thumbs up Thanks =D

    Going to be following your 3rd tutorial today ^-^.

    Thank you for the first 2 man

    Will probably follow the 3rd video through, read 2-3 written guides then re-watch yours (they're just that good) xD

    Easy to follow, explanations for each command used, letting us know trial and error isn't exclusive to us noobs and all round enjoyable to follow along ^-^

    +Repped


  12. #162
    Join Date
    Jan 2012
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey, i'm having problems with this error ( i'm about 18 mins into the first tutorial), i know it's simple, but I don't know what to do lmao :S. Please help, thanks!
    On line 52,it's:

    If FindObjCustom( X, Y ['Chop','Ivy'] [4091477, 5147243, 4157527, 4353142] 10,) then

    the error i'm getting is:

    [Error] (52:25): Semicolon (';') expected at line 51
    Compiling failed.

    Code:
    program CWIvyCutter;
    {$i srl/srl/misc/smart.simba}
    {$i srl/srl.simba}
    {$i sps/sps.simba}
    {$i srl/srl/misc/debug.simba}
    {$i srl/srl/misc/paintsmart.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;
     begin
     case Random(100) of
       10: RandomRClick;
       30: PickUpMouse;
       50: RandomMovement;
       70: BoredHuman;
       89: ExamineInv;
       end;
     end;
    end;
    
    
    // Failsafe
    Procedure FailSafe(Reason:String);
    begin
      Players[CurrentPlayer].Loc := Reason;
      Logout;
      Stats_Commit;
      //ProgressReport;
      TerminateScript;
    end;
    
    Var
      X, Y: Integer;
    
    
    Function Chopdown:boolean;
    begin
    
     If FindObjCustom( X, Y ['Chop','Ivy'] [4091477, 5147243, 4157527, 4353142] 10,) then
     begin
      Writein('Hurray! We Found Ivy!');
    
    end;
    
    
    
    
    begin
      SetupSRL;
      DeclarePlayers;
      Repeat
      Chopdown;
      until(false);
    
    
    end.
    Last edited by ggsus; 06-04-2012 at 12:50 AM.

  13. #163
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Forgot some commas

    You have
    If FindObjCustom( X, Y ['Chop','Ivy'] [4091477, 5147243, 4157527, 4353142] 10,) then
    You need
    If FindObjCustom( X, Y, ['Chop','Ivy'], [4091477, 5147243, 4157527, 4353142] ,10 (Remove extra comma here)) then

  14. #164
    Join Date
    Jan 2012
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks , now i have one last problem.. It says:
    [Error] (1:1): Unexpected end of file at line 0
    Compiling failed.
    Code:
    program CWIvyCutter;
    {$i srl/srl/misc/smart.simba}
    {$i srl/srl.simba}
    {$i sps/sps.simba}
    {$i srl/srl/misc/debug.simba}
    {$i srl/srl/misc/paintsmart.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 Statsguise(wat:string);
    begin
      status(wat);
      Disguise(wat);
    end;
    Procedure  Antiban;
    begin
     if(not(LoggedIn))then Exit;
     begin
     case Random(100) of
       10: RandomRClick;
       30: PickUpMouse;
       50: RandomMovement;
       70: BoredHuman;
       89: ExamineInv;
       end;
     end;
    end;
    
    
    // Failsafe
    Procedure FailSafe(Reason:String);
    begin
      Players[CurrentPlayer].Loc := Reason;
      Logout;
      Stats_Commit;
      //ProgressReport;
      TerminateScript;
    end;
    
    Var
      X, Y, Plusone, Treecounter: Integer;
    
    
    Function Chopdown:boolean;
    begin
    Plusone:=invcount+1;
    If FindObjCustom( X, Y, ['Chop','Ivy'], [4091477, 5147243, 4157527, 4353142] ,10) then
     begin
      Statsguise('Hurray! We found Ivy!');
      getmousepos(x,y);
      Case Random(2) of
      0: Mouse(x, y, 5, 5, true);
      1: Begin
          mouse(x, y, 5, 5, false);
          Chooseoption('chop');
          waitoption('chop',500);
          end;
      end;
    
     repeat
       Marktime(Treecounter);
       antiban;
       wait(100);
       if invcount=Plusone then
         statsguise('We Got one!');
       Until (invcount=Plusone) or (timefrommark(Treecounter) > 3000)
    
    begin
      SetupSRL;
      DeclarePlayers;
      Repeat
      Chopdown;
      until(false);
    end.
    Last edited by ggsus; 06-04-2012 at 01:15 AM.

  15. #165
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Last end in script must ALWAYS end with period.
    End.

    You seem to also be missing some begins (or end; s ) around your script.

  16. #166
    Join Date
    Jan 2012
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sorry for bugging you , where am i missing them? I changed the last end to a period, but it says error compiling there because there is no semi-colon.. I'm really bad at this lmao.
    Thanks
    Last edited by ggsus; 06-04-2012 at 11:28 PM.

  17. #167
    Join Date
    May 2012
    Location
    Draynor Willows
    Posts
    498
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Exception: Range check error at line 286
    The following DTMs were not freed: [SRL - Lamp bitmap, 1]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]
    This error appears when I run the script, it doesn't print the "we got one" but it does manage to cut the tree. the inventory Simba tab also opens when the error occurs, but not to any certain function. Any ideas? =/

    Simba Code:
    Function ChopTree:Boolean;
    Var
      X, Y, PlusOne, TreeCounter: Integer;
    Begin
      PlusOne:= InvCount + 1;
      If FindObjCustom(X, Y, ['Chop', 'down', 'p d'], [1054486, 1516579, 2833741, 1252637], 10) Then
      Begin
        StatsGuise('Hooray, we found a tree');
        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
        ChopTree;
      Until(false);

    End.

  18. #168
    Join Date
    Jun 2012
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Mr. Freeweed View Post
    Some of the SRL calls have changed try

    Code:
    ClickNorth(SRL_ANGLE_HIGH); //Or SRL_ANGLE_LOW or SRL_ANGLE_NONE
    SetAngle(SRL_ANGLE_HIGH); //Or SRL_ANGLE_LOW
    There is a whole thread on new srl function and procedure calls. Just search "set angle error srl5" or something =)



    These are in the srl5 antirandoms. Most likely you stopped the scripted before they were freed.

    GoodLuck
    Thanks Mr. Freeweed, cleared up the SetAngle(false) compiling error. YoHoJo, perhaps you could add a note to your vid to help out future learners?

    THANKS YoHoJo!

  19. #169
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Yeah I've been meaning to add annotations/comments/edit description etc etc to address all of the fixes and things that need to be done.

    It's not very many but you need to change some .scar to .simba and change some true/false to 1/2s and stuff.

    Glad so many people are enjoying these!!!

  20. #170
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    It's summer time!
    What better time than now to start leaning how to script?!

  21. #171
    Join Date
    Jun 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey man thanks for the tutorial, I'm having problems with one of the lines though, I get a compiling error:

    Simba Code:
    Internal error (20) at line 29
    Compiling failed.

    Line 29:
    Simba Code:
    FindColorSpiralTolerance(x, y, 416254, 192, 433, 439, 648, 20) then

    EDIT: Nevermind, I found what was missing.
    Last edited by Bu3; 06-19-2012 at 09:54 PM.

  22. #172
    Join Date
    Apr 2012
    Posts
    108
    Mentioned
    1 Post(s)
    Quoted
    21 Post(s)

    Default

    Just watched the first video now watching the other two, Finally finished exams to can learn to script.
    Thanks for these!

  23. #173
    Join Date
    Sep 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just confused about line 23 on your script with the
    for i ;= 0 to NumbOfPlayers-1 do
    Players(i).BoxRewards (= ('mote', 'ostume', What is the whole scripting part here

  24. #174
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Quote Originally Posted by Tigerheart View Post
    Just confused about line 23 on your script with the
    for i ;= 0 to NumbOfPlayers-1 do
    Players(i).BoxRewards (= ('mote', 'ostume', What is the whole scripting part here
    This means, for all players you are setting up, they will each be assigned those reward box details. It could also be written as:
    Simba Code:
    Players[0].BoxRewards := ['mote', 'ostume']; // .. etc
    Players[1].BoxRewards := ['mote', 'ostume']; // .. etc
    Players[2].BoxRewards := ['mote', 'ostume']; // .. etc
    //etc (for more players)

    The for to do loop saves code. A good practice too.

  25. #175
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Its a for..to..do loop. As a beginner, you don't need to worry about these. If you have any other questions, feel free to PM me.
    E: Looks like Jingle explained it for you.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

Page 7 of 9 FirstFirst ... 56789 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
  •