-fix delay thing when looking for answer from /w
write real uploader
test real uploader
speed it up
}
if (o_mode & mf_analyse) {
if (o_flags & ff_needisland) {
- find_islandname();
+ find_islandname(page0_rgbimage);
if (o_flags & ff_printisland)
printf("%s, %s\n", archipelago, island);
}
/*----- from structure.c -----*/
void find_structure(const CanonImage *im, int *max_relevant_y_r);
+Rect find_sunshine_widget(void);
-void find_islandname(void);
+void find_islandname(RgbImage *ri);
void check_correct_commodities(void);
void read_screenshots(void);
void read_one_screenshot(void);
raise_and_get_details();
wait_for_stability(¤t,0,0, "checking current YPP client screen...");
-#if 0
-timestamp();
-snapshot(¤t);
-snapshot(¤t);
-snapshot(¤t);
-snapshot(¤t);
-snapshot(¤t);
-snapshot(¤t);
-snapshot(¤t);
-snapshot(¤t);
-snapshot(¤t);
-snapshot(¤t);
-timestamp();
-#endif
-
test= convert_page(current, 0);
find_structure(test, &max_relevant_y);
check_correct_commodities();
+ Rect sunshine= find_sunshine_widget();
+
+ progress("poking client...");
+ mouse_1_updown((sunshine.tl.x + sunshine.br.x) / 2,
+ (sunshine.tl.y*9 + sunshine.br.y) / 10);
+
free(test);
- free_snapshot(¤t);
- progress("requesting status information...");
+ wait_for_stability(¤t,0,0, "checking basic YPP client screen...");
mouse_1_updown(250, wheight-10);
mouse_1_updown_here();
mouse_1_updown_here();
send_key(XK_w);
send_key(XK_Return);
sync_after_input();
- sysassert(! usleep(1000000) );
+
+ Snapshot *status=0;
+ wait_for_stability(&status,current,0, "awaiting status information...");
+ free_snapshot(¤t);
+ free_snapshot(&status);
}
void take_screenshots(void) {
DEBUG_DEFINE_SOME_DEBUGF(structcolon,colondebugf)
-void find_islandname(void) {
+Rect find_sunshine_widget(void) {
Rect sunshiner;
- char sunshine[MAXIMGIDENT], archisland[MAXIMGIDENT];
- RgbImage *ri= alloc_rgb_image(page0_rgbimage->w, page0_rgbimage->h);
- const unsigned char *srcp;
- unsigned char *destp, *endp;
- for (srcp=page0_rgbimage->data, destp=ri->data,
- endp= ri->data + 3 * ri->w * ri->h;
- destp < endp;
- srcp++, destp++) {
- unsigned char c= *srcp & 0xf0;
- *destp= c | (c>>4);
- }
-
- cim= page_images[0];
-
sunshiner.tl.x= cim->w - 1034 + 885;
sunshiner.br.x= cim->w - 1034 + 1020;
sunshiner.tl.y= 227;
ADJUST_BOX(sunshiner,"o",20, (cim->w - 1034 + 700), MUST, tl,x,-1);
ADJUST_BOX(sunshiner,"o",20, cim->w, MUST, br,x,+1);
debug_rect("sunshiner",1, sunshiner);
+ return sunshiner;
+}
+
+void find_islandname(RgbImage *ri) {
+ Rect sunshiner= find_sunshine_widget();
+ char sunshine[MAXIMGIDENT], archisland[MAXIMGIDENT];
+
+ const unsigned char *srcp;
+ unsigned char *destp, *endp;
+ for (srcp=page0_rgbimage->data, destp=ri->data,
+ endp= ri->data + 3 * ri->w * ri->h;
+ destp < endp;
+ srcp++, destp++) {
+ unsigned char c= *srcp & 0xf0;
+ *destp= c | (c>>4);
+ }
identify_rgbimage(ri, sunshiner, sunshine, "sunshine widget");