Results 1 to 10 of 10

Thread: autocolor,pls help

  1. #1
    Join Date
    Nov 2006
    Location
    belgium
    Posts
    73
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default autocolor,pls help

    hey i'm updating the autosmelter from x'can.I've updated alot of things but i want autocoloring.If i enter the furnace he needs to open it and wait for menu that shows all bars now he needs to get the color of each bar because those colors are almost on each world different.

    i'll show the if then statement for steel:

    SCAR Code:
    if bar ='steel' then
     begin//1
     InvCount;
      if (not(invCount=27)) then
       begin
        AntiRandoms;
        writeln('going to bank...')
        MakeCompass('W');
        tobank;
        whereami;
       end
      else
     begin//2
      antirandoms;
      begin//3
       LowestAngle;
       repeat
        FindMSColorTol(x,y,furnace,5)
        wait(50+random(10))
        Mouse(x,y,5,8,false)
       until(ClickOption( 'Smelt', 1)=true)
        writeln('found furnace')
        wait(500+random(200))
       AntiRandoms;
     end//3
    //this is the part
      repeat
       wait(500+random(200))
      until(FindColor(x, y, 7369081, 20, 360, 260, 400))
    //7369081 is the color of the middle from the steel bar in the smelting
    //menu now i want to auto that color but can t find a tutorial for it...
    //if you know plz tell me
      Mouse( x, y, 8, 9,false)
      wait(1000+random(500))
      ClickOption('Smelt X',3)
       repeat
        wait(1000+random(500))
       until (FindText(x,y,'Enter amount:',UpChars,MCX1,MCY1,MCX2,MCY2)=true)
      Sendtext('9'+chr(13))
       repeat
        wait(1000+random(200))
        antirandoms;
        CountItemBmpTol(Steel, 20);
       until(CountItemBmpTol(Steel, 20)=9)
      writeln('all 9 bars are smelted')
     end//2
    end;//1

  2. #2
    Join Date
    Jul 2006
    Location
    NY
    Posts
    371
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Use the procedure
    SCAR Code:
    GetColor(x, y)
    You can sue it like this.
    NOTE: First state the word your going to be using as an integer. Im using the word SteelBar.
    SCAR Code:
    var
     SteelBar: integer;

    procedure autoc;
    begin
     Steelbar := GetColor(x, y);
     //x, y = the cords where you want it to pick the color
    end;

  3. #3
    Join Date
    Nov 2006
    Location
    belgium
    Posts
    73
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    k,thanks for the reply will add a new procedure I knew it was something whit getcolor( x, y)but didn't know how i could place that color to the bar i was making

    SCAR Code:
    procedure GetColors;
    begin
     if Players[CurrentPlayer].loc='furn' then
      begin//need to open furnace
       writeln('going to open furnace')
        repeat//opens furnace
         LowestAngle;
         FindMSColorTol(x,y,furnace,5)
         wait(50+random(10))
         Mouse(x,y,5,8,false)
        until(ClickOption( 'Smelt', 1)=true)
        wait(3500+random(500))//waits until found the smelting menu
        MMouse(255,405,0,0)
       SteelC := GetColor(x,y);//this should pick the color,doesn't work
      end
     
    //if Players[CurrentPlayer].Loc='bank' then
    //  begin

    //  end
     
    end;
    i'm off now going to sleep

  4. #4
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    You need to actually enter the coords of where you want to get the color. Like
    SCAR Code:
    program New;

    begin
    GetColor(200,300);
    end.

    that would get the color of whatever is at those coords


  5. #5
    Join Date
    Nov 2006
    Location
    belgium
    Posts
    73
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hmm srr guys i stil don't get it plz explain it wel GetColor(x,y);gets a color at the x,y coords,but i need to use that color!

    SCAR Code:
    repeat//this waits until he finds the color of the bar in the menu
              wait(500+random(200))
             until(FindColor(x, y, SteelC, 20, 360, 260, 400))

    SteelC needs to be the color that GetColor(x,y); returns but how can i add that color to SteelC.i tried this before whit the following:

    SCAR Code:
    SteelC= GetColor(255,405);

    plz someone work this out for me or just give an example of how to do it...

  6. #6
    Join Date
    Jul 2006
    Location
    NY
    Posts
    371
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So are those the exact cords of where to pick the color?
    That would be correct. But you missed a assignment, its supposed to be exactly like this:
    SCAR Code:
    SteelC := GetColor(255, 405);
    That would work, it will store the color it picks at the cords 255, 405. And make sure you pick that color before the waiting procedure, and make sure the cords to look for the color are correct, or else it will never wait.
    SCAR Code:
    while not (FindColor(x, y, SteelC, 20, 360, 260, 400)) do
      Wait(500 + Random(200));
    Or you can do your waiting procedure that you pasted above, both work the same.

  7. #7
    Join Date
    Nov 2006
    Location
    belgium
    Posts
    73
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok still doesn't work I really don't know what i'm doing wrong.If I use the following procedure:
    SCAR Code:
    procedure GetColors;
    begin
     if Players[CurrentPlayer].loc='furn' then
      begin//need to open furnace
       writeln('going to open furnace')
        repeat//opens furnace
         LowestAngle;
         FindMSColorTol(x,y,furnace,5)
         wait(50+random(10))
         Mouse(x,y,5,8,false)
        until(ClickOption( 'Smelt', 1)=true)
        wait(3500+random(500))//waits until found the smelting menu
        MMouse(255,405,0,0)
       SteelC:= GetColor(255,405);//this should pick the color,doesn't work
      end
     
    //if Players[CurrentPlayer].Loc='bank' then
    //  begin

    //  end
     
    end;

    then i want to use SteelC because SteelC should be the color:
    SCAR Code:
    repeat
       wait(500+random(200))
      until(FindColor(x, y, SteelC, 20, 360, 260, 400))
    this waits until he found the smelting menu if it really doesn't work i will try something else...But i really wanne now how to autocolor

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

    Default

    this is what i did in mine(based off of wizzys pm modded by me)
    SCAR Code:
    Const
      BronzeColor       = 2902109;
      IronColor         = 6119013;
      SilverColor       = 11971242;
      SteelColor        = 9013650;
      GoldColor         = 1880792;
      MithrilColor      = 7491150;
      AdamantColor      = 5400146;
      RuniteColor       = 8023891;

    Procedure SetColor;
    Begin
      Case LowerCase(Players[CurrentPlayer].String1) Of
        'bronze' :  BarColor:=BronzeColor;
        'iron'   :  BarColor:=IronColor;
        'steel'  :  BarColor:=SteelColor;
        'silver' :  BarColor:=SilverColor;
        'gold'   :  BarColor:=GoldColor;
        'mith'   :  BarColor:=MithrilColor;
        'addy'   :  BarColor:=AdamantColor;
        'rune'   :  BarColor:=RuniteColor;
     End;
    End;


    Procedure AutoGetBarColors;

    Begin
      WriteLn('AutoColor:');

      If FindColor(X, Y, BarColor, MCX1, MCY1, MCX2, MCY2) Then
        BarColor := GetColor(X, Y);

      WriteLn(Players[CurrentPlayer].String1+' color = '+IntToStr(BarColor));

    End;
    the problem with that is you have to add
    SCAR Code:
    Players[0].String1 :='addy';
    to your declare players part.

  9. #9
    Join Date
    Nov 2006
    Location
    belgium
    Posts
    73
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    k thanks xcan I've added this to the script:


    SCAR Code:
    const
    BronzeC       =2309198;//color of the bronze bar in the smelting menu
    IronC         =5000275;//color of the iron bar in the smelting menu
    SteelC        =7171702;//color of the steel bar in the smelting menu
    MithC         =6177087;//color of the mithril bar in the smelting menu
    AddyC         =4346690;//color of the addy bar in the smelting menu

    and then i use the followinf to wait until the smelting menu popsup:

    SCAR Code:
    repeat
      wait(500+random(200))
    until(FindColorTolerance( x, y, SteelC, 30, 383, 495, 435, 15)=true);

    this works for all bars now changd the world a few times and it did it,i'm glad it works now i only want a better openbanking procedure i tried to make a dtm for it but he never finds it

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

    Default

    your making a dtm of the yellow dots? if so use FindRotatedDtm. thats what i use in my new script and it works great. also you should have it so if it cant find the bitmap it should look for the symbol and then look for the bitmap then.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Doesn't AutoColor
    By BKNYKavkaz in forum OSR Help
    Replies: 5
    Last Post: 04-26-2008, 10:31 AM
  2. Help AUTOCOLOR???
    By papenco in forum OSR Help
    Replies: 0
    Last Post: 12-06-2007, 06:27 AM

Posting Permissions

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