Client Upload Part 2

RD Core / Commit #5

Commit Client Upload Part 2

Alex Alex committed 19/10/2026 00:06 main Patch
1,244 files +271,215 -0
A RD_Client/modules/game_bot/scripts.png +0-0 View file
Binary file not shown.
A RD_Client/modules/game_bot/ui/basic.otui +88-0 View file
@@ -0,0 +1,88 @@
1+BotButton < Button
2+ height: 17
3+ margin-top: 2
4+
5+BotSwitch < Button
6+ margin-top: 2
7+ height: 17
8+ image-color: green
9+ $!on:
10+ image-color: red
11+
12+SmallBotSwitch < Button
13+ margin-top: 2
14+ height: 15
15+ image-color: green
16+ $!on:
17+ image-color: red
18+
19+BotLabel < Label
20+ margin-top: 2
21+ height: 15
22+ text-auto-resize: true
23+ text-align: center
24+ text-wrap: true
25+
26+BotItem < Item
27+ virtual: true
28+ &selectable: true
29+ &editable: true
30+
31+BotTextEdit < TextEdit
32+ @onClick: modules.client_textedit.show(self)
33+ text-align: center
34+ multiline: false
35+ focusable: false
36+ height: 20
37+
38+BotSeparator < HorizontalSeparator
39+ margin-top: 5
40+ margin-bottom: 3
41+
42+BotSmallScrollBar < SmallScrollBar
43+
44+BotPanel < Panel
45+ margin-top: 1
46+ ScrollablePanel
47+ id: content
48+ anchors.fill: parent
49+ margin-right: 8
50+ margin-left: 1
51+ margin-bottom: 5
52+ vertical-scrollbar: botPanelScroll
53+ layout:
54+ type: verticalBox
55+ $mobile:
56+ margin-right: 16
57+
58+ BotSmallScrollBar
59+ id: botPanelScroll
60+ anchors.top: parent.top
61+ anchors.bottom: parent.bottom
62+ anchors.right: parent.right
63+
64+CaveBotLabel < Label
65+ background-color: alpha
66+ text-offset: 2 0
67+ focusable: true
68+
69+ $focus:
70+ background-color: #00000055
71+
72+SlotComboBoxPopupMenu < ComboBoxPopupMenu
73+SlotComboBoxPopupMenuButton < ComboBoxPopupMenuButton
74+SlotComboBox < ComboBox
75+ @onSetup: |
76+ self:addOption("Head")
77+ self:addOption("Neck")
78+ self:addOption("Back")
79+ self:addOption("Body")
80+ self:addOption("Right")
81+ self:addOption("Left")
82+ self:addOption("Leg")
83+ self:addOption("Feet")
84+ self:addOption("Finger")
85+ self:addOption("Ammo")
86+ self:addOption("Purse")
87+
88+
A RD_Client/modules/game_bot/ui/config.otui +54-0 View file
@@ -0,0 +1,54 @@
1+BotConfig < Panel
2+ id: botConfig
3+ height: 45
4+ margin-left: 2
5+ margin-right: 2
6+
7+ ComboBox
8+ id: list
9+ anchors.top: parent.top
10+ anchors.left: parent.left
11+ text-offset: 3 0
12+ width: 130
13+
14+ Button
15+ id: switch
16+ anchors.top: prev.top
17+ anchors.left: prev.right
18+ anchors.right: parent.right
19+ margin-left: 5
20+ $on:
21+ text: On
22+ color: #00AA00
23+
24+ $!on:
25+ text: Off
26+ color: #FF0000
27+
28+ Button
29+ margin-top: 2
30+ id: add
31+ anchors.top: prev.bottom
32+ anchors.left: parent.left
33+ text: Add
34+ width: 56
35+ height: 18
36+ text-offet: 0 2
37+
38+ Button
39+ id: edit
40+ anchors.top: prev.top
41+ anchors.horizontalCenter: parent.horizontalCenter
42+ text: Edit
43+ width: 56
44+ height: 18
45+ text-offet: 0 2
46+
47+ Button
48+ id: remove
49+ anchors.top: prev.top
50+ anchors.right: parent.right
51+ text: Remove
52+ width: 56
53+ height: 18
54+ text-offet: 0 2
A RD_Client/modules/game_bot/ui/container.otui +19-0 View file
@@ -0,0 +1,19 @@
1+BotContainer < Panel
2+ height: 68
3+
4+ ScrollablePanel
5+ id: items
6+ anchors.fill: parent
7+ vertical-scrollbar: scroll
8+ layout:
9+ type: grid
10+ cell-size: 34 34
11+ flow: true
12+
13+ BotSmallScrollBar
14+ id: scroll
15+ anchors.top: prev.top
16+ anchors.bottom: prev.bottom
17+ anchors.right: parent.right
18+ step: 10
19+ pixels-scroll: true
A RD_Client/modules/game_bot/ui/icons.otui +60-0 View file
@@ -0,0 +1,60 @@
1+BotIcon < UIWidget
2+ size: 50 50
3+ anchors.horizontalCenter: parent.horizontalCenter
4+ anchors.verticalCenter: parent.verticalCenter
5+ focusable: false
6+ phantom: false
7+ draggable: true
8+
9+ UIItem
10+ id: item
11+ anchors.top: parent.top
12+ anchors.horizontalCenter: parent.horizontalCenter
13+ margin-top: 6
14+ virtual: true
15+ phantom: true
16+ size: 32 32
17+
18+ UICreature
19+ id: creature
20+ anchors.top: parent.top
21+ anchors.horizontalCenter: parent.horizontalCenter
22+ margin-top: 0
23+ size: 48 48
24+ phantom: true
25+
26+ UIWidget
27+ id: status
28+ anchors.top: parent.top
29+ anchors.left: parent.left
30+ size: 18 10
31+ color: black
32+ font: terminus-10px
33+ phantom: true
34+
35+ $on:
36+ text: ON
37+ background: green
38+
39+ $!on:
40+ text: OFF
41+ background: red
42+
43+ UIWidget
44+ id: hotkey
45+ anchors.top: parent.top
46+ anchors.left: parent.left
47+ anchors.right: parent.right
48+ size: 18 10
49+ color: white
50+ phantom: true
51+ text-align: right
52+
53+ UIWidget
54+ id: text
55+ anchors.bottom: parent.bottom
56+ anchors.left: parent.left
57+ anchors.right: parent.right
58+ text-wrap: true
59+ text-auto-resize: true
60+ phantom: true
A RD_Client/modules/game_bot/ui/panels.otui +240-0 View file
@@ -0,0 +1,240 @@
1+DualScrollPanel < Panel
2+ height: 51
3+ margin-top: 3
4+
5+ SmallBotSwitch
6+ id: title
7+ anchors.left: parent.left
8+ anchors.right: parent.right
9+ anchors.top: parent.top
10+ text-align: center
11+
12+ HorizontalScrollBar
13+ id: scroll1
14+ anchors.left: title.left
15+ anchors.right: title.horizontalCenter
16+ anchors.top: title.bottom
17+ margin-right: 2
18+ margin-top: 2
19+ minimum: 0
20+ maximum: 100
21+ step: 1
22+ &disableScroll: true
23+
24+ HorizontalScrollBar
25+ id: scroll2
26+ anchors.left: title.horizontalCenter
27+ anchors.right: title.right
28+ anchors.top: prev.top
29+ margin-left: 2
30+ minimum: 0
31+ maximum: 100
32+ step: 1
33+ &disableScroll: true
34+
35+ BotTextEdit
36+ id: text
37+ anchors.left: parent.left
38+ anchors.right: parent.right
39+ anchors.top: scroll1.bottom
40+ margin-top: 3
41+ margin-left: 2
42+ margin-right: 1
43+
44+SingleScrollItemPanel < Panel
45+ height: 45
46+ margin-top: 2
47+
48+ BotItem
49+ id: item
50+ anchors.left: parent.left
51+ anchors.top: prev.bottom
52+ margin-top: 3
53+
54+ SmallBotSwitch
55+ id: title
56+ anchors.left: prev.right
57+ anchors.right: parent.right
58+ anchors.top: prev.top
59+ margin-left: 2
60+ text-align: center
61+
62+ HorizontalScrollBar
63+ id: scroll
64+ anchors.left: title.left
65+ anchors.right: title.right
66+ anchors.top: title.bottom
67+ margin-top: 2
68+ minimum: 0
69+ maximum: 100
70+ step: 1
71+ &disableScroll: true
72+
73+DualScrollItemPanel < Panel
74+ height: 33
75+ margin-top: 3
76+
77+ BotItem
78+ id: item
79+ anchors.left: parent.left
80+ anchors.top: prev.bottom
81+ margin-top: 3
82+
83+ SmallBotSwitch
84+ id: title
85+ anchors.left: prev.right
86+ anchors.right: parent.right
87+ anchors.top: prev.top
88+ margin-left: 2
89+ text-align: center
90+
91+ HorizontalScrollBar
92+ id: scroll1
93+ anchors.left: title.left
94+ anchors.right: title.horizontalCenter
95+ anchors.top: title.bottom
96+ margin-top: 2
97+ margin-right: 2
98+ minimum: 0
99+ maximum: 100
100+ step: 1
101+ &disableScroll: true
102+
103+ HorizontalScrollBar
104+ id: scroll2
105+ anchors.left: title.horizontalCenter
106+ anchors.right: title.right
107+ anchors.top: prev.top
108+ margin-left: 2
109+ minimum: 0
110+ maximum: 100
111+ step: 1
112+ &disableScroll: true
113+
114+ItemsRow < Panel
115+ height: 33
116+ margin-top: 2
117+
118+ BotItem
119+ id: item1
120+ anchors.top: parent.top
121+ anchors.left: parent.left
122+
123+ BotItem
124+ id: item2
125+ anchors.top: prev.top
126+ anchors.left: prev.right
127+ margin-left: 2
128+
129+ BotItem
130+ id: item3
131+ anchors.top: prev.top
132+ anchors.left: prev.right
133+ margin-left: 2
134+
135+ BotItem
136+ id: item4
137+ anchors.top: prev.top
138+ anchors.left: prev.right
139+ margin-left: 2
140+
141+ BotItem
142+ id: item5
143+ anchors.top: prev.top
144+ anchors.left: prev.right
145+ margin-left: 2
146+
147+ItemsPanel < Panel
148+ height: 55
149+
150+ SmallBotSwitch
151+ id: title
152+ anchors.left: parent.left
153+ anchors.right: parent.right
154+ anchors.top: parent.top
155+ text-align: center
156+
157+ ItemsRow
158+ id: items
159+ anchors.left: parent.left
160+ anchors.right: parent.right
161+ anchors.top: prev.bottom
162+
163+
164+ItemAndButtonPanel < Panel
165+ height: 40
166+
167+ BotItem
168+ id: item
169+ anchors.left: parent.left
170+ anchors.top: parent.top
171+
172+ BotSwitch
173+ id: title
174+ anchors.left: prev.right
175+ anchors.right: parent.right
176+ anchors.verticalCenter: prev.verticalCenter
177+ text-align: center
178+ margin-left: 2
179+ margin-top: 0
180+
181+ItemAndSlotPanel < Panel
182+ height: 40
183+
184+ BotItem
185+ id: item
186+ anchors.left: parent.left
187+ anchors.top: parent.top
188+
189+ SmallBotSwitch
190+ id: title
191+ anchors.left: prev.right
192+ anchors.right: parent.right
193+ anchors.top: prev.top
194+ text-align: center
195+ margin-left: 2
196+ margin-top: 0
197+
198+ SlotComboBox
199+ id: slot
200+ anchors.left: prev.left
201+ anchors.right: prev.right
202+ anchors.top: prev.bottom
203+ margin-top: 2
204+ height: 20
205+ &disableScroll: true
206+
207+TwoItemsAndSlotPanel < Panel
208+ height: 35
209+ margin-top: 4
210+
211+ BotItem
212+ id: item1
213+ anchors.left: parent.left
214+ anchors.top: parent.top
215+ margin-top: 1
216+
217+ BotItem
218+ id: item2
219+ anchors.left: prev.right
220+ anchors.top: prev.top
221+ margin-left: 1
222+
223+ SmallBotSwitch
224+ id: title
225+ anchors.left: prev.right
226+ anchors.right: parent.right
227+ anchors.top: parent.top
228+ text-align: center
229+ margin-left: 2
230+ margin-top: 0
231+
232+ SlotComboBox
233+ id: slot
234+ anchors.left: prev.left
235+ anchors.right: prev.right
236+ anchors.top: prev.bottom
237+ margin-top: 2
238+ height: 20
239+ &disableScroll: true
240+
A RD_Client/modules/game_bugreport/bugreport.lua +40-0 View file
@@ -0,0 +1,40 @@
1+-- TODO: find another hotkey for this. Ctrl+Z will be reserved to undo on textedits.
2+--HOTKEY = 'Ctrl+Z'
3+
4+bugReportWindow = nil
5+bugTextEdit = nil
6+
7+function init()
8+ g_ui.importStyle('bugreport')
9+
10+ bugReportWindow = g_ui.createWidget('BugReportWindow', rootWidget)
11+ bugReportWindow:hide()
12+
13+ bugTextEdit = bugReportWindow:getChildById('bugTextEdit')
14+
15+ --g_keyboard.bindKeyDown(HOTKEY, show, modules.game_interface.getRootPanel())
16+end
17+
18+function terminate()
19+ --g_keyboard.unbindKeyDown(HOTKEY, modules.game_interface.getRootPanel())
20+ bugReportWindow:destroy()
21+end
22+
23+function doReport()
24+ g_game.reportBug(bugTextEdit:getText())
25+ bugReportWindow:hide()
26+ modules.game_textmessage.displayGameMessage(tr('Bug report sent.'))
27+end
28+
29+function show()
30+ if g_game.isOnline() then
31+ bugTextEdit:setText('')
32+ bugReportWindow:show()
33+ bugReportWindow:raise()
34+ bugReportWindow:focus()
35+ end
36+end
37+
38+function isBugEnabled()
39+ return bugReportWindow:isVisible()
40+end
A RD_Client/modules/game_bugreport/bugreport.otmod +9-0 View file
@@ -0,0 +1,9 @@
1+Module
2+ name: game_bugreport
3+ description: Bug report interface (Ctrl+Z)
4+ author: edubart
5+ website: https://github.com/edubart/otclient
6+ scripts: [ bugreport ]
7+ sandboxed: true
8+ @onLoad: init()
9+ @onUnload: terminate()
A RD_Client/modules/game_bugreport/bugreport.otui +40-0 View file
@@ -0,0 +1,40 @@
1+BugReportWindow < MainWindow
2+ !text: tr('Report Bug')
3+ size: 280 250
4+ @onEscape: self:hide()
5+
6+ Label
7+ id: bugLabel
8+ !text: tr('Please use this dialog to only report bugs. Do not report rule violations here!')
9+ text-wrap: true
10+ text-auto-resize: true
11+ anchors.top: parent.top
12+ anchors.left: parent.left
13+ anchors.right: parent.right
14+
15+ MultilineTextEdit
16+ id: bugTextEdit
17+ text-wrap: true
18+ anchors.top: bugLabel.bottom
19+ anchors.left: parent.left
20+ anchors.right: parent.right
21+ anchors.bottom: sendButton.top
22+ margin-top: 4
23+ margin-bottom: 8
24+
25+ Button
26+ id: sendButton
27+ !text: tr('Send')
28+ anchors.bottom: cancelButton.bottom
29+ anchors.right: cancelButton.left
30+ margin-right: 10
31+ width: 80
32+ &onClick: doReport
33+
34+ Button
35+ id: cancelButton
36+ !text: tr('Cancel')
37+ anchors.bottom: parent.bottom
38+ anchors.right: parent.right
39+ width: 80
40+ @onClick: self:getParent():hide()
A RD_Client/modules/game_buttons/buttons.lua +49-0 View file
@@ -0,0 +1,49 @@
1+buttonsWindow = nil
2+contentsPanel = nil
3+
4+function init()
5+ buttonsWindow = g_ui.loadUI('buttons', modules.game_interface.getRightPanel())
6+ buttonsWindow:disableResize()
7+ buttonsWindow:setup()
8+ contentsPanel = buttonsWindow.contentsPanel
9+ if not buttonsWindow.forceOpen or not contentsPanel.buttons then
10+ buttonsWindow:close()
11+ end
12+end
13+
14+function terminate()
15+ buttonsWindow:destroy()
16+end
17+
18+function takeButtons(buttons)
19+ if not buttonsWindow.forceOpen or not contentsPanel.buttons then return end
20+ for i, button in ipairs(buttons) do
21+ takeButton(button, true)
22+ end
23+ updateOrder()
24+end
25+
26+function takeButton(button, dontUpdateOrder)
27+ if not buttonsWindow.forceOpen or not contentsPanel.buttons then return end
28+ button:setParent(contentsPanel.buttons)
29+ if not dontUpdateOrder then
30+ updateOrder()
31+ end
32+end
33+
34+function updateOrder()
35+ local children = contentsPanel.buttons:getChildren()
36+ table.sort(children, function(a, b)
37+ return (a.index or 1000) < (b.index or 1000)
38+ end)
39+ contentsPanel.buttons:reorderChildren(children)
40+ local visibleCount = 0
41+ for _, child in ipairs(children) do
42+ if child:isVisible() then
43+ visibleCount = visibleCount + 1
44+ end
45+ end
46+ if visibleCount > 6 and buttonsWindow:getHeight() < 30 then
47+ buttonsWindow:setHeight(buttonsWindow:getHeight() + 22)
48+ end
49+end
A RD_Client/modules/game_buttons/buttons.otmod +8-0 View file
@@ -0,0 +1,8 @@
1+Module
2+ name: game_buttons
3+ description: Shows miniwindow with buttons
4+ author: otclient@otclient.ovh
5+ sandboxed: true
6+ scripts: [ buttons ]
7+ @onLoad: init()
8+ @onUnload: terminate()
A RD_Client/modules/game_buttons/buttons.otui +6-0 View file
@@ -0,0 +1,6 @@
1+GameButtonsWindow
2+ id: buttons
3+ &save: true
4+ !text: tr("Buttons")
5+ icon: /images/topbuttons/buttons
6+
Top