Results 1 to 6 of 6

Thread: Daemonheim Resource Island Woodcutter

  1. #1
    Join Date
    Nov 2010
    Location
    West Philadelphia, born and raised
    Posts
    522
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default Daemonheim Resource Island Woodcutter

    After messing around with Simba and reading some tutorials around here, I've decided to try my hand at actually writing a script. So here it is (description is copied from the script itself):

    Simba Code:
    {
    Daemonheim Woodcutter
    by dd409

    You can start the script anywhere, it will use the Ring of kinship to
    teleport to Daemonheim.  From there it will walk to the woodcutting
    island, cut trees until the inventory is full, then use the ring to
    teleport back and bank.  This script is mostly F2P based, since I
    do not have a membership and don't feel like getting one.

    It supports all F2P axes both equipped and in inventory from bronze-rune,
    and *should* support Dragon and Clay axes as well.  This needs confirmation
    from a member.

    Assumptions:
    -Ring of kinship (any color) is equipped at start of script
    -Useable axe is equipped or in inventory at start of script
    -Dungeoneering level is sufficient to enter the island
    -Woodcutting level is sufficient to cut selected tree(s)

    I will eventually add failsafes for each of these so that they no longer
    need to be assumed.  Consider it the first part of my 'to-do' list.

    Everything outside of assumptions that still needs to be done:
    -Implement bitmaps for Ring of kinship recognition (currently relies on preset screen coordinates, which I know is bad)
    -Add walking from trees back to bank if Ring is not equipped
    }

    I think that sums it up pretty well. Since this is my first attempt at scripting, I need all the critisism on it you have to offer. Suggestions for fixing/optimizing anything within the script are also more than welcome and will be credited accordingly. Also, my standards may be a little messed up since I've never programmed in Pascal; I just followed the Java standards as closely as I could.

    Also, just as proof that it runs:
    Progress Report:
    ------------------------------------
    - Daemonheim Woodcutter - by dd409 -
    ------------------------------------
    Player: 
    Trees being cut: maple
    Loads banked: 1
    Randoms encountered: 0
    ------------------------------------


    So let me know what you think!

    EDIT: Newer version uploaded. I've replaced the Reflection tree finding with Color. The Reflection finding code is still included, just commented out; eventually I'll add an option for the user to decide which to use.
    Last edited by Tlachtli; 01-21-2011 at 06:31 AM.
    Long ago, the '90s Nicktoons lived together in harmony. Then, everything changed when the century turned. Only Avatar, the best of the 2000's Nicktoons, could save them. But when the channel needed it most, the show finished. Four years passed and Mike and Bryan created the new Avatar: Legend of Korra. And although the show itself is great, it has a long way to go before it can live up to The Last Airbender. But I believe Korra can save Nickelodeon.

  2. #2
    Join Date
    Dec 2010
    Location
    Leuven
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I thought it was an interesting script. But not because of the way it works. Because your account name and password were still in it. Don't worry, I quickly changed your pass so that no one could steal stuff, check my PM in your inbox. (There were no moderators online to remove it).
    Last edited by Furyan; 01-07-2011 at 01:48 PM.

  3. #3
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What are resource islands, they sound good if you need a dung lvl as botter will be less and also what is the ring?

    Sorry im a noob about runescape nowadays
    Quote Originally Posted by DD on IRC
    wanted to troll the troll

  4. #4
    Join Date
    Nov 2010
    Location
    West Philadelphia, born and raised
    Posts
    522
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by Furyan View Post
    I thought it was an interesting script. But not because of the way it works. Because your account name and password were still in it. Don't worry, I quickly changed your pass so that no one could steal stuff, check my PM in your inbox. (There were no moderators online to remove it).
    Well, that's definitely embarrassing . That would also explain why my login details had been changed. Thanks a ton. Anyways, I changed my password (again) and uploaded a clean copy of the script.

    Quote Originally Posted by Troll Man View Post
    What are resource islands, they sound good if you need a dung lvl as botter will be less and also what is the ring?

    Sorry im a noob about runescape nowadays
    They're places you can only access with a certain Dungeoneering level. The Ring of kinship is given to you by the Dungeoneering tutor, and it allows you to form Dungeoneering parties and (conveniently) teleport straight to Daemonheim; the ring itself can be worn like any normal ring and is weightless.

    EDIT: Newer version uploaded. Walking and tree finding significantly improved and slightly more human-like. Still one issue and a few features to deal with before I post this in the real scripts section. It's safe to use now if you want to mess around with it, just don't rely on it as a maple cutter for now. Also, now with 100% fewer account details! :P
    Last edited by Tlachtli; 01-09-2011 at 07:21 AM.
    Long ago, the '90s Nicktoons lived together in harmony. Then, everything changed when the century turned. Only Avatar, the best of the 2000's Nicktoons, could save them. But when the channel needed it most, the show finished. Four years passed and Mike and Bryan created the new Avatar: Legend of Korra. And although the show itself is great, it has a long way to go before it can live up to The Last Airbender. But I believe Korra can save Nickelodeon.

  5. #5
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Your DeclarePlayers and some global variables that are used for options can be shortened and "Tidied" with this:

    Simba Code:
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer  := 0;


      {
        What "with Players[0] do" does is removes the need to put
        "Players[x]." before everything. Making it look tidier and allows
        for better script maintaining, in my opinion.

        The strings and integers are arrays that are quite useful for options.
        You could find a better alternative, if you wished. But for now it would
        be good to use.
      }

      with Players[0] do
      begin
        Name := '';
        Pass := '';
        Nick := '';
        Pin := '';
        Active:=True;

        Strings[0] := 'Maple'; // Chopping
        Integers[0] := 999; // Loads and/or how many logs to chop of the selected type
        // And etc.
      end;
    end;

    --

    Your procedure "SetupVariables" is really unneeded, in my opinion. As you should stick to using local variables and not global like you have for the TTileArrays. It makes it tidier and easier to maintain.

    --
    Readability:
    Simba Code:
    findcolortolerance(x,y,2438653,MSX1,MSY1,MSX2,MSY2,15);
    That should be (And every other thing you have this way):
    Simba Code:
    FindColorTolerance(X, Y, {COLOR}, MSX1, MSY1, MSX2, MSY2, {TOL});

    Yet again, it makes things easier to maintain and read over quickly when making changes to your script and future scripts that you may create.

    --

    For your procedure "GoToBanker" (And every other procedure that uses your TTileArrays that you have as your global variables; You should have the TTileArrays as local variables instead.

    --

    That is all I saw from quickly glancing over the script.

    Overall, this is a good first script, dd409. You have done very well. I can't wait to see what you create in the future!

    -

    E: @ This line of If's:
    Simba Code:
    if (Lowercase(TreeToCut[CurrentPlayer]) = 'willow') then
        TargetTree := 1;
      if (Lowercase(TreeToCut[CurrentPlayer]) = 'maple') then
        TargetTree := 2;
      if (Lowercase(TreeToCut[CurrentPlayer]) <> 'willow') and (Lowercase(TreeToCut[CurrentPlayer]) <> 'maple') then
        TargetTree := 3;

    This is incorrect and should be changed to a case instead since it is the same type of string you are using in all of the If's. Like this:
    Simba Code:
    // You should also change "Players[*" to be something like "Chopping".
      case Lowercase(Players[CurrentPlayer].Strings[0]) of // Refer to the DeclarePlayers suggestion I gave earlier in the post
        'willow' : TargetTree := 1;
        'maple' : TargetTree := 2;
        'both' : TargetTree := 3; // If I understand this correctly in your line of If's
      end;
    Last edited by RISK; 01-09-2011 at 12:57 PM.

  6. #6
    Join Date
    Nov 2010
    Location
    West Philadelphia, born and raised
    Posts
    522
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    Thanks RISK, I've committed all of those changes you suggested. The if's (or replacement case statement) were actually entirely unnecessary since I found a different way of going about it.

    I've just recently gotten back to school, so my time to work on this will probably be limited. Once I get all of the kinks worked out of it and get the banking straight I'll put this up in the main section.

    EDIT: Latest revision is up. I've added in Color tree finding which (for the moment) is being used instead of Reflection. Eventually I'll add an option to let the user decide which to use.
    Last edited by Tlachtli; 01-21-2011 at 06:29 AM.
    Long ago, the '90s Nicktoons lived together in harmony. Then, everything changed when the century turned. Only Avatar, the best of the 2000's Nicktoons, could save them. But when the channel needed it most, the show finished. Four years passed and Mike and Bryan created the new Avatar: Legend of Korra. And although the show itself is great, it has a long way to go before it can live up to The Last Airbender. But I believe Korra can save Nickelodeon.

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
  •