Results 1 to 22 of 22

Thread: My First Script - Power Miner

  1. #1
    Join Date
    Feb 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default My First Script - Power Miner (Now a Working Version!)

    This script does not have alot, but its my first script, and its geting better.
    if you have any good Tut's that could help me, post them and ill have alook at them, or if you ahve any idea's on what i could do to make it better.

    Thank You.
    -ShadowRecon

    New features:
    * S.M.A.R.T ADDED
    * added anti-ban
    * added anti-random

    There not of the greatest quality, but its geting better.

    The script worked fine on Scar 3.14, Rev 13.

  2. #2
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    here's something i did for you: i added standards and suggestions. you're on the right way, but you still have some way to go. you'll need to learn about failsafes, antiban, antirandoms, multiplayer, etc.

    SCAR Code:
    {///.-Shady-Shadows Power Miner-. //
    By
    ShadowRecon
    Edited By
    Matlott
    Credits
    Thanks To Malott For Help
    TuT Iland

    What it does
    * power mines any ore you set to mine

    What it does not do
    * Does not have anti-randoms (sorry, ill try to add this later)

    My First Script!

    }

    program ShadowPwrMnr;
    {.include SRL/SRL.scar}

    var
      i,x,y,m: Integer;

    const
      RockColor = 000000;//Change to the color of the rock you wish to mine.
                  //the color cannot between ' ' orthise scar will think it's a word
    begin
      if (not(LoggedIn)) then Exit;
      i:= 0;
      repeat
        if invfull then  //here you could use DropAll; //but be carefull because the pickaxe
        begin            //might be in your hand, so you could use
          for m := 1 to 28 do   //DropTo(2, 28); (starts at spot 2, stops at spot 28)
            DropItem(m);
        end;
        if (FindColor(x,y,RockColor,4,4,514,337)) then  //go learn about: FindColorTolerance,
        begin                                           // Findbj, FindObjCustom
          mmouse(x,y,1,1)
          Wait(100); //here would be usefull to check for uptext, to be sure it's a rock
          {
          if IsUpTextMulti('ine rock', 'Mine', 'rock') then
          }

          mouse(x,y,0,0,true); //
          Break; //this will actually break the repeat, not the if
          i:=0; //this shouldn't be here, this will mine until InvFull and then Drop it all, forever
                // so there's no use for this " i "
          wait(2000+random(500))
        end else
          i:=i+1;//this shouldn't be here, this will mine until InvFull and then Drop it all, forever
                // so there's no use for this " i ",
          wait(1000);
      until(i=28);
    end.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  3. #3
    Join Date
    Feb 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks. do you have any good tut on how to use anti-randoms on scripts?

  4. #4
    Join Date
    Apr 2007
    Location
    Los Angeles
    Posts
    622
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    its a great script for the first mate, once u learn how to get anti-randoms and anti-ban in there ull be a great scripter. Good luck!!

  5. #5
    Join Date
    Feb 2008
    Posts
    73
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is a great script, you have talent, May I ask how much time you put into this?

  6. #6
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    JAD's tut

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  7. #7
    Join Date
    Feb 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    umm well i just started about a week ago. i put alot more time into Tut. than anything else. only took about an hour or so to write this script. its really pretty basic. lol. thanks.

  8. #8
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    What was the original SCAR and SRL that you used.

    Btw, its not a good idea to double post, it could get your post count back down to 0, use the edit button.

    EDIT: I just realised you did a triple post, ahhh!!!!

  9. #9
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok... i uhh know why your script doesnt work.... (YOU HAVE NO MAIN LOOP xD) i would fix for you but idk how you want your loop set up...
    but ill fix your droping procedure to drop all if there isnt a axe or drop all but the axe
    Edit: idk if im allowed to do this but i fixed pretty much your entire script for you, its not 100% fool proof becuase i only spent bout 30 minuets looking it over, but its decent. (to a mod or member, if i wasnt suppost to do that im sorry ) but yeah heres you "working" script, gj on your first script btw
    SCAR Code:
    {///.-Shady-Shadows Power Miner-. //
    By-
    ShadowRecon
    Edited By-
    Matlott, Rasta Magician, and Mikevskater
    Credits-
    Thanks To Malott For Help
    TuT Iland

    What it does
    * power mines any ore you set to mine

    What it needs work on
    * Anti-Ban isnt the greatest, but its better than none.
    * Anti-Random isnt the greatest either, but better than none.

    My First Script!

    INSTRUCTIONS:
    Use the eye droper to pick color of rock, then if pick is weilded change
    line 127 to (1 to 28) or the autoer will drop pick-axe. HAVE FUN!

    }


    program ShadowPwrMnr;
    {.include SRL/SRL.scar}

    var
    i,x,y,m,Axe: Integer;
    axetype: String;

    const
    RockColor = 5077158;//Change to the Color of the Rock
    TypeOfPick = 'Bronze';//Bronze, Iron, Steel, Mithril, Adamant, and Rune are valid types



    //////////////////////////////DONT NOT EDIT BELOW!/////////////////////////////
    procedure DeclarePlayers;
    begin
      SRLID := '';       //enter or script will terminate
      SRLPassword := ''; //register at srl please if dont have one of these!
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name   := '';//Enter username
      Players[0].Pass   := '';//Enter password
      Players[0].Nick   := '';    //Enter nickname
      Players[0].Active := True;
    end;
    ///////////////////////////////////////////////////////////////////////////////
    procedure AntiBan;
    begin
      if(not(LoggedIn))then
      Exit;
      case Random(12) of
        0: begin
             HoverSkill('Mining', false);
             wait(2000+random(1000));
             GameTab(4);
           end;


        4: PickUpMouse;

        6: begin
             GameTab(1 + Random(12));
             wait(1000+random(1000));
             GameTab(4);
           end;

        8: begin
             case random(6) of
               0: TypeSend('mining lvls?');
               2: TypeSend('combat levels');
               4: TypeSend('range levels');
             end;
           end;

        10: MouseBox(MSX1,MMY1,MMX2,MMY2,3);
      end;
    end;

    ///////////////////////////////////////////////////////////////////////////

    procedure FindRandoms;
    begin
      FindNormalRandoms;
      If findfight then
         RunAway('N', True, 1, 9000+random(1000));
    end;


    ///////////////////////////////////////////////////////////////////////////

    procedure SetupAxeDtm;
    begin
      Axe := DTMFromString('78DA63B463626078C280020C15D9C0342394C' +
           'F680354F398010D30A2AA3107AA7947408D1550CD47026A5C806A' +
           'EE1150130054F390801A67A09A6B04D49802D5DCC2AF060011CB0' +
           '98C');

    end;
    ///////////////////////////////////////////////////////////////////////////
    procedure AutoMining; //By Mikevskater
     var
       ItemPoint: TPoint;
    begin
      if invfull then
        begin
         SetupAxeDtm;
         if FindDTM(Axe, x, y, MIX1, MIY1, MIX2, MIX2) then //This will look for pick
         begin                                              //then drop rest
           for m := 1 to 28 do
           ItemPoint := ItemCoords(m);
           MMouse(ItemPoint.x, ItemPoint.y, 5, 5);
           wait(500 + random(250))
           if not(IsUpText(AxeType)) then
             DropItem(m);
         end else
           DropAll;
         FreeDTM(Axe);
        end;
      if (FindColor(x,y,RockColor,4,4,514,337)) then
        begin
         FindRandoms;
         mmouse(x,y,1,1)
         Wait(100);
         if IsUpTextMulti('ine rock', 'Mine', 'rock') then
           mouse(x,y,1,1,true);
           wait(3000+random(500))
      end else
         wait(2000);
    end;
    /////////////////////////////////////////////////////////////////
    procedure setupAxe;
    begin
      case Lowercase(TypeOfPick) of
             'bronze': begin
                         axetype := 'ronze pickaxe'
                       end;
             'iron': begin
                       axetype := 'ron pickaxe'
                     end;
             'steel': begin
                        axetype := 'teel pickaxe'
                      end;
             'mithril': begin
                         axetype := 'ithril pickaxe'
                       end;
             'adamant': begin
                          axetype := 'damant pickaxe'
                        end;
             'rune': begin
                       axetype := 'une pickaxe'
                     end;
      end;
    end;
    /////////////////////////////////////////////////////////////////
    begin
     setupsrl;
     DeclarePlayers;
     SetupAxe;
     ActivateClient;
     wait(1000);
     if (not(LoggedIn)) then Loginplayer;
     setangle(True);
     MakeCompass('N');
     repeat
       automining;
       antiban
     until(false);
    end.
    If you dont get anything or find something wrong, post or me me and ill be glad to explain, or fix.
    Kindof Inactive...

  10. #10
    Join Date
    Feb 2008
    Posts
    0
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Pretty good one

  11. #11
    Join Date
    Feb 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok thanks. but could someone help me put a main loop on it?

  12. #12
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by shadowrec0n View Post
    ok thanks. but could someone help me put a main loop on it?
    if you look i added one in there for you...
    Kindof Inactive...

  13. #13
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Putting in a mainloop is quite simple, but if you are having trouble then use this tut: http://www.villavu.com/forum/showthread.php?t=18736

  14. #14
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by dude_richard View Post
    Putting in a mainloop is quite simple, but if you are having trouble then use this tut: http://www.villavu.com/forum/showthread.php?t=18736
    thanks richard. i couldnt find a link to a loop tut
    (is what i did wrong? like should i have only fixed one procedure?)
    Kindof Inactive...

  15. #15
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    I hae no idea, I haven't look I was helping him so he could do it on his on, although I found it easier just to loo at other scripts, I just thought it might help if ever needed

  16. #16
    Join Date
    Jan 2008
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    please try and get the anti banning and randoms in
    as fast as possible thankyou

  17. #17
    Join Date
    Feb 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok thanks guys, ive been having alot of computer trouble and avent quite got it all fixed but as soon as i get everything up and running ill be back to scripting.

    off topic-
    I got 3 computers and guess what.. all 3 catch the same virus! im running a small home server i aquired from a friend, and 2 other desktop comp. all the hard drives were completely scewed up so i had to reinstall all th OS's and try to et some files back. its almost complete. =)

  18. #18
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey sorry, i realised something that I screwd up on in the setup axe procedure....
    SCAR Code:
    procedure setupAxe;
    begin
      case Lowercase(TypeOfPick) of
             'bronze': begin
                         axetype := 'ronze pickaxe'
                       end;
             'iron': begin
                       axetype := 'ron pickaxe'
                     end;
             'steel': begin
                        axetype := 'teel pickaxe'
                      end;
             'mithril': begin
                         axetype := 'ithril pickaxe'
                       end;
             'adamant': begin
                          axetype := 'damant pickaxe'
                        end;
             'rune': begin
                       axetype := 'une pickaxe'
                     end;
      end;
    end;
    should be:
    SCAR Code:
    procedure setupAxe;
    begin
      case Lowercase(TypeOfPick) of
             'bronze': axetype := 'ronze pickaxe';
             'iron': axetype := 'ron pickaxe';
             'steel': axetype := 'teel pickaxe';
             'mithril': axetype := 'ithril pickaxe';
             'adamant': axetype := 'damant pickaxe';
             'rune': axetype := 'une pickaxe';
      end;
    end;
    Just making it look better in case you plan on using to apply for membership.
    And also remove the "i" integer because its not used and it just gets annoying.
    Kindof Inactive...

  19. #19
    Join Date
    Feb 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    kk, i updated it. i also added smart to it. =)
    thanks alot. ive learned alot form this simple script. im wokring on a draynor woodcutter atm, i have been testing a few different ones, and i noticed that if thep erson died, it couldnt cut any more. so why not make it so if the person dies, it walks back to drynor from lummy.. or if it can not find the trees it tele's to lummy (usen home) and walk back? radial walking isnt easy tho... if anyone has any good tut that arnt on the forum about radial walking post them.

  20. #20
    Join Date
    Jan 2008
    Location
    Alberta
    Posts
    727
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    stop double/tripple posting. Use the edit button like said before.

    Also i'm pretty sure theres a tut on radialwalk in intermediate(sp?) tut section. I think its stickied. (i know you said on a diff site but i'm not going to search sites...also google would help you here)

    Btw using search button and looking around the tut section would solve your need-a-tut problem.

  21. #21
    Join Date
    Jul 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What does this mean ::

    Line 129: [Error] (12857:4): Unknown identifier 'IsUpTextMulti' in script E:\Documents and Settings\Jesse\Desktop\ShadowPowerMiner(SMART).sca r

  22. #22
    Join Date
    Dec 2007
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SMART, working your way up there..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Power Miner first script
    By dallas574 in forum First Scripts
    Replies: 4
    Last Post: 05-04-2008, 07:53 PM
  2. [SRL 4][First Script] Power Miner by Scapian
    By Runescapian321 in forum First Scripts
    Replies: 54
    Last Post: 03-22-2008, 11:54 PM
  3. corl45's Power miner (2nd script)
    By corl455 in forum First Scripts
    Replies: 31
    Last Post: 01-05-2008, 07:08 AM
  4. The Lords Power Miner (h) First Script (h)
    By The Lord Ahmed in forum RS3 Outdated / Broken Scripts
    Replies: 5
    Last Post: 07-15-2007, 10:40 PM
  5. JADMiner (power miner) my first script!
    By JAD in forum RS3 Outdated / Broken Scripts
    Replies: 17
    Last Post: 04-08-2007, 11:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •