Simulation keyboard/mouse events

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

darkdiver

Administrator
Команда форума
Регистрация
13.01.2009
Сообщения
2 285
Реакции
2 732
Баллы
113
To install samples properly:

  1. Upload to the ZennoPoster.exe path 2 files Emulations.dll and Emulations.xml
  2. Open project EmulatorCS.zpproj for C# developers or EmulatorPHP.zpproj for PHP developers
  3. Replace reference to the Emulation.dll in the reference section to the new location of Emulations.dll
  4. Save and run the project, it will simulates clicks on the check boxes and simulate type in the text area.
Emulations works only in browser window and does not work in plug ins of the browser like flash.
 

Вложения

thx for the tutorial

btw, i think the CodeCreator forum is in the wrong place, because it's a part of zennoposter....
 
off: we are thing of moving codecreator to the sub forum of the ZennoPoster.
 
The left click function does not click on any checkboxes for me, cant get it to work. The text input is working fine though. Anyone else with the same problem?
 
It should clicks on Windows and Mac OS check boxes.
May be some firewall (outpost for example) or anti virus filtered some messages try to disable them.
 
It should clicks on Windows and Mac OS check boxes.
May be some firewall (outpost for example) or anti virus filtered some messages try to disable them.

Tried on 3 different computers with and without firewall/anti virus, nothing happens when it is supposed to click. I am going crazy, been looking forward to this feature for over 1 month.
 
what example are you using? PHP or C#?
 
please attach here a screen shot of the page lessons.zennolab.com/en/inputs in the code creator, may be it looks different, because click requires coordinates of the element, and click sends to the wrong place.

This is a very simple C# code on a very simple page, test it. Do you see green message "Button Clicked"?

PHP:
Развернуть Свернуть Копировать
    internal class Step1
    {
        public static int Execute(Instance instance)
        {
            instance.ClearCookie();

            // Go to http://zennolab.com/files/testbutton.html
            Tab tb = instance.MainTab;
            if ((tb.IsVoid) || (tb.IsNull)) return -1;
            if (tb.IsBusy) tb.WaitDownloading();
            tb.Navigate("http://zennolab.com/files/testbutton.html");
            if (tb.IsBusy) tb.WaitDownloading();

            HtmlElement he;

            // Click on the button "Test Button"
            he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByAttribute("input:button", "fulltag", "input:button", "text", 0);
            if (he.IsVoid) return -1;
            Emulations.Emulator.LeftMouseClick(instance.MainTab.Handle, he);
            
            return 0;
        }
    }
 
one qustion, will the free visual c# express version work with codecreator? Will it make working much more difficult?
 
  • Оценить
Реакции: Stereomike
C# but I have tried using the PHP too and it made no difference.
I've attached updated version of Emulations.dll/Emulations.xml, it should work fine on IE8, click does not work in IE8/7 because of wrong click coordinates. We added additional information parameters to the function click coordinates.
It is better to simulate random clicks positions near the center of the element, to avoid ban of the services.
 
Is there any support for pressing keys which don't result in typing a character? I see there's code specific to pressing the enter key " Emulator::EnterDown($instance->MainTab->Handle);". Is there any way to simulate pressing other keys, like the arrow keys?
 
I've attached updated version of Emulations.dll/Emulations.xml, it should work fine on IE8, click does not work in IE8/7 because of wrong click coordinates. We added additional information parameters to the function click coordinates.
It is better to simulate random clicks positions near the center of the element, to avoid ban of the services.

The testing files are still not working, I am running Windows 7 64bit with IE8, should I down grade to IE7 or upgrade to IE9 for better results?
 
I'm having a problem too, everytime I try to replace Emulations.dll and save, it doesn't save.

Anybody know something for this issue?
 
Is there any easy way for us to update our existing templates to use keystrokes/mouseclicks?
 
Is there any support for pressing keys which don't result in typing a character? I see there's code specific to pressing the enter key " Emulator::EnterDown($instance->MainTab->Handle);". Is there any way to simulate pressing other keys, like the arrow keys?
Re download the dll and xml files. New methods for pressing arrows are added

I'm having a problem too, everytime I try to replace Emulations.dll and save, it doesn't save.
Anybody know something for this issue?
Try to recreate project, code creator have some bug, it will be fixed in the next release.

Is there any easy way for us to update our existing templates to use keystrokes/mouseclicks?
there is no way to emulate clicks in XML template, use Code Creator as a sub template for example, clicks in XML template will be supported in feature releases.
 
I am not sure how to download it to the zenno exe path... Can someone guide me? Thx

This is for code creator, makes it a little more clearer
 
I am not sure how to download it to the zenno exe path... Can someone guide me? Thx

This is for code creator, makes it a little more clearer
Maybe I misunderstood.
Just copy Emulations.dll and Emulations.xml to the directory with ZennoPoster. For example: "C:\Program Files\ZennoLab\ZennoPoster Pro\Progs\".
 
  • Оценить
Реакции: shaddelick
Yes, thats what i meant. I actually was able to figure that much after a while. I also take it the next step is to open the EmulatorCS.zpproj‎ in codemaker, then delet the Emulations.dll‎ and add the Emulations.dll‎ that i put in the zennoposter directory into the references menu. I did it up to that point. When i do this, do i just start a from that point or is there a specific way i can get it to do the key strokes... I tried to start the project after these steps and get an error saying that the project wasnt able to build... thanks
 
So for example,

How to add emulation to imported PHP project where it choosing value from macro builder (login created randomly) ???


I tried:

// Executing macros
$he->Focus();
Emulator::SendString($instance->RiseMacros("Person.HumanLogin", array( "[Eng|4][RndNum|1970|1990]" )), true);


But it's not working...
 
So for example,

How to add emulation to imported PHP project where it choosing value from macro builder (login created randomly) ???


I tried:

// Executing macros
$he->Focus();
Emulator::SendString($instance->RiseMacros("Person.HumanLogin", array( "[Eng|4][RndNum|1970|1990]" )), true);


But it's not working...

Of course it does not work.
You are incorrectly set parameters.
It should be like this:
Emulator::SendString($instance->MainTab->Handle, $instance->RiseMacros("Person.HumanLogin", array( "[Eng|4][RndNum|1970|1990]" )));
 
Can you make it work on YouTube or on any website that belongs to Google? When I try registering to YT it just doesn't fill up the fields.
 
If you want to create an account on YT. Create an email, then sign up for Adwords. You won't ever use the Adwords account of course, but then you can sign up to YT with no problem.
Can you make it work on YouTube or on any website that belongs to Google? When I try registering to YT it just doesn't fill up the fields.
 
First of all make focus to the element where you emulate keystrokes:
he.Focus();
And after clicks put
instance.MainTab.WaitDownloading();
 
Hi, guys

I see you have many questions about emulations. Ok, I made examples on C# and PHP.
All examples work with youtube.com and fill up some fields with help Emulator on the registration page.
I checked all examples, they work on my machine.
You just open example on C# or PHP, remove "Emulations.dll" from references and add "Emulations.dll" from your ZP location.

And I want to say that in IE7 it can not work.

YouTubeEmulationCS.zpproj‎ - on C#
YouTubeEmulationPHP.zpproj‎ - on PHP

I hope it will help you.
 

Вложения

Hi everybody !

I have a problem with the simulation keyboard and i broke my brains for 4 days without find an anwser... :(

I used the nice example template of Shade (youtube account) to begin to learn codecreator. I understand how simulate keybord for a specific text, but it doesn't run when i want simulate keybord to write the result of a macro (exemple : a macro who generate a password).


i write "password" in the password field, and the simulation keyboard work very well :

// Set focus on this html elemet (it's necessarily for SendString of SentText)
$he->Focus();

// Enter password with delay 100-200 ms
Emulator::SendString($instance->MainTab->Handle, "password", 100, 200);




but how integrate a macro who generate a password and write it with the simulation keyboard ? :confused:

where i need insert that ?

$he->SetValue($instance->RiseMacros("Random.Text", array( "10", "cd" )), true);



Thanks for your help ^_^
 
Hi everybody !

I have a problem with the simulation keyboard and i broke my brains for 4 days without find an anwser... :(

I used the nice example template of Shade (youtube account) to begin to learn codecreator. I understand how simulate keybord for a specific text, but it doesn't run when i want simulate keybord to write the result of a macro (exemple : a macro who generate a password).


i write "password" in the password field, and the simulation keyboard work very well :






but how integrate a macro who generate a password and write it with the simulation keyboard ? :confused:

where i need insert that ?





Thanks for your help ^_^

Hi kendy.
Don't worry. It's possible and very easy.

$instanse->RiseMacros("Random.Text", array( "10", "cd" )) generates a string value.

First: You can create a new variable to storage this value and set it instead of "password", like this:
PHP:
Развернуть Свернуть Копировать
$password = $instance->RiseMacros("Random.Text", array( "10", "cd" ));
Emulator::SendString($instance->MainTab->Handle, $password, 100, 200);
Second: Just set this -
$instanсe->RiseMacros("Random.Text", array( "10", "cd" ))
instead of "password", like this:
PHP:
Развернуть Свернуть Копировать
Emulator::SendString($instance->MainTab->Handle, $instance->RiseMacros("Random.Text", array( "10", "cd" )), 100, 200);
I have modified my examples.
 

Вложения

  • Оценить
Реакции: kendy
Thank you very very much Shade, it's work like a charm :D
 
Shade, thanks so much for your help and your projects. Can you explain how to use the macros for get file and split string. In my template I have this:

Код:
Развернуть Свернуть Копировать
he.SetValue(instance.RiseMacros("String.Split", new [] { "", "File.GetString", "\\Resources\\email.txt", "random", "false", "", ":", "0" }), true);

This is recorded while making the template, but when I run the debug, everything works okay but this. Hopefully you can help.
 

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