• Hail Guest!
    We're looking for Community Content Contribuitors to Stratics. If you would like to write articles, fan fiction, do guild or shard event recaps, it's simple. Find out how in this thread: Community Contributions
  • Greetings Guest, Having Login Issues? Check this thread!
  • Hail Guest!,
    Please take a moment to read this post reminding you all of the importance of Account Security.
  • Hail Guest!
    Please read the new announcement concerning the upcoming addition to Stratics. You can find the announcement Here!

COMMAND scripts

Storm

UO Forum Moderator
Alumni
Stratics Veteran
Stratics Legend
Awards
1
And Petra forwarded it to me!
That page will be updated shortly with all the commands that have been posted since then.
Thanks Gildar!! I did not relies you could edit pages! or would have asked you directly! Makes note to pay more attention to titles and signatures at the bottom of pages !
 
T

Tazar

Guest
Description: Creates a mobile healthbar from the current target, attaches it to the current target (moves it over the target's head and keeps it stuck there), then detaches it (lets you drag it around as you please).
Code:
script _mobID, _x = WindowData.CurrentTarget.TargetId, MobileHealthBarWindow.CreateHealthBar(WindowData.C urrentTarget.TargetId)
script AttachWindowToWorldObject(_mobID, "MobileHealthBarWindow".._mobID)
script DetachWindowFromWorldObject(_mobID, "MobileHealthBarWindow".._mobID)
I'm not having any luck getting this one to work.
What I want is basically a macro that targets nearest enemy target, then pulls and sticks the health-bar to the target. I am hoping the health-bar vanishes upon creature death.

I have the macro with "target nearest enemy" followed by the three command scripts above - but I never get the health-bar. For what I want, I don't think I need the 3rd script line, but included it since leaving it out also did produce the sticky health bar

I also tried adding a 1.0 delay between selecting target and the command scripts hoping that would help... with no luck.

Any ideas?
 

Decors

UOEC Modder
Stratics Veteran
Stratics Legend
I have the macro with "target nearest enemy" followed by the three command scripts above - but I never get the health-bar. For what I want, I don't think I need the 3rd script line, but included it since leaving it out also did produce the sticky health bar
Any ideas?
The First line includes spacing. Check around CurrentTarget and You'll be fine.
 

Storm

UO Forum Moderator
Alumni
Stratics Veteran
Stratics Legend
Awards
1
There is a space between the c and the u in current remove this and it will be fine!as decor stated!
also the third line can be removed but then the health bar will stay attached to the mob!

Mine has target next in front with no delays !If i hit the hot key 3 times it targets the closest three to me and creates a mobile bar for each!
 
T

tuatha

Guest
I'm not having any luck getting this one to work.
What I want is basically a macro that targets nearest enemy target, then pulls and sticks the health-bar to the target. I am hoping the health-bar vanishes upon creature death.

I have the macro with "target nearest enemy" followed by the three command scripts above - but I never get the health-bar. For what I want, I don't think I need the 3rd script line, but included it since leaving it out also did produce the sticky health bar

I also tried adding a 1.0 delay between selecting target and the command scripts hoping that would help... with no luck.

Any ideas?

i just ran into this same problem... there is a typo in the sample code..

Code:
script _mobID, _x = WindowData.CurrentTarget.TargetId, MobileHealthBarWindow.CreateHealthBar(WindowData.C urrentTarget.TargetId)
note the second instance of "Current target there is a space between the C and the rest...

Code:
script _mobID, _x = WindowData.CurrentTarget.TargetId, MobileHealthBarWindow.CreateHealthBar(WindowData.CrrentTarget.TargetId)
use this line and your script should work just fine
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
If you are using Lucis Interface, the following script will toggle other paperdolls on and off.

Code:
script SettingsWindow.DisablePaperdolls = not SettingsWindow.DisablePaperdolls
script UserSettingsChanged()
 

Hildebrand

Certifiable
Stratics Veteran
Stratics Legend
Code:
script _mobID, _x = WindowData.CurrentTarget.TargetId, MobileHealthBarWindow.CreateHealthBar(WindowData.[U][B]CrrentTarget[/B][/U].TargetId)
use this line and your script should work just fine
In same spot, you mistyped again. You have CrrentTarget... should be CurrentTarget.

I'm not able to get this script to work anymore since pub66. Is anyone else having problems?
 
D

Diggity

Guest
The last client patch updated/changed the MobileHealthBar.lua.

Code:
script MobileHealthBar.CreateHealthBar(WindowData.CurrentTarget.TargetId)
This will use the target window id to create the mobile healthbar stickied to your cursor. Click to anchor it. I'm not sure how to get it to anchor onto the mob like Gildar's original 3 command scripts did, but I prefer being able to drop it where I want it. Actually, I'd prefer that I press a button one time and all the blue/green/red/grey mob bars show up in separate columns ;). Pretty sure that is doable thru mods, but I'm too busy/lazy/stupid to do it. for now, macros with cycle friend/enemy followed by the create healthbar script are good enough for me.
 
W

wreckdumb

Guest
ive seen this script

Toggle "UI Freeze"
Note: This effectively locks (or unlocks) the play window, status window, chat windows, and menubar. You will need to re-run this set of commands every time you log in. script Debug.PrintToChat(L"UI (Un)Freezing...")
script _doFreeze = _WindowGetShowing( "ResizeWindow" )
script WindowSetShowing( "ResizeWindow", not _doFreeze )
script WindowSetMovable( "StatusWindow", not _doFreeze )
script ChatWindow.LockWindow( _doFreeze )
script WindowSetMovable( "MenuBarWindow", not _doFreeze )
script WindowSetMovable( "MenuBarWindowMinimized", not _doFreeze )
script Debug.PrintToChat(L"UI Frozen? "..StringToWString

ive tried changing a couple values to InventoryWindow, ect. but had no luck to lock my "backpack/inventory" if anyone could help me out it would be greatly appriciated,
 

Lore Denin (GL)

Sage
Stratics Veteran
Stratics Legend
Is there a way to use the mouse wheel to preform other functions such as mouse wheel down for bandage self?

Thanks

-Lore's Player
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
I'm not sure, and I don't want to check it out myself, but the easy way to find out is make a macro and try binding it to your mouse wheel. If that doesn't work and you have a programmable mouse you can always bind your mouse wheel down to a key combination and bind that key combination to your mouse wheel.
 

ATLPvPer

Journeyman
Stratics Veteran
Stratics Legend
Is there a way to use the mouse wheel to preform other functions such as mouse wheel down for bandage self?

Thanks

-Lore's Player
I can't believe you can't set mouse scroll down/up as a macro!
This is the only glaring flaw Ive seen so far in the client.
 
A

anvira

Guest
Hi all, I'm very new to this and thought it would be interesting to learn.

Specifically, I have questions at to where to actually 'insert' the COMMAND at in the Macro.

<UserAction type="Macro" id="54" iconId="0" name="Dismount" repeatEnabled="false" repeatCount="2" binding="">
<UserAction type="UserCommand" id="0" iconId="790" targetType="Current" text="" />
</UserAction>

Where do I insert the Command at? I mean, I saw where it was stated that you "Drag a COMMAND icon to the macro slot then enter the line of text shown in the text box for the COMMAND icon. Multiple lines (beginning with the word script) need multiple COMMAND icons. Letter case, punctuation and spacing must be perfect."

I would like to learn where to insert the Command :

script UserActionUseItem(WindowData.PlayerStatus.PlayerId ,false)

Any help would be appreciated, and I really think that once I havea handle on the basic location of something like this, it'll be way easier.
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
I would like to learn where to insert the Command :

script UserActionUseItem(WindowData.PlayerStatus.PlayerId ,false)

Any help would be appreciated, and I really think that once I havea handle on the basic location of something like this, it'll be way easier.
I think you are trying to do it the hard way. In game in the macro actions menu there is a "Command" icon. You just drag that into your macro and enter the script in the text field that appears when you do that. If you want to edit it you right click the icon and choose edit. If you want to move it around you just drag it to a different location in your macro.
 
A

anvira

Guest
Oooooh, seriously AWESOME!!!

Thanks a ton Llewen! Worked like a charm ;)
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
Welcome, the Enhanced Client rocks. It really does. But you have to take the time to figure it out and get used to it.
 

Storm

UO Forum Moderator
Alumni
Stratics Veteran
Stratics Legend
Awards
1
Rather than put this in a new sticky I decided to add it here for those who might want to change the map tilt!

C:\Program Files (x86)\Electronic Arts\Ultima Online Stygian Abyss\UserInterface\Copper_Enhanced\Source

This is the directory I go to yours will be similar depending on what you use!
Then go to the radarwindow.lua or the mapwindow.lua depending on what map you wish to change
then their will be a line that says mapwindow.rotation change the 45 to a 0 and save (or radarwindow.rotation.lua)
then when you pull up atlas it will not be tilted but radar map will depending on what map you changed!

Make sure and back up the file before you do this encase you mess up!!!
This was posted by Lucitus
I will see what i can do in the next release of my Interface, but i think it is also possible if you change this variable.

/script MapWindow.Rotation = 0

for the atlas and

/script RadarWindow.Rotation = 0

for the Radar.
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
Is there a command script for reloading your UI?

edit: Nevermind I see it is there in your input options, although it might be nice to be able to make a macro out of it.
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
This is courtesy of Decors. What is so exciting about this is that you can use this same macro to create a reliable mount macro!

<Petball Macro Example.>

1. Create Item-ID Macro
Befor to make petball macro You must make macro to get Item-IDs.
- Create "ItemID" Macro
- Drag Command action into ItemID macro
- Type this script into Command action
script _itemID = WindowData.CurrentTarget.TargetId

- Drag One more Command action into ItemID macro
- Type this script into Command Action
script Debug.PrintToChat(L" <TargetID> ".._itemID)

2.Get Petball Item-ID
Once you create ItemID macro, you can get Petball-ItemID.
- Drag your Petball on the ground.
- Click Petball and target it.
- Use ItemID macro. You'll see the ItemID of your petball in the chat window.
- Once you get ItemID you can pick your petball into your backpack.

3.Create Petball Macro. For example "Petball_Greater_Dragon"
- Drag Command Action Into Petball Macro. And Paste below line.
script WindowData.CurrentTarget.TargetId = 1122334455
(Replace 1122334455 to your Petball-ID)

- Drag one more Command action Into Petball Macro. And Paste below line.
script TargetWindow.UpdateTarget()

- Drag one more Command action Into Petball Macro. And Paste below line.
script TargetWindow.OnLClick()

- Drag "Use Targeted Object" action into Petball Macro. And set it to "Current"

4.Finished. Let's try your Petball macro.
edit: One of the nice things about the EC is that you can "chain" macros if you wish. So what I have is this macro, followed by a "target nearest follower, use targeted object" macro, followed by a macro to use my ethereal mount. What this means is, if, for example, I have two mounts out, I can designate one as the primary mount, while the other one will get used if it is within range and I fail to mount my primary mount. Or if I don't want to bother setting a different mount when I take one out of the stable, I can still use my old mount macro. Or if I have no mount out I can use my ethereal mount, all without rejigging my mount macro every time. It isn't as reliable, but it is fine for most purposes. The only time it really caused me problems was in pvp.
 

Mervyn

Babbling Loonie
Stratics Veteran
Stratics Legend
anyone know the command script for cancel target?

Meaning, say i have a spell casted and the cursor target up, and i want to just cancel that (the equivalent of pressing esc)
 
O

Old Man of UO

Guest
anyone know the command script for cancel target?

Meaning, say i have a spell casted and the cursor target up, and i want to just cancel that (the equivalent of pressing esc)
The easiest way I've found to do that is to create a blank macro that does nothing. You can't run two macros at the same time, so the second macro cancels the first.

It's easy and fast, and for whatever reason the ESC does not always work for me. The Blank Macro does.
 

Mervyn

Babbling Loonie
Stratics Veteran
Stratics Legend
anyone know the command script for cancel target?

Meaning, say i have a spell casted and the cursor target up, and i want to just cancel that (the equivalent of pressing esc)
The easiest way I've found to do that is to create a blank macro that does nothing. You can't run two macros at the same time, so the second macro cancels the first.

It's easy and fast, and for whatever reason the ESC does not always work for me. The Blank Macro does.
Well i added a blank command to the begining of a macro but it doesn't seem to cancel the target that i have, basically, i wanna disarm my shield when i have a spell precasted, and it doesn't let me do that with the target cursor up.
 
O

Old Man of UO

Guest
Well i added a blank command to the begining of a macro but it doesn't seem to cancel the target that i have, basically, i wanna disarm my shield when i have a spell precasted, and it doesn't let me do that with the target cursor up.
Sorry, but I misunderstood what you were asking for. I thought you wanted a way to cancel a macro once you have the target up.

I don't know how to do what you want.
 

Mervyn

Babbling Loonie
Stratics Veteran
Stratics Legend
i guess what i'm asking for is a command for the escape button :p should be simple enough
 
O

Old Man of UO

Guest
i guess what i'm asking for is a command for the escape button :p should be simple enough
The escape key cancels a macro.

What I think you are asking for is a way to cancel an active macro within another macro? Or you are asking for a way to cancel only the target cursor, but to continue with the new macro?

I'm missing something, or not quite understanding what you want to do.
 

Mervyn

Babbling Loonie
Stratics Veteran
Stratics Legend
Yeah the latter,

Basically, on CC, if you have a spell precasted and you press disarm shield, it will auto cancel your target cursor and disarm shield, on EC it won't auto cancel the target cursor and the disarm shield macro will just not work, i just figured there must be an easy fix with a cancel target cursor command to wack infront of disarm shield macro.
 

Hannes Erich

Seasoned Veteran
Stratics Veteran
Stratics Legend
I would like a hotbar button that can toggle object handles on/off.

Would a script command for that be possible?
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
All you need to do is hit ctrl-shift.
 

Hannes Erich

Seasoned Veteran
Stratics Veteran
Stratics Legend
All you need to do is hit ctrl-shift.
I know, that hot-key has been there since the beginning of UO. :)

