Page 1 of 2 12 LastLast
Results 1 to 25 of 46

Thread: I need some quick help

  1. #1
    Join Date
    Dec 2007
    Location
    Florida... it sucks.
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default I need some quick help... again

    Alright, so I'm having some problems making an auto smelter... I'm currently trying to make it withdraw the ores from the bank for steel bars, and it withdraws the iron correctly, but it just stops afterwards. Any ideas, or other ways to do it?
    SCAR Code:
    program Smelting;
    var
    x,y: Integer;

    const
    CoalColor = 2570553;
    IronColor = 2371405;
    begin
    if(FindColor(x,y,IronColor,0,0,515,334)) then
     begin
      Wait(500+random(25));
      MoveMouseSmoothEx(x+random(5),y+random(3),20,40,45,25,20);
      Wait(100+random(10));
      ClickMouse(x,y,false);
      Wait(200+random(20));
      MoveMouseSmoothEx(317,283,20,40,45,25,20);
      Wait(150+random(15));
      ClickMouse(317,280,True);
    end;
    if(FindColor(x,y,CoalColor,0,0,515,334)) then
     begin
      MoveMouseSmoothEx(x+random(5),y+random(3),20,40,45,25,20);
      Wait(100+random(10));
      ClickMouse(x,y,false);
      Wait(200+random(20));
      MoveMouseSmoothEx(392,286,20,40,45,25,20);
      Wait(150+random(15));
      ClickMouse(392,283,True);
    end;
    End.

  2. #2
    Join Date
    Jun 2007
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    First of all, I would suggest using DTMs instead of color finding.

    And OF COURSE use srl commands.

    MoveMouseSmooth, ClickMouse, ect. will get you banned.


    And instead of if's Just have it RIGHT click the DTM of the coal/iron and choose the option ( ChooseOption('draw x') ) withdraw x, have it typesend the amount you need, and do the same for the other ore.


    hoped this helped.

  3. #3
    Join Date
    Dec 2007
    Location
    Florida... it sucks.
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    And instead of if's Just have it RIGHT click the DTM of the coal/iron and choose the option ( ChooseOption('draw x') ) withdraw x, have it typesend the amount you need, and do the same for the other ore.
    How exactly do I use those? I made the DTM and it works pretty good, so now I guess I'm stuck until I figure this out...

  4. #4
    Join Date
    Jul 2007
    Location
    St. Louis, Missouri, USA.
    Posts
    575
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    if FindDTM(Ore, x, y, MSX1, MSY1, MMX2, MMY2) then
    begin
      Mouse(x, y, 3, 3, False);
      ChooseOption('draw x');
      TypeSend('28');
    end;

    That'll search the mainscreen for a dtm of the ore, and withdraw 28 of the ore. You could also use a ChooseOption('draw all') to withdraw all of them, or you could change the 28 to however many you want to withdraw.
    -You can call me Mick-



  5. #5
    Join Date
    Dec 2007
    Location
    Florida... it sucks.
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OK, I tried that, but it says 'Mouse' is an unknown identifier. So If I change it a 'Clickmouse' with the correct format, it goes on to say that ChooseOption is an unknown identifier. Was there something else I was supposed to do?

  6. #6
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    //^NEED THIS LINE

    begin
      //stuff here
    end.

    Just forgot to include SRL. Don't use clickmouse because it's too detectable. Mouse will work fine after including SRL as will ChooseOption.
    Temporarily inactive.

  7. #7
    Join Date
    Dec 2007
    Location
    Florida... it sucks.
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, thanks a bunch, but one more thing. The mouse moves incredibly slow, probably about snail speed. What else could I have done wrong??

  8. #8
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You need to add SetupSRL; before you use any procedures or functions listed in SRL. It's usually one of the first lines in a script, if not THE first.
    Temporarily inactive.

  9. #9
    Join Date
    Dec 2007
    Location
    Florida... it sucks.
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, thanks... but that leads to another problem. First, its not really messing up anything, but it says the script is trying to access chatlog.txt, which is in the SCAR directory, and it asks for permission. So I just click the radio button for always permit, but it still comes up if I do it again. The other thing is that when it goes over to the iron, it goes ahead and right clicks it, then it jumps over to where my gold is. Do I need my Iron to be in a certain slot for the withdraw command to work properly?

  10. #10
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    @Your access problem:
    Go to Tools > Options > Filewall settings. Check it to Allow All.

    @Your withdrawal problem:
    Could you repost your script, since I assume it's somewhat updated from the original you posted?
    Temporarily inactive.

  11. #11
    Join Date
    Dec 2007
    Location
    Florida... it sucks.
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program Smelt;
    {.include SRL/SRL.scar}
    var
       x, y: Integer;
       Iron: Integer;
       
    begin
    SetupSRL;
      Iron := DTMFromString('78DA631462606010604001EEDA8A0CBF80342' +
           '310FF0702466920439C010D302291405A0148701250230A249809' +
           'A86127C21C26202148400D37909020428D0C01354244A8E125EC2' +
           'F0034EB06E7');
      if FindDTM(Iron, x, y, 0, 0, 515, 334) then
       begin
       Mouse(x, y, 3, 3, False);
      ChooseOption('draw x');
      TypeSend('10');
    end;
    end.

    That's what I've got right now.

  12. #12
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok it looks fine, but you should put some waits in there. The mouse won't instantly right click. Also, the "Enter amount" box won't instantly appear either. It's probably typing the 10 in and then just moving on before the "Enter amount" box has a chance to show up.

    So just add some short waits between the Mouse, ChooseOption, and TypeSend. Also, you might want to make it check for UpText to make sure it found iron and not coal or something similar.
    Temporarily inactive.

  13. #13
    Join Date
    Dec 2007
    Location
    Florida... it sucks.
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thats not really the problem. It right clicks on the iron, then goes straight to my gold, then types 10 and sends it through public chat...

  14. #14
    Join Date
    Jul 2007
    Location
    St. Louis, Missouri, USA.
    Posts
    575
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You need a wait between the mouse and chooseoption.

    Should have included that earlier, sorry. Its because SCAR processes it too fast and it doesn't see the option to choose so you have to add a wait. Do something like Wait(100 + Random(200)) between those two. If it still skips it, increase the 100 to 200 etc.

    Edit: Just listen to ducels. Put waits between anything that needs it (Mouse/ChooseOption/TypeSend)
    -You can call me Mick-



  15. #15
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's easier if you post the whole script so we can see why it might be just going straight onto the gold.

    All that I can think of from this is simply what I've said. Since you have no failsafes, it's totally possible for it to have gone straight through that code returning false for everything and just go pick the gold since it's going too fast.

    Edit: If you want to check to make sure it's finding the option, change your code to:
    SCAR Code:
    program Smelt;
    {.include SRL/SRL.scar}
    var
       x, y: Integer;
       Iron: Integer;
       
    begin
    SetupSRL;
      Iron := DTMFromString('78DA631462606010604001EEDA8A0CBF80342' +
           '310FF0702466920439C010D302291405A0148701250230A249809' +
           'A86127C21C26202148400D37909020428D0C01354244A8E125EC2' +
           'F0034EB06E7');
      if FindDTM(Iron, x, y, 0, 0, 515, 334) then
      begin
        Mouse(x, y, 3, 3, False);
        wait(100);
        if not ChooseOption('draw x') then writeln('Withdraw X not found.');
        wait(100);
        TypeSend('10');
      end;
    end.
    Temporarily inactive.

  16. #16
    Join Date
    Dec 2007
    Location
    Florida... it sucks.
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That is the entire script that I have so far. I'm just working on trying to get it to get the ores out of the bank. I added a wait in between mouse and chooseoption and chooseoption and typesend. I'll try making them larger to see if that fixes it, but i don't think thats it...

    Edit: Nah, it just waits longer to go to the gold. What kind of failsafes are you talking about? I just saw your edit, and aparrently, its not finding withdraw X.

  17. #17
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Did you use the "if not... then" statement which I added around your ChooseOption? Since ChooseOption returns a boolean, you can use it to check whether or not the option was found. With what I wrote, if it doesn't find the option it'll tell you in the debug box.

    That's what I meant by a failsafe. It will tell you via a boolean (or the debug box if you use the one I wrote) whether or not it worked. This is frequently used to keep scripts from running an excess amount of time while they're logged out or in an unsolvable random.
    Temporarily inactive.

  18. #18
    Join Date
    Dec 2007
    Location
    Florida... it sucks.
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah, I put it in exactly like you said.
    SCAR Code:
    program Smelt;
    {.include SRL/SRL.scar}
    var
       x, y: Integer;
       Iron: Integer;
       
    begin
    SetupSRL;
      Iron := DTMFromString('78DA631462606010604001EEDA8A0CBF80342' +
           '310FF0702466920439C010D302291405A0148701250230A249809' +
           'A86127C21C26202148400D37909020428D0C01354244A8E125EC2' +
           'F0034EB06E7');
      if FindDTM(Iron, x, y, 0, 0, 515, 334) then
       begin
       Mouse(x, y, 3, 3, False);
       Wait(400+random(1000))
       if not ChooseOption('draw x') then writeln('Withdraw X not found.');
       Wait(500+Random(1000))
       TypeSend('10');
    end;
    end.
    Right?

  19. #19
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, that's right.

    It's not writing anything in? Because that would mean it's finding the option but not clicking it... which is very strange.
    Temporarily inactive.

  20. #20
    Join Date
    Dec 2007
    Location
    Florida... it sucks.
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No its writing "Withdraw X not found"... I said that, right? Maybe not....

  21. #21
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Change "draw x" to "draw X".

    Makes all the difference for me.

    And since it's not really missing the option, just looking for the wrong one, you can greatly reduce the wait()s to something like 50 + random(50) or something small like that.
    Temporarily inactive.

  22. #22
    Join Date
    Dec 2007
    Location
    Florida... it sucks.
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    *sigh* Why must it be so picky. Well thanks for your help, because I never would have thought it was something so simple as an uncapitalized letter.

    Well, I knew something else would go wrong... as I'm attempting to get the script to withdraw coal, it gives me the error
    "Failed when compiling
    [Error] (14716:4): Identifier expected"
    Heres the updated script:
    SCAR Code:
    program Smelt;
    {.include SRL/SRL.scar}
    var
       x, y: Integer;
       Iron: Integer;
       Coal: Integer;
       
    begin
    SetupSRL;
      Iron := DTMFromString('78DA631462606010604001EEDA8A0CBF80342' +
           '310FF0702466920439C010D302291405A0148701250230A249809' +
           'A86127C21C26202148400D37909020428D0C01354244A8E125EC2' +
           'F0034EB06E7');
      if FindDTM(Iron, x, y, 0, 0, 515, 334) then
       begin
       Mouse(x, y, 3, 3, False);
       Wait(400+random(1000))
       if not ChooseOption('draw X') then writeln('Withdraw X not found.');
       Wait(500+Random(1000))
       TypeSend('9');

      Coal :=DTMFromString('78DA6314606060E0634001FA7AF20CBF80342' +
           '310FF07024651208389010D302291409A870835AC408283801A90' +
           '19BC44A81127A0461048481150230924C408A89107129C04D4C80' +
           '00956026AA481043F01355C40421ABF1A00C31D0700');
      if FindDTM(Coal, x, y, 0, 0, 515, 334) then
       begin
       Mouse(x, y, 3, 3, False);
       Wait(400+random(1000))
       if not ChooseOption('draw X') then writeln('Withdraw X not found.');
       Wait(500+random(1000))
       Typesend('18');

    end;
    end.
    As you can tell I did some intricate work... such as copying and pasting. lol, wlle in any case it doesn't work... and I don't understand the error.

  23. #23
    Join Date
    Dec 2007
    Location
    Florida... it sucks.
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    bump... sorry, I didn't want my post to die....

  24. #24
    Join Date
    Jul 2007
    Location
    St. Louis, Missouri, USA.
    Posts
    575
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You were missing an end. You should search up on some standards, yours weren't too horrible but I standardized it for you.

    SCAR Code:
    program Smelt;
    {.include SRL/SRL.scar}
    var
       x, y: Integer;
       Iron: Integer;
       Coal: Integer;

    begin
      SetupSRL;
      Iron := DTMFromString('78DA631462606010604001EEDA8A0CBF80342' +
           '310FF0702466920439C010D302291405A0148701250230A249809' +
           'A86127C21C26202148400D37909020428D0C01354244A8E125EC2' +
           'F0034EB06E7');
      if FindDTM(Iron, x, y, 0, 0, 515, 334) then
      begin
        Mouse(x, y, 3, 3, False);
        Wait(400+random(1000))
        if not ChooseOption('draw X') then writeln('Withdraw X not found.');
        Wait(500+Random(1000))
        TypeSend('9');
      end;
      Coal :=DTMFromString('78DA6314606060E0634001FA7AF20CBF80342' +
           '310FF07024651208389010D302291409A870835AC408283801A90' +
           '19BC44A81127A0461048481150230924C408A89107129C04D4C80' +
           '00956026AA481043F01355C40421ABF1A00C31D0700');
      if FindDTM(Coal, x, y, 0, 0, 515, 334) then
      begin
        Mouse(x, y, 3, 3, False);
        Wait(400+random(1000))
        if not ChooseOption('draw X') then writeln('Withdraw X not found.');
        Wait(500+random(1000))
        Typesend('18');
      end;
    end.

    Also, for your:

    SCAR Code:
    if not ChooseOption then WriteLn('Withdraw X not found')

    it will still type 18 into the mainchat and send it.

    You could do something like:
    SCAR Code:
    if ChooseOption('draw X') then
    begin
      Wait(500 + Random(1000));
      TypeSend('18');
    end else WriteLn('Withdraw X not found');
    That will type 18 and press enter if you find choose the option, otherwise it'll write the line.
    -You can call me Mick-



  25. #25
    Join Date
    Dec 2007
    Location
    Florida... it sucks.
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright... I hope its not a really stupid mistake...

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Just a quick question? Did I say quick?
    By SeanJohn in forum OSR Help
    Replies: 3
    Last Post: 01-28-2009, 12:03 AM
  2. I need some quick help
    By Timothegreat in forum OSR Help
    Replies: 6
    Last Post: 05-30-2007, 09:33 PM
  3. quick ? plz
    By rjbk1989 in forum OSR Help
    Replies: 3
    Last Post: 05-07-2007, 12:43 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
  •