eindbaas 0 Posted October 12, 2015 Report Share Posted October 12, 2015 Hi, So i want to restart a command if the page contains a certain text, when this text is not there i want ubot to do somthing els. Idealy i want to make a bot like this IF text contains: example wurd Then restart the IF command ( example word is on page) Els Go do somthing else (example word is NOT on page) What i want to ask is, wich commands in ubot should i use ? Anybody can get me in the right direction? Thanks Quote Link to post Share on other sites
deliter 203 Posted October 13, 2015 Report Share Posted October 13, 2015 theres a lot of ways to do it,the best would probably be a define command,but heres a simple example load html("<p id=\"text\">text</p> ") loop while($comparison($scrape attribute(<id="text">,"innertext"),"=","text")) { wait(2) load html("<p id=\"text\">No longer</p> ") } alert("text changed") Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 13, 2015 Report Share Posted October 13, 2015 This command will call itself until wurd is not found and track the number of times it s found: ui stat monitor("Count:",#count) comment("Counter to see how many times the command calls itself") set(#count,0,"Global") Recursive Command Name() define Recursive Command Name { comment("Some random loading code so that it can eventually exit") set(#num,$rand(1,1000),"Global") comment("24/1000 chance of not being \"wurd\"") if($comparison(#num,">=",25)) { then { load html("wurd") } else { load html($random text(10)) } } set(#text,$scrape attribute($element offset(<tagname="body">,0),"innertext"),"Global") if($contains(#text,"wurd")) { then { increment(#count) Recursive Command Name() } else { alert("No \"wurd\" found, do something else") } } } 1 Quote Link to post Share on other sites
eindbaas 0 Posted October 18, 2015 Author Report Share Posted October 18, 2015 Code is not jet my cup of thee. Will watch all ubot training and hope it makes some more sens at the time. I can drag and drope comands in to ubot, thats all the skills i have at the moment. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 19, 2015 Report Share Posted October 19, 2015 Code is not jet my cup of thee. Will watch all ubot training and hope it makes some more sens at the time. I can drag and drope comands in to ubot, thats all the skills i have at the moment. Click on "Code View" and paste in the code, then click back to node view and you will be able to see the nodes the code represents. 1 Quote Link to post Share on other sites
eindbaas 0 Posted October 26, 2015 Author Report Share Posted October 26, 2015 Good info. Thank you 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.