package com.poker.ui.settings.rooms;
import java.awt.Color;
import java.awt.Point;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import com.poker.analyst.parse.BufferParser;
import com.poker.analyst.parse.IPokerBufferParser;
import com.poker.analyst.parse.ParimatchBufferParser;
import com.poker.ui.robot.reaction.UIReaction;
import com.poker.ui.robot.reaction.UIReactionDoing;
import com.poker.ui.robot.reaction.UIReactionPrimitive;
import com.poker.ui.robot.reaction.UIReactionSeq;
import com.poker.ui.robot.reaction.UIReactionStep;
import com.poker.ui.settings.RoomSettings;
import com.poker.ui.settings.rooms.events.Event;
import com.poker.ui.settings.rooms.events.EventCondition;
import com.poker.ui.settings.rooms.events.EventType;
import com.poker.ui.settings.rooms.events.PointCondition;
import com.poker.ui.settings.tables.parimatch.ParimatchTable_10;
public abstract class IPokerSettings extends RoomSettings {
//ET_SYSTEM_MN_ERROR_OPEN_WINDOW
Point ptMainErr1;
Point ptMainErr2;
Color colorSERRFrom;
Color colorSERRTo;
//ET_SYSTEM_MESSAGE
Color colorSysButtonFrom;
Color colorSysButtonTo;
// BACKGROUND color (black)
Color ColorBackgFrom ;
Color ColorBackgTo ;
//Actions
Color colorActionButtonFrom ;
Color colorActionButtonTo ;
public IPokerSettings() {
super();
this.processName = "casino.exe";
this.playWndWidth = 486;//486;
this.playWndHeight = 366;//366;
this.playWndWidthDelta = 486;
this.playWndHeightDelta = 366;
for (int i = 0; i < 10; i++) {
this.tables[i] = null;
}
this.bufferInfoX = 118;
this.bufferInfoY = 334;
this.bufferInfoTurnOnX = 30;
this.bufferInfoTurnOnY = 299;
this.tables[9] = new ParimatchTable_10();
this.ReadyPixelPoint = new Point(262, 334);
this.ptAutoPost = new Point(440, 356);
this.ptBBButton = new Point(310, 335);
this.ptBBWaitButton = new Point(386, 335);
}
public void addMainEvents() {
// redesign
Event event;
EventCondition eventCondition;
eventCondition = new EventCondition();
eventCondition.addPointCondition(new PointCondition(ptMainErr1, colorSERRFrom, colorSERRTo, true));
eventCondition.addPointCondition(new PointCondition(ptMainErr2, colorSERRFrom, colorSERRTo, true));
event = new Event();
event.setEventType(EventType.ET_SYSTEM_MN_ERROR_OPEN_WINDOW);
event.setEventCondition(eventCondition);
this.mainEvents.add(event);
}
public void addEvents() {
// redesign
Event event;
EventCondition eventCondition;
eventCondition = new EventCondition();
eventCondition.addPointCondition(new PointCondition(new Point(435, 284),
getRoomSystemColorFrom(), getRoomSystemColorTo(), true));
eventCondition.addPointCondition(new PointCondition(new Point(175, 294),
colorSysButtonFrom, colorSysButtonTo, true));
event = new Event();
event.setEventType(EventType.ET_SYSTEM_MESSAGE);
event.setEventCondition(eventCondition);
this.events.add(event);
/*==============================================*/
// redesign
eventCondition = new EventCondition();
eventCondition.addPointCondition(new PointCondition(new Point(435, 284),
getRoomSystemColorFrom(), getRoomSystemColorTo(), true));
eventCondition.addPointCondition(new PointCondition(new Point(175, 273),
colorSysButtonFrom, colorSysButtonTo, true));
event = new Event();
event.setEventType(EventType.ET_SYSTEM_MESSAGE_2);
event.setEventCondition(eventCondition);
this.events.add(event);
/*==============================================*/
/*
eventCondition = new EventCondition();
eventCondition.addPointCondition(new PointCondition(new Point(262, 334), new Color(29, 46,
28), new Color(36, 52, 36), true));
event = new Event();
event.setEventType(EventType.ET_WAIT_ACTION);
event.setEventCondition(eventCondition);
// events.add(event);
*/
/*==============================================*/
// redesign
eventCondition = new EventCondition();
eventCondition.addPointCondition(new PointCondition(new Point(267, 325),
colorActionButtonFrom, colorActionButtonTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(350, 324),
ColorBackgFrom, ColorBackgTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(350, 333),
ColorBackgFrom, ColorBackgTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(350, 342),
ColorBackgFrom, ColorBackgTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(421, 325),
colorActionButtonFrom, colorActionButtonTo, true));
event = new Event();
event.setEventType(EventType.ET_NEED_WAIT_BB);
event.setEventCondition(eventCondition);
events.add(event);
/*==============================================*/
// redesign
eventCondition = new EventCondition();
eventCondition.addPointCondition(new PointCondition(new Point(267, 325),
colorActionButtonFrom, colorActionButtonTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(350, 324),
ColorBackgFrom, ColorBackgTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(350, 333),
ColorBackgFrom, ColorBackgTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(350, 342),
ColorBackgFrom, ColorBackgTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(421, 324),
ColorBackgFrom, ColorBackgTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(421, 323),
ColorBackgFrom, ColorBackgTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(421, 342),
ColorBackgFrom, ColorBackgTo, true));
event = new Event();
event.setEventType(EventType.ET_SET_BB);
event.setEventCondition(eventCondition);
events.add(event);
/*==============================================*/
// redesign
eventCondition = new EventCondition();
eventCondition.addPointCondition(new PointCondition(new Point(267, 325),
colorActionButtonFrom, colorActionButtonTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(328, 325),
ColorBackgFrom, ColorBackgTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(411, 325),
colorActionButtonFrom, colorActionButtonTo, true));
event = new Event();
event.setEventType(EventType.ET_ACTION_FOLD_ANY_RAISE);
event.setEventCondition(eventCondition);
this.events.add(event);
/*==============================================*/
// redesign
eventCondition = new EventCondition();
eventCondition.addPointCondition(new PointCondition(new Point(267, 325),
colorActionButtonFrom, colorActionButtonTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(328, 325),
ColorBackgFrom, ColorBackgTo, true));
eventCondition.addPointCondition(new PointCondition(new Point(411, 325),
ColorBackgFrom, ColorBackgTo, true));
event = new Event();
event.setEventType(EventType.ET_ACTION_FOLD_CALL);
event.setEventCondition(eventCondition);
this.events.add(event);
}
public void addReactions() {
addReactionsBB();
addReactionsActions();
addReactionsRebuy();
addReactionOpenWindow();
}
@Override
public void addReactionsBB() {
UIReactionSeq reactionSeq;
UIReactionStep reactionStep;
// redesign
//UIReaction.UIR_BB_SET
reactionSeq = new UIReactionSeq();
reactionStep = new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, getPtBBButton());
reactionSeq.addReactionStep(reactionStep);
reactionStep = new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_CLICK, KeyEvent.VK_ESCAPE, null);
reactionSeq.addReactionStep(reactionStep);
reactionStep = new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, getPtAutoPost());
reactionSeq.addReactionStep(reactionStep);
addUiReactionToSeq(UIReaction.UIR_BB_SET, reactionSeq);
// redesign
//UIReaction.UIR_BB_WAIT_FOR
reactionSeq = new UIReactionSeq();
reactionStep = new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, getPtBBWaitButton());
reactionSeq.addReactionStep(reactionStep);
addUiReactionToSeq(UIReaction.UIR_BB_WAIT_FOR, reactionSeq);
};
@Override
public void addReactionsActions() {
UIReactionSeq reactionSeq;
final UIReactionStep reactionStep;
//UIReaction.UIR_ACTION_FOLD
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(295, 335)));
addUiReactionToSeq(UIReaction.UIR_ACTION_FOLD, reactionSeq);
//UIReaction.UIR_ACTION_CHECK
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(365, 335)));
addUiReactionToSeq(UIReaction.UIR_ACTION_CHECK, reactionSeq);
//UIReaction.UIR_ACTION_ALLIN
// redesign
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(447, 295)));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_WAIT,
null, 300, null));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(434, 330)));
addUiReactionToSeq(UIReaction.UIR_ACTION_ALLIN, reactionSeq);
//UIReaction.UIR_ACTION_RAISE
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(449, 309)));
for (int i = 0; i < 7; i++) {
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_CLICK, KeyEvent.VK_DELETE, null));
}
for (int i = 0; i < 7; i++) {
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_CLICK, KeyEvent.VK_BACK_SPACE, null));
}
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_PRESS, KeyEvent.VK_CONTROL, null));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_PRESS, KeyEvent.VK_V, null));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_RELEASE, KeyEvent.VK_V, null));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_RELEASE, KeyEvent.VK_CONTROL, null));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(435, 335)));
addUiReactionToSeq(UIReaction.UIR_ACTION_RAISE, reactionSeq);
//UIReaction.UIR_ACTION_CALL
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(360, 335)));
addUiReactionToSeq(UIReaction.UIR_ACTION_CALL, reactionSeq);
//UIReaction.UIR_CLOSE_WINDOW
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(476, 9)));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(203, 293)));
addUiReactionToSeq(UIReaction.UIR_CLOSE_WINDOW, reactionSeq);
//UIReaction.UIR_ACCEPT_SYSTEM_WINDOW
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(203, 293)));
addUiReactionToSeq(UIReaction.UIR_ACCEPT_SYSTEM_WINDOW, reactionSeq);
//UIReaction.UIR_ACCEPT_SYSTEM_WINDOW_2
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(190, 273)));
addUiReactionToSeq(UIReaction.UIR_ACCEPT_SYSTEM_WINDOW_2, reactionSeq);
};
@Override
public void addReactionsRebuy() {
/*
UIReactionSeq reactionSeq;
final UIReactionStep reactionStep;
//UIReaction.UIReaction.UIR_REBUY
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(27, 258)));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(59, 216)));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(187, 216)));
for (int i = 0; i < 10; i++) {
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_CLICK, KeyEvent.VK_DELETE, null));
}
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_PRESS, KeyEvent.VK_CONTROL, null));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_PRESS, KeyEvent.VK_V, null));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_RELEASE, KeyEvent.VK_V, null));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_RELEASE, KeyEvent.VK_CONTROL, null));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(187, 319)));
addUiReactionToSeq(UIReaction.UIR_REBUY, reactionSeq);
*/
};
@Override
public void addReactionOpenWindow() {
UIReactionSeq reactionSeq;
final UIReactionStep reactionStep;
//UIReaction.UIReaction.UIR_OPEN_WINDOW
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(405, 500)));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_MOVE, 0, new Point(1200, 1000)));
addUiReactionToSeq(UIReaction.UIR_OPEN_WINDOW, reactionSeq);
//UIR_MN_CLOSE_SYSTEM_WINDOW
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(376, 414)));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_MOVE, 0, new Point(1200, 1000)));
addUiReactionToSeq(UIReaction.UIR_MN_CLOSE_SYSTEM_WINDOW, reactionSeq);
//UIR_TAKE_BUYIN_SUMM
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(188, 216)));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_PRESS, InputEvent.BUTTON1_MASK, null));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_MOVE, 0, new Point(288, 216)));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_RELEASE, InputEvent.BUTTON1_MASK, null));
/*
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_PRESS,
KeyEvent.VK_SHIFT, null));
for(int i = 0; i<10; i++){
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_CLICK,
KeyEvent.VK_RIGHT, null));
}
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_RELEASE,
KeyEvent.VK_SHIFT, null));
*/
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_PRESS, KeyEvent.VK_CONTROL, null));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_PRESS, KeyEvent.VK_C, null));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_RELEASE, KeyEvent.VK_C, null));
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_KEYBOARD,
UIReactionDoing.KEY_RELEASE, KeyEvent.VK_CONTROL, null));
addUiReactionToSeq(UIReaction.UIR_TAKE_BUYIN_SUMM, reactionSeq);
//UIR_ACCEPT_BUYIN
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(198, 320)));
addUiReactionToSeq(UIReaction.UIR_ACCEPT_BUYIN, reactionSeq);
//UIR_REJECT_BUYIN
reactionSeq = new UIReactionSeq();
reactionSeq.addReactionStep(new UIReactionStep(UIReactionPrimitive.UIRP_MOUSE,
UIReactionDoing.MOUSE_CLICK, 0, new Point(280, 320)));
addUiReactionToSeq(UIReaction.UIR_REJECT_BUYIN, reactionSeq);
};
@Override
public BufferParser getBufferParser(String heroName) {
return new IPokerBufferParser(heroName);
}
}