Jump to content

Recommended Posts

Posted (edited)

Hey Guys!!

 

I have been using XDAT Editor to make new Windows.

 

The problem I found and the lack of information of this software, I couldn't find on Internet anything of how to use this Script Console. I just found some samples of "SAVO" He shared long time ago on other RU forums.

 

I know you can add windows, tabs, textures etc, etc, if you are using the GUI, but some times when your project is getting too big, better start using the Script Console.

 

So, long story short, this is the problem:

 

How to add a "TabElement" and filling it with some data information? for example this is the code I have been trying:

println "Data Base Windows"

xdat.windows.add(new Window(
	name: "DataBaseWnd",
	anchored: 0,
	size: 1,
	size_absolute_width: 800,
	size_absolute_height: 490,
	usePosition: 1,
	relativePoint: Alignment.TOP_LEFT,
	anchorPoint: Alignment.TOP_LEFT,
	parent: "undefined",
	backTex: "L2UI_CT1.Windows_DF_Large_Bg",
	script: "DataBaseWnd",
	state: "GamingState",
	frame: 1,
	hidden: 1,
	alwaysFullAlpha: 1,
	savePosition: 1,
	title: 6000,
	exitbutton: 1,
	workingConfiguration: "Game"))

def DataBaseWnd = xdat.windows["DataBaseWnd"]

DataBaseWnd.children.add(new Texture(
	name: "TexTabBg",
	parentName: "MagicSkillWnd",
	anchored: 0,
	size: 1,
	size_absolute_width: 800,
	size_absolute_height: 458,
	usePosition: 1,
	relativePoint: Alignment.TOP_LEFT,
	anchorPoint: Alignment.TOP_LEFT,
	anchor_y: 31.0,
	virtual: 1,
	file: "L2UI_CT1.tab.tab_df_bg",
	type: "Stretch",
	layer: "Background",
	alpha: -9999))

DataBaseWnd.children.add(new Texture(
	name: "TexTabBgLine",
	alwaysOnBack: 1,
	parentName: "MagicSkillWnd",
	anchored: 0,
	size: 1,
	size_absolute_width: 631,
	size_absolute_height: 30,
	usePosition: 1,
	relativePoint: Alignment.TOP_LEFT,
	anchorPoint: Alignment.TOP_LEFT,
	anchor_x: 164.0,
	anchor_y: 31.0,
	virtual: 1,
	file: "L2UI_CT1.tab.tab_df_bg_line",
	type: "Stretch",
	layer: "Background",
	alpha: -9999))

DataBaseWnd.children.add(new Tab(
	name: "DataBaseTabCtrl",
	parentName: "DataBaseWnd",
	anchored: 0,
	size: 1,
	size_absolute_width: 160,
	size_absolute_height: 23,
	usePosition: 1,
	relativePoint: Alignment.TOP_LEFT,
	anchorPoint: Alignment.TOP_LEFT,
	anchor_x: 8.0,
	anchor_y: 31.0))

def DataBaseTabCtrl = DataBaseWnd.children["DataBaseTabCtrl"]

DataBaseTabCtrl.tabs[0].buttonName = 6001
DataBaseTabCtrl.tabs[0].target = "NpcDataTab"
DataBaseTabCtrl.tabs[0].width = 78
DataBaseTabCtrl.tabs[0].height = 23
DataBaseTabCtrl.tabs[0].normalTex = "L2UI_CT1.tab.Tab_DF_Tab_Unselected"
DataBaseTabCtrl.tabs[0].pushedTex = "L2UI_CT1.tab.Tab_DF_Tab_Selected"


DataBaseTabCtrl.tabs[1].buttonName = 6002
DataBaseTabCtrl.tabs[1].target = "ItemDataTab"
DataBaseTabCtrl.tabs[1].width = 78
DataBaseTabCtrl.tabs[1].height = 23
DataBaseTabCtrl.tabs[1].normalTex = "L2UI_CT1.tab.Tab_DF_Tab_Unselected"
DataBaseTabCtrl.tabs[1].pushedTex = "L2UI_CT1.tab.Tab_DF_Tab_Selected"

println "done!"

And this is the error of the Script Console:

Data Base Windows
java.lang.NullPointerException: Cannot set property 'buttonName' on null object
	at org.codehaus.groovy.runtime.NullObject.setProperty(NullObject.java:80)
	at org.codehaus.groovy.runtime.InvokerHelper.setProperty(InvokerHelper.java:195)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setProperty(ScriptBytecodeAdapter.java:484)
	at Script1.run(Script1.groovy:86)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:623)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:594)
	at acmi.l2.clientmod.xdat.scripting.Controller.lambda$execute$0(Controller.java:156)
	at acmi.l2.clientmod.xdat.scripting.Controller$$Lambda$442/1071997580.call(Unknown Source)
	at acmi.l2.clientmod.xdat.XdatEditor.lambda$execute$7(XdatEditor.java:219)
	at acmi.l2.clientmod.xdat.XdatEditor$$Lambda$209/1755738610.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

So, as you can see, the problem is when I'm trying to add some data information on "DataBaseTabCtrl".

 

I hope someone have any clue or experience doing this process and it would be grateful share their knowledge to resolve this issue.

 

thx so much guys!!

Edited by Pulentolento
Posted

Shouldnt buttonName value be a string?

 

The best way of using those scripts is to create objects with UI on your own and then just copy automatically created script for later use. They are not perfect, if you make some modifications that collide with the script, it will not work well.

Posted (edited)

According to groovy, its an INT

static class TabElement implements IOEntity {
        @Sysstr
        int buttonName = -9999
        String buttonNameText = 'undefined'
        String target = 'undefined'
        int width
        int height
        @Tex
        String normalTex = 'undefined'
        @Tex
        String pushedTex = 'undefined'
        boolean movable
        int gap
        @Sysstr
        int tooltip = -1
        int noHighlight = -1

        @Override
        String toString() {
            getClass().simpleName
        }
Edited by Akar0
Posted (edited)

Found the problem!!!  ;D

 

this is the right way to add a Tab Element with info:

 

DataBaseTabCtrl.tabs.add(new Tab.TabElement(
	buttonName: 6001,
	target: "NpcDataTab",
	width: 78,
	height: 23,
	normalTex: "L2UI_CT1.tab.Tab_DF_Tab_Unselected",
	pushedTex: "L2UI_CT1.tab.Tab_DF_Tab_Selected"))
Edited by Akar0
Guest
This topic is now closed to further replies.
  • Posts

    • I’ve seen tools like Find Person Name by Photo come in handy for creators who want to understand their audience better or spot fake accounts trying to piggyback on their growth. Pairing something like that with a solid SMM panel can make your workflow feel way smoother, especially if you're trying to grow without getting tangled in guesswork.
    • Join our discord: https://www.lineage2.cz/discord  
    • You should buy it then I’ll make a discount  
    • Hi everyone,   In 2014, I completely stepped away from developing L2 servers and doing L2J-related work. Since then, I’ve only opened this server about once a year and helped a few servers and individuals for free. I haven’t taken on any paid L2J work since then.   LINEAGE2.GOLD is a project that has reached about Season 6. The first season launched at the end of 2020 and was a fully rebuilt Gold-style server on the Classic client (protocol 110). It featured many custom systems and enhancements. After several seasons, I decided to abandon the Mobius-based project and move to Lucera, as my goal was to get as close as possible to Interlude PTS behavior while still staying on the L2J platform.   The current project was once again completely rebuilt, this time on the Essence client (protocol 306), and is based on Lucera. Because of that, acquiring a license from Deazer is required.   My Lucera extender includes, but is not limited to: Formulas.java Basic anti-bot detection, which proved quite effective, we caught most Adrenaline users using relatively simple server-side logic, logged them, and took staff action. Simple admin account lookup commands based on IP, HWID, and similar identifiers. In-game Captcha via https://lineage2.gold/code, protected by Cloudflare, including admin commands for blacklisting based on aggression levels and whitelisting. Additional admin tools such as Auto-Play status checks, Enchanted Hero Weapon live sync, force add/remove clans from castle sieges, item listeners for live item monitoring, and more. A fully rewritten Auto-Play system with support for ExAutoPlaySetting, while still using the Auto-Play UI wheel, featuring: Debuff Efficiency Party Leader Assist Respectful Hunting Healer AI Target Mode Range Mode Summoner buff support Dwarf mechanics Reworked EffectDispelEffects to restore buffs after Cancellation. Raid Bomb item support. Reworked CronZoneSwitcher. Prime Time Raid Respawn Service. Community Board features such as Top rankings and RB/Epic status. Custom systems for Noblesse, Subclasses, support-class rewards, and much more.   Depending on the deal, the project can include: The lineage2.gold domain The website built on the Laravel PHP framework The server’s Discord Client Interface source Server files and extender source The server database (excluding private data such as emails and passwords)   I’m primarily looking for a serious team to continue the project, as it would be a shame to see this work abandoned. This is not cheap. You can DM me with offers. If you’re wondering why I’m doing this: I’ve felt a clear lack of appreciation from the L2 community, and I’m not interested in doing charity work for people who don’t deserve it. I’m simply not someone who tolerates BS. Server Info: https://lineage2.gold/info Server for test: https://lineage2.gold/download Over 110 videos YouTube playlist: https://www.youtube.com/watch?v=HO7BZaxUv2U&list=PLD9WZ0Nj-zstZaYeWxAxTKbX7ia2M_DUu&index=113
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock