Results 1 to 3 of 3

Thread: Problems with bilging tile matcher

  1. #1
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default Problems with bilging tile matcher

    I'm currently trying to complete a basic auto-bilger for puzzle pirates. Unfortunately, my matching tile finder isn't able to get past the 1st funtion I've made. ATM it's a bit badly coded, but the basic outlines are there and I've gone through it a few times, but still can't see to find out what's stopping it.

    Tile Identifier (Works)
    SCAR Code:
    Function CheckTile(a,b:Integer):Integer;
    Begin
      Result:=0;
      a:=(a*45)+XStart+65;
      b:=(b*45)+YStart+110;
      For i:=1 To 5 Do
      Begin
        If(FindColorTolerance(x,y,tile[i],a,b,a+5,b+5,10)) Then Result:=i;
      End
      Writeln('Identified Tile, now going to check for matching tile');
    End;

    Tile Matcher (Looks for a tile that could end in a 3 of a kind)
    SCAR Code:
    Function CheckMatch(c,d:Integer):Integer;
    Begin
      Result:=0;
      z:=CheckTile(c,d);
      c:=(c*45)+XStart+20;
      d:=(d*45)+YStart+20;
      If(z>0) Then
      Begin
        If(FindcolorTolerance(x,y,tile[z],c,d-90,c+5,d-85,10)) Then Result:=1;
        If(FindcolorTolerance(x,y,tile[z],c,d+90,c+5,d+95,10)) Then Result:=2;
        If(FindcolorTolerance(x,y,tile[z],c-45,d,c-40,d+5,10)) Then Result:=3;
        If(FindcolorTolerance(x,y,tile[z],c+45,d,c+50,d+5,10)) Then Result:=4;
      End
      If(Result>0) Then Writeln('Found a matching tile, now going to check for a move');
      If(Result=0) Then Writeln('No matching tiles, going onto next');
    End;

    Move Checker (Final check to see if a move can be made)
    SCAR Code:
    Function CheckMove(e,f:Integer):Integer;
    Begin
      Result:=0;
      w:=CheckMatch(e,f);
      e:=(e*45)+XStart+20;
      f:=(f*45)+YStart+20;
      If(w>0) Then
      Begin
        If(w=1) Then
        Begin
          If(FindcolorTolerance(x,y,tile[z],e-45,f-45,e-40,f-40,10)) Then Result:=1;
          If(FindcolorTolerance(x,y,tile[z],e+45,f-45,e-40,f+50,10)) Then Result:=2;
        End
        If(w=2) Then
        Begin
          If(FindcolorTolerance(x,y,tile[z],e-45,f+45,e-40,f+50,10)) Then Result:=3;
          If(FindcolorTolerance(x,y,tile[z],e+45,f+45,e+50,f+50,10)) Then Result:=4;
        End
        If(w=3) Then
        Begin
          If(FindColorTolerance(x,y,tile[z],e-135,f,e-130,f+5,10)) Then Result:=5;
        End
        If(w=4) Then
        Begin
          If(FindColorTolerance(x,y,tile[z],e+135,f,e+140,f+5,10)) Then Result:=6;
        End
      End
      If(Result>0) Then Writeln('Move found, yay');
      If(Result=0) Then Writeln('No moves, onto next one');
    End;

    These are my functions I use and the only other important thing in the script is my procedure which just generates x and y values for the move and interpreting CheckMove's result into a tile to move. If you need any other part of the script, you just have to ask and also you can just ask for any other info that can prove useful to help me getting this working

  2. #2
    Join Date
    Dec 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default i think it depends

    on what type of computer you have, my slow desktop did the same but my laptop works just fine

  3. #3
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    No but come on, this is your second 1 year + grave dig, might stop now and look at the rules ?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Reflection MM tile clicking off.
    By insanomano in forum OSR Help
    Replies: 11
    Last Post: 02-09-2009, 03:49 AM
  2. complete bilging script for puzzle pirates
    By RaptorBlaze in forum RS3 Outdated / Broken Scripts
    Replies: 4
    Last Post: 10-28-2007, 08:55 AM
  3. Advanced Bilging script for Puzzle Pirates
    By RaptorBlaze in forum RS3 Outdated / Broken Scripts
    Replies: 0
    Last Post: 08-29-2007, 09:26 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
  •