Jump to content
UBot Underground

Help opening a bot from another bot!


Recommended Posts

Hi! I have a bot that is just a html UI and from it I open other bots ... but the problem is that when I click the UI the new bot opens minimized. How can I open the new bot as a normal window and not minimized in the windows bar??

Link to post
Share on other sites

Check you compiling options, I think I saw there some alternatives for how the bot will open.  Not sure if there are differences between the STD/PRO/DEV licenses, in this respect, though...

Link to post
Share on other sites

I have tried... the only option that works..in a way... is the option that will open the bot maximized, but this will make the bot to open full screen and I don't want a bot that is 300px x 400px to be all over my screen :D

Link to post
Share on other sites

I have used winautomation and made a little exe that opens the new bot: I call the winauto exe with shell command from the main bot and the winauto exe opens the new bot... in this way the new bot opens on the screen not on the windows bar the downside is that I can't change the extension of the new bot (it has to be exe to be opened by winauto... so I can't hide important files) and I have double the numbers of files in my software :)

Link to post
Share on other sites
I call the winauto exe with shell command from the main bot and the winauto exe opens the new bot...

 

Not sure I understand WHY you needed WinAuto in order to shell the launch from within another UBot bot, when the same SHELL command would have launched the compiled bot directly?

Link to post
Share on other sites
Not sure I understand WHY you needed WinAuto in order to shell the launch from within another UBot bot, when the same SHELL command would have launched the compiled bot directly?

when you use shell to launch the bot directly, the bot will open in the task bar at the bottom of the screen! That was the problem I needed to be solved in this thread! and as far as I know there is no solution to this problem, even with the new "windows" commands :)

Link to post
Share on other sites

Yeah I am having that issue as well when it launches the program it gets stuck on the shell command and the program starts minimized. I tried to use a thread to get past the part where it gets stuck and then set the active window but that didn't work either then it just gets stuck on that - kind of frustrating.

Link to post
Share on other sites

Hi,

 

My notes on code:

Shell cmd.exe /C runs compiled bot/program and waits until finshed.

Shell cmd.exe /C start runs compiled bot/program and does not wait until finished.

Running compiled bots/programs with VBS code no waiting. Will hide compiled bot/program window from Window's taskbar until the running compiled bot/program is clicked on.

 

Just some ideas. Maybe they could be useful.

 

Sample code:

ui check box("Run external bot wait", #runexternalbotwait)
ui check box("Run bot with /auto", #runexternalbotauto)
ui check box("Use VBS (No Wait)", #runexternalbotwithvbs)
wait(5)
navigate("http://www.yahoo.com/", "Wait")
wait for browser event("Everything Loaded", 30)
wait(10)
set(#bottorun, "C:\\dnld\\ubotstudio\\samplescript-v4\\sample-run-auto-001.exe", "Global")
set(#bottorun, "C:\\dnld\\ubotstudio\\samplescript-v4\\test space\\sample-run-auto-001.exe", "Global")
set(#vbsfilesave, "{$special folder("Application Data")}\\ubot-run-invisible.vbs", "Global")
set(#runbotwithauto, $nothing, "Global")
if($comparison(#runexternalbotauto, "=", "true")) {
    then {
        set(#runbotwithauto, " /auto", "Global")
    }
    else {
    }
}
set(#runbotstart, $nothing, "Global")
if($comparison(#runexternalbotwait, "=", "false")) {
    then {
        set(#runbotstart, " start \"Ubot cmd.exe\" ", "Global")
    }
    else {
    }
}
if($comparison(#runexternalbotwithvbs, "=", "true")) {
    then {
        runviavbs()
    }
    else {
        shell("cmd.exe /C {#runbotstart} \"{#bottorun}\" {#runbotwithauto}")
    }
}
define runviavbs {
    clear list(%vbspgm)
    set(#vbspgmp1, "Option Explicit
dim strArgument
dim objArgs
dim numofargs
dim i
dim spc
strArgument=\"\"
\'Get the command line arguments
Set objArgs = WScript.Arguments
numofargs = objArgs.count - 1
spc=\" \"
\' run arg script invisible no cmd window
", "Global")
    add list to list(%vbspgm, $list from text(#vbspgmp1, $new line), "Don\'t Delete", "Global")
    if($comparison(#runexternalbotauto, "=", "true")) {
        then {
            set(#vbspgmp2, "if numofargs = 1 then
  CreateObject(\"Wscript.Shell\").Run \"\"\"{#bottorun}\"\" /auto\", 0, False
end if
", "Global")
        }
        else {
            set(#vbspgmp2, "if numofargs = 0 then
  CreateObject(\"Wscript.Shell\").Run \"\"\"{#bottorun}\"\"\", 0, False
end if
", "Global")
        }
    }
    add list to list(%vbspgm, $list from text(#vbspgmp2, $new line), "Don\'t Delete", "Global")
    set(#vbspgmp3, "
wscript.quit", "Global")
    add list to list(%vbspgm, $list from text(#vbspgmp3, $new line), "Don\'t Delete", "Global")
    save to file(#vbsfilesave, %vbspgm)
    shell("wscript.exe \"{#vbsfilesave}\" \"{#bottorun}\" {#runbotwithauto}")
    wait(2)
    delete file(#vbsfilesave)
    clear list(%vbspgm)
}
wait(5)
navigate("http://www.bing.com/", "Wait")
wait for browser event("Everything Loaded", 30)
wait(5)

 

Kevin

  • Like 2
Link to post
Share on other sites
  • 2 weeks later...

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