Results 1 to 11 of 11

Thread: Help me with Finding Rocks in my powerminer please

  1. #1
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default Help me with Finding Rocks in my powerminer please

    ok im very confused to be honest, i have made a powerminer script firstly each rock had its own mining procedure, and i was told that it was unnessesary to have 8 procedures that all do the same thing execpt mine a different rock!

    so i change the script and added cases eg...

    Code:
    procedure SetRockColor;
    begin
      Case Rock of //Depending on what the user put for RockType, do one of the following
        'Clay'      : RockColor := ClayColor; //Load the right color into RockColor
        'Tin'       : RockColor := TinColor;
        'Copper'    : RockColor := CopperColor;
        'Iron'      : RockColor := IronColor;
        'Gold'      : RockColor := GoldColor;
        'Mithril'   : RockColor := MithrilColor;
        'AddyColor' : RockColor := AddyColor;
        'RuneColor' : RockColor := RuneColor;
        else
        begin
          WriteLn('Invalid RockType.');
          TerminateScript;
        end;
    and with that i used only one procedure...

    Code:
    procedure Mine;
    begin
    if FindColorSpiralTolerance(x, y, RockColor, 1, 1, 515, 338, 5) then
    begin
    repeat
    wait(100+random(123))
       Mmouse(x,y,3,3)
       wait(50 + random(50));
       if (IsTextAt2(x, y, 'ine', 5) = True) then
       wait(50 + random(50));
       wait(1)
       Mouse(x,y,2,2,True)
       Flag;
       FindNormalRandoms;
       Until(invfull)
       If (invfull) = True Then
       Loads := Loads + 1;
      MinedOres := MinedOres + 28;
    End;
    End;
    (i know this procedure isnt my work but im just learning)

    but now im getting a problem with finding the rocks...

    you see the whole...
    Code:
    'Clay' : RockColor := ClayColor;
    confuses me, now somone said that i should change it to

    Code:
    'Clay' := ClayColor;
    but that wouldnt work because then i would be back to making a different procedure for each rock eg...

    Code:
    procedure Mine;
    begin
    if FindColorSpiralTolerance(x, y, 'Clay', 1, 1, 515, 338, 5) then
    begin
    repeat
    wait(100+random(123))
       Mmouse(x,y,3,3)
       wait(50 + random(50));
       if (IsTextAt2(x, y, 'ine', 5) = True) then
       wait(50 + random(50));
       wait(1)
       Mouse(x,y,2,2,True)
       Flag;
       FindNormalRandoms;
       Until(invfull)
       If (invfull) = True Then
       Loads := Loads + 1;
      MinedOres := MinedOres + 28;
    End;
    End;
    this is confusing me quite abit and ive been looking for help for the last two days... please can somone help me out here and explain this to me.

    thanks a million to everyone who helps me here, i would appreciate it so much.

    HTYA

  2. #2
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    procedure Mine;
    begin
    if FindColorSpiralTolerance(x, y, RockColor, 1, 1, 515, 338, 5) then
    begin
    repeat
    wait(100+random(123))
       Mmouse(x,y,3,3)
       wait(50 + random(50));
       if (IsTextAt2(x, y, 'ine', 5) = True) then
       wait(50 + random(50));
       wait(1)
       Mouse(x,y,2,2,True)
       Flag;
       FindNormalRandoms;
       Until(invfull)
       If (invfull) = True Then
       Loads := Loads + 1;
      MinedOres := MinedOres + 28;
    End;
    End;
    that should work fine if you have
    SCAR Code:
    procedure SetRockColor;
    begin
      Case Rock of //Depending on what the user put for RockType, do one of the following
        'Clay'      : RockColor := ClayColor; //Load the right color into RockColor
        'Tin'       : RockColor := TinColor;
        'Copper'    : RockColor := CopperColor;
        'Iron'      : RockColor := IronColor;
        'Gold'      : RockColor := GoldColor;
        'Mithril'   : RockColor := MithrilColor;
        'AddyColor' : RockColor := AddyColor;
        'RuneColor' : RockColor := RuneColor;
        else
        begin
          WriteLn('Invalid RockType.');
          TerminateScript;
        end;
    before in your main loop.

  3. #3
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    no it still isnt working!

    the mouse just goes over to the top left of the RS screen!

  4. #4
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what kind of rock are you doing? and do you have the part in your script that is like
    SCAR Code:
    const
    claycolor:= 06503475;
    //other colors here
    ?

  5. #5
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    well im trying to use it with iron rocks but ive tried it on clay, copper and tin, but it still doesnt work! and yes

    Procedure Colors;
    Begin
    ClayColor := 6005188;
    TinColor := 9013908;
    CopperColor := 0000000;
    IronColor := 2898528;
    GoldColor := 0000000;
    MithrilColor := 0000000;
    AddyColor := 0000000;
    RuneColor := 0000000;
    End;

  6. #6
    Join Date
    Mar 2006
    Location
    United States, -7:00 GMT
    Posts
    1,790
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Well to find it, you could do many things..

    FindObject
    FindObj3
    FindColorSpiralTolerance

    etc.

    I dunno, experiment.

    hakuna matata ;)

  7. #7
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    change the procedure colors to a const

  8. #8
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    im now getting a error

    Line 23: [Error] (18650:1): Duplicate identifier '' in script C:\Program Files\SCAR 2.03\Scripts\HTYA Powerminer V2.scar

    and the line is ClayColor.

    const
    ClayColor := 6005188;
    TinColor := 9013908;
    CopperColor := 0000000;
    IronColor := 2898528;
    GoldColor := 0000000;
    MithrilColor := 0000000;
    AddyColor := 0000000;
    RuneColor := 0000000;

    i think im just too tired :P
    couldyou help me out here again please

    thanks

  9. #9
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    do you still have the procedure colors aswell as having the const?

  10. #10
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    You use := for variables. For Constants you just use =.

    So you need to change it to look like this...

    Code:
    const
    ClayColor = 6005188;
    TinColor = 9013908;
    CopperColor = 0000000;
    IronColor = 2898528;
    GoldColor = 0000000;
    MithrilColor = 0000000;
    AddyColor = 0000000;
    RuneColor = 0000000;
    And when you set a constant like that, it also declares that constant, so make sure you don't try to declare them as variables too or it will give you an error. In other words, if you have
    Code:
    Var claycolor,IronColor,RuneColor: integer;
    anywhere in your script then you need to delete it.

  11. #11
    Join Date
    Jul 2006
    Posts
    189
    Mentioned
    1 Post(s)
    Quoted
    19 Post(s)

    Default

    ok thankyou man i think you have just solved my problems :P

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. autocolouring rocks
    By R0bby in forum OSR Help
    Replies: 13
    Last Post: 12-04-2007, 01:38 AM
  2. Need help fiixing Pwnaz0r's Powerminer gas finding
    By Danteliciouz in forum OSR Help
    Replies: 7
    Last Post: 10-22-2007, 02:51 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
  •