Results 1 to 10 of 10

Thread: Help Please New To Scripting!

  1. #1
    Join Date
    Mar 2012
    Posts
    58
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Help Please New To Scripting!

    Ok this is my first script im following YoHoJo's tutorial video step by step.



    Can someone please tell me whats wrong?

    Script:

    Code:
    program YewCutter;
    
     //{$DEFINE SMART8}
    {$i SRL/SRL.simba}
    {$i P07Include.simba}
    
    
     procedure  StatsGuise(wat:String);
     begin
       Status(wat);
       Disguise(wat);
     end;
    
     function CheckAndClick(UpText, Ootion: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('text', 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('Skill_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('Skill_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: Integer;
      begin
      if FindObjCustom (x, y, ['Ch', 'Do', 'Ye'], [3297875 , 284750 , 1525308 , 1462857 ], 0) Then
      begin
        Writeln ('Found a tree');
    
      GetMousePos ( x, y);
      Case Random(2) Of
        0: Mouse ( x, y, 5, 5, True);
        1: begin
            Mouse ( x, y, 5, 5, False);
            WaitOption( 'Chop', 500);
           end;
       end;
      end;
     end;
    
    
    
    
    
    
    
    begin
      SetupSRL;
      //DeclarePlayers;
      //repeat
      ChopDown;
      //until( False);
    end.
    Last edited by Darcy_Oner; 03-27-2013 at 04:06 AM.

  2. #2
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Wait(Option, 2000);

    Should be

    WaitOption('text', 2000);

    Creds to DannyRS for this wonderful sig!

  3. #3
    Join Date
    Mar 2012
    Posts
    58
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    Wait(Option, 2000);

    Should be

    WaitOption('text', 2000);
    Ahh thankyou! YoHoJo made the same mistake but it still compiled for him :S

  4. #4
    Join Date
    Mar 2012
    Posts
    58
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Also lines 37-42 have invalid paramters. Does anyone know why?

  5. #5
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Simba Code:
    procedure Antiban;
    begin
      Case Random(250) Of
        0: Begin StatGuide('AntiBan') GameTab(Tab_Stats) HoverSkill('Woodcut'), False) GameTab(28); end; // Missing a opening parenthesis for HoverSkill
        1: Begin StatGuide('AntiBan') SleepAndMoveMouse(7000 + Random(500)); end;
        2: Begin StatGuide('AntiBan') GameTab(Tab_Inv) ExamineInv; GameTab(28); end;
        3: Begin StatGuide('AntiBan') RandomAngle(1); end;
        4: Begin StatGuide('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); end;
        5: Begin StatGuide('AntiBan') GameTab(TabStats) ; HoverSkill('random', False); GameTab(28); end; // Missing a opening parenthesis for HoverSkill and missing underscore in Tab_Stats
      end;
    end;

  6. #6
    Join Date
    Mar 2012
    Posts
    58
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    EDIT: NVM Fixed it
    Last edited by Darcy_Oner; 03-27-2013 at 02:50 AM.

  7. #7
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Simba Code:
    procedure Antiban;
    begin
      Case Random(250) Of
        0: Begin StatGuide('AntiBan') GameTab(Tab_Stats) HoverSkill(('Woodcut'), False) GameTab(28); end; // Missing a opening parenthesis for HoverSkill
        1: Begin StatGuide('AntiBan') SleepAndMoveMouse(7000 + Random(500)); end;
        2: Begin StatGuide('AntiBan') GameTab(Tab_Inv) ExamineInv; GameTab(28); end;
        3: Begin StatGuide('AntiBan') RandomAngle(1); end;
        4: Begin StatGuide('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); end;
        5: Begin StatGuide('AntiBan') GameTab(Tab_Stats) ; HoverSkill(('random', False); GameTab(28); end; // Missing a opening parenthesis for HoverSkill and missing underscore in Tab_Stats
      end;
    end;

    That should work. Just talking about a normal parenthesis '(' lol.

  8. #8
    Join Date
    Mar 2012
    Posts
    58
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Total View Post
    Simba Code:
    procedure Antiban;
    begin
      Case Random(250) Of
        0: Begin StatGuide('AntiBan') GameTab(Tab_Stats) HoverSkill(('Woodcut'), False) GameTab(28); end; // Missing a opening parenthesis for HoverSkill
        1: Begin StatGuide('AntiBan') SleepAndMoveMouse(7000 + Random(500)); end;
        2: Begin StatGuide('AntiBan') GameTab(Tab_Inv) ExamineInv; GameTab(28); end;
        3: Begin StatGuide('AntiBan') RandomAngle(1); end;
        4: Begin StatGuide('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); end;
        5: Begin StatGuide('AntiBan') GameTab(Tab_Stats) ; HoverSkill(('random', False); GameTab(28); end; // Missing a opening parenthesis for HoverSkill and missing underscore in Tab_Stats
      end;
    end;

    That should work. Just talking about a normal parenthesis '(' lol.
    Actually that doesn work either its HoverSkill('Skill_Woodcut', False)
    Also getting an error at line 60 'Writeln'

  9. #9
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Oh my bad lol. Here is the full code fixed.

    Simba Code:
    program YewCutter;

     {$DEFINE SMART8}
    {$i SRL/SRL.simba}
    {$i P07Include.simba}


     procedure  StatsGuise(wat:String);
     begin
       Status(wat);
       Disguise(wat);
     end;

     function CheckAndClick(UpText, Ootion: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:= WaitUpText('', 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 StatGuide('AntiBan') GameTab(Tab_Stats) HoverSkill('Woodcut', False) GameTab(28); end; // Missing a opening parenthesis for HoverSkill
        1: Begin StatGuide('AntiBan') SleepAndMoveMouse(7000 + Random(500)); end;
        2: Begin StatGuide('AntiBan') GameTab(Tab_Inv) ExamineInv; GameTab(28); end;
        3: Begin StatGuide('AntiBan') RandomAngle(1); end;
        4: Begin StatGuide('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); end;
        5: Begin StatGuide('AntiBan') GameTab(Tab_Stats) ; HoverSkill('random', False); GameTab(28); end; // Missing a opening parenthesis for HoverSkill and missing underscore in Tab_Stats
      end;
    end;

    procedure FailSafe(Reason:String);
    begin
      Players[CurrentPlayer] .Loc:=Reason;
      Logout;
      Stats_Commit;
      //ProgressReport;
      TerminateScript;
    end;

    procedure ChopDown;
    var
      x , y: Integer;
    begin
      if FindObjCustom (x, y, ['Ch', 'Do', 'Ye'], [2836291, 1194297, 409140, 2115648], 20) Then
      Writeln('Found Tree');
    end;





    begin
      SetupSRL;
      ChopDown;
    end.

    Basically for line 60 you weren't using the arrays correctly. They all need to be put in square brackets with commas separating each term. For the Writeln you had a colon that you didn't need.

  10. #10
    Join Date
    Mar 2012
    Posts
    58
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Thanks Total!

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
  •