fix bug in fold button click function
This commit is contained in:
parent
2e3c9eb117
commit
dfcf6af304
1 changed files with 7 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
|||
// ==UserScript==
|
||||
// @name onlinetichu.com card counter
|
||||
// @version 1.1.0
|
||||
// @version 1.1.1
|
||||
// @description automatically count cards at onlinetichu.com
|
||||
// @author kesslermaximilian
|
||||
// @match *://*.onlinetichu.com/Site/Game/Table/*
|
||||
|
@ -396,7 +396,7 @@ function injectCounter() {
|
|||
|
||||
// overwrite functionality of fold button
|
||||
ot.$fold.unbind();
|
||||
ot.$fold.click()(function () {
|
||||
ot.$fold.hide().click(function () {
|
||||
if (otc.davidProtection) {
|
||||
if(ot.$passCards.length != 0 && !otc.davidProtectionTriggered) {
|
||||
ot.$gameMessage.text("You have selected cards to play but folded. Are you sure? Press fold again to fold");
|
||||
|
@ -404,7 +404,7 @@ function injectCounter() {
|
|||
return;
|
||||
}
|
||||
}
|
||||
ot.action.fold();
|
||||
ot.action.Fold();
|
||||
otc.davidProtectionTriggered = false;
|
||||
$(this).hide();
|
||||
});
|
||||
|
@ -436,15 +436,15 @@ function injectCounter() {
|
|||
|
||||
otc.action.drawPlayedCards();
|
||||
|
||||
console.log('reached smartFold point');
|
||||
// console.log('reached smartFold point');
|
||||
$(message.Table.Players).each(function () {
|
||||
if (this.Username == ot.$Username.val()) {
|
||||
console.log('found player');
|
||||
// console.log('found player');
|
||||
if (message.Table.Turn == this.Position) {
|
||||
console.log('my turn!');
|
||||
// console.log('my turn!');
|
||||
if (this.Cards.length < 4 && this.Cards.length < message.Table.TableCards.length) {
|
||||
console.log('obvious that have to fold now');
|
||||
if (otc.smartFold) {
|
||||
console.log('smart fold triggered');
|
||||
ot.action.Fold();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue