Jump to content
UBot Underground

Need Help - Guide Me To Multi Threading


Recommended Posts

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?

 

 

 

 

Link to post
Share on other sites

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