Results 1 to 13 of 13

Thread: Some editing help please...

  1. #1
    Join Date
    Jun 2007
    Posts
    106
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default Some editing help please...

    SCAR Code:
    Program MineTest;
    {.include SRL/SRL.scar}

    Const
    IronRock= 1976384;
    LoadsToDo=10;

    Var
    IronOre:integer;
    X,y,i:integer;

    Procedure DeclarePlayers;
    begin
         HowManyPlayers  :=1;
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer:=0;

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

    NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    end;


    Procedure LoadDTM;
    Begin
      IronOre := DTMFromString('78DA637466626078C280023C7595184480342' +
           '310FF07024607A09A4F0C6880118904D2A640356F09A8F105AA79' +
           '8D69178A9A40A09A07A86AEAD23C50D5B802D5DC2060971950CD7' +
           'DFC6A0039AB0EA3');
    end;

    Procedure MineOre;
    begin
     repeat
      If(Findcolor(x,y,IronRock,0,0,515,340))then
       begin
        Mouse(x,y,5,5,true);
        wait(2500)
        end;
     until(InvFull);
    end;


    Procedure DropOre;
     Begin
     if FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
     repeat
      begin
       MMouse(x,y,1,1);
        wait(100)
       If Isuptext('Iron ore')then
        begin
         mouse(x,y,1,1,false);
          ChooseOption('Drop');
        end else
         Writeln('No ore found.');
         TerminateScript;
       end;
     until(InvEmpty);
    end;

    Begin
      SetupSRL;
       ClearDebug;
        ActivateClient;
         DeclarePlayers;
          LoginPlayer;
         i:=LoadsToDo;
      repeat
       LoadDTM;
        MineOre;
         DropOre;
          FreeDTM(IronOre);
           i:=i-1
      until(i=0);
       logout;
       Writeln('There were '+floattostr(i)+' loads made.');
    end.
    I know i don't have anti ban or loads of other things.
    This is my very first interaction with programming so please dont be TOO critical.
    The main problem i have right now is that after the inventory is full, it drops 1 ore, then the script terminates. Could you guys show me what sections of code i'd need to change, and maybe how to continue mining after all or is dropped even if pick is in inventory(I have until(InvEmpty).

    Any other suggestions would be appreciated as well

    Thanks- Anoobis

  2. #2
    Join Date
    Jan 2007
    Posts
    55
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    maybe make the dropping procedure do this:
    (i am pretty new to this too so it might not be the best)

    but anyways have it find dtm of iron ore in your invintory then move mouse to the dtm and right click and drop (pretty sure you can figure out how to do that by what you have done) and then put it in a loop until not find dtm.

    get it?
    AKA http://i105.photobucket.com/albums/m...uceSigcopy.jpg

    I am a SCAR//SRL newb and i am willing to become better =) reading my tut's day by day.

  3. #3
    Join Date
    Jun 2007
    Posts
    106
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Well thats what i have it set as right now, but i must have messed up my placement of repeat/until, since it only drops one ore then terminates the script

  4. #4
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well I'm not the best scripter but some of this might help...

    SCAR Code:
    Procedure DropOre;
     Begin
     if FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
     begin //try a begin there
     repeat
                  //I don't think you need a begin there
       MMouse(x,y,1,1); //You could just skip this part and go straight to
        wait(100)          //mouse(x,y,1,1,false), it would be faster but I guess
       If Isuptext('Iron ore')then       //making sure you got it is a decent failsafe
        begin
         mouse(x,y,1,1,false);
          ChooseOption('Drop');   // I think you can't use capitals on these
        end else                       // maybe you can but I would use 'rop'
         Writeln('No ore found.');
         TerminateScript;  //put an exit; here instead because it'll terminate
       end;                     //when it's done dropping because of TerminateScript
     until(InvEmpty);  //if pickaxe is there use "until(InvCount = 27)"
                           //along with that I would add a failsafe such as like
                      //"until(InvCount = 27) or (TimeDropping = 240000)" if you count the time
        end; //end there because of the begin after the if/then
    end;

    Oh and a big thing, I think the reason it only drops one ore is because the repeat is after it finds the ore. So it'll find the ore (lets say the ore is at 50,50), store the cords, then go to the 50,50 once, drop that ore, then it won't look for another one, it'll go to 50,50 again, it won't find 'Iron ore', and it'll terminate.

  5. #5
    Join Date
    Jun 2007
    Posts
    106
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Thanks Bunches 'Scapian, ill try out these changes and see how it holds up =)

  6. #6
    Join Date
    Jun 2007
    Posts
    106
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    SCAR Code:
    Program MineTest;
    {.include SRL/SRL.scar}

    Const
    IronRock= 1976384;
    LoadsToDo=10;

    Var
    IronOre:integer;
    X,y,i:integer;

    Procedure DeclarePlayers;    {Whole procedure may cause not to run correctly?
    begin
         HowManyPlayers  :=1;
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer:=0;

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

    NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    end;


    Procedure LoadDTM;
    Begin
      IronOre := DTMFromString('78DA637466626078C280023C7595184480342' +
           '310FF07024607A09A4F0C6880118904D2A640356F09A8F105AA79' +
           '8D69178A9A40A09A07A86AEAD23C50D5B802D5DC2060971950CD7' +
           'DFC6A0039AB0EA3');
    end;

    Procedure MineOre;
    begin
     repeat
      If(Findcolor(x,y,IronRock,0,0,515,340))then
       begin
        Mouse(x,y,5,5,true);
        wait(2500)
        end;
     until(InvFull);
    end;


    Procedure DropOre;
     Begin
     repeat //Moved above IF
     if FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
       MMouse(x,y,1,1);
        wait(100)
       If Isuptext('Iron ore')then
        begin
         mouse(x,y,1,1,false);
          ChooseOption('Drop');
        end else
         Writeln('No ore found.');
         TerminateScript;
       end;
     until(InvCount=27); //Changed frmo InvEmpty to current
    end;

    Begin
      SetupSRL;
       ClearDebug;
        ActivateClient;
         DeclarePlayers; //  Causing
          LoginPlayer;   //  Problems?
         i:=LoadsToDo;
      repeat
       LoadDTM;
        MineOre;
         DropOre;
          FreeDTM(IronOre);
           i:=i-1
      until(i=0);
       logout;
       Writeln('There were '+floattostr(i)+' loads made.');
    end.

    Commented changes i made for now

    It seems that ever since i added in the DeclarePlayers procedure that it wont really run the whole script. I guess i placed something out of order, Anyone see anything wrong with them?

    Ill get back to any replies tomorow, out for the night =)

  7. #7
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Begin
      SetupSRL;
       ClearDebug;
        ActivateClient;
         DeclarePlayers; //  Causing
          LoginPlayer;   //  Problems?
         i:=LoadsToDo;
      repeat
       LoadDTM;
        MineOre;
         DropOre;
          FreeDTM(IronOre);
           i:=i-1
      until(i=0);
       logout; //this should be "nextplayer(true)" but I'm not sure if it'll fix your problem, it might.
       Writeln('There were '+floattostr(i)+' loads made.');
    end.

    What part exactly does the script not work (like the dropping, mining, or what?)? what I said in there will make the player log out and then start mining again, I'm not sure that's what you want though.

  8. #8
    Join Date
    Aug 2007
    Location
    Vancouver
    Posts
    394
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    Program MineTest;
    {.include SRL/SRL.scar}

    Const
    IronRock= 1976384;
    LoadsToDo=10;

    Var
    IronOre:integer;
    X,y,i:integer;

    Procedure DeclarePlayers;
    begin
         HowManyPlayers  :=1;
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer:=0;

         Players[0].Name :='Hork bjarr';
         Players[0].Pass :='giuseppe1';
         Players[0].Nick :='ork';
         Players[0].Active:=True;

    NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    end;


    Procedure LoadDTM;
    Begin
      IronOre := DTMFromString('78DA637466626078C280023C7595184480342' +
           '310FF07024607A09A4F0C6880118904D2A640356F09A8F105AA79' +
           '8D69178A9A40A09A07A86AEAD23C50D5B802D5DC2060971950CD7' +
           'DFC6A0039AB0EA3');
    end;

    Procedure MineOre;
    begin
     repeat
      If(Findcolor(x,y,IronRock,0,0,515,340))then
       begin
        Mouse(x,y,5,5,true);
        wait(2500)
        end;
     until(InvFull);
    end;


    Procedure DropOre;
     Begin
     repeat //Moved above IF
     if FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
       MMouse(x,y,1,1);
        wait(100)
       If Isuptext('Iron ore')then
        begin
         mouse(x,y,1,1,false);
          ChooseOption('Drop');
        end else
         Writeln('No ore found.');
         TerminateScript;
       end;
     until Not FindDtm(ironOre,x,y,MIx1,miy1,mix2,miy2)
    end;

    Begin
      SetupSRL;
       ClearDebug;
        ActivateClient;
         DeclarePlayers; //  Causing
          LoginPlayer;   //  Problems?
         i:=LoadsToDo;
      repeat
       LoadDTM;
        MineOre;
         DropOre;
          FreeDTM(IronOre);
           i:=i-1
      until(i=0);
       logout;
       Writeln('There were '+floattostr(i)+' loads made.');
    end.

    fixed your dropping a bit.

    Also, to add randoms all you need to do is

    FindNormalRandoms;

  9. #9
    Join Date
    Jun 2007
    Posts
    106
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Thanks Garden, (would the FindNormalRandoms just go in the main loop? I havent gone over a antiban/random tut yet so im still shaky in that field)


    Scapian - Ever since i added declare players, the script successfully compiles and runs, but it doesnt do any action. Just sits there saying: script running... until i manually stop it

  10. #10
    Join Date
    Aug 2007
    Location
    Vancouver
    Posts
    394
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by anoobis View Post
    Thanks Garden, (would the FindNormalRandoms just go in the main loop? I havent gone over a antiban/random tut yet so im still shaky in that field)


    Scapian - Ever since i added declare players, the script successfully compiles and runs, but it doesnt do any action. Just sits there saying: script running... until i manually stop it
    Add it when your mining/after mining

  11. #11
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh, I see. I just looked at my script and it seems that it's not "loginplayer", just 'login;'. Try that

  12. #12
    Join Date
    Jun 2007
    Posts
    106
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    SCAR Code:
    Program MineTest;
    {.include SRL/SRL.scar}

    Const
    IronRock=1779525;
    LoadsToDo=10;

    Var
    IronOre:integer;
    X,y,i:integer;

    Procedure DeclarePlayers;
    begin
         HowManyPlayers  :=1;
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer:=0;

         Players[0].Name :='username';
         Players[0].Pass :='password';
         Players[0].Nick :='ser';
         Players[0].Active:=True;

    NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    end;


    Procedure LoadDTM;
    Begin
      IronOre := DTMFromString('78DA637466626078C280023C7595184480342' +
           '310FF07024607A09A4F0C6880118904D2A640356F09A8F105AA79' +
           '8D69178A9A40A09A07A86AEAD23C50D5B802D5DC2060971950CD7' +
           'DFC6A0039AB0EA3');
    end;

    Procedure MineOre;
    begin
     repeat
      If(FindColorTolerance(x,y,IronRock,5,5,514,336,0))then
       begin
        FindNormalRandoms;   //ADDED
         Mouse(x,y,5,5,true);
          wait(2500)
           FindNormalRandoms;    //ADDED, not sure if placement is right for either
        end else
        TerminateScript;
     until(InvFull);
    end;


    Procedure DropOre;
     Begin
     repeat
     if FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
       MMouse(x,y,1,1);
        wait(100)
       If Isuptext('Iron ore')then
        begin
         mouse(x,y,1,1,false);
          ChooseOption('Drop');
        end else
         Writeln('No ore found.');
       end;
     until Not FindDtm(ironOre,x,y,MIx1,MIy1,MIx2,MIy2)
    end;

    Begin
      SetupSRL;
       ClearDebug;
        ActivateClient;
         DeclarePlayers;
          LoginPlayer;
           SetAngle(true);  // ADDED
            MakeCompass('W')   //ADDED
         i:=LoadsToDo;
      repeat
       LoadDTM;
        MineOre;
         DropOre;
          FreeDTM(IronOre);
           i:=i-1
      until(i=0);
       logout;
       Writeln('There were '+floattostr(i)+' loads made.');
    end.


    Now it logs in perfectly fine.
    Sometimes everything will work fine, (angles,mining,not sure about dropping.)
    Others it logs in, says found compass in debug, then never changes angle, mines or terminates like its supposed to.

    I have absolutely no idea whats going on now. If some of you guys could try it and see if you can solve some bugs taht would be awesome.

    Thanks, Anoobis

  13. #13
    Join Date
    Aug 2007
    Location
    Vancouver
    Posts
    394
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    i think the problem is, that runescape's colors always change, so you cant have 1 set color for the rock because they change. You will probably need to auto color the rocks if im not correct.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Video Editing
    By Macros in forum Misc. Links and Programs
    Replies: 4
    Last Post: 01-12-2009, 10:21 PM
  2. need help editing
    By dicklick in forum OSR Help
    Replies: 1
    Last Post: 10-30-2008, 11:13 PM
  3. help with editing a file...
    By zenma in forum RuneScape News and General
    Replies: 0
    Last Post: 08-28-2007, 11:49 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
  •