When does a hotkey need to wait?

Post Reply
Rob
Site Admin
Posts: 1128
Joined: Sat Sep 25, 2010 6:52 am

When does a hotkey need to wait?

Post by Rob » Thu Jan 25, 2018 3:01 pm

Somebody sent me the following hotkey. I’m answering him here so other people can read my reply.

Code: Select all

Hotkey (F1)
{
   Slash ( "/bg invite Joe" )
   Wait (100)
   Slash ( "/bg invite Moe" )
   Wait (100 )
   Slash ( "/bg invite Sue" )
   Wait (100 )
   Slash ( "/bg invite Stu" )
   Wait (100 )
   Slash ( "/bg invite Pru" )
}
I don't think those waits are needed. On my computer, they can be removed. As far as I know, waits are needed after slash commands only if (1) you need to wait for an answer to come back from the server before executing the next command or (2) you /say something. Here’s an example where you need a wait:

Code: Select all

Hotkey (F2)
{
  Slash ( "/assist Fred" )
  Wait ( 150 )
  Slash ( /face )
}
The reason you need to wait in that hotkey is because “/assist Fred” makes your copy of DAOC send a question to DAOC’s server. The question is, “Who is Fred’s target?” It takes time for the server to answer. If you try to /face before your copy of DAOC receives the server’s answer, /face won't work because your copy of DAOC doesn't know who to face.

But when you execute /bg invite, you’re not asking a question and the server doesn’t answer you. Since there’s no answer, there’s nothing to wait for.

Here’s the other case where you need to wait.

Code: Select all

Hotkey(F3)
{
   Slash ( "/say Joe" )
   Slash ( "/say Moe" )
   Slash ( "/say Sue" )
}
You need waits in Hotkey(F3) because the game is programmed to complain, “Slow Down! Think before each word!” when you issue /say commands rapidly. But Hotkey(F1), which started this conversation, doesn’t contain any /say’s.
Author of Mojo

Post Reply