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

cesario678

Client
Регистрация
10.03.2022
Сообщения
201
Благодарностей
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!
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 595
Благодарностей
5 952
Баллы
113
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");
}
 

cesario678

Client
Регистрация
10.03.2022
Сообщения
201
Благодарностей
13
Баллы
18
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
 

Alex91

Известная личность
Read only
Регистрация
15.08.2024
Сообщения
880
Благодарностей
251
Баллы
63

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