EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   Onpress (https://www.eq2interface.com/forums/showthread.php?t=12210)

samejima 01-09-2009 07:02 AM

Onpress
 
So I got tired of crashing my client. Working on a pretty big file and looking to make my code actually readable.

As far as I know a commonly used practice would be!

Code:

Parent.Button.onpress =('say')##(x)
Parent.Button.press=true
Parent.Button.onpress=('say')##(y)
Parent.Buton.press=true

Code:

Now what I'm trying to do is
Parent.Button.onpress =('say')##(x)
Parent.Button.onpress=(parent.Button.onpress)##(line return)##('say')##(y)
Parent.Buton.press=true

Something like this even possible?

gm9 01-09-2009 08:48 AM

Quote:

Originally Posted by samejima (Post 79582)
Code:

Now what I'm trying to do is
Parent.Button.onpress =('say')##(x)
Parent.Button.onpress=(parent.Button.onpress)##(line return)##('say')##(y)
Parent.Buton.press=true


That will work if you add the missing spaces after 'say' and if you have define "linereturn" (drop the space, element names cannot have spaces) as a line feed character (or carriage return + line feed).

Of course it would be easier to just directly do it like this but that might not have been what you are after:
Parent.Button.OnPress='say ' ## (x) ## ' say ' ## (y)

samejima 01-09-2009 06:29 PM

Your code returns

you say, "test say test2"

which was the same problem i was running into previously if i wasn't crashing of course!

For the record that was definitely pseudo code to help understand what i was trying to do. I need a line return so when it presses it thinks that its a slue of commands.

gm9 01-09-2009 06:36 PM

Oh lol yeah sorry did that in a hurry, you can't just separate different /say commands via a space because it thinks that's still part of the text you want to say, so in this case you would need to use the = notation. Also I got the order wrong. So the correct line without a linebreak would be:
Parent.Button.OnPress='say ' ## (y) ## ' say ' ## (y) ## ' say ' ## (x) ## ' say ' ## (x)
But I thought so that your question was mainly directed at the linebreak anyway.

samejima 01-09-2009 08:10 PM

Basically instead of doing
ONPRESS= BLAH BLAH
Press=true
ONPRESS= BLAH BLAH
Press=true
ONPRESS= BLAH BLAH
Press=true
ONPRESS= BLAH BLAH
Press=true
ONPRESS= BLAH BLAH
Press=true
ONPRESS= BLAH BLAH
Press=true
ONPRESS= BLAH BLAH
Press=true

I was trying to see if its possible to add line breaks so I could do

ONPRESS= BLAH BLAH
ONPRESS= ONPRESS + LINEBREAK + BLAH BLAH
ONPRESS= ONPRESS + LINEBREAK + BLAH BLAH
ONPRESS= ONPRESS + LINEBREAK + BLAH BLAH
Press=true

Which I gave up on for the moment but if its possible would cut down on code emmensly

gm9 01-09-2009 08:16 PM

Yes you can, sorry if that didn't become clear above. For example in my code I usually add an element CRLF to the xml which is the linebreak characters and then my code I just XX.OnPress=(code1) ## CRLF ## (code2) ## CLRF ## (code3) ## ...

samejima 01-09-2009 08:31 PM

I tried doing that by creating a variable="
" then put it there could you put a more exact example because everything I tried just crashed me.

gm9 01-09-2009 08:39 PM

if you tried that runtime it won't work, if you put it in the xml that will work. Or just put it in the XML like this:
CRLF="
"
That's what I did before we had the entities.

samejima 01-09-2009 08:57 PM

HUMM that was one of the first things I tried Ill go back and do it again after raids, thanks.


All times are GMT -5. The time now is 06:26 PM.

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