esidagn 0 Posted December 24, 2015 Report Share Posted December 24, 2015 HI All,This is the first time I ask to ubot community.my bot is feeding a lot of url from mysql, do filtering and mark it as DONE in mysql. plugin command("DatabaseCommands.dll", "connect to database", "server=127.0.0.1;uid=myid; pwd=mypass; database=mydb; port=3306; pooling=false") { plugin command("DatabaseCommands.dll", "query with results", "SELECT * FROM table_name WHERE status = \'\';", &my_table) } loop while($comparison($table total rows(&my_table),"> Greater than",0)) { set(#id,$table cell(&my_table,0,0),"Global") navigate($table cell(&my_table,0,1),"Wait") FILTERING CODE HERE plugin command("DatabaseCommands.dll", "connect to database", "server=127.0.0.1;uid=myid; pwd=mypass; database=mydb; port=3306; pooling=false") { plugin command("DatabaseCommands.dll", "query", "UPDATE table_name SET status=\' DONE\' WHERE id=\'{#id}\';") } plugin command("TableCommands.dll", "delete from table", &my_table, "Row", 0) } it is done 'one by one' and it's doing well. But it's a lot of url around 6000 urls, i want do it faster with Multi Threading .But I get confused, should I used Thread Spawn? or only Thread.Let say i want do 3 Thread, Can some one give me the pattern code for the looping code so its not process with double link? Quote Link to post Share on other sites
Brutal 164 Posted December 24, 2015 Report Share Posted December 24, 2015 Use thread spawn 1 Quote Link to post Share on other sites
esidagn 0 Posted December 24, 2015 Author Report Share Posted December 24, 2015 (edited) Ok, I try to change it to (not tested it yet): plugin command("DatabaseCommands.dll", "connect to database", "server=127.0.0.1;uid=myid; pwd=mypass; database=mydb; port=3306; pooling=false") { plugin command("DatabaseCommands.dll", "query with results", "SELECT * FROM table_name WHERE status = \'\';", &my_table) } loop while($comparison($table total rows(&my_table),"> Greater than",0)) { thread spawn(3,3) { in new browser { wait(4) set(#id,$table cell(&my_table,0,0),"Global") set(#link,$table cell(&my_table,0,1),"Global") plugin command("TableCommands.dll", "delete from table", &my_table, "Row", 0) navigate(#link,"Wait") FILTERING CODE HERE() plugin command("DatabaseCommands.dll", "connect to database", "server=127.0.0.1;uid=myid; pwd=mypass; database=mydb; port=3306; pooling=false") { plugin command("DatabaseCommands.dll", "query", "UPDATE table_name SET status=\' DONE\' WHERE id=\'{#id}\';") } } } } But it seem have chance to process double link, will taste is and back here===================================================================UPDATE: YES tested it, but it execute same link (double link), i want is every thread running different link Edited December 24, 2015 by esidagn 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.