Jump to content
UBot Underground

Incrementing a value but leaving the 000 in front?


Recommended Posts

I want to nav to a url web.com?s=000000001

I need to increment the number, while not changing the total number of digits, like this

 

0000001

0000002

0000003

...

0000010

0000011

...

0000099

0000100

0000101

...

Link to post
Share on other sites

That's not quite what I was asking because in your scenario, when you hit the 10th loop, the total number of digits will increase by one, so you would have this:

000000009

0000000010

whereas all my samples had the same number of digits.

000000009

000000010

I found out though it didn't matter for my job because I could remove any preceding zeros.

Link to post
Share on other sites

No, it would still work fine...you would just add a condition that if #page is greater than 9, then url = (one less zero), if #page is greater than 99, then url = (remove another 0). I was just provide a process by which you would accomplish that.

 

 

John

Link to post
Share on other sites

try this

 

set(#pagenumber, 0, "Global")
ui stat monitor("Numbers", #pagenumber)
loop(1000000) {
   increment(#pagenumber)
   set(#pagenumber, $pad text(#pagenumber, 0, 8, "Left"), "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...