customising hotkeys for switching between active worlds

Posted by Sev on Wed 11 Apr 2007 07:19 AM — 4 posts, 18,900 views.

#0
Hi,

I have noticed that you can switch between active worlds by either using ctrl-tab or ctrl-X for the first 10 world windows (where X is a number from 1 to 10).

I was wondering if it was possible to customise the hotkeys for switch between specific world windows. For example, using F1 to switch to world one (instead of ctrl-1).

Thanks
Sev
USA #1
Yet again I'm going to answer the question on the assumption that Lua is the main scripting language. Please change the script if you are using a different language.

for i,v in pairs(GetWorldIdList()) do
  if i <= 10 then
    Accelerator( "F"..i, "/GetWorldById(\""..v.."\"):Activate() )
  end
end

That script should initialize all the function keys up top to open up whatever currently open window is associated with that number. And some day I will get things right on the first post without having to edit.
Amended on Wed 11 Apr 2007 11:23 AM by Shaun Biggs
#2
Thanks. However, I ended up just using the macro key settings of all the worlds in question and used: /world.DoCommand "WorldX"

I will might use the Accelerator function in the future though.

Again thanks.
USA #3
Yeah, that's much simpler. And I learn something new every day. I didn't know that DoCommand could change worlds. Thanks.