AKprogrammer
-
Content Count
24 -
Joined
-
Last visited
-
Days Won
3
Posts posted by AKprogrammer
-
-
This is probably a part of a bigger discussion that we are having in another thread. Personally, I would love to be able to direct which script is run auto-magically. But so far the powers at be do not see the value with this level of automation.
Buddy
I agree that's needed... that's why I wrote an AutoIt3 script for it.
From a .bat file or other program, you could call my .exe:
AutoRunNewUBot.exe MyUbotExe.exe 2
That would open the UBot (assuming it's in the same folder), select the second tab, and then mouse over and press play. Although it doesn't close when finished.
-
OMG I just posted this question and Dave answered it. I thought the $application folder variable was equivalent to "Program Files" but I see now it's wherever the compiled bot is. Perfect!!!!
OMG is right! I assumed the same thing.
Since it behaved differently between scripts/compiled versions... I never thought about how the .ubot was using a different .exe, so that I should try it with a compiled bot. Thanks for letting us know.
-
Another interesting suggestion. The removal part works and the field disappears, but putItBack doesn't seem to do anything. I assume I just call it via putItBack(); yes? It doesn't need to define what element name is being put back?
Jonathan
Yeah, I think it may be:
function putItBack() { parent.appendChild(elem); }
I almost always use jQuery for javascript, so I'm rusty in the "native" javascript I guess.
-
You can just go like "save to file" and then write the filename and it will save to the current path
Someone asked for this again. I'd also like this enhancement.
"save to file" doesn't help if you need the executable path to shell execute some utility you've packaged with your application, or if you want to load a configuration file in the same folder.
Actually it's the "one path" that I need... I never use any of the others. I have a user load a "configuration file" in the same or sub folder to get around it (which is ugly).
In C# it would be:
string appPath = Path.GetDirectoryName(Application.ExecutablePath);
I'd call an .exe to run the above code (actually I'd probably use something more light-weight like AutoIt instead of .NET)... but how can I call the .exe? I don't know the path!
-
Nope, no onchange, nor onkeyup or onkeydown.
Great idea though... any others? Any way to simply shut OFF javascript for a particular element all together or something??
Jonathan
Remove the element from the DOM... delay to make sure the element is removed (it should disappear), then right before submitting the form, re-insert the element? I didn't test this code, but something like this...
var elem = null; var parent = null; function removeIt(someName) { elem = document.getElementsByName(someName)[0]; parent = elem.parentNode; parent.removeChild(elem); //if it doesn't disappear after this maybe there is another element with same name } function putItBack() { parent.addChild(elem); }
-
The text-input element that's used to overwrite the other field probably has an onchange event. Maybe you could try unregistering the onchange event?
You could try getting the element (by name or id) and setting onchange to null...
elem.onchange = null;
-
How can I change the ID of an element on a page I don't control? I must be missing something about your suggestion here...
javascript of course. You can do 'run javascript' to define a function...
function changeId(oldId, newId) { var elem = document.getElementById(oldId); elem.id = newId; }
Then run javascript...
changeId('{1}', 'blah');
Try changing the value.
Then run javascript again....
changeId('blah', '{1}');
Where {1} is UBot var of original id.
BTW, have you tried a delay between setting the field values? Maybe UBot is so fast, all the fields get filled before the javascript to update the field is run.
-
Hi,
I did read and try out the advice given here:
http://ubotug.com/index.php?/topic/2672-auto-start
But seems the "Tab" and "enter" on the AutoIt script doesn't do the trick with the new Ubot files (tab is stuck on the top tabs only).
Yeah the main problem with automating the new UBots is that you can't tab to the bottom pane which contains the play button and form fields. That definitely makes automating a little harder.
I made a new AutoIt3 script for the new UBots... it opens the UBot, selects the correct tab, and mouses over the play button to press play. Here's the .exe file (more info on my blog). You can create this .exe file by compiling the script below in AutoIt3.
Just don't move the mouse when it's trying to click play.
;Basic script AutoRun UBot - takes an .exe as parameter ;Directions: ;Put this .exe inside the same folder of the UBot .exe you want to AutoRun ;Call this script like this from console window or other app: ;AutoRunNewUBot.exe MyUbotExe.exe ;You can now optionally select the script index... (tab) you want to run ;AutoRunNewUBot.exe MyUbotExe.exe 2 ;Above would run the 2nd tab $totCommands = $CmdLine[0] If($totCommands <= 0) Then MsgBox(0, "Need parameter", "You didn't pass a UBot .exe to run."); Exit EndIf ;Move mouse to get rid of screensavers etc. $pos = MouseGetPos() MouseMove($pos[0] + 5, $pos[1], 5); $pos = MouseGetPos() MouseMove($pos[0] - 5, $pos[1], 5); Opt("MouseCoordMode", 0) Opt("PixelCoordMode", 0) $scriptIndex = 1 If($totCommands = 2) Then $exeFile = $CmdLine[1] $scriptIndex = $CmdLine[2] Else $exeFile = $CmdLine[1] EndIf $ubotPath = @WorkingDir & "\" & $exeFile ;RUN UBOT PROCESS ;========================================== $winName = runProcessGetWindowName($exeFile, $ubotPath); $hHandle = WinGetHandle($winName) Sleep(500) WinActivate($winName) WinWaitActive($winName) execNewBot() Func execNewBot() MouseClick("left", 17, 76, 1, 2) Sleep(500) pressKeyLoop("{DOWN}", $scriptIndex - 1) Sleep(500) Send("{ENTER}"); Sleep(500) ;DO A PIXEL SEARCH FOR THE PLAY BUTTON $blackCount = 0 ;how many in a row $playFound = False For $p = 75 To 575 $var = PixelGetColor( 27 , $p, $hHandle ) $hexCol = Hex($var, 6) If StringInStr($hexCol, "000000") Then $blackCount = $blackCount + 1 Else $blackCount = 0 EndIf If $blackCount > 6 Then $playPosition = $p - 3 ;writeToLogFile("Play button found at pixel location: 27," & $playPosition); $playFound = True ExitLoop EndIf Next MouseClick("left", 27, $playPosition, 1, 2) EndFunc Func pressKeyLoop($key, $howMany) If $howMany >= 0 Then ;DoubleCheck For $i = 0 To $howMany Sleep(200) Send($key) Next EndIf EndFunc Func runProcessGetWindowName($ProgramName, $programPath) $rPid = Run($programPath) ;MsgBox(0, "pid", "pid of run process is: " & $rPid) ;ProcessWait($rPid) Sleep(1000) ;Local $Processes = ProcessList() Local $Windows = WinList() Local $PIDSearch = 0 Local $WinSearch = 0 Local $PID $title = "" $maxTries = 20 ;$ProgramName = $ProgramName[$ProgramName[0]] While $title = "" $title = getNameFromPID($rPid) Sleep(1000) $maxTries = $maxTries - 1 If $maxTries < 0 Then Exit EndIf WEnd Return $title EndFunc Func getNameFromPID($rPid) Local $Windows = WinList() Local $WinSearch = 0 Local $PID For $WinSearch = 0 To UBound($Windows, 1) - 1 Step 1 $PID = WinGetProcess($Windows[$WinSearch][0]) $title = $Windows[$WinSearch][0] If $PID = $rPid Then ;And _ProcessGetName ($rPid) = $ProgramName Then If StringLen($title) > 0 And StringInStr($title, "UBot Studio Compiled Bot") Then If _ProcessGetName($rPid) = $exeFile Then ;writeToLogFile("Now monitoring process with WindowTitle: " & $title) ;MsgBox(0, "found pid", "found pid with title: " & $title) Return $title EndIf EndIf EndIf Next Return "" EndFunc Func _ProcessGetName( $i_PID ) If Not ProcessExists($i_PID) Then SetError(1) Return '' EndIf Local $a_Processes = ProcessList() If Not @error Then For $i = 1 To $a_Processes[0][0] If $a_Processes[$i][1] = $i_PID Then Return $a_Processes[$i][0] Next EndIf SetError(1) Return '' EndFunc
As a side note... I'm looking to trade bots. If this post was helpful, PM me a list of your bots you're willing to trade (and have rights to give away), and I'll PM you back some of the bots and applications I've made that you might find useful.
- 3
-
Basically I used the scrape to get the titles then scraped the whole page, wrote it out to a temp txt file and then read it back into a list so that each line of the page was on a seperate list item. I had title2 and title3 stored in variables so I looped through the new list and recorded the position in the list that title2 and title3 fell at. Finally I built the article2 and 3 variables buy looping through and if the line number was >title2pos and less than title3pos then add the line to article2 variable. If it was greater than title3 pos then add it to article3.
Nice workaround. Never thought to save to a file and parse it line-by-line... I'll keep that in mind if I have to make a scrape-bot without javascript.
Thanks for sharing.
-
OK I solved it for you :-)
Will email you the working bot.
Do you mind sharing how you did it without javascript?
Did you use the page_scrape function?
-
In my opinion, your code to scrape title2 should work and this is a UBot bug. Either that, or I don't understand the implementation of $page_scrape.
One time I was so frustrated with $page_scrape, I wrote my own function in javascript. Unfortunately I can't help you using this function, because your page doesn't have javascript on it... and pages without existing javascript don't run inserted javascript (btw - my utility SpeedyBot can get around this).
So I can't claim your $20. Still - I attached a bot that would work if you had javascript on the page.
I'd also like to see how a UBot expert would scrape this page with $page_scrape...
-
This is a good idea to speed up your own bots but quite a lot of us on here sell compiled bots. Maybe there is a market for a version that can be redistributed and reads all the settings from a file. Might be a licencing nightmare though, but something you might want to think about.Andy
Yes I was thinking of doing that. It would take some real work though - making settings files, an .exe to distribute that runs silently in the background, another .exe that you call from UBot that uses Named Pipes to communicate with a running instance of the silent version of SpeedyBot... and although I already have a licensing system, this would make it more complex.
I was hoping some people would buy the tool now to support future development on this.
@OP, I'm curious how Speedbot works with rendering xml (or non-HTML) to the screen.
I'm not sure what Zap is trying to do... but right now SpeedyBot doesn't try to intercept non-HTML traffic. If you intercepted an RSS feed I'm not sure what code you could inject to make it easily readable by UBot. The best way to extract info from feeds and use it in UBot is probably to read the feed in an RSS Reader (or download the feed and run a utility that does that).
If someone has a specific idea of what I could do with RSS to make UBot handle RSS better, let me know.
-
Thanks for the suggestion.
That does seem like an essential option... so I added another checkbox so you can block external CSS files. Anyone who buys SpeedyBot will get the new version.
For the most part - IE sucks as a webspider. I think this utility can change that.
-
This isn't a UBot, but it's a utility that I use while running my UBots - so I hope no one minds me posting it here.
SpeedyBot is a .NET program that can make your botting/spidering faster. It intercepts HTTP traffic, and modifies the HTML of a webpage before your browser reads it. This program can insert or remove any code from a webpage before UBot or any browser loads it.
You can:
1. Remove all iframe, flash, or script tags before loading.
2. Insert Jquery, or your own javascript and have that code become part of the page.
3. Remove images from a webpage. Or remove all images except the captcha images(experimental).
I'm selling this tool at my website for $40. BlogPost with YouTube Video
I'm planning to add more features to SpeedyBot in the future, and any upgrades will automatically be emailed to anyone who buys it now. You can post any questions you have in this thread, or feel free to PM me.
Also as a side note... I was busy with php contract work before so couldn't do much botting - but the company I was doing contract-work for went under. If you have a UBot bot you need created, or any custom .NET development done - PM me. Thanks.
- 2
-
I cant make this autoit thing work.. I tried to make a ubot compiled named ubottest.exe and put it in the same folder as the AutoRunUBot.exe but im always getting the "You didn't pass a UBot .exe to run."
Do i need to modify the autoit file first???? I really need this...
You can't double-click it because it doesn't know what .exe to run, and takes the .exe name as a parameter. The reason it's setup like that is so I can tell the .exe what UBot to run on the fly from another program.
But if you want something to double-click, you can open up Notepad and type in:
AutoRunUBot.exe YOUR_UBOT.exe
Then "Save As" - put it in the same folder as the other files, and name it:
something.bat
It doesn't matter what you name it - it just has to be a batch file (ending with .bat). Then you can double-click that and it will run the .exe with your ubot .exe as the parameter.
-
I'm interested in this as well.
My app works as I described for DeathByCaptcha. You drop a folder into My Documents, and edit an .ini file with user credentials for either service, then call a function in a .ubot library which eventually returns the solved captcha after calling a .NET console app. It sounds very similar to some_guy's although I haven't tried his.
There are two problems though...
1. I haven't been able to get in touch with the person who runs CaptchaBot so I can give him money for captchas and test my app. I wrote the CaptchaBot implementation code, but I'm not sure if it works. Even if the icon for ICQ on captchabot.com is lit up - the guy doesn't respond to my ICQ messages.
2. Even if I was able to test it - some_guy has a free app that does 90% of what my app does. The 10% missing is the CaptchaBot API implementation (which is really just a small portion of the work). So it's safer to work on something else if I need money (which I do) than to polish and release something that might be available for free.
So I'm sorry - I've given up on this one for now.
-
Note, some people said they would pay for this bot / app to be created, $50-$100 was bounded about I think, anyway I don't want it, but if you could donate to a charity helping out in Haiti that would be fantastic (or any other charity of your choice).
In the other thread where it says that people would pay money (which you obviously read)... I asked if anybody was going to work on this.
It would have helped if you spoke up.
-
But if we compile the exe's then they won't be able to auto start the program right? And we can't have ubot files autostarting on too computers since the limit is using one at a time on up to two computers.
You can automate your automation.
I already looked into this because I'm designing a .NET scheduler application for my UBots (and they need to be run while I'm afk).
What I used was AutoIt3. It's pretty good at automating Winforms. The below AutoIt3 script takes a UBot .exe as a parameter, then it opens the UBot .exe, waits for the window to become active, then sends a TAB key press, then an ENTER key press... which will tab to the play button and then press it.
I even compiled it with AutoIt3 (like UBot it also compiles to .exes) and you can download the .exe from my blog.
Below is the code you could compile yourself if you downloaded AutoIt3.
;Basic script to AutoRun UBot - takes an .exe as parameter ;Directions: ;Put this .exe inside the same folder of the UBot .exe you want to AutoRun ;Call this script like this from console window or other app: ;AutoRunUBot.exe MyUbotExe.exe $totCommands = $CmdLine[0] If($totCommands <= 0) Then MsgBox(0, "Need parameter", "You didn't pass a UBot .exe to run."); Exit EndIf $param1 = $CmdLine[1] $windowName = StringSplit($param1, ".", 0) ;Run .exe and wait for window name to become active window Run($param1) WinWaitActive($windowName[1]) ;Tab and then enter will select play button and press it Send("{TAB}") Send("{ENTER}")
- 2
-
Ok, sounds like people are interested - so I've started working on this in my spare time.
It could take a couple days or up to a week, depending on if I can get away from my usual contract work.
I'll keep everyone updated.
-
Hi, this is my first post on the forum. Been busy with web contract work lately - but I want to get more involved with UBot soon.
With the CaptchaBot API - they don't use javascript. They use some JScript that instantiates an ActiveX control. You can't inject Microsoft's Jscript into a webpage - it needs to be compiled and then uploaded to the server you're going to run it on. So plain javascript won't work.
If no one else is going to work on this - I could do it before the weekend and sell the app for under $15 on my website...
I was planning on making an app to use the DeathByCaptcha API anyway - and adding CaptchaBot shouldn't be too difficult. Basically my UBot library would call a Console .NET app to talk with the API and the .NET app would write the answer to a file that UBot would be looking for (every few seconds).
So to you it would work as you described... you select the image element (choose by attribute etc.) in your UBot script, call my UBot library function - then after a little while, you are returned a variable with the answer.
Let me know if that sounds good.
Dynamic UI... set up via a BeforePlay() or Init() override sub
in UBot Studio Feature Suggestions
Posted
I know implementing the ability to write to the UI fields at run-time might be difficult. So I have a suggestion.
Why not have a BeforePlay() function that we can override? Then we could populate any variables that the UI uses with data from text files "Before Play" is ever pressed. Right now if you try to use variables in the UI (let's say a listbox), empty strings get added to the listbox no matter what(unless I'm missing something).
The current setup isn't really user-friendly. Let's say you have a list of registered usernames in a text file and you want the user to choose one to perform an operation. Right now you can...
1. Have them type the username. You can't present them with a list in the UBot UI because it's dynamic data, so hopefully they know the registered usernames already, and don't mistype the username.
2. Have them press play, then let them pick the username on a website, or in another program (using shell). This option also sucks because the user sees the UBot UI and thinks "what do I do?". It's not intuitive to press play to set the options, and even if they do try that... it's not intuitive that the options would be in the window where things should be automated.
So I think it's critical to have an Init() or BeforePlay() function that can be used to set up the UI. It should run when a bot is opened.
Sorry if this has already been asked for before.