Results 1 to 5 of 5

Thread: PowerChopper

  1. #1
    Join Date
    Mar 2007
    Location
    Eugene, Oregon
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default PowerChopper

    Simple Power Cutter
    By FuruChan

    Although this script isn't well written, it can be somewhat effect for leveling up a little. I will not be updating this script. I only released it as more of a learning process. I would like as much feed back on Procedures/Functions I can change/add to make future scripts with the same type work better.

    Thanks for the feedback.

    Setup:
    1. Start anywhere there are some trees.
    2. Fill out the setup.
    3. Press play.
    4. Further instructions inside the script.


    Attachment 7068

  2. #2
    Join Date
    Feb 2009
    Location
    Philipines
    Posts
    600
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Instead of this:
    SCAR Code:
    MyTimer:= MyTimer+1;

    Change it to this:
    SCAR Code:
    Inc(MyTimes)

    Because it looks better and it's quicker to type, and if you want to add more than one, do this.
    SCAR Code:
    IncEx(MyTimer, 28);

    I fixed your standards, you can use it if you want.
    Last edited by Dark Arcana; 05-09-2009 at 10:17 AM.

  3. #3
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ummm you could shorten your code by almost half. I dont think you really understand cases (it kinda reminds me of my first powerchopper).

    Instead of doing the case tree of
    willow: same code with color change
    normal: same code with color change
    oak: same as above;

    have a variable called tree color and a variable uptext then do:

    SCAR Code:
    Function ChopTree: Boolean;
    var TreeColor: Integer; UpText: String;
    begin
      case LowerCase(Players[CurrentPlayer].Strings[0]) of
      'normal':
      begin
        TreeColor := 1234567;
        UpText := 'ree';
      end;
      'oak':
      begin
        TreeColor := 9876654321;
        UpText := 'ak';
      end;
      'willow':
      begin
        TreeColor := 1234598876;
        UpText := 'illow';
      end;
      // Now do the chopping procedure but instead of the static numbers input your Variables so like
      FindColorsSpiralTolerance(x, y, tpa, TreeColor {Get it?}, msx1, msy1, msx2, msy2);
      if tpa > 0 then
      begin
        TpaShitdownhere;
        if IsUpText(UpText) then
        Mousethatshit;
      end;
    end;

    I hope you kinda understood that, im kinda in a hurry sorry, pm me if you want more help/ want me to elaborate.
    “Ignorance, the root and the stem of every evil.”

  4. #4
    Join Date
    Mar 2007
    Location
    Eugene, Oregon
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Blumblebee View Post
    ummm you could shorten your code by almost half. I dont think you really understand cases (it kinda reminds me of my first powerchopper).

    Instead of doing the case tree of
    willow: same code with color change
    normal: same code with color change
    oak: same as above;

    have a variable called tree color and a variable uptext then do:

    SCAR Code:
    Function ChopTree: Boolean;
    var TreeColor: Integer; UpText: String;
    begin
      case LowerCase(Players[CurrentPlayer].Strings[0]) of
      'normal':
      begin
        TreeColor := 1234567;
        UpText := 'ree';
      end;
      'oak':
      begin
        TreeColor := 9876654321;
        UpText := 'ak';
      end;
      'willow':
      begin
        TreeColor := 1234598876;
        UpText := 'illow';
      end;
      // Now do the chopping procedure but instead of the static numbers input your Variables so like
      FindColorsSpiralTolerance(x, y, tpa, TreeColor {Get it?}, msx1, msy1, msx2, msy2);
      if tpa > 0 then
      begin
        TpaShitdownhere;
        if IsUpText(UpText) then
        Mousethatshit;
      end;
    end;

    I hope you kinda understood that, im kinda in a hurry sorry, pm me if you want more help/ want me to elaborate.
    Ha that does make a lot more sense. Thank you for explaining it. I didn't even think about that. Basically your saying you use one typed function after stating what each case is?

  5. #5
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by FuruChan View Post
    Ha that does make a lot more sense. Thank you for explaining it. I didn't even think about that. Basically your saying you use one typed function after stating what each case is?
    yes and to make the code look better you can have the variables just globals, and have the function that sets the variables called everytime a new player is logged in. this will cut down your coding by a large amount, making it faster and more effiecient (it doesnt have to read through all that code that it doesnt use).
    “Ignorance, the root and the stem of every evil.”

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
  •