webDOMinator - Minion Scripting Language Reference

Search a Command:
<< Back to Script Level Commands

softwait

Usage...
softwait:condition
Waits using a timer, and breaks out of the script allowing other events to happen. Once the condition is met, it returns to the waiting script and continues. This is good for use with pages which load elements using javascript which you want to load before interacting with them. condition can be a number of seconds to wait or a Minion condition.
This applies to webDOM version 2.5.0 and above.

User Comments on softwait

New softwait usage in 3.0

Written by: webDOMinator 2 years and 4 months ago

There's a new way to use softwait now. Normally a softwait would only be a number (to wait for a number of seconds), or a condition (any valid minion condition.) There are now what's called "Program Events" and these are events that mark both user interaction events and some important happenings in the bot itself.

These are mainly added because of the new interactive tutorials and the new "echo" feature which replaces the old echo feature of echoing to the status. In the new interactive tutorials, it's interactive because it waits for you to do something or waits for you to open some window, etc. before moving on to the next step.

The way to use these new program events is for instance, if you're doing a quick tour of your plugin and need to explain it to people...

Code

echo:Now, click the back button on the webDOM browser.
softwait:[back]

The syntax for a program event is just simply using brackets and the actual event code.

Here's a list of all the event codes available currently:

* = events that are automatic vs. caused by the user.

The domainchange event happens when the base domain of the URL the browser is on changes. The difference between gatherstop and gatherfinish is that gatherstop is when the user stops the gathering process whereas gather finish is when the auto-gathering process naturally finishes. The same goes for automation like adding all / PMing all /custom action... "automatefinish" is when this process naturally finishes.

Softwait Video Tutorial

Written by: webDOMinator 2 years and 7 months ago

This should help understand why softwait is needed and in what situations to use it -> Youtube Video

any more questions, let me know.

Softwait Flow

Written by: webDOMinator 3 years and 3 months ago

This is how softwait works from a flow standpoint.

http://webdombot.com/content/img/softwait-flow.jpg

softwait is the Magic Duct Tape of webDOM

Written by: webDOMinator 3 years and 4 months ago

It's not only Duct Tape, it's Magic! Here's an example using the new dom.state

Quick Reference for "dom.state"
Click on command to see examples & comments
Top Level Dom Values
Description: Returns the numeric state of the browser. 4 is page loaded. 3 is when the page is loading and hasn't finished yet. variable that will use a softwait condition to ACT like a pagewait.
Code

navigate:webdombot.com/updates.php
click:dom.a.Testimonials
wait:1
softwait:dom.state==4
echo:this is like a pagewait, but better

If you run that code, you will see it perform exactly like a page wait. But instead of using the event system of the webBrowser control, it uses webDOM's own built in event system... thus, let's say that there was no testimonials link, and you wanted your script to continue anyway, the above script would do this. Notice the wait:1 before the softwait command, this is to give the web browser a little time to react to the click and start loading the next page before it tries to start checking for the page to be finished loading.

Sometimes you need to make webDOM softwait just to break your script out of the main order of operations. The order of operations, or what happens when a web page loads in webDOM is that, the browser has to send a signal to it's parent (in this case webDOM)... when webDOM picks up this signal, it performs whatever script you're trying to run, then it gives control back to the web browser. The web browser then continues with whatever javascript or vbscript it has to run on the page.

This means that webDOM's scripts happen exactly after the page load... or the moment that the page is loaded, and that your minion sripts have priority over javascript in the order of operations.

Here's the problem...

Sometimes you need those extra javascripts to run in order to interact with the completed page properly, like in the case with sites that are heavy web2.0 (Ajax) sites. Sometimes the javascript that runs loads the elements dynamically into the page that you need to interact with. Before softwait, there was not a way to get at them; no matter how much you used the "wait" command, the webBrowser would just wait until your Minion script was done running to run it's javascripts

Post a Comment About the "softwait" Command
Title:
Comment:
Post as Anonymous:
User Login
Username:
Email:
Password:
webDOMinator is copyright ©2008, 2009, 2010, 2011, 2012 Nathaniel D. Gibson. All Rights Reserved.
Contact | Tutorials | Forum
By using webDOMinator you are taking all liability in to your own hands. Nathaniel D. Gibson is not responsible for any damages, loss, or defamation (legal or otherwise) caused to you or your business from using this program. Nathaniel D. Gibson is not associated with, affiliated with, nor responsible for the content submitted and displayed by users of this site.