PDA

View Full Version : Need Help with script!



Semtex
08-27-2012, 02:45 PM
Hi i need someone to help me make a script that can identify letters, let me explain, i'm on a 3D chat that got an anti afk system, every hour you've been online a blue box pops up with 3 letters or numbers in it, then you have to type those 3 letters or numbers in the white box just underneith.

Now what i need the script to do, is that every 8-9 minutes gotta be random when it does it, write a sentence i can decide myself. and when the box pops up it should type in the 3 letters in the box
Here is a image of the box and the letters and chat.
http://i803.photobucket.com/albums/yy314/semtexen/noget.jpg

I hope someone can help me since im not the strongest scripter :)

Footy
08-27-2012, 02:48 PM
You cant really read the text, as im assuming the fonts and shapes of the letters change every time. As for writing a sentance, just do

procedure Sentance;
begin
wait(randomrange(600000, 1000000));
typesend('Your sentance here');
end;

And repeat it in a main loop.

Semtex
08-27-2012, 02:59 PM
I'm quite sure that the letters each time they are written, they look the same, just in random order, and it can be letters or numbers

Footy
08-27-2012, 03:02 PM
Then I'd make a bitmap of each letter, and associate each bitmap with a char to enter into the box. If you dont know how to do this, ask someone else, I dont either :D

Semtex
08-27-2012, 03:03 PM
ah okay hehe, i heard someone mention OCR function in simba, but i don't know what that is

Semtex
08-27-2012, 03:52 PM
Here is some extra photos of the text

http://i803.photobucket.com/albums/yy314/semtexen/noget2.jpg

http://i803.photobucket.com/albums/yy314/semtexen/Noget3.jpg

I would say that the 3 in last photo and 3 in first photo looks the same

P1ng
08-27-2012, 04:02 PM
If you make a font of your own that has all of the different characters in it (I'm sure there is a create your own font tutorial on here somewhere...) Then you can write a function that will detect the writing in the box and return that as it's result. From there you can Simply put TypeSend(whatever your function returned)

Semtex
08-27-2012, 05:34 PM
Alright, but does anyone know what that OCR function is?

masterBB
08-27-2012, 05:37 PM
It is comparing a tpointarray to a bitmap. So it checks for the colors found by simba with a black and white bitmap containing a char. It also uses vspacing and such. Not really useful in your case.

Semtex
08-27-2012, 05:45 PM
It is comparing a tpointarray to a bitmap. So it checks for the colors found by simba with a black and white bitmap containing a char. It also uses vspacing and such. Not really useful in your case.

Oh okay, is there anything else i can do?

Semtex
08-28-2012, 01:10 PM
Anyone that can help me find a guide how to make a script for this? :) i know a simple part for it, just make it write random text at random times, thats easy enough, but the letter recognition is kinda hard, anyone know guides how to do that?

Oxygen
08-28-2012, 01:13 PM
I would make my own font and then say search in area.
After it found the letters I would record them and then output them through typesend.

Semtex
08-28-2012, 01:16 PM
I would make my own font and then say search in area.
After it found the letters I would record them and then output them through typesend.

how would you make your own font? its hard to find all the letter since, that box only pops up every hour

riwu
08-28-2012, 02:00 PM
The font looks common enough so you can just use microsoft word and trial and error until you get a font and size that is as close to that as possible. Then make a bitmap of each alphabet/number (change the font color to anything other than black), and change the background to black. Example of a bitmap i made:
http://img401.imageshack.us/img401/6541/opengl.png
In your case you should make individual bitmap for every alphabet/number.

Complete this 2 procedures and you should be done:
procedure TypeLetter(i: Integer);
begin
case i of
0: TypeByte(VK_A);
1: TypeByte(VK_B);
2: TypeByte(VK_C);
//carry on the list
end;
end;

procedure TypeAll;
var
TIA: TIntegerArray;
SearchBox: TBoxArray;
i,k,x,y: Integer;
begin
TIA:=[A_bmp, B_bmp, C_bmp, D_bmp {continue on the list}];
SearchBox:=[TBox({box where the first letter shd appear}, TBox({box where the 2nd shd appear}), TBox({box of 3rd})];
for k:=0 to High(SearchBox) do
for i:=0 to High(TIA) do
if FindDeformedBitmapToleranceIn(TIA[i], x,y, SearchBox[k].x1,SearchBox[k].y1,SearchBox[k].x2,SearchBox[k].y2,{other parameters}) then
TypeLetter(i);
end;


You can look at tutorials (eg. http://villavu.com/forum/showthread.php?t=47374) if you have problem making the bitmaps. Ask around if you have problem understanding my procedure.

EDIT: oh rmb you also have to load the bitmaps to be used in the TIA.