Студопедия
Случайная страница | ТОМ-1 | ТОМ-2 | ТОМ-3
АвтомобилиАстрономияБиологияГеографияДом и садДругие языкиДругоеИнформатика
ИсторияКультураЛитератураЛогикаМатематикаМедицинаМеталлургияМеханика
ОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРелигияРиторика
СоциологияСпортСтроительствоТехнологияТуризмФизикаФилософияФинансы
ХимияЧерчениеЭкологияЭкономикаЭлектроника

Scraper Override DLL

The scraper override DLL extension provides for a user-specified override of the output of the screen scraper engine. Sometimes, better game state information can be retrieved from poker client controls that are not scrapable by the pixel-driven scraper engine in OpenHoldem, such as by parsing the chat box. Parsing the chat box would require direct memory reading of the poker client, or DLL injection. The approach for such a chat box parsing is beyond the scope of this document, but a good discussion on the topic can be found here: http://www.codingthewheel.com/archives/how-i-built-a-working-online-poker-bot-7

 

Immediately after the screen scrape is complete, OpenHoldem will pass a pointer to a structure containing the results of the scrape to your override DLL. This is not a const pointer reference, so any of the members of the struct can be changed directly. The prototype for the method called by OpenHoldem is quite straightforward:

 

SCRAPERDLL_API void OverrideScraper(SScraperState *state)

 

No casting required. The members of the SScraperState struct are as follows:

 

struct SScraperState

{

char title[512];

unsigned int card_common[5];

unsigned int card_player[10][2];

unsigned int card_player_for_display[2];

bool dealer[10];

bool sitting_out[10];

CString seated[10];

CString active[10];

CString name[10];

double balance[10];

bool name_good_scrape[10];

bool balance_good_scrape[10];

double bet[10];

double pot[10];

CString button_state[10];

CString i86X_button_state[10];

CString i86_button_state;

CString button_label[10];

double sblind;

double bblind;

double bbet;

double ante;

LimitType limit;

double handnumber;

bool istournament;

};

 

Any of these can be changed like so (which will give you four-of-a-kind Aces)

 

SCRAPERDLL_API void OverrideScraper(SScraperState *state)

{

state->card_common[0] = StdDeck_MAKE_CARD(StdDeck_Rank_ACE, StdDeck_Suit_HEARTS);

state->card_common[1] = StdDeck_MAKE_CARD(StdDeck_Rank_ACE, StdDeck_Suit_DIAMONDS);

state->card_common[2] = StdDeck_MAKE_CARD(StdDeck_Rank_ACE, StdDeck_Suit_SPADES);

state->card_common[3] = StdDeck_MAKE_CARD(StdDeck_Rank_ACE, StdDeck_Suit_CLUBS);

}

 

And on return, OpenHoldem will instantly use the changed values instead of the scraped values.

 

 

10 Appendix A – OpenScrape Font collection example

This example on collecting fonts was reproduced from here: http://www.maxinmontreal.com/wiki/index.php5?title=Collecting_text

 

We start with nothing except a table that we need to extract fonts from, here I am using a Notepad doc for simplicity.

 

Figure 9.4‑67 Font collection example - notepad


Next we fire up OpenScrape, and attach it to our "Table". Then we build a region around the area we are working on. "New" / "Region" / name it characters / Use the coordinate editor to enclose the Region. You can also "shift-drag" the rectangle around to place it.

 

Figure 9.4‑68 Font collection example - region

 

Set the region to the correct "transform", Type 0 in this case. Use the eyedropper to highlight the foreground pixels until we have nice seperation in the "Pixel seperation" field. Press "Create Font". We are presented with the "Add font characters" window.

 

Highlight each "?" in turn and enter the correct character. "OK" to save. "Sort" when done here, then "save" on main GUI.

 

If you hit the problem of openscrape seeing two letters as one because they have touching pixels then you will need to collect them seperately. Make a new temporary region that only encloses one character (call it char), capture the problem characters individualy and all should be good.

Figure 9.4‑69 Font collection example - add characters

 

 


Here is the result after collecting only "A", you can see this by clicking inside the "characters" Region.

Figure 9.4‑70 Font collection example – “A” collected

 

Note "A,B,C" are already present in the Table Map.

Figure 9.4‑71 Font collection example - "ABC" collected

 

So on we go collecting fonts, here we collect "D".

Figure 9.4‑72 Font collection example - collecting "D"

 

 

11 Appendix B – Future TODOs

- Move Edit/Preferences/Use Comma or Dot setting to the Table Map.

 


Дата добавления: 2015-07-20; просмотров: 102 | Нарушение авторских прав


Читайте в этой же книге: Iterations and Standard Deviation | How to use it from a DLL | Starting Hand Ranking | PokerPro | Poker Tracker symbols | Conclusion | Technical documentation | Familiarizing yourself with ManualMode | ManualMode Options | Ninja Folders |
<== предыдущая страница | следующая страница ==>
Definitions| Ахмед Саид «Нубийский танец» 2 часа: 11.00 – 13.00

mybiblioteka.su - 2015-2024 год. (0.006 сек.)