Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 55

Thread: problems with my script

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

    Default

    i corrected the than to then before you posted it as well seen my error they are all direct statements and commands i am getting the hang of scripting without even watching the tutorial and learning a lot more this way
    Goals:

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

  2. #27
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    I added it into the function declaration in my previous post:

    Simba Code:
    Function CheckAndClick(Uptext,Option:String; X,Y:Integer; Stronger:Boolean):Boolean;

    That way, when you call the function later in the script, you can use whatever uptext/option is necessary:

    Simba Code:
    CheckAndClick('booth', 'bank',  x, y, True);

  3. #28
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    so with that it can clickandcheck find the bank and click and select it? for later and to declare it a variable i put option in the quotes as string?
    Goals:

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

  4. #29
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I KNOW COMPLETELY WHY THE BASIS OF MY SCRIPT WAS WRONG THE TUTORIAL GUIDE WAS BASED OFF A SCRIPT WITH Anti leeeching!!! it has a lotta basic errors eg GamaTab instead of GameTab and it's mixed and matched
    Goals:

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

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

    Default

    Simba Code:
    Begin
      Players[CurrentPlayer] .Loc= Reason;
      Logout;
      Stats_Commit;
      //ProgressReport;
      Teriminate Scipt

    [Error] (90:32): Unknown identifier 'Reason' at line 89
    Compiling failed.

    need help on this one too
    Goals:

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

  6. #31
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    BOOM GOT IT declared the variable
    Goals:

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

  7. #32
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    Procedure ChopDown:Boolean;


    [Error] (96:19): Semicolon (';') expected at line 95
    Compiling failed.

    getting this error however when i change it to a semi colon this comes up

    [Error] (96:20): 'BEGIN' expected at line 95
    Compiling failed.
    Goals:

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

  8. #33
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    Procedure ChopDown
    var x, y: Integer;
    begin
    //FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
    if FindObjCustom(x, y, ['Chop', 'down' 'p d'], [1713699, 2108458, 1844516], 30) Then
    WriteIn('Found tree');
    Mouse(x, y, 0, 0, false);
    ChooseOption('hop');
    repeat
    Wait(1200+random(250));
    Until not IsUpText('ew') or (InvFull);
    End;


    THIS IS WHERE I AM HAVING TROUBLE NOW NEED HELP
    Goals:

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

  9. #34
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    After a procedure name, you must put a semi colon.

    Procedure ChopDown;

    Only function will return something, such as boolean.

    Function ChopDown :Boolean;

  10. #35
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    when i do Function ChopDown:Boolean; it tells me a semicolon was still expected before Boolean and if I add a semi colon it tells me that Begin was expected before Boolean
    [Error] (96:20): 'BEGIN' expected at line 95
    Compiling failed.
    [Error] (96:19): Semicolon (';') expected at line 95
    Compiling failed.
    Goals:

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

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

    Default

    If you're referring to my tutorial, thee is no antileech in it.

  12. #37
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well then I must have misinterpreted some of my spelling errors as an anti leech because I guess my spelling errors could have been used as an anti leech lol.
    Goals:

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

  13. #38
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by insidethefire666 View Post
    when i do Function ChopDown:Boolean; it tells me a semicolon was still expected before Boolean and if I add a semi colon it tells me that Begin was expected before Boolean
    [Error] (96:20): 'BEGIN' expected at line 95
    Compiling failed.
    [Error] (96:19): Semicolon (';') expected at line 95
    Compiling failed.
    You probably missed out a begin before that procedure/function, or an extra end. You should post the whole script in simba tags, and in good standards which is shown in Yohojo's video. I used to follow his video tuts once, and I never had a problem other than some codes being outdated.

  14. #39
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    program insidethefires_MULTI_chopper;
    {$DEFINE SMART}
    {$DEFINE SimbaDebug}
    {$i srl/srl.simba}

     //var
        ///Loads: Integer //whole number
        //Done:  Boolean       //true or false
        //LongNumbers:  Extended Integers with decimal basis

    const
      SRLStats_Username= ''; // your username
      SRLStats_Password= ''; // your password
      BreakEvery= ''; // however many minutes your going to break for after
      BreakFor= ''; // how long you want that break to be
      NumbOfPlayers= 1; //this is how many players your using
      StartPlayer= 0; // what players you are starting with
      Version= '1'; // Leave this alone it's my script don't change it



    procedure DeclarePlayers;
    var i:integer;
    begin
      NumberOfPlayers(NumbOfPlayers);
      CurrentPlayer := StartPlayer;
      for i := 0 to NumbOfPlayers-1 do
       Players[i].BoxRewards := ['Xp'];

      with Players[0] do
      begin
        Name := ''; // Player Username
        Pass := ''; // this is your pass
        Pin := ''; // your pin if you have one if not leave blank
        Active := True; //leave at true
        Integers[1] := 1; //1 for Yews,2 for magics,3,for willows,4 for oaks
        Integers[2] := 4; // this is how long it waits before chopping another tree
      end;




    End;





    Procedure StatsGuise (wat:String);
    Begin
      Status (wat);
      Disguise (wat);
    end;

    Function CheckAndClick(Uptext:String; Option:String; X,Y:Integer; RClick:Boolean):Boolean;
    Begin
      MMouse (x, y, 5, 5) ;
      If WaitUPtext(UpText, 1000+Random(250)) Then
      Begin
    Result:=True;
      GetMousePos(x,y)
      If RClick Then
    Begin
      Mouse(x, y, 0, 0, False);
      Result:=WaitOption(Option, 1000);
      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('Magic', False); GameTab(28) End;
      1: Begin StatsGuise ('AntiBan') SleepAndMoveMouse((750)+ Random(250)); End;
      2: Begin StatsGuise ('AntiBan') RandomAngle(1); End;
      3: Begin StatsGuise ('AntiBan') GameTab (Tab_Stats) ; Wait(750 + Random(250)); GameTab(28) End;
      4: 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;


    Procedure ChopDown: Boolean;
      Var
       x, y: Integer;
    Begin
    //FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
    if FindObjCustom(x, y, ['Chop', 'down' 'p d'], [1713699, 2108458, 1844516], 30) Then
    WriteIn('Found tree');
    Mouse(x, y, 0, 0, false);
    ChooseOption('hop');
    repeat
    Wait(1200+random(250));
    Until not IsUpText('ew') or (InvFull);
    End;



    Begin


    SetupSRL;
    DeclarePlayers;
    Repeat
    ChopDown
    Until(False);

    End;


    this is what it is right now and im getting that error still
    Last edited by insidethefire666; 05-30-2012 at 06:11 PM.
    Goals:

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

  15. #40
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I mean the entire script, not just the procedure.

    And your procedure just returned a boolean.

  16. #41
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I removed the boolean from after the chopdown and it fixed that error i dunno if it needs to be there but yeah. and now im
    Goals:

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

  17. #42
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    Procedure ChopDown;
      Var
       x, y: Integer; WriteIn: String;
    Begin
    //FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
    if FindObjCustom(x, y, ['Chop', 'down', 'p d'], [1713699, 2108458, 1844516], 30) Then
    WriteIn:('Found tree');
    Mouse(x, y, 0, 0, false);
    ChooseOption('hop');
    repeat
    Wait(1200+random(250));
    Until not IsUpText('ew') or (InvFull);
    End;


    [Error] (104:8): Assignment expected at line 103
    Compiling failed.
    for the WriteIn: ('Found Tree')
    Goals:

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

  18. #43
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    Procedure ChopDown;
      Var
       x, y: Integer; WriteIn: String;
    Begin
    //FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
    if FindObjCustom(x, y, ['Chop', 'down', 'p d'], [1713699, 2108458, 1844516], 30) Then
    WriteIn:('Found tree');
    Mouse(x, y, 0, 0, false);
    ChooseOption('hop');
    repeat
    Wait(1200+random(250));
    Until not IsUpText('ew') or (InvFull);
    End;


    [Error] (104:8): Assignment expected at line 103
    Compiling failed.
    for the WriteIn: ('Found Tree')
    Goals:

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

  19. #44
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    WriteLn('Found tree');

    No : in between. And should be WRITELN, which is WriteLn

  20. #45
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok and thank you for helping me as i go along once i have the basics down for this script i want to tweak them and turn it into an autofighter with banking instead of chopping with banking
    Goals:

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

  21. #46
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    program insidethefires_MULTI_chopper;
    {$DEFINE SMART}
    {$DEFINE SimbaDebug}
    {$i srl/srl.simba}

     //var
        ///Loads: Integer //whole number
        //Done:  Boolean       //true or false
        //LongNumbers:  Extended Integers with decimal basis   := it's value
        //Text: String '' to declare a string
    const
      SRLStats_Username= ''; // your username
      SRLStats_Password= ''; // your password
      BreakEvery= ''; // however many minutes your going to break for after
      BreakFor= ''; // how long you want that break to be
      NumbOfPlayers= 1; //this is how many players your using
      StartPlayer= 0; // what players you are starting with
      Version= '1'; // Leave this alone it's my script don't change it



    procedure DeclarePlayers;
    var i:integer;
    begin
      NumberOfPlayers(NumbOfPlayers);
      CurrentPlayer := StartPlayer;
      for i := 0 to NumbOfPlayers-1 do
       Players[i].BoxRewards := ['Xp'];

      with Players[0] do
      begin
        Name := ''; // Player Username
        Pass := ''; // this is your pass
        Pin := ''; // your pin if you have one if not leave blank
        Active := True; //leave at true
        Integers[1] := 1; //1 for Yews,2 for magics,3,for willows,4 for oaks
        Integers[2] := 4; // this is how long it waits before chopping another tree
      end;




    End;





    Procedure StatsGuise (wat:String);
    Begin
      Status (wat);
      Disguise (wat);
    end;

    Function CheckAndClick(Uptext:String; Option:String; X,Y:Integer; RClick:Boolean):Boolean;
    Begin
      MMouse (x, y, 5, 5) ;
      If WaitUPtext(UpText, 1000+Random(250)) Then
      Begin
    Result:=True;
      GetMousePos(x,y)
      If RClick Then
    Begin
      Mouse(x, y, 0, 0, False);
      Result:=WaitOption(Option, 1000);
      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('Magic', False); GameTab(28) End;
      1: Begin StatsGuise ('AntiBan') SleepAndMoveMouse((750)+ Random(250)); End;
      2: Begin StatsGuise ('AntiBan') RandomAngle(1); End;
      3: Begin StatsGuise ('AntiBan') GameTab (Tab_Stats) ; Wait(750 + Random(250)); GameTab(28) End;
      4: 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;


    Procedure ChopDown;
      Var
       x, y: Integer; WriteIn: String;
    Begin
    //FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
    if FindObjCustom(x, y, ['Chop', 'down', 'p d'], [1713699, 2108458, 1844516], 30) Then
    WriteLn('Found tree');
    Mouse(x, y, 0, 0, false);
    ChooseOption('hop');
    repeat
    Wait(1200+random(250));
    Until not IsUpText('ew') or (InvFull);
    End;


    ALLL OF THIS IS NOW WORKINGG!!!! JUST NEED TO ADD A BANKING SYSTEM AND SET SRL UP TO DO AND AND ADD WALKING AND I DID IT!! which is probably a lot harder than i'm thinking it is but it's progress
    Last edited by insidethefire666; 05-30-2012 at 06:55 PM.
    Goals:

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

  22. #47
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    By then, you should learn something more complicated. With reading scripts from SRL members to see how they use codes to make very useful functions and how they write procedures efficiently. I don't think anyone would use FindObj after their first script. Everything can be learnt in the tutorial section. Good luck.

  23. #48
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yeah I want to use TPA eventually and FindObjDtm but right now im into basics and ill probably need some more help so i'll keep posting on this thread so as not to make a duplicate
    Goals:

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

  24. #49
    Join Date
    Dec 2011
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    Program Insidethefires_MULTI_chopper;

    {$DEFINE SMART}
    {$i SRL\SRl.simba}



     //var
        ///Loads: Integer //whole number
        //Done:  Boolean       //true or false
        //LongNumbers:  Extended Integers with decimal basis   := it's value
        //Text: String '' to declare a string
    const
      SRLStats_Username= ''; // your username
      SRLStats_Password= ''; // your password
      BreakEvery= ''; // however many minutes your going to break for after
      BreakFor= ''; // how long you want that break to be
      LoadsTotal= ''; // how many loads you want to chop
      NumbOfPlayers= 1; //this is how many players your using
      StartPlayer= 0; // what players you are starting with
      Version= '1'; // Leave this alone it's my script don't change it



    procedure DeclarePlayers;
    var i:integer;
    begin
      NumberOfPlayers(NumbOfPlayers);
      CurrentPlayer := StartPlayer;
      for i := 0 to NumbOfPlayers-1 do
       Players[i].BoxRewards := ['Xp'];

      with Players[0] do
      begin
        Name := ''; // Player Username
        Pass := ''; // this is your pass
        Pin := ''; // your pin if you have one if not leave blank
        Active := True; //leave at true
        Integers[1] := 1; //1 for Yews,2 for magics,3,for willows,4 for oaks
        Integers[2] := 4; // this is how long it waits before chopping another tree
      end;




    End;





    Procedure StatsGuise (wat:String);
    Begin
      Status (wat);
      Disguise (wat);
    end;

    Function CheckAndClick(Uptext:String; Option:String; X,Y:Integer; RClick:Boolean):Boolean;
    Begin
      MMouse (x, y, 5, 5) ;
      If WaitUPtext(UpText, 1000+Random(250)) Then
      Begin
    Result:=True;
      GetMousePos(x,y)
      If RClick Then
    Begin
      Mouse(x, y, 0, 0, False);
      Result:=WaitOption(Option, 1000);
      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('Magic', False); GameTab(28) End;
      1: Begin StatsGuise ('AntiBan') SleepAndMoveMouse((750)+ Random(250)); End;
      2: Begin StatsGuise ('AntiBan') RandomAngle(1); End;
      3: Begin StatsGuise ('AntiBan') GameTab (Tab_Stats) ; Wait(750 + Random(250)); GameTab(28) End;
      4: 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;


    Procedure ChopDown;
      Var
       x,y : Integer;
    Begin
    //FindObjCustom(x, y, ['att', 'ack''a'], [12346, 35678], 5); this is for attack
    If FindObjCustom(x, y, ['Chop', 'down', 'Yew'], [1713699, 2108458, 1844516], 30) Then
    WriteLn('Found tree');
    Mouse(x, y, 0, 0, false);
    ChooseOption('hop');
    repeat
    Wait(1200+random(250));
    Until IsUpText('ew') or (InvFull);
    End;



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

    End.


    Having trouble still this doesn't chop down the yew it just moves around the screen in a circle i need some help guys
    Goals:

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

  25. #50
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Whenever there is more than 1 action to be performed, use begin and end.
    in ur script:
    Simba Code:
    If FindObjCustom(x, y, ['Chop', 'down', 'Yew'], [1713699, 2108458, 1844516], 30) Then
    WriteLn('Found tree');
    Mouse(x, y, 0, 0, false);
    ChooseOption('hop');
    this will always perform
    Mouse(x, y, 0, 0, false);
    ChooseOption('hop');
    even if the obj is not found.

    Just add "begin" before the WriteLn and "end" after the ChooseOption.

    Also is ur colortolerance of 30 a bit too high? it'd still work if there isn't any similar color around the area.

Page 2 of 3 FirstFirst 123 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
  •