Results 1 to 6 of 6

Thread: need help autofisher...Type mismatch in script

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

    Default need help autofisher...Type mismatch in script

    ok i'm creating an autofisher +cooker for barabarian village.I made A procedure called ChopDown;

    SCAR Code:
    procedure ChopDown;
    begin
     Mouse(628, 148, 5, 5,true)//i'm gonna change this to a DTM i think it just clicks to the tree on the MM
     Flag;
     FFlag(0);
      repeat
       if(ScanForObjectMulti(x, y, 644, 82, 5077104, 1515552, 1515552, 15, 'Tree'))then
        begin
         Mouse(x,y,2,2,false);
         writeln('found the tree');
          repeat
           wait(250+random(10));
           PopUp('Chop');
          until(PopUp('Chop'))
         writeln('chopped down the tree')
         wait(500+random(300));
         ExistsItem('Logs');//this should check the inventory for logs
        end;
      until(ExistsItem('Logs'));//if we have logs he may start fishing
     writeln('we have some logs :p')
     wait(2500+random(700));
    end;

    now I've seen that there is a prob whit theExistsItem('Logs');does someone know what i could use to check the inventory for logs i tried alot of things but...I just can't think any more functions I looked into the srl include inventory.scar.Plz help me on this!

  2. #2
    Join Date
    Dec 2006
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ExistsItem is a function, so it returns a value, either true if it finds 'Logs', or false if it does not. Because of this, you can't just put it on it's own. Basically, all you have to change is to get rid of the line ExistsItem('Logs'); , because it doesn't do anything.

  3. #3
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    function findlogsininv( logname : string ) : boolean;
    var
      InvSpot : integer;
    begin
    InvSpot := 0;
    repeat
      InvSpot := InvSpot + 1;
      MMouseItem(InvSpot);
      If(IsUpText(LogName))then
        begin
          result := true;
          exit;
        end;
    until(InvSpot = 28);
    result := false;
    end;

    or you could just search for DTM in inv.

    ** Note ** Why would you use dtm to click tree in mainscreen it would never find it.

    Join the fastest growing merchanting clan on the the net!

  4. #4
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by pwnaz0r View Post
    SCAR Code:
    function findlogsininv( logname : string ) : boolean;
    var
      InvSpot : integer;
    begin
    InvSpot := 0;
    repeat
      InvSpot := InvSpot + 1;
      MMouseItem(InvSpot);
      If(IsUpText(LogName))then
        begin
          result := true;
          exit;
        end;
    until(InvSpot = 28);
    result := false;
    end;

    or you could just search for DTM in inv.

    ** Note ** Why would you use dtm to click tree in mainscreen it would never find it.
    SCAR Code:
    {*******************************************************************************
    function FindItemName(Name: String): Boolean;
    By: based off PPLSUQBAWLZ's InventoryCount
    Description: Finds first item with  name in inventory.
    *******************************************************************************}


    function FindItemName(Name: string): Boolean;
    var
      i, e: Integer;
    begin
      GameTab(4);
      while (i < 6) do
      begin
        if (i = 5) and (e < 8) then
        begin
          i := 0;
          e := e + 1;
        end;
        if (FindColor(x, y, 65536, (571 + 47 * i), (215 + 36 * e), (601 + 47 * i),
          (245 + 36 * e))) then
        begin
          MMouse(x, y, 0, 0)
            if (IsUpText(Name)) then
          begin
            Result := True;
            break;
          end;
        end;
        i := i + 1;
      end;
    end;

    Look in inventory.scar

  5. #5
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yeah he said he did and couldnt find one so I just made on from scratch

    Join the fastest growing merchanting clan on the the net!

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

    Default

    wow thanks for the replies,i'm working on it but that stupid tree finding arrg i hate it sometimes he finds it and sometimes he just starts clicking on the MM like a freak

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Type mismatch in script...
    By Dervish in forum OSR Help
    Replies: 2
    Last Post: 11-04-2008, 08:01 PM
  2. Sorry me again (Type mismatch in script)
    By StrikerX in forum OSR Help
    Replies: 8
    Last Post: 04-12-2008, 12:41 PM
  3. Type mismatch in script.
    By Wade007 in forum OSR Help
    Replies: 12
    Last Post: 02-18-2008, 12:12 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
  •