What I'm asking about is the creation of a hotbar button, a one-click toggle that doesn't involve the keyboard at all. I'm guessing this would require a script command.
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
All you need to do is hit ctrl-shift.
I know, that hot-key has been there since the beginning of UO. :)

What I'm asking about is the creation of a hotbar button, a one-click toggle that doesn't involve the keyboard at all. I'm guessing this would require a script command.
Ah, I understand. I'd suggest you ask Pinco. If anyone can figure something out, he can.
 

Pinco

UOEC Modder
Stratics Veteran
Stratics Legend
I know, that hot-key has been there since the beginning of UO. :)

What I'm asking about is the creation of a hotbar button, a one-click toggle that doesn't involve the keyboard at all. I'm guessing this would require a script command.
I've tried to do it long time ago, but the ctrl shift is managed inside the client and can't be changed...
unfortunately I can only invoke the label creation but the server don't send the data so is useless :(
 

Hannes Erich

Seasoned Veteran
Stratics Veteran
Stratics Legend
I've tried to do it long time ago, but the ctrl shift is managed inside the client and can't be changed...
unfortunately I can only invoke the label creation but the server don't send the data so is useless :(
Wait! Maybe there's hope. :)

In Dermott's forum signature, there's a link to a "UO Modders Exchange" website. In the "Mods" section, there's a file named "ObjectHandleToggleWindow". However, it's from September, 2009 (though it has lots of downloads). What does this do? Does this do what it sounds like it does? Will it help me make a button? If so, will it work for the Enhanced Client, or is it for some previous version? Do you know anything about this file? Can you tell I really want a button for this? Hee hee!

I've already removed all the other needs for my keyboard in UO (besides chat). Games were hurting my wrists, so I paid a lot of money for a Razer gaming mouse, very sensitive to touch and easy on the wrists. So UO has been much more enjoyable with the enhanced client's hotbars. :heart:
 

Pinco

UOEC Modder
Stratics Veteran
Stratics Legend
Wait! Maybe there's hope. :)

In Dermott's forum signature, there's a link to a "UO Modders Exchange" website. In the "Mods" section, there's a file named "ObjectHandleToggleWindow". However, it's from September, 2009 (though it has lots of downloads). What does this do? Does this do what it sounds like it does? Will it help me make a button? If so, will it work for the Enhanced Client, or is it for some previous version? Do you know anything about this file? Can you tell I really want a button for this? Hee hee!

I've already removed all the other needs for my keyboard in UO (besides chat). Games were hurting my wrists, so I paid a lot of money for a Razer gaming mouse, very sensitive to touch and easy on the wrists. So UO has been much more enjoyable with the enhanced client's hotbars. :heart:
is the same in my UI, is the little window to change on the fly the type :p
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
Why was this unstickied? It is still a very useful thread.
 

Petra Fyde

Peerless Chatterbox
Alumni
Stratics Veteran
Stratics Legend
erm, it's not?
Every thread in the reference area is stickied.
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
I'm an idiot, I forgot there was a reference section... :eek:
 
