Jump to content
UBot Underground

Counting Loops in UI Stat window


Recommended Posts

Hi team,

 

I created a Google search bot, it then goes to the specified link, goes through a couple of steps then changes the IP address using a great HMA code I found here from Bliss. Once its done it starts over again.

 

I created a UI window which tells the bot how many loops to do, but I wuld like to know exactly how many loops it has already done.

 

Like "Loop 45/100" or something similar.

 

Thank you very much in advance

 

ui stat monitor("Total", "")
clear cookies
set user agent("Chrome")
ui text box("Set Referrer", #set referrer)
set referrer(#set referrer)
ui text box("Cycles", #cycles)
loop(#cycles) {
   set visibility("Visible")
   allow images("No")
   allow popups("No")
   allow flash("No")
   allow css("No")
   navigate("http://www.google.com", "Wait")
   type text(<name="q">, "insurance service los angeles", "Standard")
   click(<name="btnG">, "Left Click", "No")
define CheckIpStatus {
       set(#IPConfig, $nothing, "Global")
       shell("cmd.exe /c ipconfig.exe > %USERPROFILE%\\Documents\\localip.txt")
       set(#IPConfig, $read file("{$special folder("My Documents")}\\localip.txt"), "Global")
       delete file("{$special folder("My Documents")}\\localip.txt")
   }
define HMAChangeIP {
       wait for browser event("Page Loaded", "")
       CheckIpStatus()
       set(#IPConfigCompare, #IPConfig, "Global")
       shell("C:\\Program Files\\HMA! Pro VPN\\bin\\HMA! Pro VPN.exe -changeip")
       loop while($comparison(#IPConfig, "=", #IPConfigCompare)) {
           CheckIpStatus()
           wait(5)
       }
       set(#IPConfigCompare, #IPConfig, "Global")
       loop while($comparison(#IPConfig, "=", #IPConfigCompare)) {
           CheckIpStatus()
           wait(3)
       }
   }
   HMAChangeIP()
   wait(9)
}

Link to post
Share on other sites

drag the defines to absolute end of your code area, they dont and shouldn't be defined inside your loop, only called inside your loop.

 

set a variable before your loop to 0

 

at the end inside the loop increment that variable, and use a ui monitor and drag in that variable to monitor it..

 

you can also space after the variable in that ui monitor node and put / #cyles drag in cycles variable so it shows 0 / total in the ui area

  • Like 2
Link to post
Share on other sites

Thanks for the quick reply as always. Im a bit to new to fully understand the instructions you gave me. Can you please copy/paste the code I added here and make the changes?

Dont get me wrong, i'm not trying to be lazy, I'm just very new to the coding aspect of uBot since I upgraded to pro about 5 or 6 days ago and I know trying to figure this out will take me another day.

 

My goal is to learn as much as possible from guys like you to one day help other noobs in the future.

 

Your help is always appreciated.

Link to post
Share on other sites

drag the defines to absolute end of your code area, they dont and shouldn't be defined inside your loop, only called inside your loop.

 

set a variable before your loop to 0

 

at the end inside the loop increment that variable, and use a ui monitor and drag in that variable to monitor it..

 

you can also space after the variable in that ui monitor node and put / #cyles drag in cycles variable so it shows 0 / total in the ui area

 

Oh man, spent like 3 hours experimenting with the instructions you gave me to no use, Im just to green in the coding section. Can you dummy proof it a bit? just a bit?

Once I get this solved it will solve about 5 other problems that are all related.

 

Thanks again

Link to post
Share on other sites

try this

 

set(#loops, 0, "Global")
ui stat monitor("Total", "{#loops} of {#cycles}")
clear cookies
set user agent("Chrome")
ui text box("Set Referrer", #set referrer)
set referrer(#set referrer)
ui text box("Cycles", #cycles)
loop(#cycles) {
   set visibility("Visible")
   allow images("No")
   allow popups("No")
   allow flash("No")
   allow css("No")
   navigate("http://www.google.com", "Wait")
   type text(<name="q">, "insurance service los angeles", "Standard")
   click(<name="btnG">, "Left Click", "No")
   increment(#loops)
define CheckIpStatus {
       set(#IPConfig, $nothing, "Global")
       shell("cmd.exe /c ipconfig.exe > %USERPROFILE%\\Documents\\localip.txt")
       set(#IPConfig, $read file("{$special folder("My Documents")}\\localip.txt"), "Global")
       delete file("{$special folder("My Documents")}\\localip.txt")
       }
define HMAChangeIP {
       wait for browser event("Page Loaded", "")
       CheckIpStatus()
       set(#IPConfigCompare, #IPConfig, "Global")
       shell("C:\\Program Files\\HMA! Pro VPN\\bin\\HMA! Pro VPN.exe -changeip")
       loop while($comparison(#IPConfig, "=", #IPConfigCompare)) {
           CheckIpStatus()
           wait(5)
       }
       set(#IPConfigCompare, #IPConfig, "Global")
       loop while($comparison(#IPConfig, "=", #IPConfigCompare)) {
           CheckIpStatus()
           wait(3)
       }
   }
   HMAChangeIP()
   wait(9)
}

  • Like 1
Link to post
Share on other sites

Thank you so much for this works like a charm! Now I can take the code and cross check it with what BotGuru gave me and I can learn what his instructions ment. baby steps here!!

 

Thanks all!!

 

try this

 

set(#loops, 0, "Global")
ui stat monitor("Total", "{#loops} of {#cycles}")
clear cookies
set user agent("Chrome")
ui text box("Set Referrer", #set referrer)
set referrer(#set referrer)
ui text box("Cycles", #cycles)
loop(#cycles) {
   set visibility("Visible")
   allow images("No")
   allow popups("No")
   allow flash("No")
   allow css("No")
   navigate("http://www.google.com", "Wait")
   type text(<name="q">, "insurance service los angeles", "Standard")
   click(<name="btnG">, "Left Click", "No")
   increment(#loops)
define CheckIpStatus {
       set(#IPConfig, $nothing, "Global")
       shell("cmd.exe /c ipconfig.exe > %USERPROFILE%\\Documents\\localip.txt")
       set(#IPConfig, $read file("{$special folder("My Documents")}\\localip.txt"), "Global")
       delete file("{$special folder("My Documents")}\\localip.txt")
       }
define HMAChangeIP {
       wait for browser event("Page Loaded", "")
       CheckIpStatus()
       set(#IPConfigCompare, #IPConfig, "Global")
       shell("C:\\Program Files\\HMA! Pro VPN\\bin\\HMA! Pro VPN.exe -changeip")
       loop while($comparison(#IPConfig, "=", #IPConfigCompare)) {
           CheckIpStatus()
           wait(5)
       }
       set(#IPConfigCompare, #IPConfig, "Global")
       loop while($comparison(#IPConfig, "=", #IPConfigCompare)) {
           CheckIpStatus()
           wait(3)
       }
   }
   HMAChangeIP()
   wait(9)
}

Link to post
Share on other sites

just showing where the defined commands should be

 

ui stat monitor("Total", "{#loops} of {#cycles}")
clear cookies
set user agent("Chrome")
ui text box("Set Referrer", #set referrer)
set referrer(#set referrer)
ui text box("Cycles", #cycles)
set(#loops, 0, "Global")
loop(#cycles) {
   set visibility("Visible")
   allow images("No")
   allow popups("No")
   allow flash("No")
   allow css("No")
   navigate("http://www.google.com", "Wait")
   type text(<name="q">, "insurance service los angeles", "Standard")
   click(<name="btnG">, "Left Click", "No")
   HMAChangeIP()
   wait(9)
   increment(#loops)
}
define CheckIpStatus {
   set(#IPConfig, $nothing, "Global")
   shell("cmd.exe /c ipconfig.exe > %USERPROFILE%\\Documents\\localip.txt")
   set(#IPConfig, $read file("{$special folder("My Documents")}\\localip.txt"), "Global")
   delete file("{$special folder("My Documents")}\\localip.txt")
}
define HMAChangeIP {
   wait for browser event("Page Loaded", "")
   CheckIpStatus()
   set(#IPConfigCompare, #IPConfig, "Global")
   shell("C:\\Program Files\\HMA! Pro VPN\\bin\\HMA! Pro VPN.exe -changeip")
   loop while($comparison(#IPConfig, "=", #IPConfigCompare)) {
       CheckIpStatus()
       wait(5)
   }
   set(#IPConfigCompare, #IPConfig, "Global")
   loop while($comparison(#IPConfig, "=", #IPConfigCompare)) {
       CheckIpStatus()
       wait(3)
   }
}

Link to post
Share on other sites

set a variable before your loop to 0

 

at the end inside the loop increment that variable, and use a ui monitor and drag in that variable to monitor it..

 

you can also space after the variable in that ui monitor node and put / #cyles drag in cycles variable so it shows 0 / total in the ui area

 

Killer info! I just googled how to do this, and up pops this thread in the serps!

 

Thanks for the help TJ! +1 I love this community!

 

 

Jay

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