Results 1 to 14 of 14

Thread: Dropping Difficulties

  1. #1
    Join Date
    Dec 2010
    Posts
    89
    Mentioned
    4 Post(s)
    Quoted
    8 Post(s)

    Default Dropping Difficulties

    Hey Guys... I was wondering if anyone with more scripting knowledge could help me understand why my script isn't dropping. It's based off of two of YoHoJo's dropping methods. The idea is to use a random of the 4 FishPatterns provided by the DropSetup so that it would provide randomization in the dropping procedure.

    Any ideas on a fix? or other dropping methods?

    Simba Code:
    procedure DropSetup;
    begin
      SetArrayLength(FishPattern, 4);
      FishPattern[0]:= [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, 24, 28];
      FishPattern[1]:= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28];
      FishPattern[2]:= [1, 2, 3, 4, 8, 7, 6, 5, 9, 10, 11, 12, 16, 15, 14, 13, 17, 18, 19, 20, 24, 23, 22, 21, 25, 26, 27, 28];
      FishPattern[3]:= [1, 5, 9, 13, 17, 21, 25, 26, 22, 18, 14, 10, 6, 2, 3, 7, 11, 15, 19, 23, 27, 28, 24, 20, 16, 12, 8, 4];
    end;

    procedure Dropping;
    var
      MyFish_DTM, x, y, I, R: integer;
      SlotBox:TBox;

    begin
      MyFish_DTM:= DTMFromString('myS0oPer1337dtmStr1ng');
      R:= Random(4);

      for I:= 0 to 27 do
        begin   //using the following Writeln for Debugging purposes
          Writeln('Using FishPattern[' + IntToStr(R) + ']');
          SlotBox:= InvBox(FishPattern[R][I]);  // Getting an "Error: Out Of Range" here
          if FindDTM(MyFish_DTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) then
            begin
              DropItem(FishPattern[R][I]);
              Writeln('Dropping InvBox[' + IntToStr(I) + ']');
            end;
        end;

      FreeDTM(MyFish_DTM);
    end;

    [Resolved] Needed to add DropSetup to my Dropping procedure. Thanks for the help that was given.
    Last edited by Valithor; 04-03-2012 at 05:33 AM.

  2. #2
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Change "SlotBox:= InvBox(FishPattern[2][I]);" to "SlotBox:= InvBox(FishPattern[I]);"
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  3. #3
    Join Date
    Dec 2010
    Posts
    89
    Mentioned
    4 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    Change "SlotBox:= InvBox(FishPattern[2][I]);" to "SlotBox:= InvBox(FishPattern[I]);"
    Thanks for your speedy reply Kyle! but quick question...
    what if I want to use a random of the 4 FishPatterns? If I understand correctly, what you are suggesting will only drop the items in one pattern.

    will edit the original post to better express the intent...

  4. #4
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Ahh I see, change the "[2]" to "[R]" as that will randomly select one of the patterns.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  5. #5
    Join Date
    Dec 2010
    Posts
    89
    Mentioned
    4 Post(s)
    Quoted
    8 Post(s)

    Default

    Right... but I'm still getting that "Out of Range" error.

  6. #6
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Could you post your full script? That will help me figure out what's wrong.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


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

    Default

    Kyle is going to be much more help than me, but does the I variable need to be defined or somehow tied to the fish patterns?

  8. #8
    Join Date
    Dec 2010
    Posts
    89
    Mentioned
    4 Post(s)
    Quoted
    8 Post(s)

    Default

    Edited first post again...
    Title says Draynor Fisher, when in reality it cages Crayfish near the Lumbridge Cemetery.
    Thanks again for your help Kyle. It's been appreciated.

    Edit: alevere4, the variable "I" defines the SlotBox (or Inventory Box) it's looking at. It works from 1 - 28. The FishPattern arrays define what "I" is. And the script uses that to know which Box to drop from.

    Edit 2: the code in the script complies fine, but when it comes to run time is when I get the error.
    Last edited by Valithor; 04-03-2012 at 04:58 AM.

  9. #9
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    You never call "DropSetup" in your script, that's why
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


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

    Default

    Quote Originally Posted by Valithor View Post
    Edited first post again...
    Title says Draynor Fisher, when in reality it cages Crayfish near the Lumbridge Cemetery.
    Thanks again for your help Kyle. It's been appreciated.

    Edit: alevere4, the variable "I" defines the SlotBox (or Inventory Box) it's looking at. It works from 1 - 28. The FishPattern arrays define what "I" is. And the script uses that to know which Box to drop from.

    Edit 2: the code in the script complies fine, but when it comes to run time is when I get the error.
    SlotBox:= InvBox(FishPattern[R][I]); // Getting an "Error: Out Of Range" here

    Have you tried to remove the [R] from that line and just have InvBox(FishPattern[I]). Don't see why you would need the fish pattern when using the FindDtm in the next line. Just free ballin here! Never used this procedure for dropping.

    E* - Well, should have known Kyle would beat me to it!
    E2 - And I am ashamed of both of my suggestions after looking at the procedure, ha.
    Last edited by iBlank; 04-03-2012 at 05:11 AM.

  11. #11
    Join Date
    Dec 2010
    Posts
    89
    Mentioned
    4 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    You never call "DropSetup" in your script, that's why
    Hmmm... So where would I call it then? At the beginning of the Dropping Proc?

    alevere4, I'm pretty sure that [R] needs to be there to get the results I'm looking for. Otherwise, it would only drop in one pattern instead of having the option of 4.

    Edit: alevere, no need to be ashamed. I'm really grateful for the help that you've offered. And if nothing else, I hope you learned a thing or two.

  12. #12
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Right, call it at the beginning of the drop procedure, and it will work
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


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

    Default

    Quote Originally Posted by Valithor View Post
    Hmmm... So where would I call it then? At the beginning of the Dropping Proc?

    alevere4, I'm pretty sure that [R] needs to be there to get the results I'm looking for. Otherwise, it would only drop in one pattern instead of having the option of 4.

    Edit: alevere, no need to be ashamed. I'm really grateful for the help that you've offered. And if nothing else, I hope you learned a thing or two.
    And to think I have written a working Rock-tail fisher with banking! But anything outside of that one script, I am not familiar with. You could just call DropSetup really anytime before you run the actual dropping procedure. This would work:

    Simba Code:
    begin
      DropSetup;
      MyFish_DTM:= DTMFromString('myS0oPer1337dtmStr1ng');
      R:= Random(4);

      for I:= 0 to 27 do
        begin   //using the following Writeln for Debugging purposes
          Writeln('Using FishPattern[' + IntToStr(R) + ']');
          SlotBox:= InvBox(FishPattern[R][I]);  // Getting an "Error: Out Of Range" here
          if FindDTM(MyFish_DTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) then
            begin
              DropItem(FishPattern[R][I]);
              Writeln('Dropping InvBox[' + IntToStr(I) + ']');
            end;
        end;

      FreeDTM(MyFish_DTM);
    end;

    E - Arrgg! Got me again, even on the one I knew, ha.

  14. #14
    Join Date
    Dec 2010
    Posts
    89
    Mentioned
    4 Post(s)
    Quoted
    8 Post(s)

    Default

    Hey guys, thanks for the all the help! The script is working a lot better now! I appreciate all the help! Rep ++

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
  •