Hi there,
I need to use simba to create a script for a game which is not SRL.
Hope you guys can help me, as I'm a begginer scripter. And I ask you not to get upset because of my english: I'm doing the absolute best I can.
The situation is sometimes(randomly), from 5 to 19 bitmaps will appear on my client, being only one of them repeated (so 4 to 18 different bitmaps). When that happens, I have to double click both of the repeated bitmap, making them all disappear by doing so. Then go to back to beggining of the script, to do the same if the bitmaps come once more. There are 42 possible different bitmaps in total, being all of them rectangles with same sizes, but different contents.
The structure I thought of was:
-define the variables and the bitmapfromstrings for all the 42
-search the client for each of the 42
-if one of them is found, get it's coordinates, and search again, excluding the area this one was on, to find an equal bitmap (if CountBitmap was still working, it would be easier, cause I would have to find the bitmap the counted 2, and not 1)
-if it finds 2 of the same bitmap, click both of them. if it doesn't find the second equal bitmap, continuing searching through the other 41 (and so on, until one is found(which will always happen if the first one was found)
-loop
For now I don't yet know how to do some parts of the script (like clicking the points of the 2 equal bitmaps, or continue looping if it doesn't find the second one or the first, or reset the loop if it successfully clicks both of the same bmps), but I do not want help with that, as I'll easily learn it by myself(at least that's what I suppose). What I want help is with the logical part. What to do.
What I imagined to do after first finding a bitmap, and checking to see if there was a second one just the same, was to get the total area, and exclude the area of the first bmp found, what would leave me with 4 squares of area to search within. But then I realized that wouldn't work if part of the bmp to be found was on one area, and the other part on another.
This is the core(the parts I don't yet know how to do are missing) of what I first thought, but now see wouldn't probably work:
Code:program CHECKERS; var bmpp: TPointArray; n, w, h, x, y, a, b, c, d, e, f, g, i: integer; bmpp[1] := BitmapFromString (8, 11, blablabla) bmpp[2] := BitmapFromString (8, 11, blebleble) bmpp[3] := BitmapFromString (8, 11, blublublu) bmpp[4] := BitmapFromString (8, 11, bliblibli) . . . bmpp[42] := BitmapFromString (8, 11, whatever) begin GetClientDimensions(w, h); for n := 1 to 42 If (FindBitmap (bmpp[n], x, y)) Then If FindBitmapIn(bmpp[n], a, b, 0, 0, x, h) Then If FindBitmapIn(bmpp[n], c, d, x + 8, 0, w, h) Then If FindBitmapIn(bmpp[n], e, f, x, y + 11, x + 8, h) Then If FindBitmapIn(bmpp[n], g, i, x, 0, x + 8, y) Then
One more thing: When the bitmaps randomly appear on my screen, I have 8 minutes to click the 2 equal ones. So the script should have to work within this time limit, what I don't know would be possible using this logic I got to.
Could you guys please help me?
Thanks a lot.


Reply With Quote










