SRL Archive - Other Scripts

bejeweled solver


nielskool

2009-02-20 17:14:59

i made a script that searches for the best possible move to do in a bejeweled game.
the code is a bit messy, but it should work.

explenation of how it works.
first it wil start with indexing the field
so it wil know where all the jewels are placed, and what kind of jewel each is.

then it will search for all the moves that are possible, for each move it wil start the proces again it searches again for all the moves, he wil do this till he know al the possible combinations.
it wil remember wich combination gave him the most opertuneties
like:
first it wil ave 3 moves.
the first one gave him one other move and after that none.
second one gave him 3 possible moves, after all thes moves there was only one left.
the third move, only gives one move, but that move gives him 2 other moves, one of these wil end the game the other gave him another move, after this move he don't know how many moves he wil have, becaus he don't know what the jewels are that will fall.

il put it in a tabel

  1. move1
    1. move1
      1. no more moves
  2. move2
    1. move1
      1. no more moves
    2. move2
      1. no more moves
    3. move3
      1. no more moves
  3. move3
    1. move1
      1. move1
        1. no more moves
      2. move2
        1. move1
          1. don't know what wil fall, but this one gives him the most opertunities

so now it wil do move 3, this one gives him the most possible moves.
when he did the move, this wil all start over.
it does one move, searches again and find the best move for the field with the new fallen jewels.

hope my english wasn't to bad:P

Sandstorm

2009-02-21 09:44:05

Which game do you suggest we use?

~Sandstorm

nielskool

2009-02-21 12:52:06

doesn't matter if you put the vars right, but this one is made for http://www.online-spellen.nl/game/Bejeweled.htm i thought

Sandstorm

2009-02-21 13:05:02

It doesn't work, it just continually clicks the first jewel. :/.

~Sandstorm

jakeyboy29

2009-02-21 13:24:53

 Line 48: [Error] (48:11): Type mismatch in script C:\Documents and Settings\Jake\Local Settings\Temporary Internet Files\Content.IE5\QNBXXR30\bejeweled%20solver[1].scar
i get this

Hugolord

2009-02-21 13:49:37

From: Sandstorm
It doesn't work, it just continually clicks the first jewel. :/.

~Sandstorm


+1

noidea

2009-02-21 14:45:17

You forget some inttostr() in yur Writeln's

Cazax

2009-02-21 14:46:29

He must be using SCAR 3.20+ which doesn't need string conversion functions.

noidea

2009-02-21 14:48:12

From: Cazax
He must be using SCAR 3.20+ which doesn't need string conversion functions.

Wow, it does that automatically :eek:I havent used it yet.

nielskool

2009-02-21 16:36:20

your right i got 3.20
i will upload a new one

Wolvy

2010-04-22 10:51:14

This did not work for me at facebook bejeweled blitz, it just keeps moving the mouse to the first jewel :S

Frement

2010-04-22 10:58:44

Nice effort.