Jump to content
UBot Underground

Get Local Variables Inside Define to Another?


Recommended Posts

This one is a little hard for me to explain...

 

Will you take a look at the code please.

 

(The reason I am trying to get this to work is to condense a lot of my code) 

 

Do I have to pass the variables to the next define or something or is it not possible? At the moment I have to set the local variables inside the define for each site, I have been trying to work this one out for a while.

 

Here is the code:

Open Threads()
define Open Threads {
    loop(2) {
        thread {
            in new browser {
                Run Fill Form()
            }
        }
    }
}
define Run Fill Form {
    Get Variables Set As Local()
    navigate("http://www.ubotstudio.com/playground/simple-form", "Wait")
    type text(<username field>, #First Name, "Standard")
    type text(<password field>, #Last Name, "Standard")
    wait(5)
}
define Get Variables Set As Local {
    set(#First Name, $spin("\{Joe|Bill|Bob\}"), "Local")
    set(#Last Name, $spin("\{Blogs|Smith|Jones\}"), "Local")
}

 

 

Cheers 

 

Carl

Link to post
Share on other sites
Open Threads()
define Open Threads {
    loop(2) {
        thread {
            in new browser {
                Run Fill Form()
            }
        }
    }
}
define Run Fill Form {
    add list to list(%Data, $list from text($Get Variables Set As Local(), ","), "Don\'t Delete", "Local")
    navigate("http://www.ubotstudio.com/playground/simple-form", "Wait")
    wait for element(<first name field>, "", "Appear")
    type text(<first name field>, $list item(%Data, 0), "Standard")
    type text(<last name field>, $list item(%Data, 1), "Standard")
    wait(20)
}
define $Get Variables Set As Local {
    set(#First Name, $spin("\{Joe|Bill|Bob\}"), "Local")
    set(#Last Name, $spin("\{Blogs|Smith|Jones\}"), "Local")
    return("{#First Name},{#Last Name}")
}

 

 

  • Like 2
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...