Results 1 to 14 of 14

Thread: Help with my First script - any help is appreciated :)

  1. #1
    Join Date
    Apr 2012
    Posts
    127
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Help with my First script - any help is appreciated :)

    Been following YoHoJo's youtube tutorials, except making a script that mines copper in lumbridge mine.

    im sorta stuck with a dropping method does want to compile at
    "MouseItem(OrePatter[I],False);":

    Simba Code:
    Procedure DropOres;
    var
      x, y, OreDTM, I : Integer;
      SlotBox : Tbox;
      OrePattern : TIntegerArray;
    begin

      OreDTM := DTMFromString('mKgEAAHic42NgYPBhYmDwYoLQgUAcDsQRQBwNxMFQOTsgtoFiJyB2BWJuIJYEYmEgFgJiQSDmAmIWIGYE4r+MDAxsUHWCUDViQLw7xxpoKxMGNlBQwCqOwOQBRjIxKgAAQyYIBQ==');
      OrePattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,28];

      For I:=0 to 27 Do
        Begin
        SlotBox:=InvBox(OrePattern[I]);
        If FindDTM(OreDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2)
        Then
          Begin
            MouseItem(OrePattern[I],False);
            ChooseOption('Dro');
          end;
         end;

      end;

    It says its a type mismatch, but im sure im doing it right? :s

    thanks in advance for any help (and to YoHoJo for making the Tut's)

  2. #2
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Simba Code:
    Procedure DropOres;
    var
      x, y, OreDTM, I : Integer;
      SlotBox : Tbox;
      OrePattern : TIntegerArray;
    begin

      OreDTM := DTMFromString('mKgEAAHic42NgYPBhYmDwYoLQgUAcDsQRQBwNxMFQOTsgtoFiJyB2BWJuIJYEYmEgFgJiQSDmAmIWIGYE4r+MDAxsUHWCUDViQLw7xxpoKxMGNlBQwCqOwOQBRjIxKgAAQyYIBQ==');
      OrePattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,28];

      For I:=0 to 27 Do
        Begin
        SlotBox:=InvBox(OrePattern[I]);
        If FindDTM(OreDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2)
        Then
          Begin
            MouseItem(OrePattern[I],mouse_Left);  //This line :) since SRL5 integers are used for mouse buttons not booleans
            ChooseOption('Dro');     //WaitOption is more reliable
          end;
         end;

      //Free that DTM!!! :P

      end;

  3. #3
    Join Date
    Dec 2011
    Location
    Berlin
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Simba Code:
    procedure DropItemAll(i:integer);
    begin
      if ExistsItem(i) then
      begin
        MouseItem(i, mouse_Right);
        if (WaitOptionEx('rop', 'action', ClickLeft, 250)) then
          Wait(RandomRange(20, 50));
      end;
    end;

    procedure DropEverythingExcept(SkipArr : TIntegerArray);
    var
    startI,CurrI : Integer;
    begin
    For StartI := 1 to 4 do
    begin
      CurrI := StartI;
      while CurrI <= 28 do
      begin
        if not InIntArray(SkipArr,CurrI) then
          DropItem(CurrI);
        CurrI := CurrI + 4;
      end;
    end;
    end;


    This should drop everything (gems too lol) out of your invintory. It won´t drop from the first invintory slot so you can put your pickaxe in there if you can´t wear it due to low attack lvl.

    I will try to answer all Runescape related questions!

  4. #4
    Join Date
    Apr 2012
    Posts
    127
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by putonajonny View Post
    Simba Code:
    Procedure DropOres;
    var
      x, y, OreDTM, I : Integer;
      SlotBox : Tbox;
      OrePattern : TIntegerArray;
    begin

      OreDTM := DTMFromString('mKgEAAHic42NgYPBhYmDwYoLQgUAcDsQRQBwNxMFQOTsgtoFiJyB2BWJuIJYEYmEgFgJiQSDmAmIWIGYE4r+MDAxsUHWCUDViQLw7xxpoKxMGNlBQwCqOwOQBRjIxKgAAQyYIBQ==');
      OrePattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,28];

      For I:=0 to 27 Do
        Begin
        SlotBox:=InvBox(OrePattern[I]);
        If FindDTM(OreDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2)
        Then
          Begin
            MouseItem(OrePattern[I],mouse_Left);  //This line :) since SRL5 integers are used for mouse buttons not booleans
            ChooseOption('Dro');     //WaitOption is more reliable
          end;
         end;

      //Free that DTM!!! :P

      end;
    Thanks! now just to find out how to "Free that DTM" ..... lol

  5. #5
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by h4x_ View Post
    Thanks! now just to find out how to "Free that DTM" ..... lol
    This will help: http://villavu.com/forum/showthread.php?t=68018

  6. #6
    Join Date
    Apr 2012
    Posts
    127
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Nearly there, thanks btw

    Simba Code:
    Procedure DropOres;
    var
      x, y, OreDTM, I : Integer;
      SlotBox : Tbox;
      OrePattern : TIntegerArray;
    begin

      OreDTM := DTMFromString('m1gAAAHic42JgYMhmYmCIBeIsIK4G4nIgzgHiIiCuAuIkII4HYjZGBgZuIP4J1MMIpAWAWBSIfzNA5EB8ZiCeF20IFGEiiI0YsAMjNMxIJEYAAIbmCOg=');
      OrePattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,28];
      For I:=0 to 27 Do
        Begin
        SlotBox:=InvBox(OrePattern[I]);
        If FindDTM(OreDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2)
        Then
          Begin
            MouseItem(OrePattern[I],2);
            WaitOption('Drop', 500);
          end;

        FreeDTM(OreDTM);
        end;

      end;

    thats how far ive got, i just keep getting this error?

    "Error: Exception: The given DTM Index[2] doesn't exist at line 128
    The following DTMs were not freed: [SRL - Lamp bitmap, 1]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]"

  7. #7
    Join Date
    Dec 2011
    Location
    Berlin
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by h4x_ View Post
    Nearly there, thanks btw

    Simba Code:
    Procedure DropOres;
    var
      x, y, OreDTM, I : Integer;
      SlotBox : Tbox;
      OrePattern : TIntegerArray;
    begin

      OreDTM := DTMFromString('m1gAAAHic42JgYMhmYmCIBeIsIK4G4nIgzgHiIiCuAuIkII4HYjZGBgZuIP4J1MMIpAWAWBSIfzNA5EB8ZiCeF20IFGEiiI0YsAMjNMxIJEYAAIbmCOg=');
      OrePattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,28];
      For I:=0 to 27 Do
        Begin
        SlotBox:=InvBox(OrePattern[I]);
        If FindDTM(OreDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2)
        Then
          Begin
            MouseItem(OrePattern[I],2);
            WaitOption('Drop', 500);
          end;

        FreeDTM(OreDTM);
        end;

      end;

    thats how far ive got, i just keep getting this error?

    "Error: Exception: The given DTM Index[2] doesn't exist at line 128
    The following DTMs were not freed: [SRL - Lamp bitmap, 1]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]"
    Is it working so can you use it and the error is in the debug box after shutting down the script or is it not working?

    I will try to answer all Runescape related questions!

  8. #8
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Wrong section bro. This is for tuts.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  9. #9
    Join Date
    Apr 2012
    Posts
    127
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Rich View Post
    Wrong section bro. This is for tuts.
    Sorry is there anyway someone can move it?
    Quote Originally Posted by Imanoobbot View Post
    Is it working so can you use it and the error is in the debug box after shutting down the script or is it not working?
    the script runs, hovers over the ore as if it is just about to rightclick/drop, but instead it stopped and i get the error

  10. #10
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Which line is line 128?

    Edit:

    Simba Code:
    Procedure DropOres;
    var
      x, y, OreDTM, I : Integer;
      SlotBox : Tbox;
      OrePattern : TIntegerArray;
    begin

      OreDTM := DTMFromString('m1gAAAHic42JgYMhmYmCIBeIsIK4G4nIgzgHiIiCuAuIkII4HYjZGBgZuIP4J1MMIpAWAWBSIfzNA5EB8ZiCeF20IFGEiiI0YsAMjNMxIJEYAAIbmCOg=');
      OrePattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,28];
      For I := 0 to 27 Do
        Begin
          SlotBox:=InvBox(OrePattern[I]);
          If FindDTM(OreDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) then
            Begin
              MouseItem(OrePattern[I],2);
              WaitOption('Drop', 500);
            end;
        end;
      FreeDTM(OreDTM);  //Move this to outside of the loop :)

    end;

    Also don't worry about it being in the wrong section, everybody makes mistakes, an admin will come across it and move it
    Last edited by putonajonny; 04-29-2012 at 04:50 PM.

  11. #11
    Join Date
    Apr 2012
    Posts
    127
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by putonajonny View Post
    Which line is line 128?
    128: If FindDTM(OreDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2)

  12. #12
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by h4x_ View Post
    128: If FindDTM(OreDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2)
    See edited post above

  13. #13
    Join Date
    Apr 2012
    Posts
    127
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by putonajonny View Post
    See edited post above
    Thanks for the help, but i still get the same error... very strange

  14. #14
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Quote Originally Posted by h4x_ View Post
    Sorry is there anyway someone can move it?
    No need to be sorry. Just pointing out so you don't make the same mistake in the future
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

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
  •