>(IconsTable.javaClass.classLoader.getResource("xml/icons.xml")!!).map { it.id to it.value }.toMap()
21 | }
22 |
23 | private data class L2Icon(@JsonProperty("Id")val id: Int, @JsonProperty("value")val value: String)
24 |
25 | fun getSkillIcon(skillId: Int) : String {
26 | val skillIdAsText = when(skillId.toString().length){
27 | 1 -> "000$skillId"
28 | 2 -> "00$skillId"
29 | 3 -> "0$skillId"
30 | else -> skillId.toString()
31 | }
32 |
33 | return "Icon.skill${skillIdAsText}"
34 | }
35 |
36 | fun getItemIcon(itemId: Int) : String {
37 | return icons.getOrDefault(itemId, "")
38 | }
39 | }
--------------------------------------------------------------------------------
/src/main/kotlin/dev/l2j/autobots/utils/ImageHelper.kt:
--------------------------------------------------------------------------------
1 | package dev.l2j.autobots.utils
2 |
3 | import dev.l2j.autobots.AutobotsNameService
4 | import dev.l2j.autobots.utils.packets.ServerSideImage
5 | import net.sf.l2j.Config
6 | import net.sf.l2j.gameserver.model.actor.Player
7 |
8 | internal fun imageTag(id: Int, width: Int, height: Int) : String{
9 | return "
"
10 | }
11 |
12 | internal fun sendImagePacket(player: Player, imageId: Int, imageName: String){
13 | val buffer = DDSConverter.convertToDDS(AutobotsNameService.javaClass.classLoader.getResource("images/$imageName")!!.openStream())!!
14 | buffer.position(0)
15 | val arr = ByteArray(buffer.remaining())
16 | buffer.get(arr)
17 | val packet = ServerSideImage(imageId, arr)
18 | player.sendPacket(packet)
19 | }
--------------------------------------------------------------------------------
/src/main/kotlin/dev/l2j/autobots/utils/Klock.kt:
--------------------------------------------------------------------------------
1 | package dev.l2j.autobots.utils
2 |
3 | import kotlinx.coroutines.*
4 | import java.util.concurrent.atomic.AtomicBoolean
5 |
6 | internal class Klock internal constructor(
7 | name: String,
8 | private val delayDuration: Long,
9 | private val repeat: Long,
10 | private val coroutineScope: CoroutineScope = GlobalScope,
11 | action: suspend () -> Unit
12 | ) {
13 | private val keepRunning = AtomicBoolean(true)
14 | private var job: Job? = null
15 | private val tryAction = suspend {
16 | try {
17 | action()
18 | } catch (e: Throwable) {
19 | println("$name timer action failed: $action")
20 | }
21 | }
22 |
23 | fun start() {
24 | job = coroutineScope.launch {
25 | delay(delayDuration)
26 | while (keepRunning.get()) {
27 | tryAction()
28 | delay(repeat)
29 | }
30 | }
31 | }
32 |
33 | fun shutdown() {
34 | keepRunning.set(false)
35 | }
36 |
37 | fun cancel() {
38 | shutdown()
39 | job?.cancel("cancel() called")
40 | }
41 |
42 | companion object {
43 | fun start(
44 | name: String,
45 | delay: Long,
46 | repeat: Long,
47 | coroutineScope: CoroutineScope = GlobalScope,
48 | action: suspend () -> Unit
49 | ): Klock = Klock(name, delay, repeat, coroutineScope, action).also { it.start() }
50 | }
51 | }
--------------------------------------------------------------------------------
/src/main/kotlin/dev/l2j/autobots/utils/packets/GMViewBuffs.kt:
--------------------------------------------------------------------------------
1 | package dev.l2j.autobots.utils.packets
2 |
3 | import dev.l2j.autobots.Autobot
4 | import net.sf.l2j.gameserver.network.serverpackets.L2GameServerPacket
5 |
6 | internal class GMViewBuffs(val bot: Autobot) : L2GameServerPacket() {
7 |
8 | override fun writeImpl() {
9 | writeC(0x91)
10 | writeS(bot.name)
11 | writeD(bot.allEffects!!.size)
12 | for (skill in bot.allEffects) {
13 | writeD(0)
14 | writeD(skill.level)
15 | writeD(skill.skill.id)
16 | writeC(0)
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/main/kotlin/dev/l2j/autobots/utils/packets/ServerSideImage.kt:
--------------------------------------------------------------------------------
1 | package dev.l2j.autobots.utils.packets
2 |
3 | import net.sf.l2j.gameserver.network.serverpackets.L2GameServerPacket
4 |
5 | internal class ServerSideImage(val imageId: Int, val data: ByteArray) : L2GameServerPacket() {
6 |
7 | override fun writeImpl() {
8 | writeC(0x6c)
9 | writeD(imageId)
10 | writeD(data.size)
11 | writeB(data)
12 | }
13 |
14 | }
--------------------------------------------------------------------------------
/src/main/resources/components/checkbox.htc:
--------------------------------------------------------------------------------
1 |
2 | {{label}}: |
3 | |
4 |
--------------------------------------------------------------------------------
/src/main/resources/components/combobox_withsave.htc:
--------------------------------------------------------------------------------
1 |
2 | {{label}}: |
3 | |
4 | {{actionname}} |
5 |
--------------------------------------------------------------------------------
/src/main/resources/components/textbox_withsave.htc:
--------------------------------------------------------------------------------
1 |
2 | {{label}}: |
3 | {{txtcontent}}
4 | {{actionname}} |
5 |
--------------------------------------------------------------------------------
/src/main/resources/views/autofarm_main.htv:
--------------------------------------------------------------------------------
1 |
2 |
3 | Autofarm Engine
4 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/src/main/resources/views/autofarm_skills.htv:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |  |
6 | Autofarm Engine Editing bot: {{name}} |
7 | |
8 | |
9 |
10 |
11 |
12 | {{content}}
13 |
--------------------------------------------------------------------------------
/src/main/resources/views/bot_details.htv:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |  |
6 | Autobots Engine Editing bot: {{name}} |
7 | |
8 | {{top_buttons}}
9 | |
10 | |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | {{botdetails_tabs.ptv}}
20 |
21 |
22 |
23 |
24 |  |
25 |
26 |
27 | |
28 |
29 |
30 | {{content}}
31 |
--------------------------------------------------------------------------------
/src/main/resources/views/create_bot.htv:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |  |
6 | Creating new bot |
7 | |
8 | |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | {{botname}}
17 |
18 | {{botlevel}}
19 |
20 | |
21 |
22 | |
23 |
24 |
25 |
26 |
27 | Choose race: |
28 | | Human |
29 | | Elf |
30 | | Dark Elf |
31 | | Orc |
32 | | Dwarf |
33 |
34 |
35 | |
36 |
37 |
38 |
39 |
40 |
41 |
42 | Class: |
43 | |
44 |
45 |
46 | Gender: |
47 | |
48 |
49 |
50 | Hairstyle: |
51 | |
52 |
53 |
54 | Hair color: |
55 | |
56 |
57 |
58 | Face: |
59 | |
60 |
61 |
62 | |
63 |
64 |
65 |
66 |
67 |
68 |
71 | |
72 |
73 |
74 |
75 |
76 |
79 | |
80 |
81 |
82 |
83 |
84 |
87 | |
88 |
89 |
90 |
91 |
92 |
93 |
99 | |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/src/main/resources/views/index.htv:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |  |
6 | Autobots Engine Active bots: {{activebotscount}} |
7 | |
8 | |
9 |
10 | {{index_filter.ptv}}
11 | |
12 | |
13 | |
14 |
15 |
16 |
17 |
18 |
19 |
20 | # |
21 | Lv |
22 | Name |
23 | Class |
24 | Clan |
25 | Ally |
26 | Actions |
27 | {{index_checkbox.ptv}}
28 |
29 |
30 |
31 |
32 |  |
33 |
34 |
35 |
36 | {{listbotsrow.ptv}}
37 |
38 |
39 |
40 |  |
41 |
42 |
43 |
44 |
45 | {{pagination}}
46 |
47 |
48 |
49 |
50 |  |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | {{index_tabs.ptv}}
59 |
60 | |
61 |
62 |
63 | {{index_tabtable.ptv}}
64 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/botdetails_offline.ptv:
--------------------------------------------------------------------------------
1 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/botdetails_online.ptv:
--------------------------------------------------------------------------------
1 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/botdetails_tabs.ptv:
--------------------------------------------------------------------------------
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/chat/botdetails_chat.ptv:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{botdetails_chat_tabs.ptv}}
7 |
8 |
9 | |
10 |
11 |
12 |
13 |
14 |
15 |
16 | {{chat}}
17 | |
18 |
19 | {{chat_input}}
20 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/chat/botdetails_chat_tabs.ptv:
--------------------------------------------------------------------------------
1 | |
2 | |
3 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/combat/botdetails_combat.ptv:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Attack Preferences
6 | |
7 |
8 | Potions
9 | |
10 |
11 |
12 |
13 |
14 | {{radiustextbox}}{{targprefcombobox}}{{atkplayertypecombobox}}{{classspecific}}
15 |
16 | |
17 |
18 |
19 | {{potions_cp}}{{potions_qhp}}{{potions_ghp}}
20 |
21 | |
22 |
23 |
24 |
25 |
26 |
27 | |
28 |
29 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/info/botdetails_activity.ptv:
--------------------------------------------------------------------------------
1 |
2 |
3 | Activity preferences |
4 |
5 | |
6 | |
7 | |
8 |
9 |
10 |
11 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/info/botdetails_activity_none.ptv:
--------------------------------------------------------------------------------
1 | Bot's activity is controlled manually |
2 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/info/botdetails_activity_schedule.ptv:
--------------------------------------------------------------------------------
1 | Bot will login and logout on the specified times below |
2 | UTC timezone is used. Current UTC time is: {{currenttime}} |
3 | |
4 |
5 |
6 |
7 | Login time: |
8 | |
9 | |
10 |
11 |
12 | |
13 |
14 |
15 |
16 | Logout time: |
17 | |
18 | |
19 |
20 |
21 | |
22 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/info/botdetails_activity_uptime.ptv:
--------------------------------------------------------------------------------
1 | Bot will stay online for the specified minutes after spawn |
2 | |
3 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/info/botdetails_info.ptv:
--------------------------------------------------------------------------------
1 |
2 | |
3 |
4 |
5 |
6 | Level: | {{level}} |
7 | CP: | |
8 | HP: | |
9 | MP: | |
10 | Location: | Near {{location}} |
11 | Coordinates: | {{coordinates}} |
12 | Online for: | {{onlinetime}} |
13 |
14 | |
15 | {{botactivity}}
16 |
17 |
18 |
19 |
20 | |
21 | |
22 |
23 |
24 |
25 |
26 |
27 |
28 | |
29 |
30 |
31 | |
32 |
33 |
34 | |
35 |
36 |
37 | |
38 |
39 |
40 |
41 |
42 | |
43 |
44 |
45 | |
46 |
47 |
48 | |
49 |
50 |
51 | |
52 |
53 |
54 | |
55 |
56 | |
57 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/skills/botdetails_skills.ptv:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Skill Preferences
6 | |
7 |
8 |
9 |
10 | {{existingconditions}}
11 |
12 |
13 |
14 |
15 |
16 |
17 | Add new condition
18 | |
19 |
20 |
21 | {{addcondition}}
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/skills/botdetails_skills_addcondition.ptv:
--------------------------------------------------------------------------------
1 |
2 |
3 | |
4 | Condition: |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | Add |
11 |
12 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/skills/botdetails_skills_condition.ptv:
--------------------------------------------------------------------------------
1 |
2 |
3 |  |
4 | {{skillname}} |
5 | Condition: {{conditiontext}} |
6 | Edit |
7 | Remove |
8 |
9 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/skills/botdetails_skills_condition_edit.ptv:
--------------------------------------------------------------------------------
1 |
2 |
3 |  |
4 | {{skillname}} |
5 | Condition: |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | Save |
12 | Cancel |
13 |
14 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/skills/botdetails_skills_condition_toggle.ptv:
--------------------------------------------------------------------------------
1 |
2 |
3 |  |
4 | {{skillname}} |
5 | Is enabled |
6 | |
7 |
8 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/social/botdetails_social.ptv:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Actions
10 | |
11 |
12 |
13 |
14 |
15 |
16 | |
17 | |
18 | |
19 | |
20 |
21 |
22 | |
23 | |
24 | |
25 | |
26 |
27 |
28 | |
29 |
30 |
31 | |
32 |
33 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/social/botdetails_social_create_craft.ptv:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Item search_____________________________
17 | |
18 |
19 |
20 |
21 |
22 |
23 | Id type: |
24 | |
25 |
26 | |
27 |
28 | Id: |
29 | |
30 |
31 | |
32 |
33 | Cost: |
34 | |
35 |
36 | |
37 | {{additembtn}}
38 | {{createstore}}
39 |
40 | |
41 |
42 |
43 | |
44 |
45 |
46 |
47 |
48 | Recipes to list_______________________________________
49 | |
50 |
51 |
52 |
53 |
54 | {{message_textbox}}
55 |
56 |
57 |
58 |
59 |
60 |
61 | Item description |
62 | Cost |
63 | Actions |
64 |
65 |
66 | |
67 |
68 | |
69 |
70 |
71 |
72 | {{botdetails_social_create_craft_item.ptv}}
73 |
74 | |
75 |
76 |
77 | |
78 |
79 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/social/botdetails_social_create_craft_item.ptv:
--------------------------------------------------------------------------------
1 |
2 |  |
3 | {{itemname}} |
4 | {{itemcost}} |
5 | X |
6 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/social/botdetails_social_create_store.ptv:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Item search_____________________________
17 | |
18 |
19 |
20 |
21 |
22 |
23 | Item id: |
24 | |
25 |
26 | |
27 |
28 | Item count: |
29 | |
30 |
31 | |
32 |
33 | Price per item: |
34 | |
35 |
36 | |
37 | {{additembtn}}
38 | {{createstore}}
39 |
40 | |
41 |
42 |
43 | |
44 |
45 |
46 |
47 |
48 | Items to list_______________________________________
49 | |
50 |
51 |
52 |
53 |
54 | {{message_textbox}}
55 |
56 |
57 |
58 |
59 |
60 |
61 | Item description |
62 | Quantity |
63 | Price per item |
64 | Actions |
65 |
66 |
67 | |
68 |
69 | |
70 |
71 |
72 |
73 | {{botdetails_social_create_store_item.ptv}}
74 |
75 | |
76 |
77 |
78 | |
79 |
80 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/botdetails/social/botdetails_social_create_store_item.ptv:
--------------------------------------------------------------------------------
1 |
2 |  |
3 | {{itemname}} |
4 | {{itemcount}} |
5 | {{itemcost}} |
6 | X |
7 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/index_checkbox.ptv:
--------------------------------------------------------------------------------
1 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/index_filter.ptv:
--------------------------------------------------------------------------------
1 | Filter: {{filter}} x
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/index_tab_table_clan.ptv:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Clan name: |
7 | |
8 |
9 |
10 | Clan level: |
11 | |
12 |
13 |
14 | Clan leader: |
15 | |
16 |
17 |
18 | Crest url (optional): |
19 | |
20 |
21 |
22 | |
23 |
24 |
29 | |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/index_tab_table_general.ptv:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 | |
11 |
12 |
17 | |
18 |
19 | {{selected_options.ptv}}
20 | |
21 |
22 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/index_tabs.ptv:
--------------------------------------------------------------------------------
1 | |
2 | |
3 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/listbotsrow.ptv:
--------------------------------------------------------------------------------
1 |
2 |  |
3 | {{level}} |
4 | {{name}} |
5 | {{classname}} |
6 | {{claninfo}} |
7 | {{allyinfo}} |
8 | {{listbotsrow_online.ptv}}
9 | {{listbotsrow_offline.ptv}}
10 | {{listbotsrow_checked.ptv}}
11 | {{listbotsrow_unchecked.ptv}}
12 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/listbotsrow_checked.ptv:
--------------------------------------------------------------------------------
1 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/listbotsrow_offline.ptv:
--------------------------------------------------------------------------------
1 |
2 | Spawn
3 | on me
4 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/listbotsrow_online.ptv:
--------------------------------------------------------------------------------
1 |
2 | Despawn
3 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/listbotsrow_unchecked.ptv:
--------------------------------------------------------------------------------
1 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/selected_options.ptv:
--------------------------------------------------------------------------------
1 |
2 | Selected: {{selectedcount}} bots |
3 | {{selected_options_offline.ptv}}
4 | {{selected_options_online.ptv}}
5 |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/selected_options_offline.ptv:
--------------------------------------------------------------------------------
1 | |
2 | |
--------------------------------------------------------------------------------
/src/main/resources/views/partialviews/selected_options_online.ptv:
--------------------------------------------------------------------------------
1 | |
--------------------------------------------------------------------------------
/src/main/resources/views/settings.htv:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |  |
6 | Autobots Engine Global settings |
7 | |
8 | |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | {{iteretiontxt}}
17 | {{rangetxt}}
18 |
19 | |
20 |
21 |
24 | |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------