有人能帮我用 discord 实现脚本自动热键吗?

有人能帮我用 discord 实现脚本自动热键吗?

我有一个带有自动热键的脚本,其工作原理如下:

  • 每隔一分钟,它就会自动输入一条消息。
  • 下一分钟,它会自动删除自动输入的消息。

我使用的脚本以前可以运行,但现在不行了,我不知道为什么。自动输入消息仍然有效,但删除它们(正确)却不行。

我遇到的问题是,当调用删除消息函数时,它只会删除文本块末尾的最后一个字符。

例子:

  • 如果我自动将消息设置为
    "how to save the world"
  • 自动删除仅删除最后一个字符(“d”),所以我得到
    "how to save the worl"

有人能告诉我我做错了什么吗,以便我自己可以解决这个问题?
我将非常感激您的帮助!

如果您无法发现缺陷,我自己会直接针对 discord 运行我的脚本。针对相同环境运行应该会重现该错误。

脚本如下:

/*  
 Notes:  
  Set message in line 6.
  Set delay between messages (in milliseconds) in line 7. 
*/  
 
#singleInstance force   
delay = 60500  
msg =  Hi guys. I'm very apologize for the delay. I found a bug issue about Matchmaking and it's not good for u guys to try this. I will fix this out for a few days and after we sure that it's work for many people. We will do the official announcement Our team try to be quick as much as possible for about this problem. I will try to solve this within this week. BUG : 1. Sometime Match Making match to a person that close the app already (that's mean it will match offline person forever) 
 
`::  ; Toggle autoTyper   
  send % !auto ? msg "{enter}" :   
  setTimer, autoTyper, % !auto ? delay : "off"   
  notify("Auto-Typer", (auto:=!auto) ? "ON" : "OFF")   
return   
autoTyper:   
  send %msg%{enter}   
return   
 
notify(alert, status = 0) {   
  global   
  gui +alwaysOnTop +toolWindow -caption +E0x20   
  gui color, black    
  gui font, cWhite s40 bold, arial   
  gui add, text, vNotification center w700   
  alert := alert " " status   
  guiControl,, notification, % alert   
  gui, show, autosize   
  opacity = 0   
  sleep 775  ; Maintain notification   
  gui destroy   
} 
 
z:: 
{ 
send, {Up} 
send, ^a 
send, {BS} 
send, {Enter} 
send, {Enter} 
sleep, 100 
} 
return

相关内容