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

COMMAND scripts

Discussion in 'Reference Library' started by Beastmaster, Jul 26, 2009.

  1. Beastmaster

    Beastmaster Guest

    Please use CODE tags around any you post here for clarity as done below. 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.

    Maplestone
    Description: opens the tip of the day window.
    Code:
    script CreateWindow("TipoftheDayWindow", true)
    Tullymars
    Description: clears out your target so you have nothing on current target.
    Code:
    script TargetWindow.ClearPreviousTarget()
    Description: zooms the radar map.
    Code:
    script MapCommon.AdjustZoom(-50)
    Description: opens a bug report window
    Code:
    script MainMenuWindow.OnOpenBugReportItem()
    Description: opens your settings window and switches it to legacy tab.
    Code:
    script MainMenuWindow.OnOpenUserSettings()
    script SettingsWindow.OpenLegacyTab()
    Description: Toggles legacy containers ON/OFF
    Note: This does not toggle containers already opened
    Code:
    script SystemData.Settings.Interface.LegacyContainers = not SystemData.Settings.Interface.LegacyContainers
    script UserSettingsChanged()

    Gildar
    Description: Switches object handle filters on the fly for dynamic objects.
    Code:
    script SystemData.Settings.GameOptions.objectHandleFilter = SystemData.Settings.ObjectHandleFilter.eDynamicFilter
    script UserSettingsChanged()
    Description: Switches object handle filters on the fly for corpses.
    Code:
    script SystemData.Settings.GameOptions.objectHandleFilter = SystemData.Settings.ObjectHandleFilter.eCorpseFilter
    script UserSettingsChanged()
    Description: Switches object handle filters on the fly for NPCs.
    Code:
    script SystemData.Settings.GameOptions.objectHandleFilter = SystemData.Settings.ObjectHandleFilter.eNPCFilter
    script UserSettingsChanged()
    Description: Switches object handle filters on the fly for vendors.
    Code:
    script SystemData.Settings.GameOptions.objectHandleFilter = SystemData.Settings.ObjectHandleFilter.eNPCVendorFilter
    script UserSettingsChanged()
    Description: Switches object handle filters on the fly for mobiles.
    Code:
    script SystemData.Settings.GameOptions.objectHandleFilter = SystemData.Settings.ObjectHandleFilter.eMobileFilter
    script UserSettingsChanged()
    Description: Turn sound off.
    Code:
    script SystemData.Settings.Sound.master.enabled = false
    script UserSettingsChanged()
    Description: Turn sound on.
    Code:
    script SystemData.Settings.Sound.master.enabled = true
    script UserSettingsChanged()
    Description: Toggle sounds ON/OFF
    Code:
    script SystemData.Settings.Sound.master.enabled = not SystemData.Settings.Sound.master.enabled
    script UserSettingsChanged()
    Description: Lower the volume by 10%
    Code:
    script SystemData.Settings.Sound.master.volume = math.max( SystemData.Settings.Sound.master.volume - 0.1, 0 )
    script UserSettingsChanged()
    Description: Raise the volume by 10%
    Note: For the volume raise/lower commands - the UI will get out of sync. The slider will be in the correct location, but the value next to the slider will show your last selected value (fixes on client restart, or whenever you move the slider manually).
    Code:
    script SystemData.Settings.Sound.master.volume = math.min( SystemData.Settings.Sound.master.volume + 0.1, 1 )
    script UserSettingsChanged()
    Description: Toggle footsteps ON/OFF
    Code:
    script SystemData.Settings.Sound.footsteps.enabled = not SystemData.Settings.Sound.footsteps.enabled
    script UserSettingsChanged()
    Description: Toggle display foliage ON/OFF
    Code:
    script SystemData.Settings.Resolution.displayFoliage = not SystemData.Settings.Resolution.displayFoliage
    Description: Tell everybody what facet you're in.
    Note: Split it into multiple commands because it was too long to fit into one.
    Code:
    script _facetLbl = GetStringFromTid( UORadarGetFacetLabel( WindowData.PlayerLocation.facet ) )
    script _channel = ChatSettings.Channels[ SystemData.ChatLogFilters.SAY ]
    script SendChat( _channel, L"We are currently in the ".._facetLbl..L" facet." )
    Description: Hide the orange border around the play window.
    Note: Effectively prevents resizing and moving of the play window.
    Code:
    script WindowSetShowing( "ResizeWindow", false )
    Description: Show the orange border around the play window.
    Code:
    script WindowSetShowing( "ResizeWindow", true )
    Description: Dismount
    Note: If you're not mounted it will toggle your paperdoll.
    Code:
    script UserActionUseItem(WindowData.PlayerStatus.PlayerId ,false)
    Description: Creates a mobile healthbar from current target and sticks it in the upper-left corner of the screen.
    Code:
    script MobileHealthBarWindow.CreateHealthBar(WindowData.CurrentTarget.TargetId)
    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)
    Description: Toggles paperdoll ON/OFF
    Code:
    script MenuBarWindow.TogglePaperdollWindow()
    Description: Puts "Your Message Here" into the chatbox
    Code:
    script Debug.PrintToChat(L"Your Message Here")
    Beastmaster
    Description: Toggles backpack ON/OFF
    Code:
    script MenuBarWindow.ToggleInventoryWindow()
    R Traveler
    Description: Set game window size to 1200*809
    Note: Height 809 is magic number to set legacy art 1:1 scale
    Code:
    script ResizeWindow.SendViewportData(1200,809)
    Ash
    Description: The heal/cure buttons on the mobile health bar of your party members will work with chivalry after this command.
    Code:
    script MobileHealthBarWindow.Spells = { Heal = 202, Cure = 201 }
     
  2. Shamus Turlough

    Shamus Turlough Lore Master
    Stratics Veteran Alumni

    Joined:
    May 19, 2008
    Messages:
    1,066
    Likes Received:
    207
    Gonna sticky this. Anyone else who has command script to share please post here in the above format.
     
  3. Gildar

    Gildar Babbling Loonie
    Stratics Veteran

    Joined:
    Apr 22, 2004
    Messages:
    2,354
    Likes Received:
    4
  4. Petra Fyde

    Petra Fyde Peerless Chatterbox
    Stratics Veteran Alumni Stratics Legend

    Joined:
    Jan 5, 2001
    Messages:
    30,888
    Likes Received:
    5,169
    heh, no. I sometimes get feedback on a proposed page before it makes it into the weekly announcement and a link from the menus.
    It may just be my pc set up, but the text of the actual scripts is a bit small. What font size did you use?
     
  5. Gildar

    Gildar Babbling Loonie
    Stratics Veteran

    Joined:
    Apr 22, 2004
    Messages:
    2,354
    Likes Received:
    4
    Was supposed to be the same size as the font on the rest of the page. Fixed it.
     
  6. R Traveler

    R Traveler Babbling Loonie
    Stratics Veteran Stratics Legend

    Joined:
    Jul 15, 2005
    Messages:
    2,950
    Likes Received:
    231
    set game window size to 1200*809 (height 809 is magic number to set legacy art 1:1 scale)
    Code:
    script ResizeWindow.SendViewportData(1200,809)
    Due some rounding this window size may not saved properly.
     
  7. TullyMars

    TullyMars Sage
    Stratics Veteran

    Joined:
    May 14, 2008
    Messages:
    525
    Likes Received:
    55
    Toggles Legacy Containers
    (Note this does not toggle containers already opened)
    Code:
     script SystemData.Settings.Interface.LegacyContainers = not SystemData.Settings.Interface.LegacyContainers
    script UserSettingsChanged() 
     
  8. Surgeries

    Surgeries Grand Poobah
    Stratics Veteran Stratics Legend

    Joined:
    Mar 18, 2004
    Messages:
    6,107
    Likes Received:
    92
    I use only the SA Client now, and although some of the stuff still is buggy, I am really loving it.

    I am not techy, at all, so I really have no idea what most any of these scripts means. I have, however, since I am not techy at all, found these scripts to be very helpful.

    I do have one macro I would really like to be able to do in SA, that I am able to do in UOA, that I haven't been able to figure out in SA:

    That is to remount a regular Swampy or whatever, after getting off accidentally in War Mode. One very aggravating thing for me is being in a fight and I go to double click a corpse, and inadvertently dismount myself.

    In UOA, I have a "Remount Macro" that was recorded while I was out of War Mode, and when used, I get back on my Swampy without attacking it, and with one button click.

    I have to think there is a way to do it in SA, but I am not sure what the syntax would need to be, and I hate guessing at stuff like this.

    Any help from the folks that know what they are doing would be awesome...thanks in advance!!
     
  9. Tina Small

    Tina Small Stratics Legend
    Stratics Veteran 4H

    Joined:
    May 12, 2008
    Messages:
    7,527
    Likes Received:
    1,914
    Surgeries, check this other thread below about using the Command action: http://vboards.stratics.com/showthread.php?t=148637. A macro to mount your character's nearest follower macro is discussed in there a couple of times. (It does not use a command script.) I set it up as directed and it works great, even when the character is in war mode. However, it may not be working properly for everyone. (Could be that having Legacy Targetting turned on makes a mess of it.)
     
  10. Fink

    Fink Guest

    Someone suggested a mount macro before, like this:

    Target Nearest Follower > Use Targeted Item

    Works in war mode or not. I use this on my tamer:

    All Stop > All Follow Me > Delay 0.2 > Target Nearest Follower > Use Targeted Item

    Stops your mount from fighting first. The delay's so you can use it while moving on foot, the pet catches up and you can reach it when you go to mount up.
     
  11. Ash

    Ash Guest

    For all you chivalry users out there, here is one that might come in handy in party hunts. The heal/cure buttons on the mobile health bar of your party members will work with chivalry after this command.

    Code:
    script MobileHealthBarWindow.Spells = { Heal = 202, Cure = 201 }
    Without a mod to auto set this, you will have to use this every time log in.
     
  12. Fink

    Fink Guest

    Nice one.

    I guess it's possible to change the cure to arch-cure with the right number? I do a few Sleeping Dragon spawns as a healer/herder & this would help.
     
  13. PJay

    PJay Seasoned Veteran
    Stratics Veteran

    Joined:
    May 29, 2008
    Messages:
    396
    Likes Received:
    38
    Anyone got any further trying to add a delay or getting other commands to happen after the dismount command??
     
  14. Ash

    Ash Guest

    The targeting doesn't work right with Arch Cure, I tried. All you get is it casting the spell and leaving the target on the cursor.
     
  15. Fink

    Fink Guest

    PJay: I still can't get a macro to continue after dismounting.
    Ash: Thanks for trying. I will stick to my usual methods.
     
  16. Fink

    Fink Guest

    A chunk of code from Gildar that was in danger of being lost in the other thread...
    Code:
    COMMAND script Debug.PrintToChat(L"Your Message Here")
    Add this into the macro, puts "Your Message Here" into the chatbox, good for jogging your memory as to which macro you just pressed. Goes into all chat tabs, evidently. Use just this one line and put in "Macro Stopped" and you have a macro-halting macro with feedback.
     
  17. Der Rock

    Der Rock Guest


    arch cure spell direct in the hotbar with target self dont work, but

    you can easy do a archcure macro: Archcure/waitfortarget/cursor target self

    easy and it works :)
     
  18. aarons6

    aarons6 Certifiable
    Stratics Veteran

    Joined:
    Oct 14, 2007
    Messages:
    1,897
    Likes Received:
    31
    Description: Creates a mobile healthbar from current target and sticks it in the upper-left corner of the screen.
    Code:

    script MobileHealthBarWindow.CreateHealthBar(WindowData.CurrentTarget.TargetId)

    any chance we can make this open the new bar stuck to the mouse so i can put it somewhere?
     
  19. Diggity

    Diggity Guest

    The target window disappears if a critter teleports and disappers. Also sometimes I cycle thru available targets and that obviously also changes what's in the target window. If I already have a critter on last target, is there a command script to set the current target window to what I have on last target?

    For pvp/group, is there a command script that can be used to open the paperdoll of the target window person?
     
  20. mdscan

    mdscan Guest

    The scripts on here are good. I would like to look into creating some but I don't know where to find the info on the script library, calls etc. Are you examing the game code and if so what programs are you using?
    Thanks for any information you can provide.
     
  21. R Traveler

    R Traveler Babbling Loonie
    Stratics Veteran Stratics Legend

    Joined:
    Jul 15, 2005
    Messages:
    2,950
    Likes Received:
    231
    Description: Set game window size to 1200*809
    Note: Height 809 is magic number to set legacy art 1:1 scale
    Code:
    script ResizeWindow.SendViewportData(1200,809)
    Since last patch (27 Aug 2009) this function broken. Art scale tied to other parameters.
     
  22. Jermosh

    Jermosh Guest

    Any help in finding a script to open my map?

    Is there a guide to script commands at all?
     
  23. Gildar

    Gildar Babbling Loonie
    Stratics Veteran

    Joined:
    Apr 22, 2004
    Messages:
    2,354
    Likes Received:
    4
  24. Jermosh

    Jermosh Guest

    I want to make a macro for my hotbar that will just open the map, I want to minimize the user toolbar in the lower right side to give up some precios blank space.
    Thanks for the link, I am going to give it a shot later.
     
  25. Radix

    Radix Guest

    If you did not changed the key bindings, just strike M.

    ¬¬
     
  26. Llewen

    Llewen Grand Inquisitor
    Professional Stratics Veteran Stratics Legend Campaign Supporter

    Joined:
    Mar 3, 2006
    Messages:
    4,699
    Likes Received:
    200
    Is there any way to use a rune book via scripts or macros?
     
  27. Beastmaster

    Beastmaster Guest

    You can make a macro to recall off the default rune of a runebook, but I'd guess that would be all.
     
  28. Llewen

    Llewen Grand Inquisitor
    Professional Stratics Veteran Stratics Legend Campaign Supporter

    Joined:
    Mar 3, 2006
    Messages:
    4,699
    Likes Received:
    200
    Another question. Anyone know if it is possible to create a command script to open a pack animal's back pack?
     
  29. Fink

    Fink Guest

    For a regular pack horse or llama, the "mount" script should work.

    For a particular packie, I would think it could be done with a stored target (not sure offhand). I am also not sure if context menu options (ie: open pack beetle) can be accessed via command script.
     
  30. Llewen

    Llewen Grand Inquisitor
    Professional Stratics Veteran Stratics Legend Campaign Supporter

    Joined:
    Mar 3, 2006
    Messages:
    4,699
    Likes Received:
    200
    Ok, here's another question. I've tried to create a macro that attacks the my nearest opponent, for some reason the "attack" macro option doesn't attack it just goes into war mode. I've tried "target nearest enemy;attack target;use target" but that didn't work. Anyone have a working command script or macro that does this?
     
  31. Storm

    Storm UO Forum Moderator
    Moderator Professional Premium Wiki Moderator Stratics Veteran Stratics Legend

    Joined:
    Mar 18, 2004
    Messages:
    7,469
    Likes Received:
    361
    target nearest enemy,cursor target current,attack current target

    hope that helps
     
  32. Llewen

    Llewen Grand Inquisitor
    Professional Stratics Veteran Stratics Legend Campaign Supporter

    Joined:
    Mar 3, 2006
    Messages:
    4,699
    Likes Received:
    200
    Thanks much, I'll try that.
     
  33. Llewen

    Llewen Grand Inquisitor
    Professional Stratics Veteran Stratics Legend Campaign Supporter

    Joined:
    Mar 3, 2006
    Messages:
    4,699
    Likes Received:
    200
    All you need is: target nearest enemy; attack current target. I stupidly bound it to shft,ctrl,alt,tab, and that didn't work. It was the keybind that was causing the problem.
     
  34. hawkeye_pike

    hawkeye_pike Babbling Loonie
    Stratics Veteran

    Joined:
    May 15, 2008
    Messages:
    2,466
    Likes Received:
    11
    Careful though, because you may accidentally attack any Energy Vortex on the screen. It is stupid that even your own EVs count as "enemy".
     
  35. JPDefault

    JPDefault Guest

    It may as well target a hind, a horse, or the Sphynx if you're in the Forgotten Pyramid in Malas.
    I think there should rather be a "target next hostile creature"...
     
  36. Llewen

    Llewen Grand Inquisitor
    Professional Stratics Veteran Stratics Legend Campaign Supporter

    Joined:
    Mar 3, 2006
    Messages:
    4,699
    Likes Received:
    200
    Ya, you have to make sure that the enemy you wish to target is actually close to to you. I also have enemy targets bound to the mouse wheel. I'm not used to that, so we'll see how useful that is to me.
     
  37. Beastmaster

    Beastmaster Guest

    Hey guys this is a stickied thread about COMMAND scripts. How about taking your MACRO discussion to another thread please?
     
  38. Barahir

    Barahir Guest

    Is there a command to stop a script that is running? I could have sworn I read of one here a few days ago, but I can't seem to find it now.
     
  39. Storm

    Storm UO Forum Moderator
    Moderator Professional Premium Wiki Moderator Stratics Veteran Stratics Legend

    Joined:
    Mar 18, 2004
    Messages:
    7,469
    Likes Received:
    361
    If I remember right you just create a blank macro
     
  40. JPDefault

    JPDefault Guest

    If I'm not mistaken, hitting ESC will also stop any running/repeating macro. At least it does for my 10x Target by resource/Delay 0.1.
     
  41. Llewen

    Llewen Grand Inquisitor
    Professional Stratics Veteran Stratics Legend Campaign Supporter

    Joined:
    Mar 3, 2006
    Messages:
    4,699
    Likes Received:
    200
    Does anyone have a script that would allow one button use of multiple pet balls? Right now pet balls stack when you try to place them in a macro, which makes pet ball macros, or hot bars, useless for multiple pets.
     
  42. Der Rock

    Der Rock Guest

    same problem i had with runes,so i colored the runes and problem solved. question is are petballs in anyway dyeable, if not,dev´s should make this possible,different colored petballs would also help for multiple pets to distinguish ;)
     
  43. Diggity

    Diggity Guest

    Coloring would be the simplest way. But if that is not possible, you can also try this if you use the enhanced client target options. I don't have pet balls but the following would work with backpacks or bags, so I think a petball would also work.

    If you know the itemid for the petball, use the following part script:

    Code:
    script WindowData.CurrentTarget.TargetId = MyPetBallItemID
    script TargetWindow.UpdateTarget()
    script TargetWindow.OnLClick()
    Use Targeted Object
    The first 3 lines set the target window to your petball and the 4th will use it.

    If you don't know your petball's id, you can store it in a variable using this script:

    Code:
    script MyPetBallItemID = WindowData.CurrentTarget.TargetID
    
    The trick here is that you have to put your petball on the ground (I think target can't be set for items in your backback) for it to work. Once you run this script, you can put your petball back in your pack and running the first script should use that petball. It works with container bags anyways.

    If it does work, you probably want to make a script to display each petball itemid so you can create a hardcoded script for each of them.
     
  44. Fink

    Fink Guest

    Is there any way to close all the hp bars on screen? Not including the follower, party, or own stat bars.
     
  45. Mike of Ameraust

    Mike of Ameraust Journeyman
    Stratics Veteran

    Joined:
    Aug 7, 2003
    Messages:
    153
    Likes Received:
    0
    Having a prob. with object handles, it doesn't seem to be able to tell difference between vendors and npc's, i cant get vendors to show on there own, yet npc's will show vendors and npc's.
    Any ideas anyone ?
     
  46. Der Rock

    Der Rock Guest

    can someone explain pls,how to paste multiple lines in the command window? thx
     
  47. Storm

    Storm UO Forum Moderator
    Moderator Professional Premium Wiki Moderator Stratics Veteran Stratics Legend

    Joined:
    Mar 18, 2004
    Messages:
    7,469
    Likes Received:
    361
    just make a macro with multiple commands in it (one command per line) thats what I do!
     
  48. Storm

    Storm UO Forum Moderator
    Moderator Professional Premium Wiki Moderator Stratics Veteran Stratics Legend

    Joined:
    Mar 18, 2004
    Messages:
    7,469
    Likes Received:
    361
    here is one posted by Bteng_mythic this will log you out !

    Sure.

    In the meantime, for the more savvy users, this functionality is already available in lua, so it is possible to create your own using the "Command" action.

    Drag the "Command" action out to a macro that you're editing or onto the hotbar and when the prompt appears, type in:

    script BroadcastEvent( SystemData.Events.LOG_OUT )

    When you're done, press the Okay button to save it and you got your very own Log Out button!

    If you want to assign a key to it, right-click the macro or the slot in the hotbar and select "Assign Hotkey".
    __________________
     
  49. Llewen

    Llewen Grand Inquisitor
    Professional Stratics Veteran Stratics Legend Campaign Supporter

    Joined:
    Mar 3, 2006
    Messages:
    4,699
    Likes Received:
    200
    That could be very useful...
     
  50. Merion

    Merion Lore Master
    Stratics Veteran

    Joined:
    Dec 1, 2009
    Messages:
    1,006
    Likes Received:
    9