Results 1 to 9 of 9

Thread: My first script(Copper ore miner+banker)

  1. #1
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default TotalMiner(Miner/Banking/Powermining)

    TotalMiner V2.35


    So here is my first script thus far. Kinda crazy looking at the first one, its so bad lol. Hopefully I can keep improving it because I know some things are still wrong with it and it has some bugs, but I think its decent now. I really need to work on my standards because I have stuff everywhere but hopefully it will come in time.

    Features:
    -Mines Tin/Copper from the mine south of lumbridge
    -Option to bank or drop ores
    -Option to use home teleport to bank or walk
    -Option to keep or drop gems
    -Option to mine only tin, only copper, or both
    -Option to use left clicks while mining, right clicks while mining, or both
    -Can set time interval between clicking rock again
    -Failsafes on a lot of things. If you fail most things it will home teleport and try again.

    Instructions:
    -Enter the settings and start the script. The settings are next to their respective choices.

    Currently working on:
    -Make mining ores faster and more accurate. Sometimes it stands there until it times out.
    -Proggy has wrong ore count, need to look at the loops and see whats going on
    -Instead of logging out, will just home teleport as failsafe
    -Improve color finding. Some of the procedures need to be redone because they cannot be found or are barely working.
    -Add more failsafes
    -Some DTMs not releasing, need to find out where
    -Proggy exp sometimes displays crazy number

    Proggies:
    V2.2
    Code:
    //////TotalMiner V2.2//////
    Copper mined: 53
    Tin mined: 48
    Inventories banked: 4
    Running for: 28 minutes.
    /////////////////////////////
    
    //////TotalMiner V2.2//////
    Copper mined: 37
    Tin mined: 34
    Inventories banked: 5
    Running for: 00:31:55
    ///////////////////////////
    ^ With 40ish mining and bronze pick, ore counts are off.

    V2.3
    Code:
    //////TotalMiner V2.3//////
    Copper mined: 193
    Tin mined: 170
    Inventories banked: 13
    Running for: 01:01:42
    ///////////////////////////
    
    //////TotalMiner V2.3//////
    Copper mined: 255
    Tin mined: 213
    Inventories banked: 17
    Running for: 01:21:32
    Exp gained: 8312
    ///////////////////////////
    
    //////TotalMiner V2.3//////
    Copper mined: 665
    Tin mined: 632
    Inventories banked: 48
    Running for: 03:46:04
    Exp gained: -113198842 <--- WTF?
    ///////////////////////////

    Changelog:
    Code:
    v1.0 : Script released (3/22/2012)
    v2.0 : Complete revamp of script. (3/24/2012)
    v2.1 : Improve various methods. Added progress report. (3/25/2012)
    v2.2 : IMPROVE MOAR METHODS. Also added some failsafes. (3/26/2012)
    v2.3 : General stability increased. Fixed some standards issues. Refined some methods. Fixed progress report ore counts. Added antiban while mining. (3/27/2012)
    v2.35 : Changed all failsafes to use home teleport. Should be pretty stable now. (3/27/2012)
    If you happen to find any bugs it should spit out something in the debug box with what went wrong, come and let me know. Thanks and enjoy.
    Last edited by Total; 03-28-2012 at 10:42 PM.

  2. #2
    Join Date
    Mar 2012
    Location
    Canada
    Posts
    870
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Ima review your script if you don't mind :D let me check it

    First let me say this, what I'm about to say might seem harsh to you but really it's not. You are doing good for a first script.

    Standards : I recommand learning those first so you don't learn to script the "bad" way. http://villavu.com/forum/showthread.php?t=60288
    This include variable name, missing semicolon (;) and bad indentation. I'm surprised the code compiles though, I'm used to C++ so when theres a slight mistake nothing work, pascal is more forgiving.

    FreeDTMs
    : When you free your DTM, you use FreeDTM and free them one by one. Instead, you could free them all at once using FreeDTMs.

    Global DTM : You should make your DTM global instead of creating/freeing new one everytime you need it. To free those DTM you should add a procedure that will free them all when the script terminate.
    Simba Code:
    AddOnTerminate('TheNameOfTheProcedureThatFreeDTMHere');
    Simba Code:
    procedure TheNameOfTheProcedureThatFreeDTMHere;
    begin
      try
        // DTMs
        FreeDTMs(q); // This free all DTMs in the array
        FreeDTM(DTM_CopperOre1); // This free a single DTM

      except
        WriteLn('Some memory might have been leaked.');
      end;

    end;

    Theres alot of small stuff that isn't right but it is understanable.
    I suggest you look other script and try to understand what the scripter did simply because that's how I did and it worked for me. Thats how I managed to learn how to script for simba so quickly.
    Basicaly I would take a script, look at it, UNDERSTAND it and modify it to my liking. If you can understand more advanced script, then it means you can make more basic stuff easily. And when you don't understand what is done in a script at some point, go to the tutorial section and try to learn it. Say there is a function that you do not understand called FindTPAObject, you would go search about TPA in the tutorial section. That way, in no time you'll have a good idea of how things work, what are the option do to stuff with simba, and then you can practice with making your own advanced script.
    Last edited by eska; 03-24-2012 at 09:14 AM.
    My scripts:
    Advanced Barb Agility Course(outdated), MonkeyThieverV0.11, MahoganyTableV0.4(outdated)
    Questions? I bet that for 98% of those, you'll find answer HERE

  3. #3
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Go ahead. I'm heading to bed, hope to see some reviews/halp in the morning cuz I know its not very good lol.

  4. #4
    Join Date
    Mar 2012
    Location
    Canada
    Posts
    870
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    I'm gonna go sleep too, you're on the right track.
    My scripts:
    Advanced Barb Agility Course(outdated), MonkeyThieverV0.11, MahoganyTableV0.4(outdated)
    Questions? I bet that for 98% of those, you'll find answer HERE

  5. #5
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Thanks for the constructive feedback. Really appreciate it. I guess I will go look at some other scripts and maybe modify some scripts before I start working on this one again.

  6. #6
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Second version released and I think its considerably better. Still working on some stuff but looking good atm. If anyone looks at the code and has some tips I'd appreciate it.

    EDIT: Sorry for double posting. Didn't realize I had previous post. :S
    Last edited by Total; 03-27-2012 at 01:13 AM.

  7. #7
    Join Date
    Jan 2012
    Posts
    296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your first script, v1.0 is very good for a begginer
    Good work. v1.0 to 2.3, good progress
    Sorry for my bad english, i'm french

  8. #8
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Thanks. Updated, changed all failsafes to just hometeleport and try again.

  9. #9
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Hi. Really great first script, it's pretty awesome .

    I have just one thing that concerns me. Line 178-180 confuses me a little bit, I think you should take a look at what you are trying to do there. I don't know why you have an if then statement, then a function, then a random begin there. Be sure to check that out.

    Other than that, I'll test it as soon as I install my VM.
    Formerly known as Cut em2 it

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
  •