2024-02-06, update for maxbot plus extension on ibon.
parent
fc088781ab
commit
8c51f5338d
|
@ -41,7 +41,7 @@ try:
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
CONST_APP_VERSION = "MaxBot (2024.02.05)"
|
CONST_APP_VERSION = "MaxBot (2024.02.06)"
|
||||||
|
|
||||||
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
|
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
|
||||||
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
||||||
|
|
|
@ -22,7 +22,7 @@ import sys
|
||||||
import threading
|
import threading
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
|
||||||
CONST_APP_VERSION = "MaxBot (2024.02.05)"
|
CONST_APP_VERSION = "MaxBot (2024.02.06)"
|
||||||
|
|
||||||
CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json"
|
CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json"
|
||||||
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
||||||
|
|
|
@ -48,7 +48,7 @@ try:
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
CONST_APP_VERSION = "MaxBot (2024.02.05)"
|
CONST_APP_VERSION = "MaxBot (2024.02.06)"
|
||||||
|
|
||||||
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
|
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
|
||||||
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
||||||
|
|
|
@ -36,25 +36,30 @@ function ibon_area_ready(settings) {
|
||||||
target_row=all_row;
|
target_row=all_row;
|
||||||
} else {
|
} else {
|
||||||
// multi select.
|
// multi select.
|
||||||
all_row.each(function ()
|
try {
|
||||||
{
|
all_row.each(function ()
|
||||||
//console.log(all_row.index(this));
|
{
|
||||||
let is_match_keyword = false;
|
//console.log(all_row.index(this));
|
||||||
if(all_row.index(this)==0) {
|
let is_match_keyword = false;
|
||||||
target_row=$(this);
|
|
||||||
} else {
|
|
||||||
if(area_keyword_array.length) {
|
if(area_keyword_array.length) {
|
||||||
let html_text=$(this).text();
|
let html_text=$(this).text();
|
||||||
//console.log("html:"+html_text);
|
//console.log("html:"+html_text);
|
||||||
|
|
||||||
|
// TOOD: multi item matched, need sort.
|
||||||
for (let i = 0; i < area_keyword_array.length; i++) {
|
for (let i = 0; i < area_keyword_array.length; i++) {
|
||||||
// TOOD: multi item matched, need sort.
|
|
||||||
// target_area = get_target_area_with_order(settings, matched_block);
|
// target_area = get_target_area_with_order(settings, matched_block);
|
||||||
|
//console.log("area_keyword:"+area_keyword_array[i]);
|
||||||
|
|
||||||
if(html_text.indexOf(area_keyword_array[i])>-1) {
|
if(area_keyword_array[i].indexOf(" ")>-1) {
|
||||||
is_match_keyword = true;
|
// TODO: muti keywords with AND logic.
|
||||||
target_row=$(this);
|
} else {
|
||||||
break;
|
// single keyword.
|
||||||
|
if(html_text.indexOf(area_keyword_array[i])>-1) {
|
||||||
|
is_match_keyword = true;
|
||||||
|
target_row=$(this);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -63,15 +68,20 @@ function ibon_area_ready(settings) {
|
||||||
target_row=$(this);
|
target_row=$(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//console.log("is_match_keyword:"+is_match_keyword);
|
//console.log("is_match_keyword:"+is_match_keyword);
|
||||||
if(is_match_keyword) {
|
if(is_match_keyword) {
|
||||||
return;
|
throw {};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} catch { }
|
||||||
}
|
}
|
||||||
if(target_row) {
|
if(target_row) {
|
||||||
target_row.click();
|
//console.log("found target, clicking");
|
||||||
|
// click fail on sandbox world.
|
||||||
|
//target_row.click();
|
||||||
|
let done_div="<div style='display:none' id='maxbot'>"+ target_row.attr("id") +"</div>";
|
||||||
|
$("body").append(done_div);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
var myInterval = null;
|
||||||
|
|
||||||
|
function dom_ready()
|
||||||
|
{
|
||||||
|
let ret=false;
|
||||||
|
if($("#maxbot").length>0) {
|
||||||
|
let target_id = $("#maxbot").text();
|
||||||
|
//console.log(target_id);
|
||||||
|
$("#maxbot").remove();
|
||||||
|
ret=true;
|
||||||
|
if(myInterval) clearInterval(myInterval);
|
||||||
|
(function () {
|
||||||
|
if(target_id) {
|
||||||
|
console.log(target_id);
|
||||||
|
console.log($("#"+target_id).text());
|
||||||
|
//https://orders.ibon.com.tw/application/UTK02/UTK0201_000.aspx?PERFORMANCE_ID=B06PV2MC&PRODUCT_ID=B06PS1OC
|
||||||
|
//https://orders.ibon.com.tw/application/UTK02/UTK0202_.aspx?PERFORMANCE_ID=B06PV2MC&GROUP_ID=&PERFORMANCE_PRICE_AREA_ID=B06PV2PH
|
||||||
|
$("#"+target_id).trigger("click");
|
||||||
|
onTicketArea(target_id);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
//console.log("dom_ready:"+ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!dom_ready()) {
|
||||||
|
myInterval = setInterval(() => {
|
||||||
|
dom_ready();
|
||||||
|
}, 100);
|
||||||
|
}
|
|
@ -111,8 +111,6 @@ function ibon_event_status_check()
|
||||||
//console.log(event_code);
|
//console.log(event_code);
|
||||||
if(event_code){
|
if(event_code){
|
||||||
let api_url = "https://ticketapi.ibon.com.tw/api/ActivityInfo/GetGameInfoList";
|
let api_url = "https://ticketapi.ibon.com.tw/api/ActivityInfo/GetGameInfoList";
|
||||||
|
|
||||||
"{\"id\":38042,\"hasDeadline\":true,\"SystemBrowseType\":0}"
|
|
||||||
dataJSON = {
|
dataJSON = {
|
||||||
id: parseInt(event_code, 10),
|
id: parseInt(event_code, 10),
|
||||||
hasDeadline: true,
|
hasDeadline: true,
|
||||||
|
|
|
@ -1,11 +1,4 @@
|
||||||
var myInterval = null;
|
var myInterval = null;
|
||||||
//console.log("assign appear");
|
|
||||||
|
|
||||||
function begin()
|
|
||||||
{
|
|
||||||
console.log("begin to next");
|
|
||||||
$("div#ticket-wrap a[onclick]").click();
|
|
||||||
}
|
|
||||||
|
|
||||||
function dom_ready()
|
function dom_ready()
|
||||||
{
|
{
|
||||||
|
@ -14,14 +7,16 @@ function dom_ready()
|
||||||
$("#done").remove();
|
$("#done").remove();
|
||||||
ret=true;
|
ret=true;
|
||||||
if(myInterval) clearInterval(myInterval);
|
if(myInterval) clearInterval(myInterval);
|
||||||
begin();
|
(function () {
|
||||||
|
$("div#ticket-wrap a[onclick]").click();
|
||||||
|
})();
|
||||||
}
|
}
|
||||||
console.log("dom_ready:"+ret);
|
//console.log("dom_ready:"+ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!dom_ready()) {
|
if(!dom_ready()) {
|
||||||
myInterval = setInterval(() => {
|
myInterval = setInterval(() => {
|
||||||
dom_ready();
|
dom_ready();
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,28 +56,29 @@ function tixcraft_assign_ticket_number(settings)
|
||||||
{
|
{
|
||||||
//console.log(all_row.index(this));
|
//console.log(all_row.index(this));
|
||||||
let is_match_keyword = false;
|
let is_match_keyword = false;
|
||||||
if(all_row.index(this)==0) {
|
if(area_keyword_array.length) {
|
||||||
target_row=$(this);
|
let html_text=$(this).text();
|
||||||
} else {
|
//console.log("html:"+html_text);
|
||||||
if(area_keyword_array.length) {
|
|
||||||
let html_text=$(this).text();
|
|
||||||
//console.log("html:"+html_text);
|
|
||||||
|
|
||||||
for (let i = 0; i < area_keyword_array.length; i++) {
|
// TOOD: multi item matched, need sort.
|
||||||
// TOOD: multi item matched, need sort.
|
for (let i = 0; i < area_keyword_array.length; i++) {
|
||||||
// target_area = get_target_area_with_order(settings, matched_block);
|
// target_area = get_target_area_with_order(settings, matched_block);
|
||||||
|
console.log("area_keyword:"+area_keyword_array[i]);
|
||||||
|
|
||||||
|
if(area_keyword_array[i].indexOf(" ")>-1) {
|
||||||
|
// TODO: muti keywords with AND logic.
|
||||||
|
} else {
|
||||||
if(html_text.indexOf(area_keyword_array[i])>-1) {
|
if(html_text.indexOf(area_keyword_array[i])>-1) {
|
||||||
is_match_keyword = true;
|
is_match_keyword = true;
|
||||||
target_row=$(this);
|
target_row=$(this);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
if(all_row.index(this)==0) {
|
} else {
|
||||||
is_match_keyword = true;
|
if(all_row.index(this)==0) {
|
||||||
target_row=$(this);
|
is_match_keyword = true;
|
||||||
}
|
target_row=$(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//console.log("is_match_keyword:"+is_match_keyword);
|
//console.log("is_match_keyword:"+is_match_keyword);
|
||||||
|
|
|
@ -237,6 +237,17 @@
|
||||||
"js/ibon_area.js"
|
"js/ibon_area.js"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"matches": [
|
||||||
|
"https://orders.ibon.com.tw/application/UTK02/UTK0201_000.aspx?*"
|
||||||
|
],
|
||||||
|
"run_at": "document_end",
|
||||||
|
"world": "MAIN",
|
||||||
|
"js": [
|
||||||
|
"jquery.min.js",
|
||||||
|
"js/ibon_area_front.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"matches": [
|
"matches": [
|
||||||
"https://orders.ibon.com.tw/application/UTK02/UTK0201_001.aspx?PERFORMANCE_ID=*PERFORMANCE_PRICE_AREA_ID=*",
|
"https://orders.ibon.com.tw/application/UTK02/UTK0201_001.aspx?PERFORMANCE_ID=*PERFORMANCE_PRICE_AREA_ID=*",
|
||||||
|
@ -388,5 +399,5 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"version": "1.0.11"
|
"version": "1.0.12"
|
||||||
}
|
}
|
Loading…
Reference in New Issue