Jump to content
UBot Underground

Set A 4 Number Variable And Have It Increment


Recommended Posts

Guys,

 

I am having trouble setting a variable with four numbers, ex: 0000, and having it increment 0001, 0002, 0003, etc. Any tips? 

 

Sorry I posted this in the wrong spot :( 

Edited by Jpizzo
Link to post
Share on other sites

You willl need to join the variable,create a new variable,as its value put in 000 and drag in your variable

 

Also do a if else if statement

 

If variable is greater than 9,new variable is 00+your variable etc

Link to post
Share on other sites

You will have to modify this to your own needs (remove the wait, change the loop while number) but it shows how you can do this:

ui stat monitor("Number:",#num)
set(#increment,0,"Global")
set(#num,0000,"Global")
loop while($comparison(#num,"<",1001)) {
    increment(#increment)
    set(#zeroes_count,$subtract(4,$text length(#increment)),"Global")
    if($comparison(#zeroes_count,"=",3)) {
        then {
            set(#zeroes,000,"Global")
        }
        else if($comparison(#zeroes_count,"=",2)) {
            set(#zeroes,00,"Global")
        }
        else if($comparison(#zeroes_count,"=",1)) {
            set(#zeroes,0,"Global")
        }
        else {
            set(#zeroes,$nothing,"Global")
        }
    }
    set(#num,"{#zeroes}{#increment}","Global")
    wait(0.01)
}
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...