• Categories
  • Recent
  • Popular
  • Users
  • Search
  • FingerprintSwitcher
  • CustomServers
  • AutomationPlugins
Skins
  • Light
  • Default
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Quartz
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Slate
  • Solar
  • Superhero
  • Vapor
Collapse

Bablosoft

Question About Getting New Random Number Everytime

Scheduled Pinned Locked Moved Support
9 Posts 4 Posters 3128 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stephenperry18
    wrote on last edited by
    #1

    Hi

    So my script is using RANDOM_NUMBER variable which randoms between 1-5

    now I'm not ending the thread, I'm just calling SET LABEL and MOVE to LABEL however every time it calls the LABEL it always used the same RANDOM_NUMBER variable which it generated at first run of the thread. Now how can I get new RANDOM_NUMBER variable every time I call it?

    Thank you

    denanotherdayD 1 Reply Last reply
    0
  • GaGG Offline
    GaGG Offline
    GaG
    wrote on last edited by
    #2

    Probably need to put generate random number inside
    or between Set Label and Move to Label actions.
    Seems that you only call already generated random number
    between those 2 statements so its always same because actual
    generation is already done before Set Label.

    S 1 Reply Last reply
    0
  • S Offline
    S Offline
    stephenperry18
    replied to GaG on last edited by
    #3

    @gag said in Question About Getting New Random Number Everytime:

    Probably need to put generate random number inside
    or between Set Label and Move to Label actions.
    Seems that you only call already generated random number
    between those 2 statements so its always same because actual
    generation is already done before Set Label.

    The random_number variable is created and generated inside "Set Label" and "Move to Label" actions, that's why I'm not sure what I'm doing wrong :(

    When I'm doing it on "Recording Mode" step by step, I can see in the LOG that it generated a new random_number variable everytime, however when I "Run" it it only generates SAME random_number variable.

    GaGG 1 Reply Last reply
    0
  • denanotherdayD Offline
    denanotherdayD Offline
    denanotherday
    replied to stephenperry18 on last edited by
    #4
    This post is deleted!
    S 1 Reply Last reply
    0
  • S Offline
    S Offline
    stephenperry18
    replied to denanotherday on last edited by
    #5

    @denanotherday said in Question About Getting New Random Number Everytime:

    chest

    what's a "chest" sir?

    1 Reply Last reply
    0
  • GaGG Offline
    GaGG Offline
    GaG
    replied to stephenperry18 on last edited by
    #6

    @stephenperry18 said in Question About Getting New Random Number Everytime:

    The random_number variable is created and generated inside "Set Label" and "Move to Label" actions, that's why I'm not sure what I'm doing wrong :(
    When I'm doing it on "Recording Mode" step by step, I can see in the LOG that it generated a new random_number variable everytime, however when I "Run" it it only generates SAME random_number variable.

    Can you post a sample script?

    GaGG 1 Reply Last reply
    0
  • GaGG Offline
    GaGG Offline
    GaG
    replied to GaG on last edited by
    #7

    And why dont you use a loop instead os label?
    Dont know how things are moving now but earlier
    bas support recomended using loops over labels.

    Im always using loops rarely labels, maybe labels work
    a bit differently and are not suitable for every task.

    S 1 Reply Last reply
    1
  • S Offline
    S Offline
    stephenperry18
    replied to GaG on last edited by
    #8

    @gag said in Question About Getting New Random Number Everytime:

    And why dont you use a loop instead os label?
    Dont know how things are moving now but earlier
    bas support recomended using loops over labels.

    Im always using loops rarely labels, maybe labels work
    a bit differently and are not suitable for every task.

    Well I figured it out but I dont know if this is the best solution for it.

    I used Global Variables to forced it to change everytime, When I used local variables it not working.

    Also I'm using labels because everytime it fails to load the URL it will go to back to Label. I don't know if you can use loops, I know you can use WHILE loop but its easy to use Labels hehe

    1 Reply Last reply
    0
  • T Offline
    T Offline
    toobie
    wrote on last edited by
    #9

    FOREACH, FOR, IF loops are perfectly suitable if you put error handling into your script (which you should).

    Global variables are shared across all threads, while the local variable is only within the current thread. If you request a value at the beginning of your thread, it will remain the same during the whole lifespan of that thread unless otherwise specified. For example, you could generate a few of them in a loop, save to list, then you have multiple random numbers to choose from.

    1 Reply Last reply
    1

  • S

    How can we get this if we reply to the Telegram bot

    Scheduled Pinned Locked Moved Support
    0 Votes
    1 Posts
    567 Views
    No one has replied
  • S

    I have a question about resource

    Scheduled Pinned Locked Moved Support
    0 Votes
    1 Posts
    619 Views
    No one has replied
  • S

    How to scrap instagram followers using post/get? / Как очистить подписчиков Instagram с помощью post / get?

    Scheduled Pinned Locked Moved Support
    0 Votes
    1 Posts
    781 Views
    No one has replied
  • nicckN

    3 Questions - reload renew periodically

    Scheduled Pinned Locked Moved Support
    1 Votes
    1 Posts
    821 Views
    No one has replied
  • Y

    (resources) Lines in text file dont get removed after thread finish but they do after script finish

    Scheduled Pinned Locked Moved Support
    0 Votes
    1 Posts
    1275 Views
    No one has replied
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Popular
  • Users
  • Search
  • FingerprintSwitcher
  • CustomServers
  • AutomationPlugins
  • Login

  • Don't have an account? Register

  • Login or register to search.