1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Greetings Guest!!

    In order to combat SPAM on the forums, all users are required to have a minimum of 2 posts before they can submit links in any post or thread.

    Dismiss Notice

[Tech Help] Command?

Discussion in 'UO Enhanced Client Discussion' started by Lynk, Jul 20, 2009.

  1. Lynk

    Lynk Grand Poobah
    Stratics Veteran

    Joined:
    May 13, 2008
    Messages:
    6,032
    Likes Received:
    145
    This was in the other SA thread, but I felt it more appropriate here (Sorry Cromag).

    Where is the documentation that teaches us how and what we can use in the command prompt?

    [​IMG]

    There are obviously key words and I would like to know them as well as the proper syntax. Something tells me that we will be able to communicate directly with the client with these. This command function built in with the recorded macros makes for some very interesting possibilities.

    If this is the case - very good job EA - now give me the damned command list!
     
  2. Harlequin

    Harlequin Babbling Loonie
    Stratics Veteran

    Joined:
    Jun 11, 2008
    Messages:
    2,716
    Likes Received:
    32
    I'm curious too! I tried a couple of o/s commands thinking that it was that kind of commands, didn't work. Anyone knows?
     
  3. Maplestone

    Maplestone Crazed Zealot
    Stratics Veteran

    Joined:
    Jul 26, 2008
    Messages:
    3,657
    Likes Received:
    9
    try this command:

    script CreateWindow("TipoftheDayWindow", true)
     
  4. CroMag1980

    CroMag1980 Guest

    It worked.... *hyperventilates*
     
  5. Petra Fyde

    Petra Fyde Peerless Chatterbox
    Stratics Veteran Alumni Stratics Legend

    Joined:
    Jan 5, 2001
    Messages:
    30,889
    Likes Received:
    5,171
    interesting, but relatively useless. Are you able to give us non-techies some idea of useful things we might be able to use it for?
     
  6. Lynk

    Lynk Grand Poobah
    Stratics Veteran

    Joined:
    May 13, 2008
    Messages:
    6,032
    Likes Received:
    145
    Yes, I want a full list of the commands like Create Window, but it def appears as though you can run script commands, looks like a variant of VB. I want to know all the different window and gump names, I want a full list of everything. Where is it!
     
  7. Harlequin

    Harlequin Babbling Loonie
    Stratics Veteran

    Joined:
    Jun 11, 2008
    Messages:
    2,716
    Likes Received:
    32
    Nice! Was it documented in the KR manual? Anyone still has the pdf?
     
  8. CroMag1980

    CroMag1980 Guest

    I am going to poke around the default.zip file tonight in the ...Electronic Arts\Ultima Online Stygian Abyss\UserInterface directory.

    The "includes" in the interface.xml I am assuming work like #includes in C++ so these files below might contain something currently usable.
    Code:
    <Scripts>
    		<Script file="Interface.lua" />
    		<Script file="Source/Tooltips.lua" />
    		<Script file="Source/StringUtils.lua" />
    		<Script file="Source/GGManager.lua" />
    		<Script file="Source/Confirms/CGManager.lua" />
    		<Script file="Source/Generic/UO_GenericGump.lua" />
    		<Script file="Source/DamageWindow.lua" />
    		<Script file="Source/HotbarSystem.lua" />
        <Script file="Source/OverheadText.lua" />
    		<Script file="Source/ObjectHandle.lua" />
    		<Script file="Source/HealthBarColor.lua" />
        <Script file="Source/NameColor.lua" />
        <Script file="Source/StaticTextWindow.lua"/>
    	</Scripts>
    Old documentation can be found here. You get a "not recommended" message from browser so use at own risk (but only place I could find those files).
     
  9. pgcd

    pgcd Guest

    It's not VB, it's Lua. The sources seem to be very closely related to those for KR, but there are some interesting differences. Too bad it's not active yet, as i long to be able to use my scripties.
     
  10. Maplestone

    Maplestone Crazed Zealot
    Stratics Veteran

    Joined:
    Jul 26, 2008
    Messages:
    3,657
    Likes Received:
    9
    The "command" action is a direct interface to the language of the UI. If you look at the Custom UI documentation at the modder exchange (from the link Cromag1980 provided above) you can get a rough overview, but in the end it still requires you to understand how to write Lua files (you can look in the default interface sources directory or custom mods for lists and examples)

    I fear I really only know enough to know how stunningly powerful this is and how steep the learning curve is.
     
  11. Gildar

    Gildar Babbling Loonie
    Stratics Veteran

    Joined:
    Apr 22, 2004
    Messages:
    2,354
    Likes Received:
    4
    *adds "writing up useful SA script commands" to his task list*

    edit:: See here.
     
  12. Lynk

    Lynk Grand Poobah
    Stratics Veteran

    Joined:
    May 13, 2008
    Messages:
    6,032
    Likes Received:
    145
    I'm really looking forward to developing some neat stuff.

    I'm not familiar with LUA, but lets be honest if you can write in one language you can write in them all.. time to find some docs and brush up.
     
  13. CroMag1980

    CroMag1980 Guest

    That would be good...
     
  14. Lynk

    Lynk Grand Poobah
    Stratics Veteran

    Joined:
    May 13, 2008
    Messages:
    6,032
    Likes Received:
    145
  15. TullyMars

    TullyMars Sage
    Stratics Veteran

    Joined:
    May 14, 2008
    Messages:
    525
    Likes Received:
    55
    I had done some previous KR modding on my own so figured I'd poke around and see what I can find for SA till they open up the custom interfaces.
    Here is what I found and got to work in a cursory look at some of the UO SA Lua and xml files. Doubt any are real useful. Use at your own risk.

    command script TargetWindow.ClearPreviousTarget()
    Description: clears out your target so you have nothing on current target.
    command script MapCommon.AdjustZoom(-50)
    Description: zooms the radar map
    command script MainMenuWindow.OnOpenBugReportItem()
    Description: opens a bug report window

    Dual Macro
    command script MainMenuWindow.OnOpenUserSettings()
    command script SettingsWindow.OpenLegacyTab()
    Description: opens your settings window and switches it to legacy tab.

    These are just the ones I got working correctly and as I said I may wait till the real talents in modding come out. The good news is I don't see why any and all previous mods and such shouldn't work again and with a little perserverance all requests will probably be worked out.
     
  16. Gildar

    Gildar Babbling Loonie
    Stratics Veteran

    Joined:
    Apr 22, 2004
    Messages:
    2,354
    Likes Received:
    4
    ((edit:: Commands moved here))

    Anybody have requests for other commands?


    Note: If you want to do multiple settings changes rapidly - merge them into a single macro with only one "UserSettingsChanged()" call at the end.
    You can also move the "UserSettingsChanged()" call as it's own macro, if you'd like.
     
  17. Fink

    Fink Guest

    Gildar, brilliant as always.

    Any you could whip up for changing performance-affecting settings would be great; frame rate, shadows, etc, whatever you think is critical. This could be handy for on-the-fly benchmarking, a "fine-tune" macro set. Seems to be a popular gripe.

    Being able to press a key and have it change playfield zoom level to the desired setting would be good, too, opting for something that scales well without rectangular pixels.
     
  18. OH WOW! I had asked for the Object Handles switch key function... I think this is what I need!!

    One other request... I use different default zoom levels depending on which character I am playing and what they are doing. For example, my tamer lead tames cu sidhes and I find it easier to zoom IN about 2/3 max to tame. Then when I go hunting for more to tame, I zoom OUT to about 2/3 max. Is there a Zoom setting that will work?

    THANKS Gildar!
     
  19. TheGrayGhost

    TheGrayGhost Guest

    Same boat this is something I have been wanting. Thanks a ton Gildar!
     
  20. Lynk

    Lynk Grand Poobah
    Stratics Veteran

    Joined:
    May 13, 2008
    Messages:
    6,032
    Likes Received:
    145
    Very nice, where are you getting this from? Is there a manual??

    I also need to assign a hot key to changing screen size since I use my mouse wheel to target self/last target.
     
  21. Petra Fyde

    Petra Fyde Peerless Chatterbox
    Stratics Veteran Alumni Stratics Legend

    Joined:
    Jan 5, 2001
    Messages:
    30,889
    Likes Received:
    5,171
    toggle circ of trans?? please?
     
  22. Lynk, in case you didn't know yet, the default hot keys for zoom in/out are

    IN: Left ALt - (Minus)
    Out: Left ALT + (Plus)

    and of course you can change those. But I want to go to a fixed zoom rather than scrolling the zoom.
     
  23. Gildar

    Gildar Babbling Loonie
    Stratics Veteran

    Joined:
    Apr 22, 2004
    Messages:
    2,354
    Likes Received:
    4
    No - I'm getting them from experience modding the KR client. It's mostly the same Lua underneath.


    You already have this - it's 6th and 7th from the bottom of the key binding list.


    You've already got that one - last option in the input list.


    As for fixed zoom... I'm not seeing any way to do that. Sorry.


    Here are a few other nice ones...

    ((edit:: Commands moved here))
     
  24. Gildar, I didn't do a very good job explaining what I am looking for in the Zoom.

    Let's say we can zoom from 0% (min) to 100% (max). Can I hot key 25% zoom and 75% zoom with the commands?
     
  25. TullyMars

    TullyMars Sage
    Stratics Veteran

    Joined:
    May 14, 2008
    Messages:
    525
    Likes Received:
    55
    Illandril, I got myself stuck on working out a dismount command that can be put into macros and I was wondering if you found a quick way of getting a toons objectId.

    I was thinking of setting the TargetWindow.TargetId to my toons ID and calling the TargetWindow.OnItemDblClicked() function which does this
    UserActionUseItem(TargetWindow.TargetId,false)

    Any suggestions?
     
  26. Lynk

    Lynk Grand Poobah
    Stratics Veteran

    Joined:
    May 13, 2008
    Messages:
    6,032
    Likes Received:
    145
    Ok.. but you must have gotten that knowledge from somewhere? How do you know the commands are ResizeWindow and _doFreeze, etc.

    I don't imagine you figured out the KR modding just by typing random words in until you got a reaction?

     
  27. TullyMars

    TullyMars Sage
    Stratics Veteran

    Joined:
    May 14, 2008
    Messages:
    525
    Likes Received:
    55
    Lynk open up the default.zip in the user interface folder of the game installation.
    From there use notepad (or whatever editor like Notepad++) to read all the different Lua (the source folder is probably where the meat of the programming can be found) Whenever you see a function you should be able to call that from the command script. You can also see various system and user variables that you should be able to set using the command.

    From there it is trial and error. If you are like me it is trial and error and error and error. If you are experienced like Gildar (and the other uo.modders-exchange.net contributers)...much less error.
     
  28. Gildar

    Gildar Babbling Loonie
    Stratics Veteran

    Joined:
    Apr 22, 2004
    Messages:
    2,354
    Likes Received:
    4
    Not that I can find.


    UserActionUseItem(WindowData.PlayerStatus.PlayerId,false) will dismount... but if you're not mounted it will toggle your paperdoll.
    I don't see a way to quickly check to see if you're mounted or not.


    I studied Lua, and read through the files in the Default zip of the UserInterface directory. There was some documentation (but it was out of date, and not particularly useful) that originally came along with KR, but that was since removed.

    _doFreeze is my own variable that I defined in the commands (I needed to pass the data between the string of commands).
     
  29. Gildar

    Gildar Babbling Loonie
    Stratics Veteran

    Joined:
    Apr 22, 2004
    Messages:
    2,354
    Likes Received:
    4
    I don't know about that one... I think we just try things faster ;)
     
  30. TullyMars

    TullyMars Sage
    Stratics Veteran

    Joined:
    May 14, 2008
    Messages:
    525
    Likes Received:
    55
    Ah thank you for that variable.
     
  31. This works perfectly!

    Anyway to remount? I know that I can drop an ethy into a hot bar slot and assign a key to that, and works great for mounting, but not my cu sidhe.
     
  32. TullyMars

    TullyMars Sage
    Stratics Veteran

    Joined:
    May 14, 2008
    Messages:
    525
    Likes Received:
    55
    I assume you don't want to use the targetnearestfriendly option that many macroers have discussed.
    Well when I get near my SA computer I will test it out but thought I'd post these two theoretical approaches in case anyone wants to play around and make them work.

    1.UserActionUseItem(WindowData.Pets.PetId[1].MobileId , false)
    OK not sure what the right variable is supposed to be but it is something like this for the first pet in your list. Of course if you replace the 1 with a 2 you would get your second pet as that is just the placement in the index.

    2. SystemData.ActiveWindow = "PetWindowShowViewHealthBar"..thenameofyourpet.."LabelName"
    PetWindow.OnDblClick()
    In this one I know the window name is wrong but it is something grandiose like that.


    As I said neither of these will work as is but may give some people a start on where to look.
     
  33. What does this one do?

    COMMAND script SystemData.Settings.GameOptions.GodMode = SystemData.Settings.GameOptions.GodMode
    COMMAND script UserSettingsChanged()
     
  34. Gildar

    Gildar Babbling Loonie
    Stratics Veteran

    Joined:
    Apr 22, 2004
    Messages:
    2,354
    Likes Received:
    4
    Nothing at all.
     
  35. Eh... you are just too smart.
     
  36. Ash

    Ash Guest

    I just upload my errors and let Gildar fix them. :dunce:
     
  37. Diggity

    Diggity Guest

    Hotkey handle filters, very handy. Thanks.

    How about a command to create a mobile healthbar from either current target or target window gump?
     
  38. CroMag1980

    CroMag1980 Guest

    I'd ideally like to store a bunch of friendly/enemy targets that i can overwrite on the fly.

    If F5-F8 were Target Friendly 1-4 and F9-F12 were Target Enemy 1-4 - along with a "store target friend" "store target enemy" macros (up to 4 of each in this example) I basically would not need to touch my mouse... o_0
     
  39. Fink

    Fink Guest

    Wish I'd seen all this before setting up all my characters.. might just have to paste a bunch of macros into each settings file.

    Good work, keep them coming. :thumbsup:
     
  40. Gildar

    Gildar Babbling Loonie
    Stratics Veteran

    Joined:
    Apr 22, 2004
    Messages:
    2,354
    Likes Received:
    4
    ((edit:: Commands moved here))

    I tried moving it to the mouse cursor... but that needed 5 commands to work for people who use UI scaling (and for those who haven't noticed yet... there's a delay between each command... so it was sloooow)
     
  41. Whenever I try to change anything in the settings files they get written over with a blank default file. Same for the XML files. Does this work for you?
     
  42. STOLEN!
     
  43. Maplestone

    Maplestone Crazed Zealot
    Stratics Veteran

    Joined:
    Jul 26, 2008
    Messages:
    3,657
    Likes Received:
    9
    What about creating a new LUA file with a subroutine doing everything and having just one script referencing the subroutine?

    ( just something to think about when doing custom UIs :) )
     
  44. Gildar

    Gildar Babbling Loonie
    Stratics Veteran

    Joined:
    Apr 22, 2004
    Messages:
    2,354
    Likes Received:
    4
    The problem with that... no custom UI stuff in SA yet :(

    If we did... I would be making skins instead of writing up commands.
     
  45. Maplestone

    Maplestone Crazed Zealot
    Stratics Veteran

    Joined:
    Jul 26, 2008
    Messages:
    3,657
    Likes Received:
    9
    I know, I just like poking peoples' imaginations :)
     
  46. Diggity

    Diggity Guest

    I'm on a laggy slow computer at the moment so not sure how it will work "for reals", but thanks for the commands.

    I did notice that if I use the MobileHealthBarWindow.OnBeginDragHealthBar(id) function, it does create the healthbar somewhat near the cursor. Real laggy on my computer tho and the healthbar gump doesn't anchor until I click the mouse right on the gump. I'll try doing a multipart command macro to also use the .OnEndDragHealthBar to see if I can get the healthbars to create somewhat quickly at the cursor location. Ultimately I'd like to create all the healthbars by spamming next enemy or next friend while positioning the cursor where I want the healthbars to show.

    On another note, is there a command that can be use to toggle the ignore persons user settings? With all the Armageddon spam, I probably have 1/2 my shards Shadowlords groups on ignore. Be nice to easily toggle them on/off.
     
  47. EnigmaMaitreya

    EnigmaMaitreya Crazed Zealot
    Stratics Veteran

    Joined:
    May 12, 2008
    Messages:
    3,402
    Likes Received:
    0
    You getting any feel for when that will happen?
     
  48. Ya, I have a request.

    Anyway to use this command script to open up all corpses within range?
     
  49. Ash

    Ash Guest

    Well, not ideal for multiple pet users, but single pet players can (at least with new targeting haven't tried legacy) make a simple macro
    1 - Target Nearest Follower
    2 - Use Targeted Object

    Presto you just mounted the nearest follower.
     
  50. Fink

    Fink Guest

    I've had one occasion where the file has gone bad and been overwritten by a default file when I've loaded the character. Not sure what I did but I restored from a backup, then attempted another copy/paste and it worked. Was basically creating a long macro with lots of repetition in the guts of it, which itself was then repeated x10.