M

miód

Guest
Are there a command for turn or rotate character? I mean, in Enhanced turn without moveing is extremely hard and turn the face to the not passable object is immposible. At rpg shards it`s really troublesome e.g. we standing against to rostrum and we can`t turn face to the audience!
 

Pinco

UOEC Modder
Stratics Veteran
Stratics Legend
Are there a command for turn or rotate character? I mean, in Enhanced turn without moveing is extremely hard and turn the face to the not passable object is immposible. At rpg shards it`s really troublesome e.g. we standing against to rostrum and we can`t turn face to the audience!
there is no way to rotate the character...
just use a quick single click in the direction you want to face and the character will turn without moving
 

jack flash uk

Crazed Zealot
Stratics Veteran
Stratics Legend
UNLEASHED
Hey Pinco i wonder

i have camera zoom set for my screen which is great, but i have the zoom wheel locked off, is there a way to have a command hotkey set for 19.3000 so i can zoom about and click the hotkey to revert?

hope so

thanks

Jack
 

Pinco

UOEC Modder
Stratics Veteran
Stratics Legend
Hey Pinco i wonder

i have camera zoom set for my screen which is great, but i have the zoom wheel locked off, is there a way to have a command hotkey set for 19.3000 so i can zoom about and click the hotkey to revert?

