Results 1 to 8 of 8

Thread: New to scripting: Angle issues

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

    Default New to scripting: Angle issues

    hey every one im following yohojos scripting tut's there have been a few problems so far but have mostly figured them out, i just came across a new one though, im trying to make my first powercutter, and im trying to set the angle but the way yohojo says to do it with
    Simba Code:
    SetAngle(False)
    this is supposed to make it set the angle as low as possible, although it does not, i tried tinkering with:
    Simba Code:
    procedure SetAngle(ANGLE: Integer);
    begin
      if ((Angle = SRL_ANGLE_NONE) or (not LoggedIn)) then
        Exit;

      KeyDown((Angle * 2) + 38);
      Sleep(1000 + Random(300));
      KeyUp((Angle * 2) + 38);
      Wait(500 + Random(100));
    end;

    but im getting errors that state:
    [Error] (88:11): Duplicate identifier 'SETANGLE' at line 87

    here is the full script of what i have so far.

    Simba Code:
    //TVJJ'S First PowerChopper//

    program PowerChopper;
    //{$include srl/srl/misc/smart.simba}
    {$I SRL/SRL.simba}
    {$I srl/srl/misc/debug.simba}
    {$I sps/sps.simba}
    {$Include SRL/SRL/skill/fighting.simba}

    Const
     SRLStats_Username = ''; //Your SRL stats Username.
     SRLStats_Password = ''; //Your SRL stats Password.
     BreakEvery        = '3'; //How many minutes to break after.
     BreakFor          = '1'; //How long to break for.
     Version           = '1.0a'; // No need to touch.
     NumbOfPlayers     = 1; //How many players are you using
     StartPlayer       = 0; // Player to start autoing with (0 means first char)

    procedure DeclarePlayers;
    var i:integer;
    begin
      NumberOfPlayers(NumbOfPlayers);
      CurrentPlayer := StartPlayer;

        With Players[0] do
        Begin
         Name        := '';  //Player Username
         Pass        := '';  //Player Password
         Active      := True;
         Integers[1] := 4; //copper etc
         Integers[2] := 4; //Seconds to try mining another rock
         BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
      end;
    end;// declare players


    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(192) Of
        0: HoverSkill('Woodcut', False);
        1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
        2: ExamineInv;
        3: RandomAngle(1);
        4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
        5: HoverSkill('random', False);
      End;
    End;


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

    procedure SetAngle(ANGLE: Integer);
    begin
      if ((Angle = SRL_ANGLE_NONE) or (not LoggedIn)) then
        Exit;

      KeyDown((Angle * 2) + 38);
      Sleep(1000 + Random(300));
      KeyUp((Angle * 2) + 38);
      Wait(500 + Random(100));
    end;

    Function ChopDown: Boolean;
    Var
      X, Y: Integer;
    begin
      //Ex. FindObjCustom(x, y, ('att', 'ack'), [123456, 345678], 5);//
      If FindObjCustom(X, Y, ['Chop', 'Down', 'p d'], [2108982, 1252123, 1713960, 2307133], 2) Then
      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;

    end;

    begin
      SetupSRL;
      DeclarePlayers;
      SetAngle;
      //Repeat
        Chopdown;
      //Until(false);
    End.

    and again any and all help is greatly appricated

  2. #2
    Join Date
    Mar 2012
    Posts
    426
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Just do SetAngle(1)

  3. #3
    Join Date
    Dec 2011
    Posts
    733
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by tvjj View Post
    hey every one im following yohojos scripting tut's there have been a few problems so far but have mostly figured them out, i just came across a new one though, im trying to make my first powercutter, and im trying to set the angle but the way yohojo says to do it with
    Simba Code:
    SetAngle(False)

    this is supposed to make it set the angle as low as possible, although it does not, i tried tinkering with:
    Simba Code:
    procedure SetAngle(ANGLE: Integer);
    begin
    if ((Angle = SRL_ANGLE_NONE) or (not LoggedIn)) then
    Exit;

    KeyDown((Angle * 2) + 38);
    Sleep(1000 + Random(300));
    KeyUp((Angle * 2) + 38);
    Wait(500 + Random(100));
    end;


    but im getting errors that state:
    [Error] (88:11): Duplicate identifier 'SETANGLE' at line 87

    here is the full script of what i have so far.

    Simba Code:
    //TVJJ'S First PowerChopper//

    program PowerChopper;
    //{$include srl/srl/misc/smart.simba}
    {$I SRL/SRL.simba}
    {$I srl/srl/misc/debug.simba}
    {$I sps/sps.simba}
    {$Include SRL/SRL/skill/fighting.simba}

    Const
    SRLStats_Username = ''; //Your SRL stats Username.
    SRLStats_Password = ''; //Your SRL stats Password.
    BreakEvery = '3'; //How many minutes to break after.
    BreakFor = '1'; //How long to break for.
    Version = '1.0a'; // No need to touch.
    NumbOfPlayers = 1; //How many players are you using
    StartPlayer = 0; // Player to start autoing with (0 means first char)

    procedure DeclarePlayers;
    var i:integer;
    begin
    NumberOfPlayers(NumbOfPlayers);
    CurrentPlayer := StartPlayer;

    With Players[0] do
    Begin
    Name := ''; //Player Username
    Pass := ''; //Player Password
    Active := True;
    Integers[1] := 4; //copper etc
    Integers[2] := 4; //Seconds to try mining another rock
    BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
    end;
    end;// declare players


    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(192) Of
    0: HoverSkill('Woodcut', False);
    1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
    2: ExamineInv;
    3: RandomAngle(1);
    4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
    5: HoverSkill('random', False);
    End;
    End;


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

    procedure SetAngle(ANGLE: Integer);
    begin
    if ((Angle = SRL_ANGLE_NONE) or (not LoggedIn)) then
    Exit;

    KeyDown((Angle * 2) + 38);
    Sleep(1000 + Random(300));
    KeyUp((Angle * 2) + 38);
    Wait(500 + Random(100));
    end;

    Function ChopDown: Boolean;
    Var
    X, Y: Integer;
    begin
    //Ex. FindObjCustom(x, y, ('att', 'ack'), [123456, 345678], 5);//
    If FindObjCustom(X, Y, ['Chop', 'Down', 'p d'], [2108982, 1252123, 1713960, 2307133], 2) Then
    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;

    end;

    begin
    SetupSRL;
    DeclarePlayers;
    SetAngle;
    //Repeat
    Chopdown;
    //Until(false);
    End.


    and again any and all help is greatly appricated
    SRL was updated, so setangle no longer uses a boolean value. The tutorial is outdated, for now =]

    Use SetAngle(SRL_ANGLE_LOW);

    SRL_ANGLE_NONE will leave the angle where it is at;
    My scripts: LunarPlanker
    ---
    My Utilities: Cross Platform, Open Source, SPS Path Generator

    Join the Unoficial SRL Skype Group by clicking here, or visiting this thread.

  4. #4
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Why do you have the whole Angle Procedure in there? It's already SRL.

    Simba Code:
    SetAngle(SRL_ANGLE_LOW)
    Will do the trick.

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

    Default

    well im really fresh to scripting so i decided to try a couple things before making myself look more nooby :P

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

    Default

    and thank you all for the reply's when people said this community is good, they were not kidding +rep all

  7. #7
    Join Date
    Mar 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Dont Worry Set Angle Seems To Work On S.M.A.R.T. but not on a targeted rs window
    Last edited by mrbarrybadger; 06-02-2012 at 02:13 PM.

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

    Default

    Quote Originally Posted by mrbarrybadger View Post
    Hey i have the same problem, is there something wrong with the path now? it compiles fine but when i attempt to rune the script it seems to ignore the command, to make sure it wasn't the script that caused it to skip I made a new one which is literally just to SetAngle(SRL_ANGLE_HIGH);
    and once again it compiles fine but when i log in and target the window then run the script there is a delay and it says successfully executed even though the window is still at ANGLE LOW I dont really understand why :/
    Works fine for me? what do u understand by ANGLE HIGH? Its simply the highest elevation ur compass can go (i.e. pressing "up arrow" will not make it go even higher). Are u at a place where u are restricted to low angle?

    EDIT: if it works on smart it should work on targeted rs window too. u probably drag the cross hair to the wrong window.

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
  •