merkaba 36 Posted August 4, 2012 Report Share Posted August 4, 2012 Here's another psuedo library file. Please refer to this for the basic concept of the psuedo library along with file structure. http://www.ubotstudio.com/forum/index.php?/topic/10970-using-hma-and-auto-verifying-ip-change/ So the premise here, is making another exe we can call on to do something that we need to do often. In this case, we're going to use it for a random user agent. When creating user accounts (xx-x,xxx) on one site, it's probably dumb to do it showing the same user agent. A lot of people are looking for random user agent codes, well this one mimics (almost) what the odds are someone will be using browser x,y,z. I based the numbers off the following. http://www.w3schools.com/browsers/browsers_stats.aspMake sure you have a main folder with a folder entitled 'data', and add a new blank notepad document in data called agent. Next open up a new ubot file, save it as "random_agent" in the main folder (first link shows the folder structure). First line of code is the onload feature from kreatus since we want it to run immediately when opened. ui stat monitor("<script type=\"text/javascript\"> window.onload = ubot.runScript(\'random_agent()\') </script>", "") Next is the define with everything in it. I've added the user agents even though they don't do anything for us, at the bottom of the page I've put a version without them. define random_agent { delete file("{$special folder("Application")}\\data\\agent.txt") set(#agent, $rand(1, 969), "Global") if($comparison(#agent, "<=", 167)) { then { set user agent("Internet Explorer 10") save to file("{$special folder("Application")}\\data\\agent.txt", 1) } else { if($comparison(#agent, "<=", 511)) { then { set user agent("Firefox 6") save to file("{$special folder("Application")}\\data\\agent.txt", 2) } else { if($comparison(#agent, "<=", 928)) { then { set user agent("Chrome") save to file("{$special folder("Application")}\\data\\agent.txt", 3) } else { if($comparison(#agent, "<=", 969)) { then { set user agent("Safari") save to file("{$special folder("Application")}\\data\\agent.txt", 4) } else { } } } } } } } } shell("cmd.exe /c \"taskkill /im random_agent.exe /f\"") } First thing it does is set the variable to a number between 1-969, then compares that number against the percents from w3's site. It should be noted that I did not include opera since ubot doesn't offer it as a user agent. After it evaluates the variable (1-969) it creates a text file in the data folder with a number 1-4 then self terminates. So save, and compile to the main folder as random_agent.exe. Now its time for the snippet we use whenever we want to call on it to generate us a new user agent. define Agent { shell("{$special folder("Application")}\\random_agent.exe") wait(5) set(#agent, $read file("{$special folder("Application")}\\data\\agent.txt"), "Global") if($comparison(#agent, "=", 1)) { then { set user agent("Internet Explorer 10") } else { if($comparison(#agent, "=", 2)) { then { set user agent("Firefox 6") } else { if($comparison(#agent, "=", 3)) { then { set user agent("Chrome") } else { if($comparison(#agent, "=", 4)) { then { set user agent("Safari") } else { } } } } } } } } } Now whenever this code is ran, it'll run the random_agent.exe to generate us a new user agent based on odds. Like the hma, the exe needs to be in the main folder of the program you're working with along with the data folder. Here's the edited/non demo version of the random_agent without the user agents showing. define random_agent { delete file("{$special folder("Application")}\\data\\agent.txt") set(#agent, $rand(1, 969), "Global") if($comparison(#agent, "<=", 167)) { then { save to file("{$special folder("Application")}\\data\\agent.txt", 1) } else { if($comparison(#agent, "<=", 511)) { then { save to file("{$special folder("Application")}\\data\\agent.txt", 2) } else { if($comparison(#agent, "<=", 928)) { then { save to file("{$special folder("Application")}\\data\\agent.txt", 3) } else { if($comparison(#agent, "<=", 969)) { then { save to file("{$special folder("Application")}\\data\\agent.txt", 4) } else { } } } } } } } } shell("cmd.exe /c \"taskkill /im random_agent.exe /f\"") } 2 Quote Link to post Share on other sites
jason 101 Posted August 4, 2012 Report Share Posted August 4, 2012 Awesome. These great code snippets of yours are not going unnoticed by team UBot! Quote Link to post Share on other sites
Legend 181 Posted September 5, 2012 Report Share Posted September 5, 2012 Yes... very awesome! Thanks loads!! Quote Link to post Share on other sites
a2mateit 395 Posted September 5, 2012 Report Share Posted September 5, 2012 Nice share bud. Appreciated! Quote Link to post Share on other sites
warriorfullights 0 Posted September 7, 2012 Report Share Posted September 7, 2012 (edited) Great coding you got here. Keep it up. http://imagicon.info/cat/5-34/boredom.gif Edited September 7, 2012 by warriorfullights Quote Link to post Share on other sites
AutomationNinja 194 Posted February 1, 2013 Report Share Posted February 1, 2013 well how cool is that? 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.