Results 1 to 19 of 19

Thread: First script, won't compile

  1. #1
    Join Date
    May 2007
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default First script, won't compile

    I'm pretty sure I'm using REV 14 w/ this, not sure what that means though.

    I really need an edgeville power flyfisher, so I decided to make one. It won't compile, there's an error, well here's the script.

  2. #2
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    There were some minor mistakes, i finished them:

    SCAR Code:
    {I "used" Wizzups? whirlpool feature from his edgeville fisher
    but I don't know if it even works cuz my script won't compile!!}


    program PowerFisher;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fishing.scar}
    const
    fishspot1= 10453355;
    fishspot2= 10650477;
    salmon= 5990048;
    trout= 10066341;

    var x, y, Tries: integer;

    procedure DeclarePlayer;
    begin

         HowManyPlayers := 1;
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer:= 0

         Players[0].Name   := 'Username';
         Players[0].Pass   := 'Password';
         Players[0].Nick   := '';
         Players[0].Active := True;

    end;

    Function FindWhirlPool(x, y: integer): Boolean; forward;  //WhirlPool so it can be used in antirandoms.

    procedure AntiRandoms;
    begin
         If(FindFight)Then
         RunAway('N', True, 1, 15000);
         FindNormalRandoms;
         FindLamp('Defense');
         If FindWhirlPool(x, y) Then   //You put the FindWhirlPool function under this one, so i forwarded it above.
            Begin
              Mouse(648, 84, 4, 4, True);
              Wait(100);
              WriteLn('Whirlpool found.');
              Inc(Whirlpools);
            End;
    end;

    Function FindWhirlPool(x, y: integer): Boolean;

    Var
       FishPoints: TPointArray;

    Begin
      If Not LoggedIn Then Exit;
      ColorToleranceSpeed(2);
      FindColorsSpiralTolerance(x, y, FishPoints, 13947343, x - 20, y - 20, x + 20, y + 20, 40)
      If GetArrayLength(FishPoints) > Round(230 * WhirlPoolAcc) Then
      Begin
        WhirlPools := Whirlpools + 1;
        WriteLn(IntToStr(Round(GetArrayLength(FishPoints) /  1600))+ '% Change');
        Result := True;
      End;
      ColorToleranceSpeed(1);
    End;

    procedure AntiBan;
    begin
         if not LoggedIn then Exit;
         case Random(30) of
              1: RandomRClick;
              2: HoverSkill('Defense', False);
              3: BoredHuman;
              4: AlmostLogout;
         end;
    end;

    procedure LureThatFish;
    begin
    if not LoggedIn then
       Exit;
       if (not (FindObjCustom(x, y, ['Lur', 'ure'], [FishSpot1, FishSpot2], 7))) then  //You did the TIntegerArray wrong
          Wait(100+random(75));
          Tries := Tries +1;
          if(Tries = 20)then
            begin
              Logout;
              Exit;
            end else
    if FindObjCustom(x, y, ['Lur', 'ure'], [FishSpot1, FishSpot2], 7) then
    repeat
          case (Random(2)) of
            1: begin
               Mouse(x, y, 4, 4, false);
               ChooseOption('ure');
               end;
            2: Mouse(x, y, 4, 4, True);
          end;
          until (InvFull)
    end;

    function DropTo(StartSlot, EndSlot: Integer): Boolean;  //By Floor66.
    var I : Integer;
    begin
     for I := StartSlot to EndSlot do
      begin
       DropItem(I);
       Result := True;
      end;
    end;

    procedure DropFish;
    begin
         if FindObjCustom(x, y, ['Trou', 'rout'], [Trout], 7) then
         DropTo(3,28);                                                    //You forgot 2 'thens'
         if FindObjCustom(x, y, ['Salm', 'almon'], [Salmon], 7) then
         DropTo(3,28);   //DropTo isnt in SRL anymore, i created one for you above!
    end;

    begin
      SetupSRL;
      repeat
       LureThatFish;
       DropFish;
       AntiBan;
       AntiRandoms;
      until(False);
    end.

    I commented the problems.
    Ce ne sont que des gueux


  3. #3
    Join Date
    May 2007
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you so much, I'm going to test it out right now. I'm going to try to make a real powerfisher later on using everything required for SRL membership.

    *edit*
    [Runtime Error] : Out Of Range in line 1211 in script C:\Documents and Settings\Owner\Desktop\Multiple SCAR\SCAR 3.15(unsigned,f2p)\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar

    any idea what this is?

  4. #4
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    I wish you very good luck
    Ce ne sont que des gueux


  5. #5
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    SCAR Code:
    {I "used" Wizzups? whirlpool feature from his edgeville fisher
    but I don't know if it even works cuz my script won't compile!!}


    program PowerFisher;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fishing.scar}
    const
    fishspot1= 10453355;
    fishspot2= 10650477;
    salmon= 5990048;
    trout= 10066341;

    var x, y, Tries: integer;

    procedure DeclarePlayer;
    begin

         HowManyPlayers := 1;
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer:= 0

         Players[0].Name   := 'Username';
         Players[0].Pass   := 'Password';
         Players[0].Nick   := '';
         Players[0].Active := True;

    end;


    procedure AntiBan;
    begin
         if not LoggedIn then Exit;
         case Random(30) of
              1: RandomRClick;
              2: HoverSkill('Defense', False);
              3: BoredHuman;
              4: AlmostLogout;
         end;
    end;

    Function FindWhirlPool(x, y: integer): Boolean; forward;

    procedure AntiRandoms;
    begin
         If(FindFight)Then
         RunAway('N', True, 1, 15000);
         FindNormalRandoms;
         FindLamp('Defense');
         If FindWhirlPool(x, y) Then
            Begin
              Mouse(648, 84, 4, 4, True);
              Wait(100);
              WriteLn('Whirlpool found.');
              Inc(Whirlpools);
            End;
    end;

    Function FindWhirlPool(x, y: integer): Boolean;

    Var
       FishPoints: TPointArray;

    Begin
      If Not LoggedIn Then Exit;
      ColorToleranceSpeed(2);
      FindColorsSpiralTolerance(x, y, FishPoints, 13947343, x - 20, y - 20, x + 20, y + 20, 40)
      If GetArrayLength(FishPoints) > Round(230 * WhirlPoolAcc) Then
      Begin
        WhirlPools := Whirlpools + 1;
        WriteLn(IntToStr(Round(GetArrayLength(FishPoints) /  1600))+ '% Change');
        Result := True;
      End;
      ColorToleranceSpeed(1);
    End;

    procedure LureThatFish;
    begin
    if not LoggedIn then
       Exit;
       if (not (FindObjCustom(x, y, ['Lur', 'ure'], [FishSpot1, FishSpot2], 7))) then
          Wait(100+random(75));
          Tries := Tries +1;
          if(Tries = 20)then
            begin
              Logout;
              Exit;
            end else
    if FindObjCustom(x, y, ['Lur', 'ure'], [FishSpot1, FishSpot2], 7) then
    repeat
          case (Random(2)) of
            1: begin                                 //Needs Begin and End Here
                 Mouse(x, y, 4, 4, false);
                 ChooseOption('ure');
               end;
            2: Mouse(x, y, 4, 4, True);
          end;
          until (InvFull)
    end;

    procedure DropFish;       // Drop To doesnt work any more
    var i: integer;
    begin
    for i := 3 to 28 do    //FindObjCustom?! WTF man, Doesnt work for inventory.
      DropItem(i);
    end;

    begin
      SetupSRL;
      repeat
       LureThatFish;
       DropFish;
       AntiBan;
       AntiRandoms;
      until (False)
    end.

    More like this.. You dont use FindObjCustom for Inventory!

    This is how it should look 0_o
    Jus' Lurkin'

  6. #6
    Join Date
    May 2007
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank both of you so much! And ToF I was reading a tutorial, and they used findobjcustom for the drop procedure <.< This is my very very first script ever haha. I hope to get better, that script you wrote looks like it's on a whole different level.

  7. #7
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Thanks =]

    But yeah, FindObjCustom shouldnt be used for dropping. At all.
    Jus' Lurkin'

  8. #8
    Join Date
    May 2007
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Torrent of Flame View Post
    Thanks =]

    But yeah, FindObjCustom shouldnt be used for dropping. At all.
    is it very bannable or what?

  9. #9
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Object finding is just for in the game screen, like finding ores, fishing spots, NPC's etc. For inventory's thats just not needed.
    Ce ne sont que des gueux


  10. #10
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    No, it just doesnt find it in the inventory.

    FindObjCustom looks on the main screen, not the inventory or minimap.

    EDIT: floor beat me to it ^^
    Jus' Lurkin'

  11. #11
    Join Date
    May 2007
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oh, well on both scripts I get this error when I run it:
    [Runtime Error] : Out Of Range in line 1211 in script C:\Documents and Settings\Owner\Desktop\Multiple SCAR\SCAR 3.15(unsigned,f2p)\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar

    any ideas?

  12. #12
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Hmm.. maybe its with the Players[#].Nick?

    Can u give me the line?
    Ce ne sont que des gueux


  13. #13
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Here we go it all works now

    SCAR Code:
    {I "used" Wizzups? whirlpool feature from his edgeville fisher
    but I don't know if it even works cuz my script won't compile!!}

    {Fixed by NaumanAkhlaQ}

    program PowerFisher;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fishing.scar}
    const
    fishspot1= 10453355;
    fishspot2= 10650477;
    salmon= 5990048;
    trout= 10066341;

    var x, y, Tries: integer;

    procedure DeclarePlayer;
    begin

         HowManyPlayers := 1;
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer:= 0

         Players[0].Name   := 'Username';
         Players[0].Pass   := 'Password';
         Players[0].Nick   := '';
         Players[0].Active := True;

    end;


    procedure AntiBan;
    begin
         if not LoggedIn then Exit;
         case Random(30) of
              1: RandomRClick;
              2: HoverSkill('Defense', False);
              3: BoredHuman;
              4: AlmostLogout;
         end;
    end;

    Function FindWhirlPool(x, y: integer): Boolean; forward;

    procedure AntiRandoms;
    begin
         If(FindFight)Then
         RunAway('N', True, 1, 15000);
         FindNormalRandoms;
         FindLamp('Defense');
         If FindWhirlPool(x, y) Then
            Begin
              Mouse(648, 84, 4, 4, True);
              Wait(100);
              WriteLn('Whirlpool found.');
              Inc(Whirlpools);
            End;
    end;

    Function FindWhirlPool(x, y: integer): Boolean;

    Var
       FishPoints: TPointArray;
       WhirlPoolAcc: Extended;
    Begin
      If Not LoggedIn Then Exit;
      ColorToleranceSpeed(2);
      FindColorsSpiralTolerance(x, y, FishPoints, 13947343, x - 20, y - 20, x + 20, y + 20, 40)
    If GetArrayLength(FishPoints) > Round(230 * WhirlPoolAcc) Then
      Begin
        WhirlPools := Whirlpools + 1;
        WriteLn(IntToStr(Round(GetArrayLength(FishPoints) /  1600))+ '% Change');
        Result := True;
      End;
      ColorToleranceSpeed(1);
    End;

    procedure LureThatFish;
    begin
    if not LoggedIn then
       Exit;
       if (not (FindObjCustom(x, y, ['Lur', 'ure'], [FishSpot1, FishSpot2], 7))) then
          Wait(100+random(75));
          Tries := Tries +1;
          if(Tries = 20)then
            begin
              Logout;
              Exit;
            end else
    if FindObjCustom(x, y, ['Lur', 'ure'], [FishSpot1, FishSpot2], 7) then
    repeat
          case (Random(2)) of
            1: begin                                 //Needs Begin and End Here
                 Mouse(x, y, 4, 4, false);
                 ChooseOption('ure');
               end;
            2: Mouse(x, y, 4, 4, True);
          end;
          until (InvFull)
    end;

    procedure DropFish;       // Drop To doesnt work any more
    var i: integer;
    begin
    for i := 3 to 28 do    //FindObjCustom?! WTF man, Doesnt work for inventory.
      DropItem(i);
    end;

    begin
      SetupSRL;
      repeat
       LureThatFish;
       DropFish;
       AntiBan;
       AntiRandoms;
      until (False);
    end.

    You needed findwhirlpoolacc as an Extended;

    Rep me if i helped

  14. #14
    Join Date
    May 2007
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well I repped all 3 of you, but here's the line that i'm having problems with. I've uninstalled/reinstalled SCAR/SRL. Here's the exact line.

    if FindTPAinTPA(Players[CurrentPlayer].NickTPA,TPA,Matches) then //Length check inside the function


    here's the error message:
    [Runtime Error] : Out Of Range in line 1216 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar

    I really do hope this can be figured out =D and thank you so much everyone for all of your help. You took my attempt and made it look amazing.

  15. #15
    Join Date
    May 2007
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay, I took out the declare players part, and the script will lure the fish(this needs work =/ it constantly clicks/rclicks lure, like 10 times a second, idk how to make it wait.) but after it lures the fish it drops them and has the same error in line 1216. I really don't know what to do with this.

  16. #16
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    make a wait while fishingproc which times out after 3-4 secs.

  17. #17
    Join Date
    May 2007
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright, I got that but any idea on what's wrong with the declare players thing? It doesn't handle any randoms and it can't log in.

  18. #18
    Join Date
    May 2007
    Posts
    344
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Double post, but I really wanna bring attention to this <.<

    Here's the script so far:

    SCAR Code:
    {I "used" Wizzups? whirlpool feature from his edgeville fisher
    but I don't know if it even works cuz my script won't compile!!}

    {Fixed by NaumanAkhlaQ}

    program PowerFisher;
    {.include srl/srl/misc/smart.scar}
    {.include srl/srl.scar}
    {.include srl/srl/skill/fishing.scar}
    const
    fishspot1= 15191480;
    fishspot2= 14858129;
    salmon= 5990048;
    trout= 10066341;

    var x, y, Tries: integer;

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

      Players[0].Name := ''; //username
      Players[0].Pass := ''; //password
      Players[0].Nick := ''; //3-4 letters from your username
      Players[0].Active := True;
    end;

    procedure AntiBan;
    begin
         if not LoggedIn then Exit;
         case Random(30) of
              1: RandomRClick;
              2: HoverSkill('Defense', False);
              3: BoredHuman;
              4: AlmostLogout;
         end;
    end;

    Function FindWhirlPool(x, y: integer): Boolean; forward;

    procedure AntiRandoms;
    begin
         If(FindFight)Then
         RunAway('N', True, 1, 15000);
         FindNormalRandoms;
         FindLamp('Defense');
         If FindWhirlPool(x, y) Then
            Begin
              Mouse(648, 84, 4, 4, True);
              Wait(100);
              WriteLn('Whirlpool found.');
              Inc(Whirlpools);
            End;
    end;

    Function FindWhirlPool(x, y: integer): Boolean;

    Var
       FishPoints: TPointArray;
       WhirlPoolAcc: Extended;
    Begin
      If Not LoggedIn Then Exit;
      ColorToleranceSpeed(2);
      FindColorsSpiralTolerance(x, y, FishPoints, 13947343, x - 20, y - 20, x + 20, y + 20, 40)
    If GetArrayLength(FishPoints) > Round(230 * WhirlPoolAcc) Then
      Begin
        WhirlPools := Whirlpools + 1;
        WriteLn(IntToStr(Round(GetArrayLength(FishPoints) /  1600))+ '% Change');
        Result := True;
      End;
      ColorToleranceSpeed(1);
    End;

    procedure LureThatFish;
    begin
    if not LoggedIn then
       Exit;
       if (not (FindObjCustom(x, y, ['Lur', 'ure'], [FishSpot1, FishSpot2], 7))) then
          Wait(100+random(75));
          Tries := Tries +1;
          if(Tries = 20)then
            begin
              Logout;
              Exit;
            end else
    if FindObjCustom(x, y, ['Lur', 'ure'], [FishSpot1, FishSpot2], 7) then
    repeat
          case (Random(1)) of
            1: begin                                 //Needs Begin and End Here
                 Mouse(x, y, 4, 4, false);
                 ChooseOption('ure');
                 FindNormalRandoms;
                 Wait(6000+(random(3000)))
               end;
          end;
          until (InvFull)
    end;

    procedure DropFish;       // Drop To doesnt work any more
    var i: integer;
    begin
    for i := 3 to 28 do    //FindObjCustom?! WTF man, Doesnt work for inventory.
      DropItem(i);
      FindNormalRandoms;
    end;

    begin
      SetupSRL;
      Wait(1000);
      declarePlayers;
      LoginPlayer;
      repeat
       LureThatFish;
       DropFish;
       AntiBan;
       AntiRandoms;
      until (False);
    end.

    The only problem it really has is that it doesn't accurately find the fishing spots, and it also detects a lot of whirlpools that aren't there.

  19. #19
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    If you dont like something remove it.
    Or if it doesn't work for you (whirlpool finder) Pm the creator.

    Im sure he'll be happy to help .

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Script wont compile. again. :(
    By Johura in forum OSR Help
    Replies: 2
    Last Post: 04-02-2007, 12:20 PM
  2. Replies: 7
    Last Post: 04-01-2007, 02:47 AM
  3. Need help getting my script to compile
    By Johura in forum OSR Help
    Replies: 5
    Last Post: 03-30-2007, 10:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •