EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   execute an action in a dropdownbox (https://www.eq2interface.com/forums/showthread.php?t=13915)

battosa 03-01-2010 12:43 PM

execute an action in a dropdownbox
 
i try to make a windows with a dropdownbox wich allow to choose a destination and cast the spell/use the object to go to the chosen place

for exemple if i chose in the dropdownbox : Spire portals , it cast the wizard portal to the spire

i tried to use but it's not working
OnSelect="/useability 1634378213"
and
OnSelect="action=/useability 1634378213"

is there a way to execute a command just by selecting a line in the box ?

also how can i make the first line of the dropdownbox always appear first or going back to it after executing a command?

and last question: is it possible to equip an item, use it and maybe equip back the previous item ? for example to use the quel'ule or hua mein item

thanks in advance :)

Landiin 03-01-2010 01:23 PM

The way you have it, every time you select an item it will try to use ability 1634378213 if you had the syntax correct.

First you never us the / for commands in the script. OnSelect="useability 1634378213" is the correct way.

Here is the way I would do what ur wanting to do..
Code:

<DataSource Name="blah">
<Data Text="Text Displayed in the drop down"/>
<Data Text="Text Displayed in the drop down" id="1634378213"/>
<Data Text="Text Displayed in the drop down" id="1634378214"/>
</DataSource>

<DropDownBox OnSelect="useability SelectedItem.id
SelectedItemIndex=0"/>


Drumstix42 03-01-2010 01:23 PM

When calling commands via the UI, you never includes the slashes.

And it is possible to swap an item cast it and swap but, BUT the item has it be an instant cast. Fishbone Earring is an example. This is only possible with the in-game macro system though. Don't think there is any other way to equip/de-equip a specific item, unless I'm mistaken.

battosa 03-01-2010 01:27 PM

oh ok i will try like that thanks :)

battosa 03-01-2010 03:10 PM

ok so now it work perfectly
i now have to find a way to be able to equip and use an item,
i tried with the id of a macro wich equip and use, but it don't work

as long an item need to be equiped before being used i won't be able to put it in

i was wondering if it was possible to put two command in the same data, when i select it execute the first one , and with the help of a button it execute the second

first one equip and second use , could be a solution but not sure it is do-able

sorry to disturb you again guys :) but it's not as simple as i tought at first :D

Landiin 03-01-2010 04:25 PM

Something like..
Code:

<DataSource Name="blah">
<Data Text="Text Displayed in the drop down"/>
<Data Text="Text Displayed in the drop down" id="1634378213" Script="what ever script u want"/>
<Data Text="Text Displayed in the drop down" id="1634378214" Script="what ever script u want"/>
</DataSource>

<DropDownBox Name="DDB" OnSelect="useability SelectedItem.id
SelectedItemIndex=0"/>

<Button OnPress="Activated=False Activated=True OnActivate=Parent.DDB.SelectedItem.Script"/>


battosa 03-01-2010 11:31 PM

i really have a lot to learn :D thanks you :)

Landiin 03-02-2010 01:28 AM

Just remember scripts execute tom to bottom, right to left..

battosa 03-02-2010 11:29 AM

once again i'm stuck so here i am

i must be doing something wrong for the script part , the ui revert back tu default with /loadui each time i try something within the script=""

i tried something like that :
Code:

<Data Name="TP007" text="Quel'ule" Script= OnActivate = "inventory equipvdl=-703437333"
"use_itemvdl=-703437333" />

or like that :
Code:

<Data Name="TP007" text="Quel'ule" Script="inventory equipvdl=-703437333"
"use_itemvdl=-703437333" />

also i tried with one command in the script and the ui load without any problem but the script don't work, it tell me this ability isn't available or something like

Code:

  <Data Name="TP007" text="Quel'ule" Script="inventory equipvdl=-703437333" />
( i got the vdl number by looking at the first number of the item link :
\aITEM -703437333 -1044721553:[Pierre de téléportation de Quel'ule]\/a
am i right ? )

could you give me an example of working script with two command to execute ? or is there a ui piece i could look at to the see how it work ?

and for the button part, do i need to choose a location and size to be able to use it or does it activate each time i choose the line ?

Landiin 03-02-2010 12:42 PM

Code:

<Data Name="TP007" text="Quel'ule" Script="inventory equipvdl -703437333
use_itemvdl -703437333
Activated=False" />


<DropDownBox Name="DDB" OnSelect="OnActivated=SelectedItem.Script
Activated=True"/>


EQAditu 03-02-2010 02:15 PM

Just as a side note... a few of your code blocks were having trouble because they were invalid XML and EQ2 could not parse it.

<Data Name="TP007" text="Quel'ule" Script= OnActivate = "inventory equipvdl=-703437333"
"use_itemvdl=-703437333" />


Here we have a quoted string floating alone. It needs to be assigned to an Attribute.
Nothing is being assigned to this Attribute. You cannot assign another Attribute to an Attribute.

A single quoted string must be assigned to an XML Attribute. If you use more than one line, you must not close the quotation. You cannot use quotation marks within a quoted string or it will prematurely close the quotation. To use a quotation mark character in XML, you must use '&quot;'. You shouldn't really have a need to use a quotation mark in EQ2 scripting however... only if you want a quotation mark visible in a label or something.

battosa 03-02-2010 02:20 PM

i've finally get it to work partially, but there something strange :confused:

if i choose one of the line then clicking the button, the effect of the spell/item ( equip first, and use at second press on the button for the item) launch correctly

but if i try to launch another one after that it's like it keep in memory the first script but not the new one

here is the code for the ui as it is now
Code:

<?xml version="1.0" encoding="utf-8"?>
<Page BackgroundColor="#554736" eq2usescomwndcontrols="true" Name="tp" OnHide="visible=True" ScrollExtent="220,20" Size="220,20" UserMovable="true">
    <Page AbsorbsInput="false" BackgroundOpacity="1.000" Name="Frame" PackLocation="left,top" PackSize="absolute,absolute" RStyleDefault="/rectlist.win_plain" ScrollExtent="221,21" Size="221,21" />
<Button Location="1,1" Name="TpButton" OnActivate="Parent.Tp_Dropdownbox.SelectedItem.Script" OnPress="Activated=False Activated=True OnActivate=Parent.Tp_Dropdownbox.SelectedItem.Script" ScrollExtent="19,19" Size="19,19" Style="/CommonElements.SmallPushButton" />
    <Dropdownbox DataSource="TpDestinationDS" Location="20,2" Name="Tp_Dropdownbox" OnSelect="OnActivated=SelectedItem.Script
Activated=True" PackSize="a,f" RowTemplate="/Templates.dropdowntemplate" ScrollExtent="197,18" Size="197,18" Style="/Fetish.dropdownlist.dropdown_default" />
    <DataSource Name="TpDestinationDS">
        <Data Name="TP000" text="Choose Your Destination..." />
        <Data Name="TP001" text="-------------------Spell-------------------" />
        <Data Name="TP002" text="Spire Portal" Script="useability 1634378213"/>
        <Data Name="TP003" text="Druid Ring Portal" Script="useability 41973245"/>
        <Data Name="TP004" text="Home Sweet Home" Script="useability 368171195"/>
        <Data Name="TP005" Text="Guild Hall" Script="useability 3266969222" />
        <Data Name="TP006" text="----------------Item--------------------" />
        <Data Name="TP007" text="Quel'ule" Script="inventory equipvdl -703437333
use_itemvdl -703437333
Activated=False" />
        <Data Name="TP008" />
        <Data Name="TP009" />
        <Data Name="TP010" />
    </DataSource>   
    <Page AbsorbsInput="false" BackgroundOpacity="1.000" Name="Framebutton" PackLocation="left,top" PackSize="absolute,absolute" RStyleDefault="/rectlist.win_plain" ScrollExtent="21,21" Size="21,21" />
    <Page AbsorbsInput="false" BackgroundOpacity="1.000" eq2usecomwndcontrols="true" Location="0,-1" Name="Bkg" PackSize="absolute,absolute" RStyleDefault="/SpecialElements.Compass.data.bkg.rect" ScrollExtent="218,22" Size="218,22" />
</Page>

is there something odd ? is there a command to reset the last script chosen or something else , searched trough the forum but didn't see anything

Drumstix42 03-02-2010 02:39 PM

Are you editing in plain text, or in the UIBuilder?

Because single apostrophe's need to be replaced with &apos;

battosa 03-02-2010 02:43 PM

i use notepad, i will change the ' but it that the cause of the problem ? because the ui lauch well and work exepted for the "keep script in memory" thing:(

Landiin 03-02-2010 02:44 PM

Try
Code:

<?xml version="1.0" encoding="utf-8"?>
<Page BackgroundColor="#554736" eq2usescomwndcontrols="true" Name="tp" OnHide="visible=True" ScrollExtent="220,20" Size="220,20" UserMovable="true">
    <Page AbsorbsInput="false" BackgroundOpacity="1.000" Name="Frame" PackLocation="left,top" PackSize="absolute,absolute" RStyleDefault="/rectlist.win_plain" ScrollExtent="221,21" Size="221,21" />
        <Button Location="1,1" Name="TpButton" OnActivate="" OnPress="Activated=True OnActivate=Parent.Tp_Dropdownbox.SelectedItem.Script" ScrollExtent="19,19" Size="19,19" Style="/CommonElements.SmallPushButton" />
    <Dropdownbox DataSource="TpDestinationDS" Location="20,2" Name="Tp_Dropdownbox" OnSelect="Activated=True OnActivated=SelectedItem.Script" PackSize="a,f" RowTemplate="/Templates.dropdowntemplate" ScrollExtent="197,18" Size="197,18" Style="/Fetish.dropdownlist.dropdown_default" />
    <DataSource Name="TpDestinationDS">
        <Data Name="TP000" text="Choose Your Destination..." />
        <Data Name="TP001" text="-------------------Spell-------------------" />
        <Data Name="TP002" text="Spire Portal" Script="useability 1634378213
Activated=False"/>
        <Data Name="TP003" text="Druid Ring Portal" Script="useability 41973245
Activated=False"/>
        <Data Name="TP004" text="Home Sweet Home" Script="useability 368171195
Activated=False"/>
        <Data Name="TP005" Text="Guild Hall" Script="useability 3266969222
Activated=False" />
        <Data Name="TP006" text="----------------Item--------------------" />
        <Data Name="TP007" text="Quel'ule" Script="inventory equipvdl -703437333
use_itemvdl -703437333
Activated=False" />
        <Data Name="TP008" />
        <Data Name="TP009" />
        <Data Name="TP010" />
    </DataSource>   
    <Page AbsorbsInput="false" BackgroundOpacity="1.000" Name="Framebutton" PackLocation="left,top" PackSize="absolute,absolute" RStyleDefault="/rectlist.win_plain" ScrollExtent="21,21" Size="21,21" />
    <Page AbsorbsInput="false" BackgroundOpacity="1.000" eq2usecomwndcontrols="true" Location="0,-1" Name="Bkg" PackSize="absolute,absolute" RStyleDefault="/SpecialElements.Compass.data.bkg.rect" ScrollExtent="218,22" Size="218,22" />
</Page>


Landiin 03-02-2010 02:49 PM

Quote:

Originally Posted by Drumstix42 (Post 88948)
Are you editing in plain text, or in the UIBuilder?

Because single apostrophe's need to be replaced with &apos;

Wrong; I use ' all the time. The only time it brakes things is when you use it like OnPress="say 'Hey that is Randy's car'" The ' obviously breaks the script but OnPress="say 'Hey that is Randys car'" is perfectly acceptable.

If you save in the UIbuilder it will convert them to &apos; for some reason but it isn't needed.

Landiin 03-02-2010 02:58 PM

Actually this is better coding here.. It checks to see if a script actually needs to be executed..
Code:

<?xml version="1.0" encoding="utf-8"?>
<Page BackgroundColor="#554736" eq2usescomwndcontrols="true" Name="tp" OnHide="visible=True" ScrollExtent="220,20" Size="220,20" UserMovable="true">
    <Page AbsorbsInput="false" BackgroundOpacity="1.000" Name="Frame" PackLocation="left,top" PackSize="absolute,absolute" RStyleDefault="/rectlist.win_plain" ScrollExtent="221,21" Size="221,21" />
        <Button Location="1,1" Name="TpButton" OnActivate="" OnPress="Activated=Parent.Tp_Dropdownbox.SelectedItem.IsScript OnActivate=Parent.Tp_Dropdownbox.SelectedItem.Script" ScrollExtent="19,19" Size="19,19" Style="/CommonElements.SmallPushButton" />
    <Dropdownbox DataSource="TpDestinationDS" Location="20,2" Name="Tp_Dropdownbox" OnSelect="Activated=SelectedItem.IsScript OnActivated=SelectedItem.Script" PackSize="a,f" RowTemplate="/Templates.dropdowntemplate" ScrollExtent="197,18" Size="197,18" Style="/Fetish.dropdownlist.dropdown_default" />
    <DataSource Name="TpDestinationDS">
        <Data Name="TP000" text="Choose Your Destination..." IsScript="false"/>
        <Data Name="TP001" text="-------------------Spell-------------------" IsScript="false" />
        <Data Name="TP002" text="Spire Portal" IsScript="true" Script="useability 1634378213
Activated=False"/>
        <Data Name="TP003" text="Druid Ring Portal" IsScript="true" Script="useability 41973245
Activated=False"/>
        <Data Name="TP004" text="Home Sweet Home" IsScript="true" Script="useability 368171195
Activated=False"/>
        <Data Name="TP005" Text="Guild Hall" IsScript="true" Script="useability 3266969222
Activated=False" />
        <Data Name="TP006" text="----------------Item--------------------" IsScript="false" />
        <Data Name="TP007" text="Quel'ule" IsScript="true" Script="inventory equipvdl -703437333
use_itemvdl -703437333
Activated=False" />
        <Data Name="TP008" />
        <Data Name="TP009" />
        <Data Name="TP010" />
    </DataSource>   
    <Page AbsorbsInput="false" BackgroundOpacity="1.000" Name="Framebutton" PackLocation="left,top" PackSize="absolute,absolute" RStyleDefault="/rectlist.win_plain" ScrollExtent="21,21" Size="21,21" />
    <Page AbsorbsInput="false" BackgroundOpacity="1.000" eq2usecomwndcontrols="true" Location="0,-1" Name="Bkg" PackSize="absolute,absolute" RStyleDefault="/SpecialElements.Compass.data.bkg.rect" ScrollExtent="218,22" Size="218,22" />
</Page>


battosa 03-02-2010 03:06 PM

i'm in a raid right know i will try it as soon as i can , thanks for all your help, advice and for pointing my mistake :)

so the IsScript="true" launch the script without any button if i understand correctly

is there a limitation for using it or can it work with any kind of scripting ?

in this line
<Data Name="TP001" text="-------------------Spell-------------------" IsScript="true" />

you code the IsScript on true but on this one , it's on false
<Data Name="TP006" text="----------------Item--------------------" IsScript="false" />

is there a reason ? i would like to understand how it work :)


Edit i saw the button line after re-reading the code :p

<Button Location="1,1" Name="TpButton" OnActivate="" OnPress="Activated=Parent.Tp_Dropdownbox.SelectedItem.IsScript OnActivate=Parent.Tp_Dropdownbox.SelectedItem.Script" ScrollExtent="19,19" Size="19,19" Style="/CommonElements.SmallPushButton" />

is it normal to leave this OnActivate empty ?

Landiin 03-02-2010 04:34 PM

Quote:

Originally Posted by battosa (Post 88953)
i'm in a raid right know i will try it as soon as i can , thanks for all your help, advice and for pointing my mistake :)

so the IsScript="true" launch the script without any button if i understand correctly

That and it stops the script from activating the object thus leaving it activated and the OnActivate code never firing again for the live of the loggin.
Quote:

Originally Posted by battosa (Post 88953)
is there a limitation for using it or can it work with any kind of scripting ?

Nope none.
Quote:

Originally Posted by battosa (Post 88953)
in this line
<Data Name="TP001" text="-------------------Spell-------------------" IsScript="true" />

you code the IsScript on true but on this one , it's on false
<Data Name="TP006" text="----------------Item--------------------" IsScript="false" />

is there a reason ? i would like to understand how it work :)

Copy and paste FTW! (mistyped, I corrected it but not in time it seems)
Quote:

Originally Posted by battosa (Post 88953)
Edit i saw the button line after re-reading the code :p

<Button Location="1,1" Name="TpButton" OnActivate="" OnPress="Activated=Parent.Tp_Dropdownbox.SelectedItem.IsScript OnActivate=Parent.Tp_Dropdownbox.SelectedItem.Script" ScrollExtent="19,19" Size="19,19" Style="/CommonElements.SmallPushButton" />

is it normal to leave this OnActivate empty ?

Normal? Hmm It doesn't matter if you leave it blank or leave that attribute out. I just blanked it out and moved on..

battosa 03-02-2010 05:54 PM

so i tested the two version , ( with IsScript and without it ) and none work , it does the same thing i described before :confused:

i really don't know what to do , i understand most of my mistake with the help of your comment , but now i'm completely lost

otherwise maybe i will be making two dropdownbox, one for the spell the other for item but it's strange it don't work multiple time with only one DDB :/

Landiin 03-02-2010 06:38 PM

HAHA me and my no prof reading..

Change OnActivated to OnActivate in the Dropdownbox..

Mybad..

battosa 03-02-2010 11:26 PM

lol coding can be really strict :)

i will try it after work :)

lordebon 03-03-2010 12:29 AM

Quote:

Originally Posted by battosa (Post 88962)
lol coding can be really strict :)

I nominate that line for understatement of the year :D

battosa 03-03-2010 09:12 AM

Thanks it work perfectly now :) now i just need to gather all the vdl number for all the item with Teleports effect :)

edit : hum i just noticed a thing, the home tp id number change with the town your from, is there a way to imput all the ability id under the same line , so when i click the "home sweet home" line it will be able to launch the available "city tp" ? Found the solution, i was thinking to hard ^^

if i can disturb you one last time :p , i know i's impossible to create a slot to contain an ingame macro , but is there a way to add a button to equip the previous item ( after using a script with an item ) without specifying a vdl number or something like

because no one use the same item , if in my case i use one of the SF charm, someone else might use a better item in the slot where the script equip an item before using it ( don't know if i'm explaining well :/ )

battosa 03-03-2010 12:55 PM

i tried to put some color on the text but it don't seem to work

i tried with TextColor

Code:

<Data Name="TP007" TextColor="#CCCCFF" text="***ANTONICA***" IsScript="false" />


All times are GMT -5. The time now is 07:42 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI