Jump to content
UBot Underground

Recommended Posts

Hey guys.

So , i just tried using ui button for the first time and it didn't worked at all as i expected it would some i'm abit lost.

The fact the you need to asign commands to each button differently is hard to understand for me.

I'm trying to build a little script that will navigate to url's from a file. 


I wanted that at the end of each loop ( each url ) the script pause ( all this i can do np ) and then after the user have clicked on a the proper button restart looping.

 

The purpose of the script was to sort items from a website in different category. i would manually asign each url to the proper category ( list )  that way. 

So the click on the button would add in item to a list depending on which button have been clicked.

I'm not really sure how to do that or if that's even possible. 

I was thinking of adding a value to the button like a variable and to check the variable value to decide what to do  (  Variable = 0  then button has been clicked variable = 1 buttoin hasn't ) and then use Else if:

 

List from a file

Loop > list total 

Navigate > next list item

Pause script ( Or wait for user input ? )

 If button1 value = 0  then > add item to list > run script ,

Else

 Else if Button2 value = 0 > add item to list  > run Script

Else
 Else if Button3 value = 0 > add item to list  > Run script
, etc..

 

 

Do you have another way to proceed ? Can it be done the way i think ?

thanks 

Link to post
Share on other sites

i don't get how alert would help in that case ?  it's just a way to restart the script ? 

i'm needing 6 buttons each adding different stuff to a list. how the user would choose the proper thing to add to the list without any input ? i can't seem to be able to add button inside altert.

Link to post
Share on other sites

Hey guys.

 

So , i just tried using ui button for the first time and it didn't worked at all as i expected it would some i'm abit lost.

 

The fact the you need to asign commands to each button differently is hard to understand for me.

 

I'm trying to build a little script that will navigate to url's from a file. 

 

I wanted that at the end of each loop ( each url ) the script pause ( all this i can do np ) and then after the user have clicked on a the proper button restart looping.

 

The purpose of the script was to sort items from a website in different category. i would manually asign each url to the proper category ( list )  that way. 

So the click on the button would add in item to a list depending on which button have been clicked.

 

I'm not really sure how to do that or if that's even possible. 

 

I was thinking of adding a value to the button like a variable and to check the variable value to decide what to do  (  Variable = 0  then button has been clicked variable = 1 buttoin hasn't ) and then use Else if:

 

List from a file

Loop > list total 

Navigate > next list item

Pause script ( Or wait for user input ? )

 If button1 value = 0  then > add item to list > run script ,

Else

 Else if Button2 value = 0 > add item to list  > run Script

Else

 Else if Button3 value = 0 > add item to list  > Run script

, etc..

 

 

Do you have another way to proceed ? Can it be done the way i think ?

 

thanks 

 

Yes, it can be done that way. Drag the ui button into your bot, and give it a variable name (#button1). In the value area, enter 0.  Somewhere before your button is executed, set the value of #button1 to 1. This way, if the button is clicked the value of #button1 will equal 0, if the button is not clicked, #button1 will equal 1. (Do the same with buttons 2 and 3.) So your code would look like:

 

 

List from a file

Loop > list total 

Navigate > next list item

Pause script ( Or wait for user input ? )

 If #button1 = 0  then > add item to list > run script ,

Else

 Else if #button2 = 0 > add item to list  > run Script

Else

 Else if #button3 = 0 > add item to list  > Run script

, etc..

  • Like 1
Link to post
Share on other sites

Ok i've managed to do this it works only problem is that i cannot restart the script ( or i have to do it manually ) so instead i made a 5seconde counntdown  before the if else but it think a run script function could be really nice !

Thanks for the help

Edit : Im wondering is there a way to have an empty loop , looping until  #button1 or button2 or button3 = 0 ?

 

 

Edit2 : Ok ive just tried loop while > either > Comparaison  #button1 = 0   or  Comparaison #button2 = 0   and ubot crashed 3 times in a row i guess that's not good xd

Link to post
Share on other sites

Create a define that checks the value of each button. if none of the buttons have been clicked, load an html page that says, 'You must click one of the button above to proceed."

 

Then wait 2 seconds and loop back to the top of the define. 

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