How to work on multiple parsed data (need help with loops or smth)



  • Hi. I have question about openbullet config.

    I got response with for example 5x xID.
    in next block I want to check every of them by adding every single xID to requested headers.

    I parsed these xIDs with Recrusive=true (without it OB will parse only first ID)

    what do to next?

    parsed data looks like:
    "VAR NAME(List): [id1, id2, id3, id4 .....]

    how can I run next blocks for every IDs?

    Hope you understend what I mean.

    thanks for any tips

    edit:

    I've tried to split these IDs using UTILITY block (Variable -> split -> VAR NAME -> ",") but it's not working.



  • ok, I'm dumb.
    I see that I can use <VARNAME[number]> and it will work.
    but how to create loop which will count amount of ids and run all next blocks for every ID?
    Should I use other language or can I do this with loliscript?



  • Hope can help you:

    REQUEST GET "https://pastebin.com/raw/C7Y8xJ8k" 
      
      HEADER "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko" 
      HEADER "Pragma: no-cache" 
      HEADER "Accept: */*" 
    
    PARSE "<SOURCE>" REGEX "(\\d+)" "[1]" Recursive=TRUE -> VAR "id" 
    
    IF "<id>" Contains ","
    
    FUNCTION CountOccurrences "," "<id>" -> VAR "count" 
    
    FUNCTION Compute "<count>+1" -> VAR "count2" 
    
    SET VAR "test" "0"
    WHILE "<test>" LessThan "<count2>"
    
    REQUEST GET "https://pastebin.com/raw/TvQ09uGi" 
      
      HEADER "custom: <id[<test>]>" 
    
    FUNCTION Compute "<test>+1" -> VAR "test" 
    
    ENDWHILE
    ELSE
    
    FUNCTION Replace "\[|\]" "" UseRegex=TRUE "<id>" -> VAR "id2" 
    
    REQUEST GET "https://pastebin.com/raw/TvQ09uGi" 
      
      HEADER "custom: <id2>" 
    
    ENDIF
    
    


  • @thanhlouis thanks a lot!
    I think I found solution.

    UTILITY List "acid" Length -> VAR "LEN" 
    
    SET VAR "int" "0"
    WHILE "<int>" LessThan "<LEN>"
    

    then blocks to parse etc

    and at the end:

    FUNCTION Compute "<int>+1" -> VAR "int" 
    
    UTILITY File "output.txt" AppendLines "<USERNAME>:<PASSWORD>:<Level>/<Server>" 
    
    ENDWHILE
    

    works perfect!
    but thanks for tip! ❤


Log in to reply