Ctrl+C and Ctrl+V function, can anyone help?

  • Автор темы Автор темы cesario678
  • Дата начала Дата начала

cesario678

Client
Регистрация
10.03.2022
Сообщения
227
Реакции
13
Баллы
18
I'm having an issue running a Ctrl+C and Ctrl+V function in C# that someone shared here. The problem is that when using multiple tabs, one tab picks up content from another. Additionally, if I'm using the computer, my Ctrl+C and Ctrl+V get overwritten with the bot's data.
I've already tried adding (set) (get) and reducing the quality to make it post the text all at once. I also tried using a key stroker, but when I do that, the site stops working.
Does anyone have another tip that could help? I was thinking of creating a function where one bot reads and waits for the other bot to complete that step before continuing. That way, one wouldn't use the other's thread data.
The question is, how can I do this? Or is there another approach you recommend?
Thanks!
 
I think you should use lock function to sync threads.
C#:
Развернуть Свернуть Копировать
lock(SyncObjects.InputSyncer) //
{
string text = project.Variables["Your_Text"].Value;

System.Windows.Forms.Clipboard.SetText(text);
instance.ActiveTab.KeyEvent("v","press","ctrl");
}
 
I think you should use lock function to sync threads.
C#:
Развернуть Свернуть Копировать
lock(SyncObjects.InputSyncer) //
{
string text = project.Variables["Your_Text"].Value;

System.Windows.Forms.Clipboard.SetText(text);
instance.ActiveTab.KeyEvent("v","press","ctrl");
}
So, this function won't mix the Ctrl+V from other bots or my PC? Each bot thread will use its own Ctrl+V?

4o
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)