Jump to content
UBot Underground

choose by position ???????????


Recommended Posts

Hi, can anybody tell me if it is possible to have the choose by position change to a different position each time it occurs in a loop and if so how it is done? I am trying to make a facebook friend adder, many thanks in advance, Cheryl :)

Yes. You should be able to use a variable or other node as the position, not only a hard-coded number.

 

I just tested the following code snippet and it worked just fine. :)

post-7-12633578115836_thumb.png

Link to post
Share on other sites

here's some comments for that code snippet to explain what I did a little better:

set				// this initializes the #i variable to zero
 #i
 0

/ loop
|
|+ 10				// loop ten times
|
|+ inc				// increment #i. this adds +1 to #i
|  #i
|
|+ choose by position		// choose the #i'th <p> tag
|  P				// so, if #i = 1, get the 1st p tag
|  #i				// if #i = 2, get the 2nd, and so on...
|
|+ change chosen attribute	// this just changes the text of each <p> tag
|  innertext			// to 'lol #i' just so I could test that it was
|  lol {1}			// in fact choosing them properly. you can do 
|    #i				// whatever chosen commands you want to do
|
\ end of loop

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...