JackCrow 4 Posted April 7, 2013 Report Share Posted April 7, 2013 Hello. I'm trying to get my bot to log into twitter and if it reaches an error to re-start the loop. I'm really trying to get the define function down but I'm having difficulty. Can someone please look at this code and let me know where I'm messing up? A clear and proxy switch was also part of this code but I took it out. Thank you for all the help. <define My Command { loop($table total rows(&accounts)) { navigate("https://twitter.com/", "Wait") wait for browser event("Everything Loaded", "") type text(<for="signin-email">, $table cell(&accounts, #row, 0), "Standard") wait(2) type text(<for="signin-password">, $table cell(&accounts, #row, 1), "Standard") wait(2) click($element offset(<login button>, 1), "Left Click", "No") wait for browser event("Page Loaded", "") } if("error") { then { My Command() } else { } }> Quote Link to post Share on other sites
LazyBotter 188 Posted April 7, 2013 Report Share Posted April 7, 2013 Try changing the page loaded to everything loaded. I also think you need an "exist" parameter in the last if statement. Quote Link to post Share on other sites
JackCrow 4 Posted April 7, 2013 Author Report Share Posted April 7, 2013 Thanks Lazy Bots. I was messing around with that a little before. I'll try it out. Quote Link to post Share on other sites
JackCrow 4 Posted April 7, 2013 Author Report Share Posted April 7, 2013 Dang it. It's still not working for me. I know I'm missing some stupid little thing. Can someone have a look at this code and let me know what I'm doing wrong? Thanks, it means a lot to me. <define $My Command { loop($table total rows(&accounts)) { navigate("https://twitter.com/", "Wait") wait for browser event("Page Loaded", "") type text(<for="signin-email">, $random list item(%justaccountnames), "Standard") wait($rand(2, 5)) type text(<for="signin-password">, "password", "Standard") wait($rand(2, 5)) click($element offset(<login button>, 1), "Left Click", "No") wait for browser event("Page Loaded", "") if($exists(<innertext="Activate your account »">)) { then { My Command() } else { } } > Quote Link to post Share on other sites
LazyBotter 188 Posted April 7, 2013 Report Share Posted April 7, 2013 Change the wait for browser event to wait of element & in the advanced add a timeout. Obviously you will get the wait for element to wait for something like "log out". Quote Link to post Share on other sites
LazyBotter 188 Posted April 8, 2013 Report Share Posted April 8, 2013 Have u sorted it mate? Quote Link to post Share on other sites
JackCrow 4 Posted April 9, 2013 Author Report Share Posted April 9, 2013 No.... I actually just changed a few commands so it was a workaround. It's very frustrating learning all of this stuff. I'm learning quickly because I'm working on it most of the day but it pisses me off when I get hung up on stupid things. Thank for the help. You have no idea what it means to me. 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.