Jump to content
UBot Underground

Recommended Posts

I'm trying to remove from a list an id ex:

22221131 which is added into a command.

But it's not working as it needs a position (under REMOVE FROM LIST)

As the ID and the Position will never be same, what could be the code ?

 

In other words, i want to pick up a random user/id to comment to and remove him from the list to make sure i don't double comment on it.

While at it, we should have the option to remove from list when using $random list item

clear list(%commenting)
add list to list(%commenting, $scrape attribute(<outerhtml=w"<textarea class=\"item_input new_comment_input list_comment_text\" name=\"comment_text\" id=\"*_comment_text\" placeholder=\"Leave a Comment..\" image_id=\"*\"></textarea>">, "image_id"), "Delete", "Global")
loop($list total(%commenting)) {
    set(#commentingid, $random list item(%commenting), "Global")
    type text(<id="{#commentingid}_comment_text">, #commenting, "Standard")
    remove from list(%commenting, #commentingid)
Link to post
Share on other sites

Maybe "Set" List position in a  variable after

 

set(#commentingid, $random list item(%commenting), "Global")

 

Then

 

remove from list(%commenting, #commentingid), The list position set in the Var

 

Hope it helps. :)

Link to post
Share on other sites

navigate("http://m.bing.com/""Wait")
clear list(%temp)
add list to list(%temp$list from text("1234
2345
3456"$new line), "Delete""Global")
loop(3) {
    set(#listitem$random list item(%temp), "Global")
    change attribute(<name="q">"value"#listitem)
    remove from list(%temp$list position(%temp))
    wait(5)
}

Link to post
Share on other sites

What should i use for the loop ?

I tried $list total but it gives me the same IDS more than once even tho it's removed ?

EDITED:

Odd, seems like the wrong IDS are removed too ??? So what's suppose to be removed stays in the list and something else is removed for sure as the list gets smaller and smaller what the heck lol !

loop($list total(%commenting)) {
    set(#commentingid, $random list item(%commenting), "Global")
    type text(<id="{#commentingid}_comment_text">, #commenting, "Standard")
    wait($rand(3, 6))
    change attribute(<name="q">, "value", #commentingid)
    remove from list(%commenting, $list position(%commenting))
}
Link to post
Share on other sites

 

What should i use for the loop ?

I tried $list total but it gives me the same IDS more than once even tho it's removed ?

EDITED:

Odd, seems like the wrong IDS are removed too ??? So what's suppose to be removed stays in the list and something else is removed for sure as the list gets smaller and smaller what the heck lol !

loop($list total(%commenting)) {
    set(#commentingid, $random list item(%commenting), "Global")
    type text(<id="{#commentingid}_comment_text">, #commenting, "Standard")
    wait($rand(3, 6))
    change attribute(<name="q">, "value", #commentingid)
    remove from list(%commenting, $list position(%commenting))
}

 

I think you may have a small error in the code.  Based on what Edward_2 posted above, I believe the last line should look like this:

 

remove from list(%commenting, #commentingid)

 

Currently the code above shows this (highlighted in red), which might be the culprit:

 

remove from list(%commenting, $list position(%commenting))

Link to post
Share on other sites
  • 2 weeks later...

Both of you guys are right !

I got the file management plugin so i will use this from now on and i did have an error in my code.

I had 2 commenting  which the old dumb a$$ musician of me, didn't see the difference at first LOL

Good ol' engrish and me stie

 

Thanks a lot guys !

Next song's on me hehehehe

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