Results 1 to 25 of 25

Thread: Understanding script:puzzle pirates

  1. #1
    Join Date
    Aug 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Understanding script:puzzle pirates

    Hi.I know there are some other posts about puzzle pirates, but they don't have what I am looking for.I am working on a bilge puzzle bot, mostly for learning and because I lost my copy of Masquerader's bilger.

    Introduction to bilge:Bilge is somewhat like nintendo's tetris attack.You have to swap the pieces with the objective of making colums or lines(and in further levels, is needed that you master the hability to make big ones, with oftenly more than one type of block/piece) to down the water line.The minimum amount of blocks you have to line up so they can "disapear" is three(3).

    Example:

    Here, you could swap the navy blue piece in the low right corner to the other side, putting it together with the another two in the oder side.By that, they would disappear, making space for new pieces.
    -

    As you may note after reading my script, I have no knowlege for doing that, or if I have, I really need to use it, because the script below wasn't capaple of swaping the pieces of anything to make lines.It simply went to the upper left corner of the game window and started swapping continously the same two titles (LMAO).

    So I proved I am able to create a retarded bot.How do I make this thing down here into something useful for my purpose?Thanks.

    program New;

    var
    x,y: Integer;

    const
    pc1= 12507298;//greenball
    pc2= 16107781;//blueball
    pc3= 13911060;//navysquare
    pc4= 16570776;//lightblueoct
    pc5= 8482850;//jadeoct

    procedure Bilge;
    begin
    if(findcolor(x,y,pc1,0,0,804,603)) then
    begin
    MoveMouseSmooth(x,y);
    Wait(500+random(30))
    ClickMouse(x,y,true);
    end else
    if(findcolor(x,y,pc2,0,0,804,603)) then
    begin
    MoveMouseSmooth(x,y);
    Wait(500+random(30))
    ClickMouse(x,y,true);
    end else
    if(findcolor(x,y,pc3,0,0,804,603)) then
    begin
    MoveMouseSmooth(x,y);
    Wait(500+random(30))
    ClickMouse(x,y,true);
    end else
    if(findcolor(x,y,pc4,0,0,804,603)) then
    begin
    MoveMouseSmooth(x,y);
    Wait(500+random(30))
    ClickMouse(x,y,true);
    end else
    if(findcolor(x,y,pc5,0,0,804,603)) then
    begin
    MoveMouseSmooth(x,y);
    Wait(500+random(30))
    ClickMouse(x,y,true);
    end else
    end;

    begin
    Wait(2000+random(370))
    repeat Bilge
    until(false)
    end.

    end.
    PS-For those who say the game is shitty.It is, but scripting for it is kind of nice.
    ____________________
    It tastes like cheat!!!

  2. #2
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your going to need to create some sort of brain for your script.

    You need to find two patterns which are either left to right, or up to down. Then check if there is a matching pattern anywhere in the row above them, if so swap.

    Also, have u tried just randomly clicking around the board? without even looking?.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  3. #3
    Join Date
    Aug 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This script was supposed to do somethinh like that (swaping everything)
    But it...doesn't.Also the possibility of making a row swapping any title in front of you is too low.

    Pattern?That is the thing.I don't have idea how to make it compare the titles to match groups and such.
    ____________________
    It tastes like cheat!!!

  4. #4
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    DTMs ! I can never get enough of them. Could probably solve your problem.

    Some math (calculating pieces distance, etc.), some DTMs and a good logical "Brain" would do for that puzzle.

    -Knives

  5. #5
    Join Date
    Aug 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, I am gonna try on dtms...Yohojo says they are easier than bitmaps.yeah..all right.
    ____________________
    It tastes like cheat!!!

  6. #6
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't think it is too hard.

    Lets say there are 4 types of pieces.

    Create a loop which will look for any occur of two pieces together. If there is, then find out what row it is on. Lets say there are 2 pieces in row 4, now we need to check row 3 and row 6 to see if theres the same piece in there.

    Ok, what column were the pair found?, column 3. Now we move the single piece to column 3 and wolla score.

    Do this for each type and should keep you going for a while.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  7. #7
    Join Date
    Feb 2006
    Posts
    406
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    the script is still posted here: http://www.villavu.com/forum/showthread.php?t=11546

    heres the best i can explain it for you (i made this like 6 months ago, lol)

    the grid is 45x45, with the middle of the first one at 115,98
    the loadboard; procedure does two "for" loops and identifies each block by comparing the color to the known color of the block types above/below water. running this procedure loads the 6x12 board array with block types
    to add another block type, you should just be able to add another statement like:
    Code:
          if(color= above water) or(color= below water)then//new block
            block:=6
    the logic for the onemoveclear is a little more complex, but i'll try to explain..
    for every block on the screen, starting at the top left, it checks to see if it could be moved to create a line of 3 other blocks

    the target variable is the type of block we are looking to match

    example:
    Code:
            switchleft:=false;
            if(j<10)then                                                   
              if(board[i+1][j+1]=target)and(board[i+1][j+2]=target)then    
                t:=true;
    the illustrations for this code goes like:
    Code:
    //   []
    //     []
    //     []
    so it is looking for a block of the same type one right, one down, and another one one right, two down

    the switchleft variable means that the block we are looking at must be moved to the right, so it knows to move the cursor about 22 pixels to the right of the coordinates of the block

    the statements like:
    if(j>0)and(j<11)then

    are just constraints that need to happen for each situation to be possible (within the coordinates of the grid)

    in the script, i is the horizontal variable (x) and j is the vertical variable (y)

    i hoped that helped a little bit. i know its a bit hard to think about, but im sure its a lot better/more efficient than using bitmaps/dtms

    btw, it helped a lot that i had been scripting for about two years when i wrote this (two dimensional arrays, etc), and i have crazy logic skills (taking calculus at the university, lol)

    its over the heads of about 95% of srl members to create an effective script for this game (using whatever method)

  8. #8
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I very much doubt it would be hard to create a script to completely auto this game properly.

    Ill give it a shot.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  9. #9
    Join Date
    Aug 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Masquerader, explaining it seems more undertandible and:
    :O (?)
    it is still posted?Why can't I acess it?..."may not have sufficient privileges"...
    What is that feeling...my good...I'M a N00Bz!?
    ____________________
    It tastes like cheat!!!

  10. #10
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    You're not a SRL Junior Member. If you don't know how to become one, read a tutorial about it.

    -Knives

  11. #11
    Join Date
    Feb 2006
    Posts
    406
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by DaimosDenamos View Post
    Thanks Masquerader, explaining it seems more undertandible and:

    :O (?)
    it is still posted?Why can't I acess it?..."may not have sufficient privileges"...
    What is that feeling...my good...I'M a N00Bz!?
    aye, thats unfortunate

    and rogeruk, go for it

  12. #12
    Join Date
    Aug 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    "Yoink!"
    I got the script.I hope you don't mind Masquerader. :P
    I am trying to understand more about this, so I may make some scripts myself for other tasks...if you do not agree I will delete the script.I cannot use your script without your permission.
    ____________________
    It tastes like cheat!!!

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

    Default

    11-14-2007, 01:50 PM

    Yeah, thats a gravedig. Seems you like to gravedig on puzzle pirates topics. I'm sorry to hear that.
    -You can call me Mick-



  14. #14
    Join Date
    Apr 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default some questions

    I know I'm grave digging, but I thought someone might be interested in helping me anyway. I took the old script and tried to modify it to perform two step moves. The problem is now it gives me runtime errors like:

    "[Runtime Error] : Out Of Range in line 153 in script C:\Program Files\SCAR 3.12\Scripts\bilgeplus.scar"

    Anyway, here is my code. What's going wrong?

    Code:
    procedure twomoveclear;
    var
      i,j,target:integer;
      t,switchleft:boolean;
    begin
      t:=false;
      for j:=0 to 11 do
      begin
    
        for i:=0 to 5 do
        begin
    
          target:=board[i][j];
    
          if(i<5)then
          begin
            switchleft:=false;
            if(j<10)then                                                   // []
              if(board[i+2][j+1]=target)and(board[i+2][j+2]=target)then    //     []
                t:=true;                                                   //     []
    
            if(j>1)then                                                    //     []
              if(board[i+2][j-1]=target)and(board[i+2][j-2]=target)then    //     []
                t:=true;                                                   // []
    
            if(j>0)and(j<11)then                                           //     []
              if(board[i+2][j-1]=target)and(board[i+2][j+1]=target)then    // []
                t:=true;                                                   //     []
                
            if(j>0)and(j<11)then                                           // []
              if(board[i+1][j+1]=target)and(board[i+2][j+2]=target)then    //   []
                t:=true;                                                   //     []
          end;
    
    
          if(t=false)and(i>0)then
          begin
            switchleft:=true;
            if(j<10)then                                                   //     []
              if(board[i-2][j+1]=target)and(board[i-2][j+2]=target)then    // []
                t:=true;                                                   // []
    
            if(j>1)then                                                    // []
              if(board[i-2][j-1]=target)and(board[i-2][j-2]=target)then    // []
                t:=true;                                                   //     []
    
            if(j>0)and(j<11)then                                           // []
              if(board[i-2][j-1]=target)and(board[i-2][j+1]=target)then    //     []
                t:=true;                                                   // []
    
            if(j>0)and(j<11)then                                           //     []
              if(board[i-1][j+1]=target)and(board[i-2][j+2]=target)then    //   []
                t:=true;                                                   // []
          end;
    
          if(t=false)and(i<3)then
            if(board[i+3][j]=target)and(board[i+4][j]=target)then
            begin                                       // []    [][]
              switchleft:=false;
              t:=true;
            end;
    
          if(t=false)and(i>2)then
            if(board[i-3][j]=target)and(board[i-4][j]=target)then
            begin
              switchleft:=true;                         // [][]    []
              t:=true;
            end;
    
          if(t)then
            break;
        end;
      if(t)then
        break;
      end;
      if(t)then
      begin
        if(switchleft)then
          clickmouse(45*i+90,45*j+98,true)
        else
          clickmouse(45*i+140,45*j+98,true)
      end;
    end;

  15. #15
    Join Date
    May 2007
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i dont know, it looks good to me, ill try it.

  16. #16
    Join Date
    May 2007
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok i dont even have a line 100 in that script, so i dont think you posted it all

  17. #17
    Join Date
    Dec 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Line 19: [Error] (19:1): Semicolon (';') expected in script C:\Documents and Settings\XXXXX\Desktop\ypp\3bilge.scar
    Failed when compiling

    Whats wrong with this? Im using masq's script

  18. #18
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by ax30070 View Post
    Line 19: [Error] (19:1): Semicolon (';') expected in script C:\Documents and Settings\XXXXX\Desktop\ypp\3bilge.scar
    Failed when compiling

    Whats wrong with this? Im using masq's script
    Grave digging much ?

    The last Post 04-21-2008, 12:27 PM
    Hi

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

    Default

    Quote Originally Posted by mickaliscious View Post
    11-14-2007, 01:50 PM

    Yeah, thats a gravedig. Seems you like to gravedig on puzzle pirates topics. I'm sorry to hear that.
    2 days and four hours is a gravedig? o.o.

  20. #20
    Join Date
    Jun 2007
    Location
    Liverpool ,Nsw,Australia
    Posts
    740
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Tickyy View Post
    Grave digging much ?

    The last Post 04-21-2008, 12:27 PM
    Lol! Maybe Next Time.
    Quote Originally Posted by Darkmage View Post
    I got 2 questions'
    #1. When i run the script will it automatically pick up the mouse and move?

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

    Default

    thx a lot

  22. #22
    Join Date
    Oct 2007
    Posts
    678
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    forget the logic algorithm, i say your better off brute forcing. just make it click (not randomly) but in a order, your bound to get some right, and with SCAR's speed, it should finish before your timer (or however it works) runs out.

  23. #23
    Join Date
    Dec 2008
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Actually that does not work - this game scores depending on speed, size of combination you create and number of moves (clicks) to get there, so clicking randomly would score really low. There is really no way to bot this game without some level of intelligence... or well - plan B. plan B is to write in every single possible move and look for each one in turn. Plan B is not very nice with the hundreds (or more) of different moves available.

  24. #24
    Join Date
    Feb 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by DaimosDenamos View Post
    Hi.I know there are some other posts about puzzle pirates, but they don't have what I am looking for.I am working on a bilge puzzle bot, mostly for learning and because I lost my copy of Masquerader's bilger.

    Introduction to bilge:Bilge is somewhat like nintendo's tetris attack.You have to swap the pieces with the objective of making colums or lines(and in further levels, is needed that you master the hability to make big ones, with oftenly more than one type of block/piece) to down the water line.The minimum amount of blocks you have to line up so they can "disapear" is three(3).

    Example:

    Here, you could swap the navy blue piece in the low right corner to the other side, putting it together with the another two in the oder side.By that, they would disappear, making space for new pieces.
    -

    As you may note after reading my script, I have no knowlege for doing that, or if I have, I really need to use it, because the script below wasn't capaple of swaping the pieces of anything to make lines.It simply went to the upper left corner of the game window and started swapping continously the same two titles (LMAO).

    So I proved I am able to create a retarded bot.How do I make this thing down here into something useful for my purpose?Thanks.



    PS-For those who say the game is shitty.It is, but scripting for it is kind of nice.
    Fun Script!!! I'm starting to code some PP bots myself
    will let you know about my progress.

  25. #25
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    This is the 3rd time this thread has been gravedug...

    Last Post: 12-27-2008, 12:19 AM

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Puzzle Pirates Gunnery Script
    By SefaAsker in forum First Scripts
    Replies: 7
    Last Post: 03-24-2009, 09:23 AM
  2. Puzzle Pirates script
    By acaliki in forum OSR Help
    Replies: 2
    Last Post: 11-04-2008, 02:39 PM
  3. complete bilging script for puzzle pirates
    By RaptorBlaze in forum RS3 Outdated / Broken Scripts
    Replies: 4
    Last Post: 10-28-2007, 08:55 AM
  4. A puzzle Pirates Script
    By jeremywilms in forum RS3 Outdated / Broken Scripts
    Replies: 1
    Last Post: 04-25-2007, 04:04 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
  •