Beele 3 Posted July 19, 2013 Report Share Posted July 19, 2013 Hey :-) i have 3 lists and with this i can post 3 random links, 1 from each list. type text(<name="xhpc_message_text">, "{$random list item(%links1)}{$new line}{$random list item(%links2)}{$new line}{$random list item(%links3)}", "Standard") But can i change the sequence of the links by chance ? random link list 1 --- random link list 2 --- random link list 3 and for the next post: random link list 3 --- random link list 2 --- random link list 1 and so on.... ?? Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted July 19, 2013 Report Share Posted July 19, 2013 make a new list%list4 add 1 link from each list to it with random list item, then randomly grab the links from that new list to use within your post. Quote Link to post Share on other sites
Beele 3 Posted July 20, 2013 Author Report Share Posted July 20, 2013 Thanks for your help. Now I have a new list4 with 3 correct links. But randomly grab the links from that new list4 returns sometimes 1 link 2 or 3 times. I found no option to use and clear the used link (because its grab randomly) or grab every link only one time.For this now i shuffle the list4 and have a new list5 and use this. Maybe there is a better way, (never i use the sequence link1 - link2 - link3) but it works. Quote Link to post Share on other sites
Security 17 Posted July 20, 2013 Report Share Posted July 20, 2013 You can create you own way to do this. I would suggest after using the link you want, add it to a list, and b4 selecting a new link, create a new list subtracting the list of links that have already been used. Also you do not have to create a remove list for each set of links.. You can use one for all of them. Quote Link to post Share on other sites
Security 17 Posted July 20, 2013 Report Share Posted July 20, 2013 Pretty sure this is what you are looking for.. add list to list(%master links1, %links1, "Delete", "Global") add list to list(%master links2, %links2, "Delete", "Global") add list to list(%master links3, %links3, "Delete", "Global") comment("Can start your loop or w/e below here..") set(#list1, $random list item(%links1), "Global") set(#list2, $random list item(%links2), "Global") set(#list3, $random list item(%links3), "Global") type text(<name="xhpc_message_text">, "{#list1}{$new line}{#list2}{$new line}{#list3}", "Standard") add item to list(%remove list, $list from text(#list1, ""), "Delete", "Global") add item to list(%remove list, $list from text(#list2, ""), "Delete", "Global") add item to list(%remove list, $list from text(#list3, ""), "Delete", "Global") clear list(%links1) clear list(%links2) clear list(%links3) add list to list(%links1, $subtract lists(%master links1, %remove links), "Delete", "Global") add list to list(%links2, $subtract lists(%master links2, %remove links), "Delete", "Global") add list to list(%links3, $subtract lists(%master links3, %remove links), "Delete", "Global")There is also another way i thought of doing it with find replace regex.. kinda busy right now.. If this doesn't work, Let me know il try to the other way.. Hope i could help.. P.S. i didn't test this. Sorry if it doesn't work 1 Quote Link to post Share on other sites
Beele 3 Posted July 20, 2013 Author Report Share Posted July 20, 2013 EDIT: sorry, wrote before read your secound post.. thanks for this, I´ll try it ! "after using the link you want, add it to a list" add item to list(%list4, $random list item(%links1), "Delete", "Global") add item to list(%list4, $random list item(%links2), "Delete", "Global") add item to list(%list4, $random list item(%links3), "Delete", "Global") /* ... now I have list4 with 3 links ... */ add item to list(%finallinks, $random list item(%list4), "Delete", "Global") I want to use a random link, how can I add this random link to an other (substarcting) list ? Quote Link to post Share on other sites
Security 17 Posted July 20, 2013 Report Share Posted July 20, 2013 i would get rid of the 4th list all together. Quote Link to post Share on other sites
Beele 3 Posted July 20, 2013 Author Report Share Posted July 20, 2013 @Security it´s an interesting way, but for an other problem. What i need: I have a list1 with some links:list1link1 list1link2 list1link3 and so on the same with list2:list2link1 list2link2 list2link3 .... and the same with list3... Now i´ll post every hour: 1 random link from list1 new line 1 random link from list2 new line 1 random link from list3 That´s easy, but the sequence should not be always the same. The next post should be: 1 random link from list3 new line 1 random link from list1 new line 1 random link from list2 I don´t need to remove or clear links, because i use all this links from list1, list2 and list3 over and over again. Sorry for my bad english. Can understand me ? Quote Link to post Share on other sites
Security 17 Posted July 20, 2013 Report Share Posted July 20, 2013 yes this is why once you are done, once all the links have been used, you just start over.. This is why you have the links stored in "Master links 1, 2, and 3.. Quote Link to post Share on other sites
Security 17 Posted July 20, 2013 Report Share Posted July 20, 2013 This is Assuming Master links 1, 2 and 3 all have the same amount of links in them.. This script will post a link from each list, add the links it has already posted to another list ( the remove list) assuring you will not post the same link more then once, From each list of links. It will go through the list, then will wait for 1 hour b4 repeating the process. ui open file("Load links:", #loadlinks1) ui open file("Load links:", #loadlinks2) ui open file("Load links:", #loadlinks3) add list to list(%master links1, $list from file(#loadlinks1), "Delete", "Global") add list to list(%master links2, $list from file(#loadlinks2), "Delete", "Global") add list to list(%master links3, $list from file(#loadlinks3), "Delete", "Global") loop($list total(%master links1)) { load list() set(#list1, $random list item(%links1), "Global") set(#list2, $random list item(%links2), "Global") set(#list3, $random list item(%links3), "Global") type text(<name="xhpc_message_text">, "{#list1}{$new line}{#list2}{$new line}{#list3}", "Standard") add item to list(%remove list, $list from text(#list1, ""), "Delete", "Global") add item to list(%remove list, $list from text(#list2, ""), "Delete", "Global") add item to list(%remove list, $list from text(#list3, ""), "Delete", "Global") clear list(%links1) clear list(%links2) clear list(%links3) add list to list(%links1, $subtract lists(%master links1, %remove links), "Delete", "Global") add list to list(%links2, $subtract lists(%master links2, %remove links), "Delete", "Global") add list to list(%links3, $subtract lists(%master links3, %remove links), "Delete", "Global") wait(360) } define load list { add list to list(%master links1, %links1, "Delete", "Global") add list to list(%master links2, %links2, "Delete", "Global") add list to list(%master links3, %links3, "Delete", "Global") } Quote Link to post Share on other sites
Security 17 Posted July 20, 2013 Report Share Posted July 20, 2013 If you would like you could PM me or we could speak on skype. Or you could just post the entire code here.. As long as you are comfortable with me knowing exactly what you are doing, i dnt think it would be to hard for me to fix this for you. I'm almost 1000% sure i know what you are trying to do. I have a few minutes now to help.. Let me know .. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.