Results 1 to 4 of 4

Thread: Ok, first script in a while - troubleshooting?

  1. #1
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Ok, first script in a while - troubleshooting?

    Alright, I'm starting my first script I've made in many months, and am trying to get RadialWalk to work. I know it's probably NOT the walker of choice, but I want to know it just in case. I'm switching it out for something else later.

    The script is an Al Kharid Smelter. For now, I'm using a constant color, even though I know it is NOT advisable. This is because I'm not to good at autocolor yet, and the FindSandColor doesn't seem to want to work.

    SCAR Code:
    program AlKharidSmelter;
    {.include srl/srl.scar}

    Var
    x, y : integer;

    Procedure Walk;
    begin
    If FindSymbol(x, y, 'Furnace') Then
    begin
    mouse(x, y, 2, 2, true);
    end else
    If RadialWalk(FindSandColor , 108, 120, 72, -2, 1) Then
    begin
    FindSymbol(x, y, 'Furnace');
    mouse(x, y, 2, 2, true);
    end else
    WriteLn('Could not find Sand Color, nor was the Furnace symbol visible!');
    end;

    begin
    ActivateClient;
    Setupsrl;
    Walk;
    end.

    Ok, I switched it around a bit, and I've tried to use some if...then...else clauses, and they seem to work. The only problem? It ALWAYS returns false to finding the sand color :/. It will walk to the Furnace symbol if it's visible though.

    ~Sandstorm

  2. #2
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You said it, FindSandColor wont work for you i guess.. i havn't tried it myself.. So you will either have to do something like this

    SCAR Code:
    SandColor := 12345;
      RadialWalk(SandColor//...
    and set the color every time, or devise some method to find the color ie. autocolor...
    ~ Metagen

  3. #3
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm no good at autocolor, but I'll delve in the art of it at some point later. Anyways, here's an updated version of my script, I got the smelting part (starts to smelt the bars) working, I think.

    SCAR Code:
    program AlKharidSmelter;
    {.include srl/srl.scar}

    Var
    x, y: integer;

    Procedure Walk;
    begin
    If FindSymbol(x, y, 'Furnace') Then
    begin
    mouse(x, y, 2, 2, true);
    end else
    If RadialWalk(6134947 , 26, 37, 72, -2, 1) Then
    begin
    If FindSymbol(x, y, 'Furnace') Then
    begin
    mouse(x, y, 2, 2, true);
    end else
    RadialWalk( 6657713 , 345, 355, 38, -2, 1);
    end else
    WriteLn('Could not find Sand Color, nor was the Furnace symbol visible!');
    end;

    Procedure OpenWithdraw;
    Begin
    OpenBankFast('akb')
    End;

    Procedure SmeltBars;
    Var
     BarSmelt, Furnace : Integer;
    Begin
    BarSmelt := DTMFromString('78DA639CC5C0C0309391011904F9F830B0026' +
           '990E87F20609C03644CC254C3005503A6270189F9A86ACC8C8C50' +
           'D52CC1B42B25361655CD6C20B108BF39003FB30E43');
    Furnace := DTMFromString('78DA633CC7C0C0309D010598191931F003694' +
           '620FE0F048CAF808C7254355AEAEA609A11CA67DC03240A50D5D8' +
           '5A5AA2AAD90024B6A2AA7173724455F314481CC3740FB21A00293' +
           '20E3C');
    If Finddtm(Furnace,x, y, MSX1, MSY1, MSX2, MSY2) Then
    Begin
    Mmouse(x, y, 3, 3);
    Wait(250 + random(500));
    If IsUpText('melt') Then
    Begin
    Wait(250 + random(500));
    Mouse(x, y, 0, 0, true);
    If Finddtm(BarSmelt,x, y, MCX1, MCY1, MCX2, MCY2) then
    Mmouse(x, y, 3, 3);
    If IsUpText('melt') Then
    Begin
    Mouse(x, y, 0, 0, false);
    ChooseOption('melt X');
    Wait(1000);
    TypeSend('28');
    FreeDtm(BarSmelt);
    FreeDtm(Furnace);
    End;
    End;
    End;
    End;

    begin
    ActivateClient;
    Wait(1000);
    Setupsrl;
    SmeltBars;
    end.

  4. #4
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Take a look at B2C's Radial thing. It has tolerance, while RadialWalk from SRL does not.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Not In Loop - Need Help TroubleShooting
    By kissdemon in forum OSR Help
    Replies: 11
    Last Post: 09-11-2007, 01:50 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
  •