hope so

thanks

Jack
there is no way to read or change the zoom value through script.
 
M

miód

Guest
"just use a quick single click in the direction you want to face"
To do this, the duration of the click need to be about 0.1 second or less :bored:
in Calssic it was 2 times easier.
And it is imposible to face to the walls and objects it`s really painful at rpg shards!
People bump into each other trying to sit on the benches it`s ridiculous.
 

Pinco

UOEC Modder
Stratics Veteran
Stratics Legend
"just use a quick single click in the direction you want to face"
To do this, the duration of the click need to be about 0.1 second or less :bored:
in Calssic it was 2 times easier.
And it is imposible to face to the walls and objects it`s really painful at rpg shards!
People bump into each other trying to sit on the benches it`s ridiculous.
try with the keyboard arrows then :p
 

petemage

Babbling Loonie
Stratics Veteran
Stratics Legend
UNLEASHED
With pub86 is seems we finally got a real clock for use with UIs, awesome!!! No more "oh damn it's already 4am" :)

Example to print current time to chat:
Code:
script Debug.PrintToChat(L"".. Interface.Clock.h .. L":" .. Interface.Clock.m .. L":" .. Interface.Clock.s)
GetCurrentDateTime() is the new client API behind it. :danceb::danceb:

Thx Pinco.
 

petemage

Babbling Loonie
Stratics Veteran
Stratics Legend
UNLEASHED
Just a quick modders FYI: There was a new GetAllMobilesTargets() API added to the EC (wasnt there 9 montsh ago). Devs dont seem to mention such things in patch notes though. Check MobilesOnScreenWindow.lua for usage example if interested. Maybe there are more but I dont have a run full diff on all the APIs in client.
 

Petra Fyde

Peerless Chatterbox
Alumni
Stratics Veteran
Stratics Legend
Is there any possibility of a command script that will pick up a lobster trap buoy? I know it's possible with Pinco's, but I really don't want to install that monster just for this one function. I'm happy with the new default UI for all else.
I've tried using the scavenger agent, it will add it to the list, but it won't actually pick it up.
 

Coco_Zamis_DF

Lore Keeper
Governor
Stratics Veteran
Stratics Legend
UNLEASHED
I have a question about open a container via script or to clearer to have a script which gets an itemid and open the container.
I have tested the following extension in actions.lua
function Actions.OpenContainer(id)
if IsContainer(id) then
Debug.Print("Test Container")
local this = "ContainerWindow_" .. id
SystemData.DynamicWindowId = id
CreateWindowFromTemplate(this, "ContainerWindow", "Root")
--UserActionUseItem(id,false)
RegisterWindowData(WindowData.ContainerWindow.Type, id)
SystemData.ActiveWindow.name = this
WindowData.UpdateInstanceId = id
WindowSetShowing(this, true)
WindowClearAnchors(this)
WindowAddAnchor(this, "center", "ResizeWindow", "center", 0,0)
--WindowUtils.RestoreWindowPosition(this, false, "LEGACY_Container")
ContainerWindow.UpdateContents(id)
end
end
I am not quite sure if every line is usefull. I had tried different codings but i didn't work.
A container gump opens with shows at the bottom 109 items and the weight. But there are no items inside the container, nor a grid or list.
if i double click the container no new container gump will open, but in this case it shows the content correctly.

empty-container.jpg

Any tipps?

And btw. LUA seems not to be LUA. The continue statement is often used in the scripts, but the eclipse based LUA 5.2 developement envrionment shows it always as an error.
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
What's the command line script for toggling the atlas? I thought it used to be here, but I can't find it.
 
Top