ipathelper 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ipathelper-1.0.0/LICENSE +20 -0
- ipathelper-1.0.0/PKG-INFO +106 -0
- ipathelper-1.0.0/README.rst +89 -0
- ipathelper-1.0.0/ipathelper/__init__.py +1 -0
- ipathelper-1.0.0/ipathelper/ipathelper.py +356 -0
- ipathelper-1.0.0/ipathelper/x64/IpatHelper.dll +0 -0
- ipathelper-1.0.0/ipathelper/x86/IpatHelper.dll +0 -0
- ipathelper-1.0.0/pyproject.toml +25 -0
ipathelper-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2024 Mikimini9627
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
4
|
+
copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: ipathelper
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: PythonでIPATに投票する際に利用可能なモジュール
|
|
5
|
+
License: MIT
|
|
6
|
+
Author: Mikimini9627
|
|
7
|
+
Requires-Python: >=3.12
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Project-URL: Homepage, https://github.com/Mikimini9627/ipathelper
|
|
14
|
+
Project-URL: Repository, https://github.com/Mikimini9627/ipathelper
|
|
15
|
+
Description-Content-Type: text/x-rst
|
|
16
|
+
|
|
17
|
+
=====================
|
|
18
|
+
ipathelper
|
|
19
|
+
=====================
|
|
20
|
+
|
|
21
|
+
--------
|
|
22
|
+
概要
|
|
23
|
+
--------
|
|
24
|
+
|
|
25
|
+
`Github <https://github.com/Mikimini9627/IpatHelper>`__ ではPython以外の利用例を公開しています。
|
|
26
|
+
関数仕様については `関数仕様書 <https://github.com/Mikimini9627/IpatHelper/blob/main/Build/%E9%96%A2%E6%95%B0%E4%BB%95%E6%A7%98%E6%9B%B8.md>`__ を確認してください。
|
|
27
|
+
|
|
28
|
+
--------
|
|
29
|
+
使用方法
|
|
30
|
+
--------
|
|
31
|
+
|
|
32
|
+
.. code-block:: python
|
|
33
|
+
|
|
34
|
+
from ipathelper import *
|
|
35
|
+
|
|
36
|
+
def main():
|
|
37
|
+
|
|
38
|
+
try:
|
|
39
|
+
# モジュールのイニシャライズ
|
|
40
|
+
returnValue = init()
|
|
41
|
+
if returnValue == False:
|
|
42
|
+
return
|
|
43
|
+
|
|
44
|
+
# ログイン処理(各自自分のIDに変えてください)
|
|
45
|
+
returnValue = login('********', '********', '****', '****')
|
|
46
|
+
if (returnValue & 1) != 1:
|
|
47
|
+
uninit()
|
|
48
|
+
print("ログインに失敗しました。")
|
|
49
|
+
return
|
|
50
|
+
|
|
51
|
+
# 馬券購入用のインスタンス取得
|
|
52
|
+
betData = ST_BET_DATA()
|
|
53
|
+
returnValue = get_bet_instance(KAISAI_NAKAYAMA, 11, 2020, 12, 27,
|
|
54
|
+
HOUSHIKI_FORMATION, SHIKIBETSU_TRIO, 100, "1,9-2,3,13-7,3,8,10", betData)
|
|
55
|
+
if (returnValue & 1) != 1:
|
|
56
|
+
logout()
|
|
57
|
+
uninit()
|
|
58
|
+
print("馬券購入情報の取得に失敗しました。")
|
|
59
|
+
return
|
|
60
|
+
|
|
61
|
+
# 馬券購入処理実行
|
|
62
|
+
betDataList = (ST_BET_DATA * 1)()
|
|
63
|
+
betDataList[0] = betData
|
|
64
|
+
returnValue = bet(betDataList, 1, 0)
|
|
65
|
+
if (returnValue & 1) != 1:
|
|
66
|
+
logout()
|
|
67
|
+
uninit()
|
|
68
|
+
print("馬券購入に失敗しました。")
|
|
69
|
+
return
|
|
70
|
+
|
|
71
|
+
# 馬券購入用のインスタンス取得(WIN5)
|
|
72
|
+
betDataWin5 = ST_BET_DATA_WIN5()
|
|
73
|
+
returnValue = get_bet_instance_win5(100, 2020, 12, 27, "1,14-9,13-12-2-1,1,3,5", betDataWin5)
|
|
74
|
+
if (returnValue & 1) != 1:
|
|
75
|
+
logout()
|
|
76
|
+
uninit()
|
|
77
|
+
print("馬券購入情報(WIN5)の取得に失敗しました。")
|
|
78
|
+
return
|
|
79
|
+
|
|
80
|
+
# 馬券購入処理実行(WIN5)
|
|
81
|
+
returnValue = bet_win5(betDataWin5, 0)
|
|
82
|
+
if (returnValue & 1) != 1:
|
|
83
|
+
logout()
|
|
84
|
+
uninit()
|
|
85
|
+
print("馬券購入(WIN5)に失敗しました。")
|
|
86
|
+
return
|
|
87
|
+
|
|
88
|
+
finally:
|
|
89
|
+
|
|
90
|
+
# ログアウト処理
|
|
91
|
+
logout()
|
|
92
|
+
|
|
93
|
+
# モジュールのファイナライズ
|
|
94
|
+
uninit()
|
|
95
|
+
|
|
96
|
+
if __name__ == '__main__':
|
|
97
|
+
main()
|
|
98
|
+
|
|
99
|
+
----------------
|
|
100
|
+
インストール方法
|
|
101
|
+
----------------
|
|
102
|
+
|
|
103
|
+
.. code-block:: console
|
|
104
|
+
|
|
105
|
+
$ pip install ipathelper
|
|
106
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
=====================
|
|
2
|
+
ipathelper
|
|
3
|
+
=====================
|
|
4
|
+
|
|
5
|
+
--------
|
|
6
|
+
概要
|
|
7
|
+
--------
|
|
8
|
+
|
|
9
|
+
`Github <https://github.com/Mikimini9627/IpatHelper>`__ ではPython以外の利用例を公開しています。
|
|
10
|
+
関数仕様については `関数仕様書 <https://github.com/Mikimini9627/IpatHelper/blob/main/Build/%E9%96%A2%E6%95%B0%E4%BB%95%E6%A7%98%E6%9B%B8.md>`__ を確認してください。
|
|
11
|
+
|
|
12
|
+
--------
|
|
13
|
+
使用方法
|
|
14
|
+
--------
|
|
15
|
+
|
|
16
|
+
.. code-block:: python
|
|
17
|
+
|
|
18
|
+
from ipathelper import *
|
|
19
|
+
|
|
20
|
+
def main():
|
|
21
|
+
|
|
22
|
+
try:
|
|
23
|
+
# モジュールのイニシャライズ
|
|
24
|
+
returnValue = init()
|
|
25
|
+
if returnValue == False:
|
|
26
|
+
return
|
|
27
|
+
|
|
28
|
+
# ログイン処理(各自自分のIDに変えてください)
|
|
29
|
+
returnValue = login('********', '********', '****', '****')
|
|
30
|
+
if (returnValue & 1) != 1:
|
|
31
|
+
uninit()
|
|
32
|
+
print("ログインに失敗しました。")
|
|
33
|
+
return
|
|
34
|
+
|
|
35
|
+
# 馬券購入用のインスタンス取得
|
|
36
|
+
betData = ST_BET_DATA()
|
|
37
|
+
returnValue = get_bet_instance(KAISAI_NAKAYAMA, 11, 2020, 12, 27,
|
|
38
|
+
HOUSHIKI_FORMATION, SHIKIBETSU_TRIO, 100, "1,9-2,3,13-7,3,8,10", betData)
|
|
39
|
+
if (returnValue & 1) != 1:
|
|
40
|
+
logout()
|
|
41
|
+
uninit()
|
|
42
|
+
print("馬券購入情報の取得に失敗しました。")
|
|
43
|
+
return
|
|
44
|
+
|
|
45
|
+
# 馬券購入処理実行
|
|
46
|
+
betDataList = (ST_BET_DATA * 1)()
|
|
47
|
+
betDataList[0] = betData
|
|
48
|
+
returnValue = bet(betDataList, 1, 0)
|
|
49
|
+
if (returnValue & 1) != 1:
|
|
50
|
+
logout()
|
|
51
|
+
uninit()
|
|
52
|
+
print("馬券購入に失敗しました。")
|
|
53
|
+
return
|
|
54
|
+
|
|
55
|
+
# 馬券購入用のインスタンス取得(WIN5)
|
|
56
|
+
betDataWin5 = ST_BET_DATA_WIN5()
|
|
57
|
+
returnValue = get_bet_instance_win5(100, 2020, 12, 27, "1,14-9,13-12-2-1,1,3,5", betDataWin5)
|
|
58
|
+
if (returnValue & 1) != 1:
|
|
59
|
+
logout()
|
|
60
|
+
uninit()
|
|
61
|
+
print("馬券購入情報(WIN5)の取得に失敗しました。")
|
|
62
|
+
return
|
|
63
|
+
|
|
64
|
+
# 馬券購入処理実行(WIN5)
|
|
65
|
+
returnValue = bet_win5(betDataWin5, 0)
|
|
66
|
+
if (returnValue & 1) != 1:
|
|
67
|
+
logout()
|
|
68
|
+
uninit()
|
|
69
|
+
print("馬券購入(WIN5)に失敗しました。")
|
|
70
|
+
return
|
|
71
|
+
|
|
72
|
+
finally:
|
|
73
|
+
|
|
74
|
+
# ログアウト処理
|
|
75
|
+
logout()
|
|
76
|
+
|
|
77
|
+
# モジュールのファイナライズ
|
|
78
|
+
uninit()
|
|
79
|
+
|
|
80
|
+
if __name__ == '__main__':
|
|
81
|
+
main()
|
|
82
|
+
|
|
83
|
+
----------------
|
|
84
|
+
インストール方法
|
|
85
|
+
----------------
|
|
86
|
+
|
|
87
|
+
.. code-block:: console
|
|
88
|
+
|
|
89
|
+
$ pip install ipathelper
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .ipathelper import *
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
from ctypes import *
|
|
2
|
+
from ctypes import wintypes
|
|
3
|
+
from pathlib import *
|
|
4
|
+
from sys import *
|
|
5
|
+
|
|
6
|
+
global lib
|
|
7
|
+
|
|
8
|
+
KAISAI_SAPPORO = 0
|
|
9
|
+
KAISAI_HAKODATE = 1
|
|
10
|
+
KAISAI_FUKUSHIMA = 2
|
|
11
|
+
KAISAI_NIIGATA = 3
|
|
12
|
+
KAISAI_TOKYO = 4
|
|
13
|
+
KAISAI_NAKAYAMA = 5
|
|
14
|
+
KAISAI_CHUKYO = 6
|
|
15
|
+
KAISAI_KYOTO = 7
|
|
16
|
+
KAISAI_HANSHIN = 8
|
|
17
|
+
KAISAI_KOKURA = 9
|
|
18
|
+
|
|
19
|
+
KAISAI_SONODA = 10
|
|
20
|
+
KAISAI_HIMEJI = 11
|
|
21
|
+
KAISAI_NAGOYA = 12
|
|
22
|
+
KAISAI_MONBETSU = 13
|
|
23
|
+
KAISAI_MORIOKA = 14
|
|
24
|
+
KAISAI_MIZUSAWA = 15
|
|
25
|
+
KAISAI_URAWA = 16
|
|
26
|
+
KAISAI_FUNABASHI = 17
|
|
27
|
+
KAISAI_OI = 18
|
|
28
|
+
KAISAI_KAWASAKI = 19
|
|
29
|
+
KAISAI_KASAMATSU = 20
|
|
30
|
+
KAISAI_KANAZAWA = 21
|
|
31
|
+
KAISAI_KOCHI = 22
|
|
32
|
+
KAISAI_SAGA = 23
|
|
33
|
+
KAISAI_LONGCHAMP = 24
|
|
34
|
+
KAISAI_SHATIN = 25
|
|
35
|
+
KAISAI_SANTAANITA = 26
|
|
36
|
+
KAISAI_DEAUVILE = 27
|
|
37
|
+
KAISAI_CHURCHILLDOWNS = 28
|
|
38
|
+
KAISAI_ABDULAZIZ = 29
|
|
39
|
+
|
|
40
|
+
HOUSHIKI_NORMAL = 0
|
|
41
|
+
HOUSHIKI_FORMATION = 1
|
|
42
|
+
HOUSHIKI_BOX = 2
|
|
43
|
+
|
|
44
|
+
SHIKIBETSU_WIN = 1
|
|
45
|
+
SHIKIBETSU_PLACE = 2
|
|
46
|
+
SHIKIBETSU_BRACKETQUINELLA = 3
|
|
47
|
+
SHIKIBETSU_QUINELLAPLACE = 4
|
|
48
|
+
SHIKIBETSU_QUINELLA = 5
|
|
49
|
+
SHIKIBETSU_EXACTA = 6
|
|
50
|
+
SHIKIBETSU_TRIO = 7
|
|
51
|
+
SHIKIBETSU_TRIFECTA = 8
|
|
52
|
+
|
|
53
|
+
DAYTYPE_TODAY = 1
|
|
54
|
+
DAYTYPE_BEFORE = 2
|
|
55
|
+
|
|
56
|
+
BETFLAG_NORMAL = 1
|
|
57
|
+
BETFLAG_WIN5 = 2
|
|
58
|
+
BETFLAG_INTERNAL = 3
|
|
59
|
+
|
|
60
|
+
DECISIONFLAG_DEFAULT = 1
|
|
61
|
+
DECISIONFLAG_NORMAL = 2
|
|
62
|
+
DECISIONFLAG_DEADLINE = 3
|
|
63
|
+
DECISIONFLAG_CANCEL = 4
|
|
64
|
+
DECISIONFLAG_FLATMATESCANCEL = 5
|
|
65
|
+
DECISIONFLAG_HIT = 6
|
|
66
|
+
DECISIONFLAG_MISS = 7
|
|
67
|
+
DECISIONFLAG_BACK = 8
|
|
68
|
+
DECISIONFLAG_PARTCANCEL = 10
|
|
69
|
+
DECISIONFLAG_INVALID = 11
|
|
70
|
+
DECISIONFLAG_SALECANCEL = 12
|
|
71
|
+
|
|
72
|
+
WEEKDAY_SUNDAY = 1
|
|
73
|
+
WEEKDAY_MONDAY = 2
|
|
74
|
+
WEEKDAY_TUESDAY = 3
|
|
75
|
+
WEEKDAY_WEDNESDAY = 4
|
|
76
|
+
WEEKDAY_THURSDAY = 5
|
|
77
|
+
WEEKDAY_FRIDAY = 6
|
|
78
|
+
WEEKDAY_SATURDAY = 7
|
|
79
|
+
|
|
80
|
+
SUCCESS = 1
|
|
81
|
+
UNSUCCESS = 2
|
|
82
|
+
FAILED_CHUOU = 4
|
|
83
|
+
FAILED_CHIHOU = 8
|
|
84
|
+
FAILED_COMMUNICATE_CHUOU = 16
|
|
85
|
+
FAILED_COMMUNICATE_CHIHOU = 32
|
|
86
|
+
|
|
87
|
+
class ST_TICKET_DATA:
|
|
88
|
+
def __init__(self):
|
|
89
|
+
self.DayFlag = 0
|
|
90
|
+
self.ReceiptNo = 0
|
|
91
|
+
self.Hour = 0
|
|
92
|
+
self.Minute = 0
|
|
93
|
+
self.Kingaku = 0
|
|
94
|
+
self.Payout = 0
|
|
95
|
+
self.DetailCount = 0
|
|
96
|
+
self.DetailData = []
|
|
97
|
+
|
|
98
|
+
class ST_PURCHASE_DATA:
|
|
99
|
+
def __init__(self):
|
|
100
|
+
self.AvailableBetCount = 0
|
|
101
|
+
self.Balance = 0
|
|
102
|
+
self.DayPurchase = 0
|
|
103
|
+
self.DayHaraimodosi = 0
|
|
104
|
+
self.TotalPurchase = 0
|
|
105
|
+
self.TotalHaraimodosi = 0
|
|
106
|
+
self.TicketCount = 0
|
|
107
|
+
self.TicketData = []
|
|
108
|
+
|
|
109
|
+
#構造体マーシャリング用クラス
|
|
110
|
+
class ST_TICKET_DATA_DETAIL(Structure):
|
|
111
|
+
_fields_ = [("DecisionFlag", c_byte), ("BetFlag", c_byte), ("Kaisai", c_byte), ("RaceNo", c_byte), \
|
|
112
|
+
("Week", c_byte), ("Youbi", c_byte), ("Method", c_byte), ("Type", c_byte), ("HorseNo", POINTER(c_uint) * 5), ("Multi", c_byte)]
|
|
113
|
+
|
|
114
|
+
class ST_TICKET_DATA_INTERNAL(Structure):
|
|
115
|
+
_fields_ = [("DayFlag", c_byte), ("ReceiptNo", c_byte), ("Hour", c_byte), ("Minute", c_byte), \
|
|
116
|
+
("Kingaku", c_uint), ("Payout", c_uint), ("DetailCount", c_uint), ("DetailData", c_void_p)]
|
|
117
|
+
|
|
118
|
+
class ST_PURCHASE_DATA_INTERNAL(Structure):
|
|
119
|
+
_fields_ = [("AvailableBetCount", c_ushort), ("Balance", c_uint), ("DayPurchase", c_uint),\
|
|
120
|
+
("DayHaraimodosi", c_uint), ("TotalPurchase", c_uint), ("TotalHaraimodosi", c_uint), ("TicketCount", c_uint), ("TicketData", c_void_p)]
|
|
121
|
+
|
|
122
|
+
class ST_BET_DATA(Structure):
|
|
123
|
+
_fields_ = [("Place", c_ushort), ("RaceNo", c_byte), ("Youbi", c_byte), ("Kaikata", c_byte),\
|
|
124
|
+
("Shikibetsu", c_byte), ("Kingaku", c_uint), ("Umaban", c_uint * 3), ("TotalAmount", c_long)]
|
|
125
|
+
|
|
126
|
+
class ST_BET_DATA_WIN5(Structure):
|
|
127
|
+
_fields_ = [("Kingaku", c_uint), ("Youbi", c_byte), ("Umaban", c_uint * 5)]
|
|
128
|
+
|
|
129
|
+
def init():
|
|
130
|
+
'''
|
|
131
|
+
モジュールのイニシャライズ
|
|
132
|
+
'''
|
|
133
|
+
|
|
134
|
+
global lib
|
|
135
|
+
|
|
136
|
+
#Get the directory where the running file resides
|
|
137
|
+
dirName = str(Path(__file__).parent)
|
|
138
|
+
|
|
139
|
+
#Check dll exists
|
|
140
|
+
if maxsize > 2 ** 32:
|
|
141
|
+
libPath = Path(dirName + "\\x64\\IpatHelper.dll")
|
|
142
|
+
else:
|
|
143
|
+
libPath = Path(dirName + "\\x86\\IpatHelper.dll")
|
|
144
|
+
|
|
145
|
+
if libPath.exists() == False:
|
|
146
|
+
return False
|
|
147
|
+
|
|
148
|
+
lib = windll.LoadLibrary(str(libPath))
|
|
149
|
+
|
|
150
|
+
lib.Login.restype = c_uint
|
|
151
|
+
lib.Login.argtypes = [c_char_p, c_char_p, c_char_p, c_char_p]
|
|
152
|
+
|
|
153
|
+
lib.Logout.restype = c_uint
|
|
154
|
+
lib.Logout.argtypes = []
|
|
155
|
+
|
|
156
|
+
lib.Deposit.restype = c_uint
|
|
157
|
+
lib.Deposit.argtypes = [c_ushort]
|
|
158
|
+
|
|
159
|
+
lib.Withdraw.restype = c_uint
|
|
160
|
+
lib.Withdraw.argtypes = []
|
|
161
|
+
|
|
162
|
+
lib.GetPurchaseData.restype = c_uint
|
|
163
|
+
lib.GetPurchaseData.argtypes = [c_void_p]
|
|
164
|
+
|
|
165
|
+
lib.ReleasePurchaseData.restype = None
|
|
166
|
+
lib.ReleasePurchaseData.argtypes = [ST_PURCHASE_DATA_INTERNAL]
|
|
167
|
+
|
|
168
|
+
lib.GetBetInstance.restype = c_uint
|
|
169
|
+
lib.GetBetInstance.argtypes = [c_byte, c_byte, c_ushort, c_byte, c_byte, c_byte, c_byte, c_uint, c_char_p, c_void_p]
|
|
170
|
+
|
|
171
|
+
lib.Bet.restype = c_uint
|
|
172
|
+
lib.Bet.argtypes = [c_void_p, c_ushort, c_ushort]
|
|
173
|
+
|
|
174
|
+
lib.GetBetInstanceWin5.restype = c_uint
|
|
175
|
+
lib.GetBetInstanceWin5.argtypes = [c_uint, c_ushort, c_byte, c_byte, c_char_p, c_void_p]
|
|
176
|
+
|
|
177
|
+
lib.BetWin5.restype = c_uint
|
|
178
|
+
lib.BetWin5.argtypes = [c_void_p, c_ushort]
|
|
179
|
+
|
|
180
|
+
lib.SetAutoDepositFlag.restype = c_uint
|
|
181
|
+
lib.SetAutoDepositFlag.argtypes = [c_bool, c_ushort, c_ushort]
|
|
182
|
+
|
|
183
|
+
if maxsize > 2 ** 32:
|
|
184
|
+
windll.kernel32.FreeLibrary.argtypes = [wintypes.HMODULE]
|
|
185
|
+
|
|
186
|
+
def uninit():
|
|
187
|
+
'''
|
|
188
|
+
モジュールのファイナライズ
|
|
189
|
+
'''
|
|
190
|
+
|
|
191
|
+
global lib
|
|
192
|
+
|
|
193
|
+
libraryHandle = lib._handle
|
|
194
|
+
del lib
|
|
195
|
+
|
|
196
|
+
windll.kernel32.FreeLibrary(libraryHandle)
|
|
197
|
+
|
|
198
|
+
def login(iNetId : str, id : str, password : str, pars : str):
|
|
199
|
+
'''
|
|
200
|
+
ログイン処理実行
|
|
201
|
+
'''
|
|
202
|
+
|
|
203
|
+
global lib
|
|
204
|
+
|
|
205
|
+
return lib.Login(iNetId.encode('utf-8'), id.encode('utf-8'), password.encode('utf-8'), pars.encode('utf-8'))
|
|
206
|
+
|
|
207
|
+
def logout():
|
|
208
|
+
'''
|
|
209
|
+
ログアウト処理実行
|
|
210
|
+
'''
|
|
211
|
+
|
|
212
|
+
global lib
|
|
213
|
+
|
|
214
|
+
return lib.Logout()
|
|
215
|
+
|
|
216
|
+
def deposit(depositValue : int):
|
|
217
|
+
'''
|
|
218
|
+
入金処理実行
|
|
219
|
+
'''
|
|
220
|
+
|
|
221
|
+
global lib
|
|
222
|
+
|
|
223
|
+
return lib.Deposit(depositValue)
|
|
224
|
+
|
|
225
|
+
def withdraw():
|
|
226
|
+
'''
|
|
227
|
+
出金処理実行
|
|
228
|
+
'''
|
|
229
|
+
|
|
230
|
+
global lib
|
|
231
|
+
|
|
232
|
+
return lib.Withdraw()
|
|
233
|
+
|
|
234
|
+
def get_purchase_data(purchaseData : ST_PURCHASE_DATA):
|
|
235
|
+
'''
|
|
236
|
+
購入状況取得処理実行
|
|
237
|
+
'''
|
|
238
|
+
|
|
239
|
+
global lib
|
|
240
|
+
|
|
241
|
+
# 内部的な構造体のインスタンスを生成する
|
|
242
|
+
tempPurchaseData = ST_PURCHASE_DATA_INTERNAL()
|
|
243
|
+
|
|
244
|
+
# 購入状況を取得する
|
|
245
|
+
returnValue = lib.GetPurchaseData(byref(tempPurchaseData))
|
|
246
|
+
if (returnValue & 1) != 1:
|
|
247
|
+
return returnValue
|
|
248
|
+
|
|
249
|
+
# 返却用のデータに値を設定
|
|
250
|
+
purchaseData.TicketCount = tempPurchaseData.TicketCount
|
|
251
|
+
purchaseData.AvailableBetCount = tempPurchaseData.AvailableBetCount
|
|
252
|
+
purchaseData.Balance = tempPurchaseData.Balance
|
|
253
|
+
purchaseData.DayPurchase = tempPurchaseData.DayPurchase
|
|
254
|
+
purchaseData.DayHaraimodosi = tempPurchaseData.DayHaraimodosi
|
|
255
|
+
purchaseData.TotalPurchase = tempPurchaseData.TotalPurchase
|
|
256
|
+
purchaseData.TotalHaraimodosi = tempPurchaseData.TotalHaraimodosi
|
|
257
|
+
purchaseData.TicketCount = tempPurchaseData.TicketCount
|
|
258
|
+
|
|
259
|
+
if tempPurchaseData.TicketCount <= 0:
|
|
260
|
+
lib.ReleasePurchaseData(tempPurchaseData)
|
|
261
|
+
return returnValue
|
|
262
|
+
|
|
263
|
+
# 馬券データ(全て)を格納するためのバッファを確保
|
|
264
|
+
allTicketBytes = bytearray(string_at(tempPurchaseData.TicketData, \
|
|
265
|
+
sizeof(ST_TICKET_DATA_INTERNAL) * tempPurchaseData.TicketCount))
|
|
266
|
+
|
|
267
|
+
for i in range(tempPurchaseData.TicketCount):
|
|
268
|
+
# 1つ分の構造体データを格納するバッファを確保して情報を格納する
|
|
269
|
+
oneTicketBytes = bytearray(sizeof(ST_TICKET_DATA_INTERNAL))
|
|
270
|
+
for j in range(sizeof(ST_TICKET_DATA_INTERNAL)):
|
|
271
|
+
oneTicketBytes[j] = allTicketBytes[j + i * sizeof(ST_TICKET_DATA_INTERNAL)]
|
|
272
|
+
|
|
273
|
+
# 馬券データ(1個)をインスタンスに変換
|
|
274
|
+
oneTicketData = ST_TICKET_DATA_INTERNAL.from_buffer(oneTicketBytes, 0)
|
|
275
|
+
|
|
276
|
+
# 返却用の馬券データ(1個)を生成
|
|
277
|
+
tempTicketData = ST_TICKET_DATA()
|
|
278
|
+
|
|
279
|
+
# 返却用のデータに値を設定
|
|
280
|
+
tempTicketData.DayFlag = oneTicketData.DayFlag
|
|
281
|
+
tempTicketData.DetailCount = oneTicketData.DetailCount
|
|
282
|
+
tempTicketData.Hour = oneTicketData.Hour
|
|
283
|
+
tempTicketData.Minute = oneTicketData.Minute
|
|
284
|
+
tempTicketData.Kingaku = oneTicketData.Kingaku
|
|
285
|
+
tempTicketData.Payout = oneTicketData.Payout
|
|
286
|
+
tempTicketData.ReceiptNo = oneTicketData.ReceiptNo
|
|
287
|
+
|
|
288
|
+
if oneTicketData.DetailCount <= 0:
|
|
289
|
+
lib.ReleasePurchaseData(tempPurchaseData)
|
|
290
|
+
return returnValue
|
|
291
|
+
|
|
292
|
+
# 詳細データ(全て)を格納するためのバッファを確保
|
|
293
|
+
allDetailBytes = bytearray(string_at(oneTicketData.DetailData, \
|
|
294
|
+
sizeof(ST_TICKET_DATA_DETAIL) * oneTicketData.DetailCount))
|
|
295
|
+
|
|
296
|
+
for j in range(oneTicketData.DetailCount):
|
|
297
|
+
# 1つ分の構造体データを格納するバッファを確保して情報を格納する
|
|
298
|
+
oneDetailBytes = bytearray(sizeof(ST_TICKET_DATA_DETAIL))
|
|
299
|
+
for k in range(sizeof(ST_TICKET_DATA_DETAIL)):
|
|
300
|
+
oneDetailBytes[k] = allDetailBytes[k + j * sizeof(ST_TICKET_DATA_DETAIL)]
|
|
301
|
+
|
|
302
|
+
# 詳細データ(1個)をインスタンスに変換
|
|
303
|
+
tempTicketData.DetailData.append(ST_TICKET_DATA_DETAIL.from_buffer(oneDetailBytes, 0))
|
|
304
|
+
|
|
305
|
+
# 馬券データを引数に追加する
|
|
306
|
+
purchaseData.TicketData.append(tempTicketData)
|
|
307
|
+
|
|
308
|
+
lib.ReleasePurchaseData(tempPurchaseData)
|
|
309
|
+
|
|
310
|
+
return returnValue
|
|
311
|
+
|
|
312
|
+
def get_bet_instance(kaisai : int, raceNo : int, year : int, month : int, day : int, \
|
|
313
|
+
houshiki : int, shikibetsu : int, kingaku : int, kaime : str, betData : ST_BET_DATA):
|
|
314
|
+
'''
|
|
315
|
+
馬券購入用インスタンス取得処理
|
|
316
|
+
'''
|
|
317
|
+
|
|
318
|
+
global lib
|
|
319
|
+
|
|
320
|
+
return lib.GetBetInstance(kaisai, raceNo, year, month, day, houshiki, shikibetsu, kingaku, kaime.encode('utf-8'), byref(betData))
|
|
321
|
+
|
|
322
|
+
def get_bet_instance_win5(kingaku : int, year : int, month : int, day : int, kaime : str, betData : ST_BET_DATA_WIN5):
|
|
323
|
+
'''
|
|
324
|
+
馬券購入用インスタンス取得処理(WIN5)
|
|
325
|
+
'''
|
|
326
|
+
|
|
327
|
+
global lib
|
|
328
|
+
|
|
329
|
+
return lib.GetBetInstanceWin5(kingaku, year, month, day, kaime.encode('utf-8'), byref(betData))
|
|
330
|
+
|
|
331
|
+
def bet(betDataList : list, listCount : int, waitMiliSeconds : int):
|
|
332
|
+
'''
|
|
333
|
+
馬券購入処理実行
|
|
334
|
+
'''
|
|
335
|
+
|
|
336
|
+
global lib
|
|
337
|
+
|
|
338
|
+
return lib.Bet(betDataList, listCount, waitMiliSeconds)
|
|
339
|
+
|
|
340
|
+
def bet_win5(betData : ST_BET_DATA_WIN5, waitMiliSeconds : int):
|
|
341
|
+
'''
|
|
342
|
+
馬券購入処理実行(WIN5)
|
|
343
|
+
'''
|
|
344
|
+
|
|
345
|
+
global lib
|
|
346
|
+
|
|
347
|
+
return lib.BetWin5(betData, waitMiliSeconds)
|
|
348
|
+
|
|
349
|
+
def set_auto_deposit_flag(enable : bool, depositValue : int, confirmTimeout : int):
|
|
350
|
+
'''
|
|
351
|
+
自動入金機能フラグ設定
|
|
352
|
+
'''
|
|
353
|
+
|
|
354
|
+
global lib
|
|
355
|
+
|
|
356
|
+
return lib.SetAutoDepositFlag(enable, depositValue, confirmTimeout)
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "ipathelper"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = ""
|
|
5
|
+
authors = [
|
|
6
|
+
{name = "Mikimini9627"}
|
|
7
|
+
]
|
|
8
|
+
readme = "README.rst"
|
|
9
|
+
requires-python = ">=3.12"
|
|
10
|
+
|
|
11
|
+
[build-system]
|
|
12
|
+
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
|
13
|
+
build-backend = "poetry.core.masonry.api"
|
|
14
|
+
|
|
15
|
+
[tool.poetry]
|
|
16
|
+
description = "PythonでIPATに投票する際に利用可能なモジュール"
|
|
17
|
+
license = "MIT License"
|
|
18
|
+
homepage = "https://github.com/Mikimini9627/ipathelper"
|
|
19
|
+
repository = "https://github.com/Mikimini9627/ipathelper"
|
|
20
|
+
readme = "README.rst"
|
|
21
|
+
classifiers = [
|
|
22
|
+
'Intended Audience :: Developers',
|
|
23
|
+
'License :: OSI Approved :: MIT License',
|
|
24
|
+
'Programming Language :: Python :: 3.12',
|
|
25
|
+
]
|